mirror of https://github.com/apache/cloudstack.git
Merge branch 'master' into ui-add-remove-nics
This commit is contained in:
commit
18a337270d
385
CHANGES
385
CHANGES
|
|
@ -1,7 +1,387 @@
|
|||
Apache CloudStack (Incubating) CHANGES
|
||||
Apache CloudStack CHANGES
|
||||
======================================
|
||||
|
||||
Full release notes for each release are located in the project's documentation website: http://cloudstack.apache.org/docs
|
||||
Full release notes for each release are located in the project's documentation website:
|
||||
http://cloudstack.apache.org/docs
|
||||
|
||||
Version 4.2.0
|
||||
------------------------
|
||||
|
||||
In progress
|
||||
|
||||
|
||||
|
||||
|
||||
Version 4.1.0
|
||||
------------------------
|
||||
|
||||
This is the second major release of CloudStack from within the Apache Software Foundation, and the
|
||||
first major release as a Top-Level Project (TLP).
|
||||
|
||||
Build Tool Changes:
|
||||
|
||||
* The project now uses Maven 3 exclusively to build.
|
||||
|
||||
New Features:
|
||||
* CLOUDSTACK-101: OVS support in KVM
|
||||
* CLOUDSTACK-132: Mash up marvin into an interactive auto-completing API shell for CloudStack
|
||||
* CLOUDSTACK-241: AWS Style Regions
|
||||
* CLOUDSTACK-297: Reset SSH Key to access VM (similar to reset password)
|
||||
* CLOUDSTACK-299: Egress firewall rules for guest network
|
||||
* CLOUDSTACK-306: Support SRX & F5 inline mode
|
||||
* CLOUDSTACK-618: API request throttling to avoid malicious attacks on MS per account through frequent API request.
|
||||
* CLOUDSTACK-637: AutoScale
|
||||
* CLOUDSTACK-644: Resize volumes feature
|
||||
* CLOUDSTACK-706: Persistent Networks without running a VM
|
||||
* CLOUDSTACK-726: Implement L3 Router functionality in Nicira Nvp Plugin
|
||||
* CLOUDSTACK-780: Additional VMX Settings
|
||||
* CLOUDSTACK-926: ApiDiscoverService: Implement a plugin mechanism that exposes the list of APIs through a discovery service on the management server
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
* CLOUDSTACK-1600 Typo in dpkg-buildpackage command
|
||||
* CLOUDSTACK-1574 updateResourceCount API is failed saying to specify valida resource type even after parsing the valid resource type
|
||||
* CLOUDSTACK-1562 Replace the short-cut solution of supportting @DB with the formal one
|
||||
* CLOUDSTACK-1541 NPE while deleting snapshot :Unexpected exception while executing org.apache.cloudstack.api.command.user.snapshot.DeleteSnapshotCmd
|
||||
* CLOUDSTACK-1521 Redundant router: Services are not stopped when switch to BACKUP state
|
||||
* CLOUDSTACK-1509 Failed to implement network elements and resources while provisioning for persistent network(createVlanIpRange to an account]
|
||||
* CLOUDSTACK-1496 List API Performance: listAccounts failing with OOME for high values of pagesize (>1000 )
|
||||
* CLOUDSTACK-1487 cloudstack-setup-agent fails to set private.network.device on KVM host add
|
||||
* CLOUDSTACK-1485 Add Baremetal Provider back to 4.1 branch
|
||||
* CLOUDSTACK-1484 "API Throttling : api.throttling.enabled, Global setting missing"
|
||||
* CLOUDSTACK-1473 deleteDomain is failing with NPE
|
||||
* CLOUDSTACK-1470 unhandled exception executing api command: deployVirtualMachine
|
||||
* CLOUDSTACK-1469 kvm agent: agent service fails to start up
|
||||
* CLOUDSTACK-1465 List Zones returns null under create instance when logged is as user
|
||||
* CLOUDSTACK-1449 listAccounts and listProjectAccounts API lists all the users not account-specific users for each account returned
|
||||
* CLOUDSTACK-1447 [UI]Persistent Status is not displayed for VPC Tiers
|
||||
* CLOUDSTACK-1436 4.1 management server fails to start from RPM build artifacts
|
||||
* CLOUDSTACK-1429 single account is unable to use same vnet across multiple physical networks
|
||||
* CLOUDSTACK-1425 unhandled exception executing api command: migrateVirtualMachine & recoverVirtualMachine
|
||||
* CLOUDSTACK-1420 Ensure trademarks are properly attributed in publican brand.
|
||||
* CLOUDSTACK-1419 Apache-ify and apply trademark logos in the UI
|
||||
* CLOUDSTACK-1418 "As regular user , we are not allowed to deploy VM on a shared network."
|
||||
* CLOUDSTACK-1417 "When invalid values are passed to createNetwork() , error message does not indicate the parameter name that has invalid values."
|
||||
* CLOUDSTACK-1414 Redundant router: BACKUP switch cancelled due to lock timeout after a glitch in network
|
||||
* CLOUDSTACK-1403 Storage and console-proxy related error
|
||||
* CLOUDSTACK-1402 listRouters API response doesn't return linklocal IP and public IP details
|
||||
* CLOUDSTACK-1399 Unhandled exception executing api command: stopVirtualMachine
|
||||
* CLOUDSTACK-1397 Static Nat configuration is failing with NPE
|
||||
* CLOUDSTACK-1391 EventBus is not getting injected after javelin merge
|
||||
* CLOUDSTACK-1383 Deploying basic zone on 4.1 fails in NPE
|
||||
* CLOUDSTACK-1382 "vm deploy fails with Error ""cannot find DeployPlannerSelector for vm"""
|
||||
* CLOUDSTACK-1375 deploydb failing with acs master
|
||||
* CLOUDSTACK-1369 "Ipv6 - In dual Stack network , guest VM does not have the Ipv6 address of the router programmed in /etc/resolv.conf for DNS resolution."
|
||||
* CLOUDSTACK-1367 NPE noticed in logs while AgentMonitor is monitoring the host ping interval
|
||||
* CLOUDSTACK-1357 "Autoscale: Provisioned VMs from Netscaler not being added to lb vserver, provserver fails with provserver_err_asynctaskpoll"
|
||||
* CLOUDSTACK-1350 Management server Stop and start causes previously downloaded ISOs and templates to redownload & reinstall
|
||||
* CLOUDSTACK-1347 "Not able to delete network. Error - ""Unable to insert queue item into database, DB is full?"""
|
||||
* CLOUDSTACK-1346 "Check to see if external devices are used in the network, is hardcoded for specific devices"
|
||||
* CLOUDSTACK-1345 BigSwitch plugin introduces 'VNS' isolation in UI without backend implementation
|
||||
* CLOUDSTACK-1344 Typo in use.external.dns setting description
|
||||
* CLOUDSTACK-1343 Porting Baremetal related UI changes to ACS
|
||||
* CLOUDSTACK-1341 URL for the KEYs file is wrong in the installation guide
|
||||
* CLOUDSTACK-1339 ASF 4.1: Management server becomes unresponsive
|
||||
* CLOUDSTACK-1338 Deploy VM failed using ISO
|
||||
* CLOUDSTACK-1334 vmware.root.disk.controller doesn't work.
|
||||
* CLOUDSTACK-1332 IPV6 - Router and guest Vms should be able to use an IPV6 address for external DNS entry.
|
||||
* CLOUDSTACK-1331 Upgrade fails for a 2.2.14 Zone having multiple guest networks using network_tags and Public Vlan
|
||||
* CLOUDSTACK-1330 ec2-run-instances - When -n option is used to deploy multiple Vms API returns error even though few of the Vms have been deployed successfully.
|
||||
* CLOUDSTACK-1320 Routers naming convention is changed to hostname
|
||||
* CLOUDSTACK-1319 createCustomerVpnGateway response gives TypeError: json.createvpncustomergatewayresponse is undefined
|
||||
* CLOUDSTACK-1315 [F5-SRX-InlineMode] Network implement failed with Run time Exception during network upgrade from VR to SRX-F5
|
||||
* CLOUDSTACK-1313 Working with Volumes Section Is Missing
|
||||
* CLOUDSTACK-1312 "Fix rolling upgrades from 4.0 to 4.1 in 4.1 release, fix db schemas to be same as 4.0"
|
||||
* CLOUDSTACK-1307 Noticed NPE when we put host in maintenance mode in clustered management setup
|
||||
* CLOUDSTACK-1303 Ipv6 - java.lang.NullPointerException when executing listnetworks() and deployVirtualMachine() after extending the Ipv4 range of a dual stack network.
|
||||
* CLOUDSTACK-1300 section in wrong order in installation guide
|
||||
* CLOUDSTACK-1299 Errors in 4.5.5 section of installation guide
|
||||
* CLOUDSTACK-1295 NPE in usage parsers due to missing @Component inject
|
||||
* CLOUDSTACK-1289 [F5-SRX-InlineMode] Usage stats are not generated for Juniper SRX Firewall in inlinemode
|
||||
* CLOUDSTACK-1288 [F5-SRX-InlineMode] classCastException during network restart with cleanup option true
|
||||
* CLOUDSTACK-1277 ApiResponseHelper.createUserVmResponse failed to populate password field set from UserVm object
|
||||
* CLOUDSTACK-1272 Autoscale: createAutoScaleVmProfile fails due to unable to retrieve Service Offering id
|
||||
* CLOUDSTACK-1267 KVM's cloudstack-agent service doesn't log (log4j)
|
||||
* CLOUDSTACK-1265 logrotate dnsmasq configuration is wrong
|
||||
* CLOUDSTACK-1262 "Failed to Prepare Secondary Storage in VMware,"
|
||||
* CLOUDSTACK-1251 Baremetal zone doesn't need primary/secondary storage in UI wizard
|
||||
* CLOUDSTACK-1243 Failed to cleanup account :java.lang.NullPointerException
|
||||
* CLOUDSTACK-1242 [F5-SRX-InlineMode] Failed to create LB rule with F5-SRX inlinemode deployement
|
||||
* CLOUDSTACK-1241 Network apply rules logic is broken
|
||||
* CLOUDSTACK-1237 "Register Template fails with ""Cannot find template adapter for XenServer"""
|
||||
* CLOUDSTACK-1234 Unable to start KVM agent with 4.1 build
|
||||
* CLOUDSTACK-1233 Veewee configuration files are inappropriately identified as ASLv2 licensed files
|
||||
* CLOUDSTACK-1232 "Ipv6 - Guest Vms are not able to get Ipaddress when executing dhclient command when using ""/96"" network."
|
||||
* CLOUDSTACK-1226 Error while running Cloudstack-setup-databases
|
||||
* CLOUDSTACK-1223 Exception while starting jetty server: org.springframework.beans.factory.BeanCreationException Error creating bean with name 'apiServer':
|
||||
* CLOUDSTACK-1222 API rate limit configs: removed double quote in upgrade script
|
||||
* CLOUDSTACK-1220 Ipv6 - Better error message when deploy Vm fails to get a free Ip address.
|
||||
* CLOUDSTACK-1219 Ipv6 - Provide better error messages when deploying a Vm with Ip an address that is outside the network's ip range / if the ip address already is assigned to another Vm.
|
||||
* CLOUDSTACK-1216 UUID is null for admin and failed to register user key with 4.1
|
||||
* CLOUDSTACK-1210 Make all pluggable services return list of api cmd classes
|
||||
* CLOUDSTACK-1206 Failure in Copy of System templates
|
||||
* CLOUDSTACK-1205 Ipv6 - Ubuntu 12.10 guest Vms looses default route (after it expiration time ~ 30 mts) when ipv6.autoconfig parameters are disabled except for net.ipv6.conf.lo.autoconf which is enabled.
|
||||
* CLOUDSTACK-1204 Fail to create advance zone due to fail to add host
|
||||
* CLOUDSTACK-1201 "Failed to create ssh key for user ""cloud"" /var/lib/cloud/management/.ssh/id_rsa and failed to start management server"
|
||||
* CLOUDSTACK-1190 Make APIChecker interface throw a single sensible exception
|
||||
* CLOUDSTACK-1181 mvn deploy db failing with NPE
|
||||
* CLOUDSTACK-1176 Issue with snapshots(create/list)
|
||||
* CLOUDSTACK-1174 Snapshots related SQL error
|
||||
* CLOUDSTACK-1173 ConsoleProxyResource instantiation exception
|
||||
* CLOUDSTACK-1168 Create firewall rule broken
|
||||
* CLOUDSTACK-1163 Failed with NPE while creating firewall rule
|
||||
* CLOUDSTACK-1161 Differences between 4.1 and master in ongoing-config-of-external-firewalls-lb.xml
|
||||
* CLOUDSTACK-1154 Account/Users related API failed due to RegionService inject exception
|
||||
* CLOUDSTACK-1153 "Ipv6 - Vm deployment fails with ""n must be positive"" error."
|
||||
* CLOUDSTACK-1152 Missing tag in host-add.xml
|
||||
* CLOUDSTACK-1141 "Ipv6 - After network restart (and reboot router) , we do not see the existing vms dnsentries not being programmed in the router."
|
||||
* CLOUDSTACK-1138 "Providing invalid values for gateway, netmask etc in the zoneWizard blocks the VLAN container to load , throwing an error"
|
||||
* CLOUDSTACK-1123 ListStoragePools API broken by refactor
|
||||
* CLOUDSTACK-1113 "Ipv6 - Not able to deploy a new VM in this network because of ""Unable to allocate Unique Ipv6 address"""
|
||||
* CLOUDSTACK-1112 "Errors in ""Prepare the System VM Template"""
|
||||
* CLOUDSTACK-1111 Ipv6 - listRouters() does not return guestipaddress/
|
||||
* CLOUDSTACK-1109 "Ipv6 - Unable to expunge User Vms that are ""Destroyed""."
|
||||
* CLOUDSTACK-1108 Ipv6 - Not able to restart Networks.
|
||||
* CLOUDSTACK-1107 Ipv6 - Unable to extend Ip range for a Ipv6 network using craeteVlanIpRange() command - Error code 530 returned.
|
||||
* CLOUDSTACK-1105 "IpV6 - listVirtualMachines() does not return netmask ,gateway,ipaddress."
|
||||
* CLOUDSTACK-1104 Ipv6 - listVlanIpRanges() returns error 530.
|
||||
* CLOUDSTACK-1103 "IpV6 - listNetwork() command does not retrun gateway,netmask,cidr"
|
||||
* CLOUDSTACK-1095 Ipv6 - dhclient command needs to be run manually on the Vms to get the Ipv6 address.
|
||||
* CLOUDSTACK-1088 EnableStaticNat error will clear the data in database
|
||||
* CLOUDSTACK-1087 Update the Developer Guide for ASFCS 4.1 Release
|
||||
* CLOUDSTACK-1083 listUsageRecords api: removed project results in NPE
|
||||
* CLOUDSTACK-1082 UI doesn't throw any error message when trying to delete ip range from a network that is in use
|
||||
* CLOUDSTACK-1079 Deploying AWSAPI with mvn -pl :cloud-awsapi jetty:run fails
|
||||
* CLOUDSTACK-1070 javelin: NPE on executing registerIso API
|
||||
* CLOUDSTACK-1064 A type error occurs when trying to add account/register template....
|
||||
* CLOUDSTACK-1063 "SG Enabled Advanced Zone - ""Add Guest Networks"" - When user tries to add a guest Network with scope as ""Account"" , he should NOT be presented with ""Offering for shared security group enabled"""
|
||||
* CLOUDSTACK-1057 regression of changeServiceForVirtualMachine API - fails to find service offering by serviceOfferingId parameter
|
||||
* CLOUDSTACK-1056 S3 secondary storage fails to upload systemvm template due to KVMHA directory
|
||||
* CLOUDSTACK-1055 "The overlay still exists when the ""Recurring Snapshots"" dialog is canceled by pressing esc key."
|
||||
* CLOUDSTACK-1051 API dispatcher unable to find objectVO corresponding to DeleteTemplatecmd
|
||||
* CLOUDSTACK-1050 No Documentation on Adding a Load Balancer Rule
|
||||
* CLOUDSTACK-1037 "Make cloudmonkey awesome-er: Online help docs and api discovery, better colored output, parameter value autocompletion"
|
||||
* CLOUDSTACK-1029 Enter the token to specified project is malfunctioned
|
||||
* CLOUDSTACK-1027 """Update SSL certificate"" button should properly reflect it's functionality"
|
||||
* CLOUDSTACK-1024 Regression: Unable to add Xenserver host with latest build
|
||||
* CLOUDSTACK-1021 the vlan is not creat to right nic. when i creat multi guest network.
|
||||
* CLOUDSTACK-1016 Not able to deploy VM.
|
||||
* CLOUDSTACK-1014 Merge ManagementServer and ManagementServerExt
|
||||
* CLOUDSTACK-1013 running cloudstack overwrites default public/private ssh keys
|
||||
* CLOUDSTACK-1011 KVM host getting disconnected in cluster environment
|
||||
* CLOUDSTACK-1010 Host count and Secondary storage count always shows 1 in UI
|
||||
* CLOUDSTACK-1002 Not able to start VM.
|
||||
* CLOUDSTACK-995 Not able to add the KVM host.
|
||||
* CLOUDSTACK-993 """admin"" user is not getting created when management server is started."
|
||||
* CLOUDSTACK-987 Sections missing in Working With Snapshots
|
||||
* CLOUDSTACK-985 Different MAC address for RvR caused issue in short term network outrage
|
||||
* CLOUDSTACK-978 TypeError: instance.displayname is undefined while adding VM's to the LB rule.
|
||||
* CLOUDSTACK-968 marvin: vlan should be an attribute of the physical_network and not the zone
|
||||
* CLOUDSTACK-959 Missing sub-sections in document section System Service Offerings
|
||||
* CLOUDSTACK-938 s2s VPN trouble
|
||||
* CLOUDSTACK-928 [Simulator] Latency for Agent Commands - change unit of wait from seconds to milliseconds
|
||||
* CLOUDSTACK-863 Non-printable characters (ASCII control character) such as %00 or %0025 are getting stored in raw/non encoded form in the database.
|
||||
* CLOUDSTACK-819 Create Account/User API logging password in access logs
|
||||
* CLOUDSTACK-799 [Load Test] Check router statistics falls behind in gathering stats by more than 2 times the set value
|
||||
* CLOUDSTACK-798 Move usage related cmd classes from cloud-server to cloud-api
|
||||
* CLOUDSTACK-736 Integration smoke tests: Fix check for vm name for the deployvm smoke test
|
||||
* CLOUDSTACK-734 api_refactoring: CreateAccountCmd fails to send response due to NPE in service layer
|
||||
* CLOUDSTACK-725 UI: Error when the Egress rules tab is selected for a network
|
||||
* CLOUDSTACK-721 Bytes sent/received in user statistics is empty (CloudStack 4.0)
|
||||
* CLOUDSTACK-720 Fail to load a png image when accessing the web console
|
||||
* CLOUDSTACK-717 cloudmonkey fails to parse/print response
|
||||
* CLOUDSTACK-693 Adding a VPC virtual router to a NiciraNVP enabled network fails
|
||||
* CLOUDSTACK-691 A warning dialog box shows after reloading the welcome page
|
||||
* CLOUDSTACK-689 RVR: Stop pending flag is not cleared when user start the disconnected router from another host
|
||||
* CLOUDSTACK-683 Image Is Missing in the Accessing VM Section
|
||||
* CLOUDSTACK-660 Network Traffic Labels are not functional in Marvin
|
||||
* CLOUDSTACK-648 The normal users could change their own login password
|
||||
* CLOUDSTACK-639 API Refactoring: Adapters for ACL
|
||||
* CLOUDSTACK-617 Unable to edit a Sub domain
|
||||
* CLOUDSTACK-614 "ListTemplates API is not returning ""Enable SSH Key"" attribute for any given template"
|
||||
* CLOUDSTACK-606 Starting VM fails with 'ConcurrentOperationException' in a clustered MS scenario
|
||||
* CLOUDSTACK-605 Host physical CPU is incorrectly calculated for Vmware hosts
|
||||
* CLOUDSTACK-599 DhcpEntryCommand fails on Router VM on CS4.0 and vSphere5 with Advanced Network Zone
|
||||
* CLOUDSTACK-596 DeployVM command takes a lot of time to return job id
|
||||
* CLOUDSTACK-584 "typos in ""Apache_CloudStack-4.0.0-incubating-CloudStack_Nicira_NVP_Guide-en-US"""
|
||||
* CLOUDSTACK-573 "NPE at ""com.cloud.network.NetworkManagerImpl.networkOfferingIsConfiguredForExternalNetworking(NetworkManagerImpl.java:4345)"" when create network from the network offering having NULL provider for the service"
|
||||
* CLOUDSTACK-572 SG Enabled Advanced Zone - Not able to deploy a VM in an account specific shared network.
|
||||
* CLOUDSTACK-560 Usage server doesn't work in 4.0.0 due to missing db changes
|
||||
* CLOUDSTACK-556 Erratic window behavior in Quick View tooltip
|
||||
* CLOUDSTACK-553 "SRX - When adding SRX device make ""Public Network"" - default to ""untrusted"" and ""Private Network"" - default to ""trusted"" as un-editable fields."
|
||||
* CLOUDSTACK-552 ]Quick view details for a volume displays scroll bar in place of name of the volume when the name of the volume has more no of characters
|
||||
* CLOUDSTACK-539 Cropped Text in UI under Quick View
|
||||
* CLOUDSTACK-536 remove citrix cloudpatform from 4.0 build - CloudStack is ASF project
|
||||
* CLOUDSTACK-527 List API performance optimization by using DB views and removing UUID conversion.
|
||||
* CLOUDSTACK-522 Log requests in cloudmonkey's log file
|
||||
* CLOUDSTACK-520 Dependency jar names mismatch with install-non-oss.sh
|
||||
* CLOUDSTACK-518 API refactoring -- change @Parameter annotation and remove the @IdentityMapper annotation
|
||||
* CLOUDSTACK-514 Marvin and Cloudmonkey don't work when an API target uses https or an alternate path
|
||||
* CLOUDSTACK-510 Add button not visible when adding public IPs to physical network
|
||||
* CLOUDSTACK-508 CLVM copies template to primary storage unnecessarily
|
||||
* CLOUDSTACK-507 fix api docs for listSSHKeyPairs
|
||||
* CLOUDSTACK-504 Duplicate guest password scripts in codebase
|
||||
* CLOUDSTACK-501 Apidocs and marvin does not know how to handle Autoscaling docs
|
||||
* CLOUDSTACK-500 Passwd-server iptables rules are dropped on domr on fresh start or on reboot
|
||||
* CLOUDSTACK-499 cloudmonkey CLI can't accept complex parameters
|
||||
* CLOUDSTACK-493 2.2.x-3.0 DB upgrade support for Advance SG enabled networks
|
||||
* CLOUDSTACK-481 Installation Guide Doc Error
|
||||
* CLOUDSTACK-467 Developer's Guide points to cloud.com for API reference
|
||||
* CLOUDSTACK-465 French language file quotes are dropping javascript syntax errors
|
||||
* CLOUDSTACK-464 "Regression in AWSAPI docs, entire sections removed"
|
||||
* CLOUDSTACK-462 A few corrections to make to the 4.0.0 installation guide
|
||||
* CLOUDSTACK-459 [Optional Public IP assignment for EIP with Basic Zone] Associate IP Checkbox in Create Network Offering Dialog is Displayed When Elastic LB is Selected
|
||||
* CLOUDSTACK-456 License tag in SPEC isn't what RPM is expecting
|
||||
* CLOUDSTACK-448 SSVM bootstrap failure on XenServer hosts with E3 CPU
|
||||
* CLOUDSTACK-446 "Host going to alert state, if you are adding already added host"
|
||||
* CLOUDSTACK-441 Running mgmt server using jetty fails to start api server
|
||||
* CLOUDSTACK-435 Vmware network labels are ignored when creating a Zone using basic networking
|
||||
* CLOUDSTACK-427 Change hardcoded step number references to dynamic links
|
||||
* CLOUDSTACK-424 Updated userdata not propagating to the VR.
|
||||
* CLOUDSTACK-417 Handle password server securely to run on port 8080 on VR
|
||||
* CLOUDSTACK-416 XCP 1.6beta2 (61002c) - can't add a host
|
||||
* CLOUDSTACK-404 Update docs on the usage of cloud-setup-databases
|
||||
* CLOUDSTACK-398 Install Guide: Section 11.17.3 (Using VPN with Mac OSX): Not complete?
|
||||
* CLOUDSTACK-397 Install Guide: Section 11.1 (Guest Traffic): Diagram is the wrong diagram
|
||||
* CLOUDSTACK-390 Install Guide: Section 4.5.7 (Prepare the System VM Template): Links go to cloud.com
|
||||
* CLOUDSTACK-378 mavenize marvin on master
|
||||
* CLOUDSTACK-377 provide deployment config access to marvin's testcase
|
||||
* CLOUDSTACK-373 "static NAT and Firewall is not working on external firewall device SRX, it needs to be implemented"
|
||||
* CLOUDSTACK-369 ASF 4.0 - unable to support XenServer 6.1 host
|
||||
* CLOUDSTACK-364 Docs point to download.cloud.com for AWS API script
|
||||
* CLOUDSTACK-361 Wrong creation of guest networks on a KVM host in Multiple Physical Networks with guest traffic
|
||||
* CLOUDSTACK-359 PropagateResourceEventCommand failes in cluster configuration
|
||||
* CLOUDSTACK-357 "ISOs can be deleted while still attached to a running VM, and they subsequently cannot be detached from a running VM"
|
||||
* CLOUDSTACK-355 "Fix ""count"" in a bunch of API commands"
|
||||
* CLOUDSTACK-348 deleteNetwork does not clean up network resource count correctly
|
||||
* CLOUDSTACK-347 listNetworks API: return vlan information only when the caller is ROOT admin
|
||||
* CLOUDSTACK-346 Cannot add Vmware cluster with class loader conflict exception
|
||||
* CLOUDSTACK-335 KVM VPC load balancer not working
|
||||
* CLOUDSTACK-333 When Datacenter name in VCenter has spaces Primary Storage (VMFS) discovery will fail
|
||||
* CLOUDSTACK-332 """count"" property in list* API response should be equal to how many entries in database, not how many objects in API response"
|
||||
* CLOUDSTACK-318 Adding XenServer Host Fails - 6.0.2 fails with 4.0.0
|
||||
* CLOUDSTACK-304 Add synchronization for createSnapshot command per host basis
|
||||
* CLOUDSTACK-293 "We do awful, hacky things in our spec file for client"
|
||||
* CLOUDSTACK-290 3.0.0 template also needed for 2.2.14 to 3.0.5 direct upgrade.
|
||||
* CLOUDSTACK-284 listVirtualMachines does not return deleted machines when zone is specified
|
||||
* CLOUDSTACK-279 deleteProject fails when executed by the regular user (works fine for root/domain admin)
|
||||
* CLOUDSTACK-274 Two error codes mapped to same value in API
|
||||
* CLOUDSTACK-271 updatePhysicalNetwork dies with an NPE when the vlan range is empty
|
||||
* CLOUDSTACK-256 "vpn:As an admin user , not able to delete VPN user which is present in a regular user's network."
|
||||
* CLOUDSTACK-250 Incorrect description of maintenance mode in admin guide
|
||||
* CLOUDSTACK-249 Add host id to failed VM deploy alerts
|
||||
* CLOUDSTACK-235 Network rate can be set in 2 places. Clarify docs on how this works.
|
||||
* CLOUDSTACK-232 Zone infrastructure chart -- disable resource total display
|
||||
* CLOUDSTACK-228 UI provides an option to reconnect a disconnected host - ServerApiException is thrown on an attempt
|
||||
* CLOUDSTACK-227 ReconnectHostCmd: NullPointerException: Unable to get host Information for XenServer 6.0.2 host - on intentionally changing the traffic labels on the physical network
|
||||
* CLOUDSTACK-226 UpdatePhysicalNetworkcommand failed due to java.sql.BatchUpdateException ; Tried to extend the existing Guest VLAN Range of one physical network into the Guest VLAN range of the other physical network
|
||||
* CLOUDSTACK-225 API Docs: Request params repeated with different descriptions
|
||||
* CLOUDSTACK-222 Admin UI prompts to restart Management server with cancel edit operation
|
||||
* CLOUDSTACK-178 Expose name parameter of VM in list Vm view.
|
||||
* CLOUDSTACK-130 Clarify docs on tags parameter in API reference
|
||||
* CLOUDSTACK-119 Move Agent-Simulator in to the hypervisor plugin model
|
||||
* CLOUDSTACK-118 "Status of host resorce stuck in ""ErrorInMaintenance"""
|
||||
* CLOUDSTACK-95 IP address allocation not working when a user tries to allocate IP addresses in a Project.
|
||||
* CLOUDSTACK-70 Improve Network Restart Behaviour for Basic Zone: Restarting Network Fails
|
||||
* CLOUDSTACK-46 Remnants of mycloud remain
|
||||
|
||||
Security Fixes:
|
||||
|
||||
* CVE-2012-4501: Apache CloudStack configuration vulnerability
|
||||
|
||||
|
||||
Version 4.0.2
|
||||
------------------------
|
||||
|
||||
This is a maintenance release for the Apache CloudStack 4.0.x series, with no new features.
|
||||
|
||||
Issues fixed in this release:
|
||||
|
||||
* CLOUDSTACK-354: Display of storage statistics is wrong.
|
||||
* CLOUDSTACK-397: Install Guide: Section 11.1 (Guest Traffic): Diagram is the wrong diagram
|
||||
* CLOUDSTACK-398: Install Guide: Section 11.17.3 (Using VPN with Mac OSX): Not complete?
|
||||
* CLOUDSTACK-462: A few corrections to make to the 4.0.0 installation guide
|
||||
* CLOUDSTACK-524: http proxy used by ssvm (secstorage.proxy) NOT working
|
||||
* CLOUDSTACK-587: MEMORY_CONSTRAINT_VIOLATIONMemory limits must satisfy:
|
||||
* CLOUDSTACK-803: HA gets triggered even when the host investigator is unable to determine the state of the host
|
||||
* CLOUDSTACK-810: Make DirectAgent thread pool size configurable
|
||||
* CLOUDSTACK-976: unable to start cloudstack (error: "java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString([B)Ljava/lang/String;")
|
||||
* CLOUDSTACK-988: HV version must be updated in hypervisor_version column of host table
|
||||
* CLOUDSTACK-990: Documentation issue with libvirtd.conf tcp_port configuration
|
||||
* CLOUDSTACK-1088: EnableStaticNat error will clear the data in database
|
||||
* CLOUDSTACK-1106: Missing documentation for cloud-setup-databases
|
||||
* CLOUDSTACK-1110: Documentation missing "Management Server Load Balancing"
|
||||
* CLOUDSTACK-1112: Errors in "Prepare the System VM Template"
|
||||
* CLOUDSTACK-1137: Force reconnect of a disconnected state complains about the state of the host.
|
||||
* CLOUDSTACK-1150: Documentation for libvirt on Ubuntu 12.04
|
||||
* CLOUDSTACK-1151: vmware systemVm template upgrade is missing in 4.0 upgrade
|
||||
* CLOUDSTACK-1211: Network operations are Blocked for the Read-only file system of Virtual Router
|
||||
* CLOUDSTACK-1265: logrotate dnsmasq configuration is wrong
|
||||
* CLOUDSTACK-1291: duplicate arguments in commands.xml prevents cloudapis.py to run to completion
|
||||
* CLOUDSTACK-1298: typo in deb package setup
|
||||
* CLOUDSTACK-1299: Errors in 4.5.5 section of installation guide
|
||||
* CLOUDSTACK-1300: section in wrong order in installation guide
|
||||
* CLOUDSTACK-1341: URL for the KEYs file is wrong in the installation guide
|
||||
* CLOUDSTACK-1419: Apache-ify and apply trademark logos in the UI
|
||||
* CLOUDSTACK-1420: Ensure trademarks are properly attributed in publican brand.
|
||||
* CLOUDSTACK-1589: Ubuntu 4.0 packages depend on non-existent chkconfig
|
||||
* CLOUDSTACK-1629: Need to move location or conflict with antlr
|
||||
* CLOUDSTACK-1642: Add support CentOS 6.4
|
||||
* CLOUDSTACK-1648: Unable to add KVM host
|
||||
* CLOUDSTACK-1652: /etc/hosts error in virtual router when deploy instance with the name same to previous instances
|
||||
* CLOUDSTACK-1666: KVM VPC NetworkUsage doesnot work
|
||||
* CLOUDSTACK-1668: IP conflict in VPC tier
|
||||
* CLOUDSTACK-1761: Available local storage disk capacity incorrectly reported in KVM to manager.
|
||||
* CLOUDSTACK-1845: KVM - storage migration often fails
|
||||
* CLOUDSTACK-1846: KVM - storage pools can silently fail to be unregistered, leading to failure to register later
|
||||
* CLOUDSTACK-2003: Deleting domain while deleted account is cleaning up leaves VMs expunging forever due to 'Failed to update resource count'
|
||||
* CLOUDSTACK-2090: Upgrade from version 4.0.1 to version 4.0.2 triggers the 4.0.0 to 4.0.1.
|
||||
* CLOUDSTACK-2091: Error in API documentation for 4.0.x.
|
||||
|
||||
|
||||
Version 4.0.1-incubating
|
||||
------------------------
|
||||
|
||||
This is a bugfix release for Apache CloudStack 4.0.0-incubating, with no new features.
|
||||
|
||||
Security Fixes:
|
||||
|
||||
* CVE-2012-5616: Local Information Disclosure Vulnerability (See CLOUDSTACK-505)
|
||||
|
||||
Bugs fixed in this release:
|
||||
|
||||
* CLOUDSTACK-359: PropagateResourceEventCommand fails in cluster configuration
|
||||
* CLOUDSTACK-374: When running cloud-setup-databases, it auto chooses the highest priority nic (lowest number ie: eth0)
|
||||
* CLOUDSTACK-389: Install Guide: Section 4.5.5 (Prepare NFS Shares): Confusing statement about iSCSI
|
||||
* CLOUDSTACK-395: Primary Storage and Secondary Storage sections missing sub-sections
|
||||
* CLOUDSTACK-411: Add another step during kvm agent installation on Ubuntu machine
|
||||
* CLOUDSTACK-415: restartNetwork call causes VM to be unreachable when Nicira based SDN is used.
|
||||
* CLOUDSTACK-422: XSL files missing license header.
|
||||
* CLOUDSTACK-426: SetVPCStaticNatRules unimplemented for KVM.
|
||||
* CLOUDSTACK-448: SSVM bootstrap failure on XenServer hosts with E3 CPU.
|
||||
* CLOUDSTACK-465: French language file quotes are dropping javascript syntax errors.
|
||||
* CLOUDSTACK-473: API Doc for uploadCustomCertificate doesn't explain how to use the optional parameters well.
|
||||
* CLOUDSTACK-480: Installation Documentation error: Section 4.5.5.2 needs to mention nfs-kernel-server.
|
||||
* CLOUDSTACK-481: Installation Guide Doc Error
|
||||
* CLOUDSTACK-498: Missing dependency in RPM of KVM Agent.
|
||||
* CLOUDSTACK-502: VPC router needs to resolve its hostname.
|
||||
* CLOUDSTACK-505: cloudstack logs the private key in plaintext.
|
||||
* CLOUDSTACK-507: fix api docs for listSSHKeyPairs.
|
||||
* CLOUDSTACK-515: NVP installation.
|
||||
* CLOUDSTACK-536: remove citrix cloudpatform from 4.0 build - CloudStack is ASF project.
|
||||
* CLOUDSTACK-560: Usage server doesn't work in 4.0.0 due to missing db changes.
|
||||
* CLOUDSTACK-580: Packages are named with 4.0 with 4.0.1 build.
|
||||
* CLOUDSTACK-591: Wrong vnet in iptables on KVM hypervisors after VM reboot.
|
||||
* CLOUDSTACK-595: Recreate root volume scenarios doesn't work in VMware
|
||||
* CLOUDSTACK-603: Upgrade from 4.0 to 4.0.1 is not enabled.
|
||||
* CLOUDSTACK-605: Host physical CPU is incorrectly calculated for VMware host
|
||||
* CLOUDSTACK-622: In the add primary storage dialog in the ui the RBD fields don't disappear when changing from RBD to another protocol.
|
||||
* CLOUDSTACK-683: Image is missing in the Accessing VM Section
|
||||
* CLOUDSTACK-685: CloudStack 4.0 Network Usage is ZERO
|
||||
* CLOUDSTACK-938: s2s VPN trouble
|
||||
* CLOUDSTACK-961: Installation docs don't detail dependencies for building RPMs
|
||||
* CLOUDSTACK-995: Not able to add the KVM host
|
||||
|
||||
|
||||
Version 4.0.0-incubating
|
||||
------------------------
|
||||
|
|
@ -34,4 +414,3 @@ New Features:
|
|||
Security Fixes:
|
||||
|
||||
* CVE-2012-4501: Apache CloudStack configuration vulnerability
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
Apache CloudStack is an effort undergoing incubation at The Apache Software Foundation (ASF),
|
||||
sponsored by the Apache Incubator. Incubation is required of all newly accepted
|
||||
projects until a further review indicates that the infrastructure, communications, and
|
||||
decision making process have stabilized in a manner consistent with other successful ASF
|
||||
projects. While incubation status is not necessarily a reflection of the completeness or
|
||||
stability of the code, it does indicate that the project has yet to be fully endorsed by
|
||||
the ASF.
|
||||
64
LICENSE
64
LICENSE
|
|
@ -180,70 +180,6 @@ Copyright (c) 2013 The Apache Software Foundation
|
|||
|
||||
|
||||
This distribution contains third party resources.
|
||||
Within the . directory
|
||||
licensed under the BSD (3-clause) http://www.opensource.org/licenses/BSD-3-Clause (as follows)
|
||||
|
||||
Copyright (c) 2005-2010 Thomas Nagy
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from Thomas Nagy http://code.google.com/p/waf/
|
||||
waf
|
||||
|
||||
Within the awsapi directory
|
||||
licensed under the BSD (3-clause) http://www.opensource.org/licenses/BSD-3-Clause (as follows)
|
||||
|
||||
Copyright (c) 2005-2010 Thomas Nagy
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
from Thomas Nagy http://code.google.com/p/waf/
|
||||
waf
|
||||
|
||||
Within the console-proxy/js directory
|
||||
licensed under the MIT License http://www.opensource.org/licenses/mit-license.php (as follows)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
Apache CloudStack (Incubating) Version 4.0.0
|
||||
Apache CloudStack Version 4.2.0
|
||||
|
||||
# About Apache CloudStack (Incubating)
|
||||
# About Apache CloudStack
|
||||
|
||||
Apache CloudStack (Incubating) is software designed to deploy
|
||||
Apache CloudStack is software designed to deploy
|
||||
and manage large networks of virtual machines, as a highly
|
||||
available, highly scalable Infrastructure as a Service (IaaS)
|
||||
cloud computing platform. CloudStack is used by a number of
|
||||
|
|
|
|||
|
|
@ -38,12 +38,10 @@ import java.util.UUID;
|
|||
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
import org.apache.log4j.xml.DOMConfigurator;
|
||||
|
||||
import com.cloud.agent.Agent.ExitStatus;
|
||||
|
|
@ -373,6 +371,7 @@ public class AgentShell implements IAgentShell {
|
|||
throw new ConfigurationException("Unable to find the guid");
|
||||
}
|
||||
_guid = UUID.randomUUID().toString();
|
||||
_properties.setProperty("guid", _guid);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -235,14 +235,14 @@ public class ConsoleProxyResource extends ServerResourceBase implements
|
|||
if (_eth1ip != null) {
|
||||
params.put("private.network.device", "eth1");
|
||||
} else {
|
||||
s_logger.warn("WARNING: eth1ip parameter is not found!");
|
||||
s_logger.info("eth1ip parameter has not been configured, assuming that we are not inside a system vm");
|
||||
}
|
||||
|
||||
String eth2ip = (String) params.get("eth2ip");
|
||||
if (eth2ip != null) {
|
||||
params.put("public.network.device", "eth2");
|
||||
} else {
|
||||
s_logger.warn("WARNING: eth2ip parameter is not found!");
|
||||
s_logger.info("eth2ip parameter is not found, assuming that we are not inside a system vm");
|
||||
}
|
||||
|
||||
super.configure(name, params);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package com.cloud.agent.api;
|
|||
import com.cloud.agent.api.LogLevel.Log4jLevel;
|
||||
import com.cloud.agent.api.to.S3TO;
|
||||
import com.cloud.agent.api.to.SwiftTO;
|
||||
import com.cloud.storage.StoragePool;
|
||||
|
||||
/**
|
||||
* This command encapsulates a primitive operation which enables coalescing the backed up VHD snapshots on the secondary server
|
||||
|
|
@ -78,7 +79,8 @@ public class DeleteSnapshotBackupCommand extends SnapshotCommand {
|
|||
* @param backupUUID The VHD which has to be deleted
|
||||
* @param childUUID The child VHD file of the backup whose parent is reset to its grandparent.
|
||||
*/
|
||||
public DeleteSnapshotBackupCommand(SwiftTO swift,
|
||||
public DeleteSnapshotBackupCommand(StoragePool pool,
|
||||
SwiftTO swift,
|
||||
S3TO s3,
|
||||
String secondaryStoragePoolURL,
|
||||
Long dcId,
|
||||
|
|
@ -86,7 +88,7 @@ public class DeleteSnapshotBackupCommand extends SnapshotCommand {
|
|||
Long volumeId,
|
||||
String backupUUID, Boolean all)
|
||||
{
|
||||
super(null, secondaryStoragePoolURL, backupUUID, null, dcId, accountId, volumeId);
|
||||
super(pool, secondaryStoragePoolURL, backupUUID, null, dcId, accountId, volumeId);
|
||||
setSwift(swift);
|
||||
this.s3 = s3;
|
||||
setAll(all);
|
||||
|
|
|
|||
|
|
@ -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 com.cloud.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
|
||||
public class MigrateWithStorageAnswer extends Answer {
|
||||
|
||||
List<VolumeTO> volumeTos;
|
||||
|
||||
public MigrateWithStorageAnswer(MigrateWithStorageCommand cmd, Exception ex) {
|
||||
super(cmd, ex);
|
||||
volumeTos = null;
|
||||
}
|
||||
|
||||
public MigrateWithStorageAnswer(MigrateWithStorageCommand cmd, List<VolumeTO> volumeTos) {
|
||||
super(cmd, true, null);
|
||||
this.volumeTos = volumeTos;
|
||||
}
|
||||
|
||||
public List<VolumeTO> getVolumeTos() {
|
||||
return volumeTos;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 com.cloud.agent.api;
|
||||
|
||||
import java.util.Map;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
import com.cloud.agent.api.to.StorageFilerTO;
|
||||
|
||||
public class MigrateWithStorageCommand extends Command {
|
||||
VirtualMachineTO vm;
|
||||
Map<VolumeTO, StorageFilerTO> volumeToFiler;
|
||||
|
||||
public MigrateWithStorageCommand(VirtualMachineTO vm, Map<VolumeTO, StorageFilerTO> volumeToFiler) {
|
||||
this.vm = vm;
|
||||
this.volumeToFiler = volumeToFiler;
|
||||
}
|
||||
|
||||
public VirtualMachineTO getVirtualMachine() {
|
||||
return vm;
|
||||
}
|
||||
|
||||
public Map<VolumeTO, StorageFilerTO> getVolumeToFiler() {
|
||||
return volumeToFiler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
package com.cloud.agent.api;
|
||||
|
||||
import java.util.List;
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
|
||||
public class MigrateWithStorageCompleteAnswer extends Answer {
|
||||
List<VolumeTO> volumeTos;
|
||||
|
||||
public MigrateWithStorageCompleteAnswer(MigrateWithStorageCompleteCommand cmd, Exception ex) {
|
||||
super(cmd, ex);
|
||||
volumeTos = null;
|
||||
}
|
||||
|
||||
public MigrateWithStorageCompleteAnswer(MigrateWithStorageCompleteCommand cmd, List<VolumeTO> volumeTos) {
|
||||
super(cmd, true, null);
|
||||
this.volumeTos = volumeTos;
|
||||
}
|
||||
|
||||
public List<VolumeTO> getVolumeTos() {
|
||||
return volumeTos;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 com.cloud.agent.api;
|
||||
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
|
||||
public class MigrateWithStorageCompleteCommand extends Command {
|
||||
VirtualMachineTO vm;
|
||||
|
||||
public MigrateWithStorageCompleteCommand(VirtualMachineTO vm) {
|
||||
this.vm = vm;
|
||||
}
|
||||
|
||||
public VirtualMachineTO getVirtualMachine() {
|
||||
return vm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 com.cloud.agent.api;
|
||||
|
||||
import java.util.Map;
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
|
||||
public class MigrateWithStorageReceiveAnswer extends Answer {
|
||||
|
||||
Map<VolumeTO, Object> volumeToSr;
|
||||
Map<NicTO, Object> nicToNetwork;
|
||||
Map<String, String> token;
|
||||
|
||||
public MigrateWithStorageReceiveAnswer(MigrateWithStorageReceiveCommand cmd, Exception ex) {
|
||||
super(cmd, ex);
|
||||
volumeToSr = null;
|
||||
nicToNetwork = null;
|
||||
token = null;
|
||||
}
|
||||
|
||||
public MigrateWithStorageReceiveAnswer(MigrateWithStorageReceiveCommand cmd, Map<VolumeTO, Object> volumeToSr,
|
||||
Map<NicTO, Object> nicToNetwork, Map<String, String> token) {
|
||||
super(cmd, true, null);
|
||||
this.volumeToSr = volumeToSr;
|
||||
this.nicToNetwork = nicToNetwork;
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public Map<VolumeTO, Object> getVolumeToSr() {
|
||||
return volumeToSr;
|
||||
}
|
||||
|
||||
public Map<NicTO, Object> getNicToNetwork() {
|
||||
return nicToNetwork;
|
||||
}
|
||||
|
||||
public Map<String, String> getToken() {
|
||||
return token;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 com.cloud.agent.api;
|
||||
|
||||
import java.util.Map;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
import com.cloud.agent.api.to.StorageFilerTO;
|
||||
|
||||
public class MigrateWithStorageReceiveCommand extends Command {
|
||||
VirtualMachineTO vm;
|
||||
Map<VolumeTO, StorageFilerTO> volumeToFiler;
|
||||
|
||||
public MigrateWithStorageReceiveCommand(VirtualMachineTO vm, Map<VolumeTO, StorageFilerTO> volumeToFiler) {
|
||||
this.vm = vm;
|
||||
this.volumeToFiler = volumeToFiler;
|
||||
}
|
||||
|
||||
public VirtualMachineTO getVirtualMachine() {
|
||||
return vm;
|
||||
}
|
||||
|
||||
public Map<VolumeTO, StorageFilerTO> getVolumeToFiler() {
|
||||
return volumeToFiler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 com.cloud.agent.api;
|
||||
|
||||
import java.util.Set;
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
|
||||
public class MigrateWithStorageSendAnswer extends Answer {
|
||||
|
||||
Set<VolumeTO> volumeToSet;
|
||||
|
||||
public MigrateWithStorageSendAnswer(MigrateWithStorageSendCommand cmd, Exception ex) {
|
||||
super(cmd, ex);
|
||||
volumeToSet = null;
|
||||
}
|
||||
|
||||
public MigrateWithStorageSendAnswer(MigrateWithStorageSendCommand cmd, Set<VolumeTO> volumeToSet) {
|
||||
super(cmd, true, null);
|
||||
this.volumeToSet = volumeToSet;
|
||||
}
|
||||
|
||||
public Set<VolumeTO> getVolumeToSet() {
|
||||
return volumeToSet;
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
package com.cloud.agent.api;
|
||||
|
||||
import java.util.Map;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
import com.cloud.agent.api.to.VolumeTO;
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
|
||||
public class MigrateWithStorageSendCommand extends Command {
|
||||
VirtualMachineTO vm;
|
||||
Map<VolumeTO, Object> volumeToSr;
|
||||
Map<NicTO, Object> nicToNetwork;
|
||||
Map<String, String> token;
|
||||
|
||||
public MigrateWithStorageSendCommand(VirtualMachineTO vm, Map<VolumeTO, Object> volumeToSr,
|
||||
Map<NicTO, Object> nicToNetwork, Map<String, String> token) {
|
||||
this.vm = vm;
|
||||
this.volumeToSr = volumeToSr;
|
||||
this.nicToNetwork = nicToNetwork;
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public VirtualMachineTO getVirtualMachine() {
|
||||
return vm;
|
||||
}
|
||||
|
||||
public Map<VolumeTO, Object> getVolumeToSr() {
|
||||
return volumeToSr;
|
||||
}
|
||||
|
||||
public Map<NicTO, Object> getNicToNetwork() {
|
||||
return nicToNetwork;
|
||||
}
|
||||
|
||||
public Map<String, String> getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class UnregisterVMCommand extends Command {
|
||||
String vmName;
|
||||
|
||||
public UnregisterVMCommand(String vmName){
|
||||
this.vmName = vmName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getVmName() {
|
||||
return vmName;
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
import com.cloud.agent.api.Answer;
|
||||
import com.cloud.agent.api.Command;
|
||||
|
||||
public class MigrateVolumeAnswer extends Answer {
|
||||
private String volumePath;
|
||||
|
||||
public MigrateVolumeAnswer(Command command, boolean success, String details, String volumePath) {
|
||||
super(command, success, details);
|
||||
this.volumePath = volumePath;
|
||||
}
|
||||
|
||||
public MigrateVolumeAnswer(Command command) {
|
||||
super(command);
|
||||
this.volumePath = null;
|
||||
}
|
||||
|
||||
public String getVolumePath() {
|
||||
return volumePath;
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
package com.cloud.agent.api.storage;
|
||||
|
||||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.agent.api.to.StorageFilerTO;
|
||||
import com.cloud.storage.StoragePool;
|
||||
|
||||
public class MigrateVolumeCommand extends Command {
|
||||
|
||||
long volumeId;
|
||||
String volumePath;
|
||||
StorageFilerTO pool;
|
||||
|
||||
public MigrateVolumeCommand(long volumeId, String volumePath, StoragePool pool) {
|
||||
this.volumeId = volumeId;
|
||||
this.volumePath = volumePath;
|
||||
this.pool = new StorageFilerTO(pool);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean executeInSequence() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getVolumePath() {
|
||||
return volumePath;
|
||||
}
|
||||
|
||||
public long getVolumeId() {
|
||||
return volumeId;
|
||||
}
|
||||
|
||||
public StorageFilerTO getPool() {
|
||||
return pool;
|
||||
}
|
||||
}
|
||||
|
|
@ -23,6 +23,7 @@ import org.apache.cloudstack.api.InternalIdentity;
|
|||
|
||||
import com.cloud.network.rules.FirewallRule;
|
||||
import com.cloud.network.rules.FirewallRule.State;
|
||||
import com.cloud.network.rules.FirewallRule.TrafficType;
|
||||
import com.cloud.utils.net.NetUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -109,6 +110,11 @@ public class FirewallRuleTO implements InternalIdentity {
|
|||
this(rule.getId(),srcVlanTag, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), revokeState, alreadyAdded, purpose,rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
|
||||
}
|
||||
|
||||
public FirewallRuleTO(FirewallRule rule, String guestVlanTag, FirewallRule.TrafficType trafficType) {
|
||||
this(rule.getId(), guestVlanTag, null, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), rule.getState()==State.Revoke, rule.getState()==State.Active, rule.getPurpose(), rule.getSourceCidrList(), rule.getIcmpType(), rule.getIcmpCode());
|
||||
this.trafficType = trafficType;
|
||||
}
|
||||
|
||||
public FirewallRule.TrafficType getTrafficType(){
|
||||
return trafficType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,197 +0,0 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT 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 org.apache.cloudstack.api.ApiConstants;
|
||||
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.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.NetworkResponse;
|
||||
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
//@APICommand(description="Creates a private network", responseObject=NetworkResponse.class)
|
||||
public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreatePrivateNetworkCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createnetworkresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the network")
|
||||
private String name;
|
||||
|
||||
@Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the network")
|
||||
private String displayText;
|
||||
|
||||
@Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class,
|
||||
required=true, description="the Physical Network ID the network belongs to")
|
||||
private Long physicalNetworkId;
|
||||
|
||||
@Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="the gateway of the network")
|
||||
private String gateway;
|
||||
|
||||
@Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, required=true, description="the netmask of the network")
|
||||
private String netmask;
|
||||
|
||||
@Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, required=true, description="the beginning IP address in the network IP range")
|
||||
private String startIp;
|
||||
|
||||
@Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address in the network IP" +
|
||||
" range. If not specified, will be defaulted to startIP")
|
||||
private String endIp;
|
||||
|
||||
@Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, required=true, description="the ID or VID of the network")
|
||||
private String vlan;
|
||||
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="account who will own the network")
|
||||
private String accountName;
|
||||
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
|
||||
description="an optional project for the ssh key")
|
||||
private Long projectId;
|
||||
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
|
||||
description="domain ID of the account owning a network")
|
||||
private Long domainId;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getGateway() {
|
||||
return gateway;
|
||||
}
|
||||
|
||||
public String getVlan() {
|
||||
return vlan;
|
||||
}
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
public String getNetmask() {
|
||||
return netmask;
|
||||
}
|
||||
|
||||
public String getStartIp() {
|
||||
return startIp;
|
||||
}
|
||||
|
||||
public String getNetworkName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDisplayText() {
|
||||
return displayText;
|
||||
}
|
||||
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public long getPhysicalNetworkId() {
|
||||
return physicalNetworkId;
|
||||
}
|
||||
|
||||
public String getEndIp() {
|
||||
return endIp;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void create() throws ResourceAllocationException {
|
||||
Network result = null;
|
||||
try {
|
||||
result = _networkService.createPrivateNetwork(getNetworkName(), getDisplayText(), getPhysicalNetworkId(), getVlan(),
|
||||
getStartIp(), getEndIp(), getGateway(), getNetmask(), getEntityOwnerId(), null);
|
||||
} catch (InsufficientCapacityException ex){
|
||||
s_logger.info(ex);
|
||||
s_logger.trace(ex);
|
||||
throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
|
||||
} catch (ConcurrentOperationException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
this.setEntityId(result.getId());
|
||||
this.setEntityUuid(result.getUuid());
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create a Private network");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException{
|
||||
Network result = _networkService.getNetwork(getEntityId());
|
||||
if (result != null) {
|
||||
NetworkResponse response = _responseGenerator.createNetworkResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create private network");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
|
||||
if (accountId == null) {
|
||||
return UserContext.current().getCaller().getId();
|
||||
}
|
||||
return accountId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_NETWORK_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "creating private network";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -49,7 +49,8 @@ public interface AsyncJob extends Identity, InternalIdentity {
|
|||
AutoScalePolicy,
|
||||
AutoScaleVmProfile,
|
||||
AutoScaleVmGroup,
|
||||
GlobalLoadBalancerRule
|
||||
GlobalLoadBalancerRule,
|
||||
AffinityGroup
|
||||
}
|
||||
|
||||
long getUserId();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ import org.apache.cloudstack.api.command.admin.offering.UpdateServiceOfferingCmd
|
|||
import org.apache.cloudstack.api.command.admin.pod.DeletePodCmd;
|
||||
import org.apache.cloudstack.api.command.admin.pod.UpdatePodCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vlan.DedicatePublicIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vlan.DeleteVlanIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vlan.ReleasePublicIpRangeCmd;
|
||||
import org.apache.cloudstack.api.command.admin.zone.CreateZoneCmd;
|
||||
import org.apache.cloudstack.api.command.admin.zone.DeleteZoneCmd;
|
||||
import org.apache.cloudstack.api.command.admin.zone.UpdateZoneCmd;
|
||||
|
|
@ -234,6 +236,10 @@ public interface ConfigurationService {
|
|||
|
||||
boolean deleteVlanIpRange(DeleteVlanIpRangeCmd cmd);
|
||||
|
||||
Vlan dedicatePublicIpRange(DedicatePublicIpRangeCmd cmd) throws ResourceAllocationException;
|
||||
|
||||
boolean releasePublicIpRange(ReleasePublicIpRangeCmd cmd);
|
||||
|
||||
NetworkOffering createNetworkOffering(CreateNetworkOfferingCmd cmd);
|
||||
|
||||
NetworkOffering updateNetworkOffering(UpdateNetworkOfferingCmd cmd);
|
||||
|
|
|
|||
|
|
@ -142,6 +142,9 @@ public class EventTypes {
|
|||
//registering SSH keypair events
|
||||
public static final String EVENT_REGISTER_SSH_KEYPAIR = "REGISTER.SSH.KEYPAIR";
|
||||
|
||||
//register for user API and secret keys
|
||||
public static final String EVENT_REGISTER_FOR_SECRET_API_KEY = "REGISTER.USER.KEY";
|
||||
|
||||
// Template Events
|
||||
public static final String EVENT_TEMPLATE_CREATE = "TEMPLATE.CREATE";
|
||||
public static final String EVENT_TEMPLATE_DELETE = "TEMPLATE.DELETE";
|
||||
|
|
@ -223,6 +226,8 @@ public class EventTypes {
|
|||
// VLANs/IP ranges
|
||||
public static final String EVENT_VLAN_IP_RANGE_CREATE = "VLAN.IP.RANGE.CREATE";
|
||||
public static final String EVENT_VLAN_IP_RANGE_DELETE = "VLAN.IP.RANGE.DELETE";
|
||||
public static final String EVENT_VLAN_IP_RANGE_DEDICATE = "VLAN.IP.RANGE.DEDICATE";
|
||||
public static final String EVENT_VLAN_IP_RANGE_RELEASE = "VLAN.IP.RANGE.RELEASE";
|
||||
|
||||
public static final String EVENT_STORAGE_IP_RANGE_CREATE = "STORAGE.IP.RANGE.CREATE";
|
||||
public static final String EVENT_STORAGE_IP_RANGE_DELETE = "STORAGE.IP.RANGE.DELETE";
|
||||
|
|
@ -345,7 +350,7 @@ public class EventTypes {
|
|||
// tag related events
|
||||
public static final String EVENT_TAGS_CREATE = "CREATE_TAGS";
|
||||
public static final String EVENT_TAGS_DELETE = "DELETE_TAGS";
|
||||
|
||||
|
||||
// vm snapshot events
|
||||
public static final String EVENT_VM_SNAPSHOT_CREATE = "VMSNAPSHOT.CREATE";
|
||||
public static final String EVENT_VM_SNAPSHOT_DELETE = "VMSNAPSHOT.DELETE";
|
||||
|
|
@ -379,6 +384,12 @@ public class EventTypes {
|
|||
public static final String EVENT_BAREMETAL_PXE_SERVER_ADD = "PHYSICAL.PXE.ADD";
|
||||
public static final String EVENT_BAREMETAL_PXE_SERVER_DELETE = "PHYSICAL.PXE.DELETE";
|
||||
|
||||
public static final String EVENT_AFFINITY_GROUP_CREATE = "AG.CREATE";
|
||||
public static final String EVENT_AFFINITY_GROUP_DELETE = "AG.DELETE";
|
||||
public static final String EVENT_AFFINITY_GROUP_ASSIGN = "AG.ASSIGN";
|
||||
public static final String EVENT_AFFINITY_GROUP_REMOVE = "AG.REMOVE";
|
||||
public static final String EVENT_VM_AFFINITY_GROUP_UPDATE = "VM.AG.UPDATE";
|
||||
|
||||
static {
|
||||
|
||||
// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
|
||||
|
|
@ -536,6 +547,8 @@ public class EventTypes {
|
|||
// VLANs/IP ranges
|
||||
entityEventDetails.put(EVENT_VLAN_IP_RANGE_CREATE, Vlan.class.getName());
|
||||
entityEventDetails.put(EVENT_VLAN_IP_RANGE_DELETE,Vlan.class.getName());
|
||||
entityEventDetails.put(EVENT_VLAN_IP_RANGE_DEDICATE, Vlan.class.getName());
|
||||
entityEventDetails.put(EVENT_VLAN_IP_RANGE_RELEASE,Vlan.class.getName());
|
||||
|
||||
entityEventDetails.put(EVENT_STORAGE_IP_RANGE_CREATE, StorageNetworkIpRange.class.getName());
|
||||
entityEventDetails.put(EVENT_STORAGE_IP_RANGE_DELETE, StorageNetworkIpRange.class.getName());
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
package com.cloud.exception;
|
||||
|
||||
import com.cloud.utils.SerialVersionUID;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
|
||||
public class AffinityConflictException extends CloudRuntimeException {
|
||||
|
||||
private static final long serialVersionUID = SerialVersionUID.AffinityConflictException;
|
||||
|
||||
public AffinityConflictException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public AffinityConflictException(String message, Throwable th) {
|
||||
super(message, th);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -52,4 +52,6 @@ public interface HypervisorCapabilities extends Identity, InternalIdentity{
|
|||
*/
|
||||
Integer getMaxHostsPerCluster();
|
||||
|
||||
boolean isStorageMotionSupported();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
// under the License.
|
||||
package com.cloud.hypervisor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.agent.api.Command;
|
||||
import com.cloud.agent.api.to.NicTO;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
|
|
@ -57,4 +59,11 @@ public interface HypervisorGuru extends Adapter {
|
|||
* @return
|
||||
*/
|
||||
NicTO toNicTO(NicProfile profile);
|
||||
|
||||
/**
|
||||
* Give hypervisor guru opportunity to decide if certain command needs to be done after expunge VM from DB
|
||||
* @param vm
|
||||
* @return a list of Commands
|
||||
*/
|
||||
List<Command> finalizeExpunge(VirtualMachine vm);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,16 +78,7 @@ public interface IpAddress extends ControlledEntity, Identity, InternalIdentity
|
|||
|
||||
boolean getSystem();
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
Long getVpcId();
|
||||
|
||||
/**
|
||||
* @param vpcId
|
||||
*/
|
||||
void setVpcId(Long vpcId);
|
||||
String getVmIp();
|
||||
void setVmIp(String vmIp);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,24 +16,11 @@
|
|||
// under the License.
|
||||
package com.cloud.network;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
import com.cloud.network.Networks.BroadcastDomainType;
|
||||
import com.cloud.network.Networks.Mode;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.network.Networks.BroadcastDomainType;
|
||||
import com.cloud.network.Networks.Mode;
|
||||
import com.cloud.network.Networks.TrafficType;
|
||||
import com.cloud.utils.fsm.StateMachine2;
|
||||
import com.cloud.utils.fsm.StateObject;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
|
@ -137,6 +124,7 @@ public interface Network extends ControlledEntity, StateObject<Network.State>, I
|
|||
public static final Provider None = new Provider("None", false);
|
||||
// NiciraNvp is not an "External" provider, otherwise we get in trouble with NetworkServiceImpl.providersConfiguredForExternalNetworking
|
||||
public static final Provider NiciraNvp = new Provider("NiciraNvp", false);
|
||||
public static final Provider CiscoVnmc = new Provider("CiscoVnmc", true);
|
||||
|
||||
private String name;
|
||||
private boolean isExternal;
|
||||
|
|
@ -182,6 +170,7 @@ public interface Network extends ControlledEntity, StateObject<Network.State>, I
|
|||
public static final Capability AllowDnsSuffixModification = new Capability("AllowDnsSuffixModification");
|
||||
public static final Capability RedundantRouter = new Capability("RedundantRouter");
|
||||
public static final Capability ElasticIp = new Capability("ElasticIp");
|
||||
public static final Capability AssociatePublicIP = new Capability("AssociatePublicIP");
|
||||
public static final Capability ElasticLb = new Capability("ElasticLb");
|
||||
public static final Capability AutoScaleCounters = new Capability("AutoScaleCounters");
|
||||
public static final Capability InlineMode = new Capability("InlineMode");
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ public interface NetworkModel {
|
|||
|
||||
String getStartIpv6Address(long id);
|
||||
|
||||
Nic getPlaceholderNic(Network network, Long podId);
|
||||
|
||||
boolean isProviderEnabledInZone(long zoneId, String provider);
|
||||
|
||||
Nic getPlaceholderNicForRouter(Network network, Long podId);
|
||||
}
|
||||
|
|
@ -46,7 +46,7 @@ public interface NetworkService {
|
|||
|
||||
List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner);
|
||||
|
||||
IpAddress allocateIP(Account ipOwner, boolean isSystem, long zoneId) throws ResourceAllocationException,
|
||||
IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException,
|
||||
InsufficientAddressCapacityException, ConcurrentOperationException;
|
||||
|
||||
boolean releaseIpAddress(long ipAddressId) throws InsufficientAddressCapacityException;
|
||||
|
|
@ -79,7 +79,7 @@ public interface NetworkService {
|
|||
Long startIndex, Long pageSize, String name);
|
||||
|
||||
PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List<String> tags,
|
||||
String newVnetRangeString, String state);
|
||||
String newVnetRangeString, String state, String removeVlan);
|
||||
|
||||
boolean deletePhysicalNetwork(Long id);
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ public interface NetworkService {
|
|||
throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException;
|
||||
|
||||
/* Requests an IP address for the guest nic */
|
||||
String allocateSecondaryGuestIP(Account account, long zoneId, Long nicId,
|
||||
NicSecondaryIp allocateSecondaryGuestIP(Account account, long zoneId, Long nicId,
|
||||
Long networkId, String ipaddress) throws InsufficientAddressCapacityException;
|
||||
|
||||
boolean releaseSecondaryIpFromNic(long ipAddressId);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package com.cloud.network;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.utils.Pair;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
|
|
@ -59,7 +60,9 @@ public interface PhysicalNetwork extends Identity, InternalIdentity {
|
|||
|
||||
Long getDomainId();
|
||||
|
||||
String getVnet();
|
||||
List<Pair<Integer,Integer>> getVnet();
|
||||
|
||||
String getVnetString();
|
||||
|
||||
String getSpeed();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,4 @@ public interface PublicIpAddress extends ControlledEntity, IpAddress, Vlan, Inte
|
|||
public String getNetmask();
|
||||
|
||||
public String getGateway();
|
||||
|
||||
@Override
|
||||
public String getVlanTag();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,11 @@ import com.cloud.utils.component.Adapter;
|
|||
|
||||
public interface IpDeployer extends Adapter{
|
||||
/**
|
||||
* Apply ip addresses to this network
|
||||
* Modify ip addresses on this network
|
||||
* Depending on the State of the ip addresses the element should take
|
||||
* appropriate action.
|
||||
* If state is Releasing the ip address should be de-allocated
|
||||
* If state is Allocating or Allocated the ip address should be provisioned
|
||||
* @param network
|
||||
* @param ipAddress
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
|
|||
public final static String SystemPrivateGatewayNetworkOffering = "System-Private-Gateway-Network-Offering";
|
||||
|
||||
public final static String DefaultSharedNetworkOfferingWithSGService = "DefaultSharedNetworkOfferingWithSGService";
|
||||
public final static String QuickCloudNoServices = "QuickCloudNoServices";
|
||||
public final static String DefaultIsolatedNetworkOfferingWithSourceNatService = "DefaultIsolatedNetworkOfferingWithSourceNatService";
|
||||
public final static String OvsIsolatedNetworkOfferingWithSourceNatService = "OvsIsolatedNetworkOfferingWithSourceNatService";
|
||||
public final static String DefaultSharedNetworkOffering = "DefaultSharedNetworkOffering";
|
||||
|
|
@ -106,6 +107,8 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
|
|||
|
||||
boolean getElasticIp();
|
||||
|
||||
boolean getAssociatePublicIP();
|
||||
|
||||
boolean getElasticLb();
|
||||
|
||||
boolean getSpecifyIpRanges();
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package com.cloud.region.ha;
|
||||
|
||||
import com.cloud.network.rules.LoadBalancer;
|
||||
import org.apache.cloudstack.api.command.user.region.ha.gslb.*;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -44,4 +45,6 @@ public interface GlobalLoadBalancingRulesService {
|
|||
|
||||
List<GlobalLoadBalancerRule> listGlobalLoadBalancerRule(ListGlobalLoadBalancerRuleCmd listGslbCmd);
|
||||
|
||||
List<LoadBalancer> listSiteLoadBalancers(long gslbRuleId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,9 +75,11 @@ import com.cloud.network.IpAddress;
|
|||
import com.cloud.org.Cluster;
|
||||
import com.cloud.storage.GuestOS;
|
||||
import com.cloud.storage.GuestOsCategory;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.SSHKeyPair;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.Ternary;
|
||||
import com.cloud.vm.InstanceGroup;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.cloud.vm.VirtualMachine.Type;
|
||||
|
|
@ -123,7 +125,7 @@ public interface ManagementService {
|
|||
/**
|
||||
* Searches for servers by the specified search criteria Can search by: "name", "type", "state", "dataCenterId",
|
||||
* "podId"
|
||||
*
|
||||
*
|
||||
* @param cmd
|
||||
* @return List of Hosts
|
||||
*/
|
||||
|
|
@ -388,10 +390,21 @@ public interface ManagementService {
|
|||
* @param Long
|
||||
* vmId
|
||||
* Id of The VM to migrate
|
||||
* @return Pair<List<? extends Host>, List<? extends Host>> List of all Hosts in VM's cluster and list of Hosts with
|
||||
* enough capacity
|
||||
* @return Ternary<List<? extends Host>, List<? extends Host>, Map<Host, Boolean>> List of all Hosts to which a VM
|
||||
* can be migrated, list of Hosts with enough capacity and hosts requiring storage motion for migration.
|
||||
*/
|
||||
Pair<Pair<List<? extends Host>, Integer>, List<? extends Host>> listHostsForMigrationOfVM(Long vmId, Long startIndex, Long pageSize);
|
||||
Ternary<Pair<List<? extends Host>, Integer>, List<? extends Host>, Map<Host, Boolean>> listHostsForMigrationOfVM(
|
||||
Long vmId, Long startIndex, Long pageSize);
|
||||
|
||||
/**
|
||||
* List storage pools for live migrating of a volume. The API returns list of all pools in the cluster to which the
|
||||
* volume can be migrated. Current pool is not included in the list.
|
||||
*
|
||||
* @param Long volumeId
|
||||
* @return Pair<List<? extends StoragePool>, List<? extends StoragePool>> List of storage pools in cluster and list
|
||||
* of pools with enough capacity.
|
||||
*/
|
||||
Pair<List<? extends StoragePool>, List<? extends StoragePool>> listStoragePoolsForMigrationOfVolume(Long volumeId);
|
||||
|
||||
String[] listEventTypes();
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import org.apache.cloudstack.acl.ControlledEntity;
|
|||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
|
||||
public interface Account extends ControlledEntity, InternalIdentity, Identity {
|
||||
public enum Type {
|
||||
Normal,
|
||||
|
|
@ -64,4 +65,7 @@ public interface Account extends ControlledEntity, InternalIdentity, Identity {
|
|||
public Long getDefaultZoneId();
|
||||
|
||||
public String getUuid();
|
||||
|
||||
boolean isDefault();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,5 +72,7 @@ public interface User extends OwnedBy, InternalIdentity {
|
|||
String getRegistrationToken();
|
||||
|
||||
boolean isRegistered();
|
||||
|
||||
boolean isDefault();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ public class DiskProfile {
|
|||
this.hyperType = hyperType;
|
||||
}
|
||||
|
||||
public HypervisorType getHypersorType() {
|
||||
public HypervisorType getHypervisorType() {
|
||||
return this.hyperType;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,14 +21,24 @@ import java.util.Map;
|
|||
|
||||
import javax.naming.InsufficientResourcesException;
|
||||
|
||||
import org.apache.cloudstack.api.BaseCmd.HTTPMethod;
|
||||
import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
|
||||
import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.*;
|
||||
import org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.DeployVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.DestroyVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.RebootVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.RemoveNicFromVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.ResetVMPasswordCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.ResetVMSSHKeyCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.RestoreVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.ScaleVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.StartVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.UpdateDefaultNicForVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.UpdateVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vm.UpgradeVMCmd;
|
||||
import org.apache.cloudstack.api.command.user.vmgroup.CreateVMGroupCmd;
|
||||
import org.apache.cloudstack.api.command.user.vmgroup.DeleteVMGroupCmd;
|
||||
import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
|
||||
import org.apache.cloudstack.api.command.user.volume.DetachVolumeCmd;
|
||||
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
|
|
@ -42,7 +52,6 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
|||
import com.cloud.network.Network.IpAddresses;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.storage.Volume;
|
||||
import com.cloud.template.VirtualMachineTemplate;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
|
@ -104,14 +113,14 @@ public interface UserVmService {
|
|||
* @return the vm object if successful, null otherwise
|
||||
*/
|
||||
UserVm addNicToVirtualMachine(AddNicToVMCmd cmd);
|
||||
|
||||
|
||||
/**
|
||||
* Removes a NIC on the given network from the virtual machine
|
||||
* @param cmd the command object that defines the vm and the given network
|
||||
* @return the vm object if successful, null otherwise
|
||||
*/
|
||||
UserVm removeNicFromVirtualMachine(RemoveNicFromVMCmd cmd);
|
||||
|
||||
|
||||
/**
|
||||
* Updates default Nic to the given network for given virtual machine
|
||||
* @param cmd the command object that defines the vm and the given network
|
||||
|
|
@ -123,7 +132,8 @@ public interface UserVmService {
|
|||
|
||||
|
||||
/**
|
||||
* Creates a Basic Zone User VM in the database and returns the VM to the caller.
|
||||
* Creates a Basic Zone User VM in the database and returns the VM to the
|
||||
* caller.
|
||||
*
|
||||
* @param zone
|
||||
* - availability zone for the virtual machine
|
||||
|
|
@ -132,61 +142,69 @@ public interface UserVmService {
|
|||
* @param template
|
||||
* - the template for the virtual machine
|
||||
* @param securityGroupIdList
|
||||
* - comma separated list of security groups id that going to be applied to the virtual machine
|
||||
* - comma separated list of security groups id that going to be
|
||||
* applied to the virtual machine
|
||||
* @param hostName
|
||||
* - host name for the virtual machine
|
||||
* @param displayName
|
||||
* - an optional user generated name for the virtual machine
|
||||
* @param diskOfferingId
|
||||
* - 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
|
||||
* - 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
|
||||
* @param diskSize
|
||||
* - the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId
|
||||
* - the arbitrary size for the DATADISK volume. Mutually
|
||||
* exclusive with diskOfferingId
|
||||
* @param group
|
||||
* - an optional group for the virtual machine
|
||||
* @param hypervisor
|
||||
* - the hypervisor on which to deploy the virtual machine
|
||||
* @param userData
|
||||
* - 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. Currently only HTTP GET is supported.
|
||||
* Using HTTP
|
||||
* GET (via querystring), you can send up to 2KB of data after base64 encoding
|
||||
* - 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. Currently only
|
||||
* HTTP GET is supported. Using HTTP GET (via querystring), you
|
||||
* can send up to 2KB of data after base64 encoding
|
||||
* @param sshKeyPair
|
||||
* - name of the ssh key pair used to login to the virtual machine
|
||||
* - name of the ssh key pair used to login to the virtual
|
||||
* machine
|
||||
* @param requestedIps
|
||||
* TODO
|
||||
* @param defaultIp
|
||||
* TODO
|
||||
* @param affinityGroupIdList
|
||||
* @param accountName
|
||||
* - an optional account for the virtual machine. Must be used with domainId
|
||||
* - 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
|
||||
* - an optional domainId for the virtual machine. If the account
|
||||
* parameter is used, domainId must also be used
|
||||
* @return UserVm object if successful.
|
||||
*
|
||||
* @throws InsufficientCapacityException
|
||||
* if there is insufficient capacity to deploy the VM.
|
||||
* @throws ConcurrentOperationException
|
||||
* if there are multiple users working on the same VM or in the same environment.
|
||||
* if there are multiple users working on the same VM or in the
|
||||
* same environment.
|
||||
* @throws ResourceUnavailableException
|
||||
* if the resources required to deploy the VM is not currently available.
|
||||
* if the resources required to deploy the VM is not currently
|
||||
* available.
|
||||
* @throws InsufficientResourcesException
|
||||
*/
|
||||
UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> securityGroupIdList, Account owner, String hostName,
|
||||
String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIp, String keyboard)
|
||||
String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor,
|
||||
HTTPMethod httpmethod, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps,
|
||||
IpAddresses defaultIp, String keyboard, List<Long> affinityGroupIdList)
|
||||
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.
|
||||
* 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
|
||||
|
|
@ -197,63 +215,69 @@ public interface UserVmService {
|
|||
* @param networkIdList
|
||||
* - list of network ids used by virtual machine
|
||||
* @param securityGroupIdList
|
||||
* - comma separated list of security groups id that going to be applied to the virtual machine
|
||||
* - comma separated list of security groups id that going to be
|
||||
* applied to the virtual machine
|
||||
* @param hostName
|
||||
* - host name for the virtual machine
|
||||
* @param displayName
|
||||
* - an optional user generated name for the virtual machine
|
||||
* @param diskOfferingId
|
||||
* - 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
|
||||
* - 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
|
||||
* @param diskSize
|
||||
* - the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId
|
||||
* - the arbitrary size for the DATADISK volume. Mutually
|
||||
* exclusive with diskOfferingId
|
||||
* @param group
|
||||
* - an optional group for the virtual machine
|
||||
* @param hypervisor
|
||||
* - the hypervisor on which to deploy the virtual machine
|
||||
* @param userData
|
||||
* - 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. Currently only HTTP GET is supported.
|
||||
* Using HTTP
|
||||
* GET (via querystring), you can send up to 2KB of data after base64 encoding
|
||||
* - 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. Currently only
|
||||
* HTTP GET is supported. Using HTTP GET (via querystring), you
|
||||
* can send up to 2KB of data after base64 encoding
|
||||
* @param sshKeyPair
|
||||
* - name of the ssh key pair used to login to the virtual machine
|
||||
* - name of the ssh key pair used to login to the virtual
|
||||
* machine
|
||||
* @param requestedIps
|
||||
* TODO
|
||||
* @param defaultIps
|
||||
* TODO
|
||||
* @param affinityGroupIdList
|
||||
* @param accountName
|
||||
* - an optional account for the virtual machine. Must be used with domainId
|
||||
* - 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
|
||||
* - an optional domainId for the virtual machine. If the account
|
||||
* parameter is used, domainId must also be used
|
||||
* @return UserVm object if successful.
|
||||
*
|
||||
* @throws InsufficientCapacityException
|
||||
* if there is insufficient capacity to deploy the VM.
|
||||
* @throws ConcurrentOperationException
|
||||
* if there are multiple users working on the same VM or in the same environment.
|
||||
* if there are multiple users working on the same VM or in the
|
||||
* same environment.
|
||||
* @throws ResourceUnavailableException
|
||||
* if the resources required to deploy the VM is not currently available.
|
||||
* if the resources required to deploy the VM is not currently
|
||||
* available.
|
||||
* @throws InsufficientResourcesException
|
||||
*/
|
||||
UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, List<Long> securityGroupIdList,
|
||||
Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps,
|
||||
IpAddresses defaultIps, String keyboard)
|
||||
Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, String sshKeyPair,
|
||||
Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, String keyboard, List<Long> affinityGroupIdList)
|
||||
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.
|
||||
*
|
||||
* 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
|
||||
|
|
@ -267,49 +291,57 @@ public interface UserVmService {
|
|||
* @param displayName
|
||||
* - an optional user generated name for the virtual machine
|
||||
* @param diskOfferingId
|
||||
* - 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
|
||||
* - 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
|
||||
* @param diskSize
|
||||
* - the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId
|
||||
* - the arbitrary size for the DATADISK volume. Mutually
|
||||
* exclusive with diskOfferingId
|
||||
* @param group
|
||||
* - an optional group for the virtual machine
|
||||
* @param hypervisor
|
||||
* - the hypervisor on which to deploy the virtual machine
|
||||
* @param userData
|
||||
* - 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. Currently only HTTP GET is supported.
|
||||
* Using HTTP
|
||||
* GET (via querystring), you can send up to 2KB of data after base64 encoding
|
||||
* - 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. Currently only
|
||||
* HTTP GET is supported. Using HTTP GET (via querystring), you
|
||||
* can send up to 2KB of data after base64 encoding
|
||||
* @param sshKeyPair
|
||||
* - name of the ssh key pair used to login to the virtual machine
|
||||
* - name of the ssh key pair used to login to the virtual
|
||||
* machine
|
||||
* @param requestedIps
|
||||
* TODO
|
||||
* @param defaultIps TODO
|
||||
* @param defaultIps
|
||||
* TODO
|
||||
* @param affinityGroupIdList
|
||||
* @param accountName
|
||||
* - an optional account for the virtual machine. Must be used with domainId
|
||||
* - 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
|
||||
* - an optional domainId for the virtual machine. If the account
|
||||
* parameter is used, domainId must also be used
|
||||
* @return UserVm object if successful.
|
||||
*
|
||||
*
|
||||
* @throws InsufficientCapacityException
|
||||
* if there is insufficient capacity to deploy the VM.
|
||||
* @throws ConcurrentOperationException
|
||||
* if there are multiple users working on the same VM or in the same environment.
|
||||
* if there are multiple users working on the same VM or in the
|
||||
* same environment.
|
||||
* @throws ResourceUnavailableException
|
||||
* if the resources required to deploy the VM is not currently available.
|
||||
* if the resources required to deploy the VM is not currently
|
||||
* available.
|
||||
* @throws InsufficientResourcesException
|
||||
*/
|
||||
UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List<Long> networkIdList, Account owner, String hostName,
|
||||
String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, String keyboard)
|
||||
String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor,
|
||||
HTTPMethod httpmethod, String userData, String sshKeyPair, Map<Long, IpAddresses> requestedIps,
|
||||
IpAddresses defaultIps, String keyboard, List<Long> affinityGroupIdList)
|
||||
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;
|
||||
|
||||
/**
|
||||
|
|
@ -386,6 +418,33 @@ public interface UserVmService {
|
|||
*/
|
||||
VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost) throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException, VirtualMachineMigrationException;
|
||||
|
||||
/**
|
||||
* Migrate the given VM with its volumes to the destination host. The API returns the migrated VM if it succeeds.
|
||||
* Only root admin can migrate a VM.
|
||||
*
|
||||
* @param destinationStorage
|
||||
* TODO
|
||||
* @param Long
|
||||
* vmId of The VM to migrate
|
||||
* @param Host
|
||||
* destinationHost to migrate the VM
|
||||
* @param Map
|
||||
* A map of volume to which pool it should be migrated
|
||||
*
|
||||
* @return VirtualMachine migrated VM
|
||||
* @throws ManagementServerException
|
||||
* in case we get error finding the VM or host or access errors or other internal errors.
|
||||
* @throws ConcurrentOperationException
|
||||
* if there are multiple users working on the same VM.
|
||||
* @throws ResourceUnavailableException
|
||||
* if the destination host to migrate the VM is not currently available.
|
||||
* @throws VirtualMachineMigrationException
|
||||
* if the VM to be migrated is not in Running state
|
||||
*/
|
||||
VirtualMachine migrateVirtualMachineWithVolume(Long vmId, Host destinationHost, Map<String, String> volumeToPool)
|
||||
throws ResourceUnavailableException, ConcurrentOperationException, ManagementServerException,
|
||||
VirtualMachineMigrationException;
|
||||
|
||||
UserVm moveVMToUser(AssignVMCmd moveUserVMCmd) throws ResourceAllocationException, ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException;
|
||||
|
||||
VirtualMachine vmStorageMigration(Long vmId, StoragePool destPool);
|
||||
|
|
|
|||
|
|
@ -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 org.apache.cloudstack.affinity;
|
||||
|
||||
import org.apache.cloudstack.acl.ControlledEntity;
|
||||
import org.apache.cloudstack.api.Identity;
|
||||
import org.apache.cloudstack.api.InternalIdentity;
|
||||
|
||||
public interface AffinityGroup extends ControlledEntity, InternalIdentity, Identity {
|
||||
|
||||
String getName();
|
||||
|
||||
String getDescription();
|
||||
|
||||
String getType();
|
||||
|
||||
}
|
||||
|
|
@ -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.affinity;
|
||||
|
||||
import com.cloud.deploy.DeploymentPlan;
|
||||
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
|
||||
import com.cloud.exception.AffinityConflictException;
|
||||
import com.cloud.utils.component.Adapter;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
|
||||
public interface AffinityGroupProcessor extends Adapter {
|
||||
|
||||
/**
|
||||
* process() is called to apply any user preferences to the deployment plan
|
||||
* and avoid set for the given VM placement.
|
||||
*
|
||||
* @param vm
|
||||
* virtual machine.
|
||||
* @param plan
|
||||
* deployment plan that tells you where it's being deployed to.
|
||||
* @param avoid
|
||||
* avoid these data centers, pods, clusters, or hosts.
|
||||
*/
|
||||
void process(VirtualMachineProfile<? extends VirtualMachine> vm, DeploymentPlan plan, ExcludeList avoid)
|
||||
throws AffinityConflictException;
|
||||
|
||||
/**
|
||||
* getType() should return the affinity/anti-affinity group being
|
||||
* implemented
|
||||
*
|
||||
* @return String Affinity/Anti-affinity type
|
||||
*/
|
||||
String getType();
|
||||
}
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT 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.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import org.apache.cloudstack.api.response.ControlledEntityResponse;
|
||||
import org.apache.cloudstack.api.response.ControlledViewEntityResponse;
|
||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||
|
||||
import com.cloud.network.security.SecurityGroup;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@EntityReference(value = AffinityGroup.class)
|
||||
public class AffinityGroupResponse extends BaseResponse implements ControlledViewEntityResponse {
|
||||
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the affinity group")
|
||||
private String id;
|
||||
|
||||
@SerializedName(ApiConstants.NAME) @Param(description="the name of the affinity group")
|
||||
private String name;
|
||||
|
||||
@SerializedName(ApiConstants.DESCRIPTION) @Param(description="the description of the affinity group")
|
||||
private String description;
|
||||
|
||||
@SerializedName(ApiConstants.ACCOUNT) @Param(description="the account owning the affinity group")
|
||||
private String accountName;
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain ID of the affinity group")
|
||||
private String domainId;
|
||||
|
||||
@SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the affinity group")
|
||||
private String domainName;
|
||||
|
||||
@SerializedName(ApiConstants.TYPE)
|
||||
@Param(description = "the type of the affinity group")
|
||||
private String type;
|
||||
|
||||
@SerializedName("virtualmachineIds")
|
||||
@Param(description = "virtual machine Ids associated with this affinity group ")
|
||||
private List<String> vmIdList;
|
||||
|
||||
public AffinityGroupResponse() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectId() {
|
||||
return this.getId();
|
||||
}
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setAccountName(String accountName) {
|
||||
this.accountName = accountName;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDomainId(String domainId) {
|
||||
this.domainId = domainId;
|
||||
}
|
||||
|
||||
public void setDomainName(String domainName) {
|
||||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
AffinityGroupResponse other = (AffinityGroupResponse) obj;
|
||||
if (id == null) {
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProjectId(String projectId) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProjectName(String projectName) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void setVMIdList(List<String> vmIdList) {
|
||||
this.vmIdList = vmIdList;
|
||||
}
|
||||
|
||||
public void addVMId(String vmId) {
|
||||
if (this.vmIdList == null) {
|
||||
this.vmIdList = new ArrayList<String>();
|
||||
}
|
||||
|
||||
this.vmIdList.add(vmId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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 org.apache.cloudstack.affinity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
public interface AffinityGroupService {
|
||||
|
||||
/**
|
||||
* Creates an affinity/anti-affinity group for the given account/domain.
|
||||
*
|
||||
* @param account
|
||||
* @param domainId
|
||||
* @param name
|
||||
* @param type
|
||||
* @param description
|
||||
* @return AffinityGroup
|
||||
*/
|
||||
|
||||
AffinityGroup createAffinityGroup(String account, Long domainId, String affinityGroupName,
|
||||
String affinityGroupType, String description);
|
||||
|
||||
/**
|
||||
* Creates an affinity/anti-affinity group.
|
||||
*
|
||||
* @param affinityGroupId
|
||||
* @param account
|
||||
* @param domainId
|
||||
* @param affinityGroupName
|
||||
* @throws ResourceInUseException
|
||||
*/
|
||||
boolean deleteAffinityGroup(Long affinityGroupId, String account, Long domainId, String affinityGroupName)
|
||||
throws ResourceInUseException;
|
||||
|
||||
/** Lists Affinity Groups in your account
|
||||
* @param account
|
||||
* @param domainId
|
||||
* @param affinityGroupId
|
||||
* @param affinityGroupName
|
||||
* @param affinityGroupType
|
||||
* @param vmId
|
||||
* @param startIndex
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
Pair<List<? extends AffinityGroup>, Integer> listAffinityGroups(Long affinityGroupId, String affinityGroupName,
|
||||
String affinityGroupType, Long vmId, Long startIndex, Long pageSize);
|
||||
|
||||
|
||||
/**
|
||||
* List group types available in deployment
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<String> listAffinityGroupTypes();
|
||||
|
||||
AffinityGroup getAffinityGroup(Long groupId);
|
||||
|
||||
UserVm updateVMAffinityGroups(Long vmId, List<Long> affinityGroupIds);
|
||||
|
||||
}
|
||||
|
|
@ -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 org.apache.cloudstack.affinity;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import org.apache.cloudstack.api.response.ControlledEntityResponse;
|
||||
import org.apache.cloudstack.api.response.ControlledViewEntityResponse;
|
||||
|
||||
import com.cloud.network.security.SecurityGroup;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@EntityReference(value = AffinityGroup.class)
|
||||
public class AffinityGroupTypeResponse extends BaseResponse {
|
||||
|
||||
@SerializedName(ApiConstants.TYPE)
|
||||
@Param(description = "the type of the affinity group")
|
||||
private String type;
|
||||
|
||||
|
||||
public AffinityGroupTypeResponse() {
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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 org.apache.cloudstack.affinity;
|
||||
|
||||
import com.cloud.deploy.DeploymentPlan;
|
||||
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
|
||||
import com.cloud.exception.AffinityConflictException;
|
||||
import com.cloud.utils.component.AdapterBase;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import com.cloud.vm.VirtualMachineProfile;
|
||||
|
||||
public class AffinityProcessorBase extends AdapterBase implements AffinityGroupProcessor {
|
||||
|
||||
protected String _type;
|
||||
|
||||
@Override
|
||||
public void process(VirtualMachineProfile<? extends VirtualMachine> vm, DeploymentPlan plan, ExcludeList avoid)
|
||||
throws AffinityConflictException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return _type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
_type = type;
|
||||
}
|
||||
}
|
||||
|
|
@ -221,6 +221,7 @@ public class ApiConstants {
|
|||
public static final String VIRTUAL_MACHINE_ID = "virtualmachineid";
|
||||
public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids";
|
||||
public static final String VLAN = "vlan";
|
||||
public static final String REMOVE_VLAN="removevlan";
|
||||
public static final String VLAN_ID = "vlanid";
|
||||
public static final String VM_AVAILABLE = "vmavailable";
|
||||
public static final String VM_LIMIT = "vmlimit";
|
||||
|
|
@ -230,6 +231,7 @@ public class ApiConstants {
|
|||
public static final String VOLUME_ID = "volumeid";
|
||||
public static final String ZONE_ID = "zoneid";
|
||||
public static final String ZONE_NAME = "zonename";
|
||||
public static final String ZONE_TYPE = "zonetype";
|
||||
public static final String NETWORK_TYPE = "networktype";
|
||||
public static final String PAGE = "page";
|
||||
public static final String PAGE_SIZE = "pagesize";
|
||||
|
|
@ -333,6 +335,7 @@ public class ApiConstants {
|
|||
public static final String LOAD_BALANCER_DEVICE_STATE = "lbdevicestate";
|
||||
public static final String LOAD_BALANCER_DEVICE_CAPACITY = "lbdevicecapacity";
|
||||
public static final String LOAD_BALANCER_DEVICE_DEDICATED = "lbdevicededicated";
|
||||
public static final String LOAD_BALANCER_RULE = "loadbalancerrule";
|
||||
public static final String LOAD_BALANCER_RULE_LIST = "loadbalancerrulelist";
|
||||
public static final String FIREWALL_DEVICE_ID = "fwdeviceid";
|
||||
public static final String FIREWALL_DEVICE_NAME = "fwdevicename";
|
||||
|
|
@ -364,6 +367,8 @@ public class ApiConstants {
|
|||
public static final String HA_HOST = "hahost";
|
||||
public static final String CUSTOM_DISK_OFF_MAX_SIZE = "customdiskofferingmaxsize";
|
||||
public static final String DEFAULT_ZONE_ID = "defaultzoneid";
|
||||
public static final String LIVE_MIGRATE = "livemigrate";
|
||||
public static final String MIGRATE_TO = "migrateto";
|
||||
public static final String GUID = "guid";
|
||||
public static final String VSWITCH_TYPE_GUEST_TRAFFIC = "guestvswitchtype";
|
||||
public static final String VSWITCH_TYPE_PUBLIC_TRAFFIC = "publicvswitchtype";
|
||||
|
|
@ -473,13 +478,17 @@ public class ApiConstants {
|
|||
public static final String HEALTHCHECK_HEALTHY_THRESHOLD = "healthythreshold";
|
||||
public static final String HEALTHCHECK_UNHEALTHY_THRESHOLD = "unhealthythreshold";
|
||||
public static final String HEALTHCHECK_PINGPATH = "pingpath";
|
||||
public static final String AFFINITY_GROUP_IDS = "affinitygroupids";
|
||||
public static final String AFFINITY_GROUP_NAMES = "affinitygroupnames";
|
||||
public static final String ASA_INSIDE_PORT_PROFILE = "insideportprofile";
|
||||
public static final String AFFINITY_GROUP_ID = "affinitygroupid";
|
||||
|
||||
public enum HostDetails {
|
||||
all, capacity, events, stats, min;
|
||||
}
|
||||
|
||||
public enum VMDetails {
|
||||
all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min;
|
||||
all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min, affgrp;
|
||||
}
|
||||
|
||||
public enum LDAPParams {
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ import java.util.regex.Pattern;
|
|||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.cloudstack.affinity.AffinityGroupService;
|
||||
import org.apache.cloudstack.query.QueryService;
|
||||
import org.apache.cloudstack.usage.UsageService;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.configuration.ConfigurationService;
|
||||
import com.cloud.consoleproxy.ConsoleProxyService;
|
||||
import com.cloud.dao.EntityManager;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
|
|
@ -95,6 +95,11 @@ public abstract class BaseCmd {
|
|||
private Object _responseObject = null;
|
||||
private Map<String, String> fullUrlParams;
|
||||
|
||||
public enum HTTPMethod {
|
||||
GET, POST, PUT, DELETE
|
||||
}
|
||||
private HTTPMethod httpMethod;
|
||||
|
||||
@Parameter(name = "response", type = CommandType.STRING)
|
||||
private String responseType;
|
||||
|
||||
|
|
@ -109,7 +114,6 @@ public abstract class BaseCmd {
|
|||
@Inject public TemplateService _templateService;
|
||||
@Inject public SecurityGroupService _securityGroupService;
|
||||
@Inject public SnapshotService _snapshotService;
|
||||
@Inject public ConsoleProxyService _consoleProxyService;
|
||||
@Inject public VpcVirtualNetworkApplianceService _routerService;
|
||||
@Inject public ResponseGenerator _responseGenerator;
|
||||
@Inject public EntityManager _entityMgr;
|
||||
|
|
@ -134,12 +138,32 @@ public abstract class BaseCmd {
|
|||
@Inject public VMSnapshotService _vmSnapshotService;
|
||||
@Inject public DataStoreProviderApiService dataStoreProviderApiService;
|
||||
@Inject public VpcProvisioningService _vpcProvSvc;
|
||||
@Inject public AffinityGroupService _affinityGroupService;
|
||||
|
||||
public abstract void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException;
|
||||
|
||||
public void configure() {
|
||||
}
|
||||
|
||||
public HTTPMethod getHttpMethod() {
|
||||
return httpMethod;
|
||||
}
|
||||
|
||||
public void setHttpMethod(String method) {
|
||||
if (method != null) {
|
||||
if (method.equalsIgnoreCase("GET"))
|
||||
httpMethod = HTTPMethod.GET;
|
||||
else if (method.equalsIgnoreCase("PUT"))
|
||||
httpMethod = HTTPMethod.PUT;
|
||||
else if (method.equalsIgnoreCase("POST"))
|
||||
httpMethod = HTTPMethod.POST;
|
||||
else if (method.equalsIgnoreCase("DELETE"))
|
||||
httpMethod = HTTPMethod.DELETE;
|
||||
} else {
|
||||
httpMethod = HTTPMethod.GET;
|
||||
}
|
||||
}
|
||||
|
||||
public String getResponseType() {
|
||||
if (responseType == null) {
|
||||
return RESPONSE_TYPE_XML;
|
||||
|
|
@ -156,7 +180,7 @@ public abstract class BaseCmd {
|
|||
/**
|
||||
* For commands the API framework needs to know the owner of the object being acted upon. This method is
|
||||
* used to determine that information.
|
||||
*
|
||||
*
|
||||
* @return the id of the account that owns the object being acted upon
|
||||
*/
|
||||
public abstract long getEntityOwnerId();
|
||||
|
|
@ -469,7 +493,7 @@ public abstract class BaseCmd {
|
|||
if (!enabledOnly || account.getState() == Account.State.enabled) {
|
||||
return account.getId();
|
||||
} else {
|
||||
throw new PermissionDeniedException("Can't add resources to the account id=" + account.getId() + " in state=" + account.getState() + " as it's no longer active");
|
||||
throw new PermissionDeniedException("Can't add resources to the account id=" + account.getId() + " in state=" + account.getState() + " as it's no longer active");
|
||||
}
|
||||
} else {
|
||||
// idList is not used anywhere, so removed it now
|
||||
|
|
@ -486,7 +510,7 @@ public abstract class BaseCmd {
|
|||
return project.getProjectAccountId();
|
||||
} else {
|
||||
PermissionDeniedException ex = new PermissionDeniedException("Can't add resources to the project with specified projectId in state=" + project.getState() + " as it's no longer active");
|
||||
ex.addProxyObject(project, projectId, "projectId");
|
||||
ex.addProxyObject(project, projectId, "projectId");
|
||||
throw ex;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ import java.text.DecimalFormat;
|
|||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.vm.NicSecondaryIp;
|
||||
import org.apache.cloudstack.affinity.AffinityGroup;
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import org.apache.cloudstack.api.ApiConstants.HostDetails;
|
||||
import org.apache.cloudstack.api.ApiConstants.VMDetails;
|
||||
import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
|
||||
|
|
@ -150,18 +153,9 @@ import com.cloud.user.UserAccount;
|
|||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.vm.InstanceGroup;
|
||||
import com.cloud.vm.Nic;
|
||||
import com.cloud.vm.NicSecondaryIp;
|
||||
import com.cloud.vm.snapshot.VMSnapshot;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
import org.apache.cloudstack.api.ApiConstants.HostDetails;
|
||||
import org.apache.cloudstack.api.ApiConstants.VMDetails;
|
||||
import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
|
||||
import org.apache.cloudstack.api.response.*;
|
||||
import org.apache.cloudstack.region.Region;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
public interface ResponseGenerator {
|
||||
UserResponse createUserResponse(UserAccount user);
|
||||
|
|
@ -196,6 +190,10 @@ public interface ResponseGenerator {
|
|||
|
||||
HostResponse createHostResponse(Host host);
|
||||
|
||||
HostForMigrationResponse createHostForMigrationResponse(Host host);
|
||||
|
||||
HostForMigrationResponse createHostForMigrationResponse(Host host, EnumSet<HostDetails> details);
|
||||
|
||||
VlanIpRangeResponse createVlanIpRangeResponse(Vlan vlan);
|
||||
|
||||
IPAddressResponse createIPAddressResponse(IpAddress ipAddress);
|
||||
|
|
@ -223,6 +221,8 @@ public interface ResponseGenerator {
|
|||
|
||||
StoragePoolResponse createStoragePoolResponse(StoragePool pool);
|
||||
|
||||
StoragePoolForMigrationResponse createStoragePoolForMigrationResponse(StoragePool pool);
|
||||
|
||||
ClusterResponse createClusterResponse(Cluster cluster, Boolean showCapacities);
|
||||
|
||||
FirewallRuleResponse createPortForwardingRuleResponse(PortForwardingRule fwRule);
|
||||
|
|
@ -384,12 +384,16 @@ public interface ResponseGenerator {
|
|||
GuestOSResponse createGuestOSResponse(GuestOS os);
|
||||
|
||||
SnapshotScheduleResponse createSnapshotScheduleResponse(SnapshotSchedule sched);
|
||||
|
||||
|
||||
UsageRecordResponse createUsageResponse(Usage usageRecord);
|
||||
|
||||
TrafficMonitorResponse createTrafficMonitorResponse(Host trafficMonitor);
|
||||
VMSnapshotResponse createVMSnapshotResponse(VMSnapshot vmSnapshot);
|
||||
NicSecondaryIpResponse createSecondaryIPToNicResponse(String ip,
|
||||
Long nicId, Long networkId);
|
||||
|
||||
NicSecondaryIpResponse createSecondaryIPToNicResponse(NicSecondaryIp result);
|
||||
public NicResponse createNicResponse(Nic result);
|
||||
|
||||
AffinityGroupResponse createAffinityGroupResponse(AffinityGroup group);
|
||||
|
||||
Long getAffinityGroupId(String name, long entityOwnerId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@
|
|||
// under the License.
|
||||
package org.apache.cloudstack.api.command.admin.account;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserAccount;
|
||||
import com.cloud.user.UserContext;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
|
|
@ -27,14 +27,12 @@ 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.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.UserResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserAccount;
|
||||
import com.cloud.user.UserContext;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
@APICommand(name = "createAccount", description="Creates an account", responseObject=UserResponse.class)
|
||||
@APICommand(name = "createAccount", description="Creates an account", responseObject=AccountResponse.class)
|
||||
public class CreateAccountCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateAccountCmd.class.getName());
|
||||
|
||||
|
|
|
|||
|
|
@ -111,14 +111,14 @@ public class UpdateClusterCmd extends BaseCmd {
|
|||
if(cpuovercommitratio != null){
|
||||
return Float.parseFloat(cpuovercommitratio);
|
||||
}
|
||||
return 1.0f;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Float getMemoryOvercommitRaito (){
|
||||
if (memoryovercommitratio != null){
|
||||
return Float.parseFloat(memoryovercommitratio);
|
||||
}
|
||||
return 1.0f;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -127,9 +127,16 @@ public class UpdateClusterCmd extends BaseCmd {
|
|||
if (cluster == null) {
|
||||
throw new InvalidParameterValueException("Unable to find the cluster by id=" + getId());
|
||||
}
|
||||
if (getMemoryOvercommitRaito() !=null){
|
||||
if ((getMemoryOvercommitRaito().compareTo(1f) < 0)) {
|
||||
throw new InvalidParameterValueException("Memory overcommit ratio should be greater than or equal to one");
|
||||
}
|
||||
}
|
||||
|
||||
if ((getMemoryOvercommitRaito().compareTo(1f) < 0) | (getCpuOvercommitRatio().compareTo(1f) < 0)) {
|
||||
throw new InvalidParameterValueException("Cpu and ram overcommit ratios should be greater than one");
|
||||
if (getCpuOvercommitRatio() !=null){
|
||||
if (getCpuOvercommitRatio().compareTo(1f) < 0) {
|
||||
throw new InvalidParameterValueException("Cpu overcommit ratio should be greater than or equal to one");
|
||||
}
|
||||
}
|
||||
|
||||
Cluster result = _resourceService.updateCluster(cluster, getClusterType(), getHypervisor(), getAllocationState(), getManagedstate(), getMemoryOvercommitRaito(), getCpuOvercommitRatio());
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ import org.apache.cloudstack.api.APICommand;
|
|||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseListCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.response.ConfigurationResponse;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.configuration.Configuration;
|
||||
|
|
@ -46,6 +45,13 @@ public class ListCfgsByCmd extends BaseListCmd {
|
|||
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "lists configuration by name")
|
||||
private String configName;
|
||||
|
||||
@Parameter(name=ApiConstants.SCOPE, type = CommandType.STRING, description = "scope(zone/cluster/pool/account) of the parameter that needs to be updated")
|
||||
private String scope;
|
||||
|
||||
@Parameter(name=ApiConstants.ID, type = CommandType.UUID, entityType = {ZoneResponse.class, ClusterResponse.class, StoragePoolResponse.class, AccountResponse.class}, description = "corresponding ID of the scope")
|
||||
private Long id;
|
||||
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
|
@ -58,6 +64,15 @@ public class ListCfgsByCmd extends BaseListCmd {
|
|||
return configName;
|
||||
}
|
||||
|
||||
public String getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Long getPageSizeVal() {
|
||||
Long pageSizeVal = 500L;
|
||||
|
|
@ -85,6 +100,11 @@ public class ListCfgsByCmd extends BaseListCmd {
|
|||
for (Configuration cfg : result.first()) {
|
||||
ConfigurationResponse cfgResponse = _responseGenerator.createConfigurationResponse(cfg);
|
||||
cfgResponse.setObjectName("configuration");
|
||||
if (scope != null) {
|
||||
cfgResponse.setScope(scope);
|
||||
} else {
|
||||
cfgResponse.setScope("global");
|
||||
}
|
||||
configResponses.add(cfgResponse);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import org.apache.cloudstack.api.ApiErrorCode;
|
|||
import org.apache.cloudstack.api.BaseCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.ConfigurationResponse;
|
||||
import org.apache.cloudstack.api.response.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.configuration.Configuration;
|
||||
|
|
@ -43,6 +43,12 @@ public class UpdateCfgCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.VALUE, type=CommandType.STRING, description="the value of the configuration", length=4095)
|
||||
private String value;
|
||||
|
||||
@Parameter(name=ApiConstants.SCOPE, type = CommandType.STRING, description = "scope(zone/cluster/pool/account) of the parameter that needs to be updated")
|
||||
private String scope;
|
||||
|
||||
@Parameter(name=ApiConstants.ID, type = CommandType.UUID, entityType = {ZoneResponse.class, ClusterResponse.class, StoragePoolResponse.class, AccountResponse.class}, description = "corresponding ID of the scope")
|
||||
private Long id;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -55,6 +61,14 @@ public class UpdateCfgCmd extends BaseCmd {
|
|||
return value;
|
||||
}
|
||||
|
||||
public String getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -75,6 +89,12 @@ public class UpdateCfgCmd extends BaseCmd {
|
|||
if (cfg != null) {
|
||||
ConfigurationResponse response = _responseGenerator.createConfigurationResponse(cfg);
|
||||
response.setResponseName(getCommandName());
|
||||
if (scope != null) {
|
||||
response.setScope(scope);
|
||||
response.setValue(value);
|
||||
} else {
|
||||
response.setScope("global");
|
||||
}
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update config");
|
||||
|
|
|
|||
|
|
@ -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 org.apache.cloudstack.api.command.admin.host;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseListCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.response.HostForMigrationResponse;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.Ternary;
|
||||
|
||||
@APICommand(name = "findHostsForMigration", description="Find hosts suitable for migrating a virtual machine.",
|
||||
responseObject=HostForMigrationResponse.class)
|
||||
public class FindHostsForMigrationCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(FindHostsForMigrationCmd.class.getName());
|
||||
|
||||
private static final String s_name = "findhostsformigrationresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
|
||||
required=false, description="find hosts to which this VM can be migrated and flag the hosts with enough " +
|
||||
"CPU/RAM to host the VM")
|
||||
private Long virtualMachineId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getVirtualMachineId() {
|
||||
return virtualMachineId;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
ListResponse<HostForMigrationResponse> response = null;
|
||||
Pair<List<? extends Host>,Integer> result;
|
||||
List<? extends Host> hostsWithCapacity = new ArrayList<Host>();
|
||||
Map<Host, Boolean> hostsRequiringStorageMotion;
|
||||
|
||||
Ternary<Pair<List<? extends Host>,Integer>, List<? extends Host>, Map<Host, Boolean>> hostsForMigration =
|
||||
_mgr.listHostsForMigrationOfVM(getVirtualMachineId(), this.getStartIndex(), this.getPageSizeVal());
|
||||
result = hostsForMigration.first();
|
||||
hostsWithCapacity = hostsForMigration.second();
|
||||
hostsRequiringStorageMotion = hostsForMigration.third();
|
||||
|
||||
response = new ListResponse<HostForMigrationResponse>();
|
||||
List<HostForMigrationResponse> hostResponses = new ArrayList<HostForMigrationResponse>();
|
||||
for (Host host : result.first()) {
|
||||
HostForMigrationResponse hostResponse = _responseGenerator.createHostForMigrationResponse(host);
|
||||
Boolean suitableForMigration = false;
|
||||
if (hostsWithCapacity.contains(host)) {
|
||||
suitableForMigration = true;
|
||||
}
|
||||
hostResponse.setSuitableForMigration(suitableForMigration);
|
||||
|
||||
Boolean requiresStorageMotion = hostsRequiringStorageMotion.get(host);
|
||||
if (requiresStorageMotion != null && requiresStorageMotion) {
|
||||
hostResponse.setRequiresStorageMotion(true);
|
||||
} else {
|
||||
hostResponse.setRequiresStorageMotion(false);
|
||||
}
|
||||
|
||||
hostResponse.setObjectName("host");
|
||||
hostResponses.add(hostResponse);
|
||||
}
|
||||
|
||||
response.setResponses(hostResponses, result.second());
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.admin.host;
|
|||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
|
|
@ -37,6 +38,7 @@ import com.cloud.async.AsyncJob;
|
|||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.Ternary;
|
||||
|
||||
@APICommand(name = "listHosts", description="Lists hosts.", responseObject=HostResponse.class)
|
||||
public class ListHostsCmd extends BaseListCmd {
|
||||
|
|
@ -73,6 +75,9 @@ public class ListHostsCmd extends BaseListCmd {
|
|||
description="the Zone ID for the host")
|
||||
private Long zoneId;
|
||||
|
||||
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
|
||||
private String zoneType;
|
||||
|
||||
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
|
||||
required=false, description="lists hosts in the same cluster as this VM and flag hosts with enough CPU/RAm to host this VM")
|
||||
private Long virtualMachineId;
|
||||
|
|
@ -122,6 +127,10 @@ public class ListHostsCmd extends BaseListCmd {
|
|||
return zoneId;
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
public Long getVirtualMachineId() {
|
||||
return virtualMachineId;
|
||||
}
|
||||
|
|
@ -170,8 +179,8 @@ public class ListHostsCmd extends BaseListCmd {
|
|||
} else {
|
||||
Pair<List<? extends Host>,Integer> result;
|
||||
List<? extends Host> hostsWithCapacity = new ArrayList<Host>();
|
||||
|
||||
Pair<Pair<List<? extends Host>,Integer>, List<? extends Host>> hostsForMigration = _mgr.listHostsForMigrationOfVM(getVirtualMachineId(), this.getStartIndex(), this.getPageSizeVal());
|
||||
Ternary<Pair<List<? extends Host>,Integer>, List<? extends Host>, Map<Host, Boolean>> hostsForMigration =
|
||||
_mgr.listHostsForMigrationOfVM(getVirtualMachineId(), this.getStartIndex(), this.getPageSizeVal());
|
||||
result = hostsForMigration.first();
|
||||
hostsWithCapacity = hostsForMigration.second();
|
||||
|
||||
|
|
@ -192,6 +201,5 @@ public class ListHostsCmd extends BaseListCmd {
|
|||
}
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
|
|||
|
||||
@Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="the VLAN for the physical network")
|
||||
private String vlan;
|
||||
@Parameter(name=ApiConstants.REMOVE_VLAN, type = CommandType.STRING, description ="The vlan range we want to remove")
|
||||
private String removevlan;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
@ -79,6 +81,10 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
|
|||
return vlan;
|
||||
}
|
||||
|
||||
public String getRemoveVlan(){
|
||||
return removevlan;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -95,7 +101,7 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public void execute(){
|
||||
PhysicalNetwork result = _networkService.updatePhysicalNetwork(getId(),getNetworkSpeed(), getTags(), getVlan(), getState());
|
||||
PhysicalNetwork result = _networkService.updatePhysicalNetwork(getId(),getNetworkSpeed(), getTags(), getVlan(), getState(), getRemoveVlan());
|
||||
PhysicalNetworkResponse response = _responseGenerator.createPhysicalNetworkResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ public class CreateServiceOfferingCmd extends BaseCmd {
|
|||
return networkRate;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
package org.apache.cloudstack.api.command.admin.storage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseListCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.StoragePoolForMigrationResponse;
|
||||
import org.apache.cloudstack.api.response.VolumeResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.utils.Pair;
|
||||
|
||||
@APICommand(name = "findStoragePoolsForMigration", description="Lists storage pools available for migration of a volume.",
|
||||
responseObject=StoragePoolForMigrationResponse.class)
|
||||
public class FindStoragePoolsForMigrationCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(FindStoragePoolsForMigrationCmd.class.getName());
|
||||
|
||||
private static final String s_name = "findstoragepoolsformigrationresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = VolumeResponse.class, required=true,
|
||||
description="the ID of the volume")
|
||||
private Long id;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.StoragePool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
Pair<List<? extends StoragePool>, List<? extends StoragePool>> pools =
|
||||
_mgr.listStoragePoolsForMigrationOfVolume(getId());
|
||||
ListResponse<StoragePoolForMigrationResponse> response = new ListResponse<StoragePoolForMigrationResponse>();
|
||||
List<StoragePoolForMigrationResponse> poolResponses = new ArrayList<StoragePoolForMigrationResponse>();
|
||||
|
||||
List<? extends StoragePool> allPools = pools.first();
|
||||
List<? extends StoragePool> suitablePoolList = pools.second();
|
||||
for (StoragePool pool : allPools) {
|
||||
StoragePoolForMigrationResponse poolResponse = _responseGenerator.createStoragePoolForMigrationResponse(pool);
|
||||
Boolean suitableForMigration = false;
|
||||
for (StoragePool suitablePool : suitablePoolList) {
|
||||
if (suitablePool.getId() == pool.getId()) {
|
||||
suitableForMigration = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
poolResponse.setSuitableForMigration(suitableForMigration);
|
||||
poolResponse.setObjectName("storagepool");
|
||||
poolResponses.add(poolResponse);
|
||||
}
|
||||
|
||||
response.setResponses(poolResponses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
|
|
@ -60,6 +60,9 @@ public class ListStoragePoolsCmd extends BaseListCmd {
|
|||
description="the Zone ID for the storage pool")
|
||||
private Long zoneId;
|
||||
|
||||
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
|
||||
private String zoneType;
|
||||
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = StoragePoolResponse.class,
|
||||
description="the ID of the storage pool")
|
||||
private Long id;
|
||||
|
|
@ -92,6 +95,10 @@ public class ListStoragePoolsCmd extends BaseListCmd {
|
|||
return zoneId;
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
package org.apache.cloudstack.api.command.admin.vlan;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||
import org.apache.cloudstack.api.response.VlanIpRangeResponse;
|
||||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.dc.Vlan;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@APICommand(name = "dedicatePublicIpRange", description="Dedicates a Public IP range to an account", responseObject=VlanIpRangeResponse.class)
|
||||
public class DedicatePublicIpRangeCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DedicatePublicIpRangeCmd.class.getName());
|
||||
|
||||
private static final String s_name = "dedicatepubliciprangeresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = VlanIpRangeResponse.class,
|
||||
required=true, description="the id of the VLAN IP range")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true,
|
||||
description="account who will own the VLAN")
|
||||
private String accountName;
|
||||
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
|
||||
description="project who will own the VLAN")
|
||||
private Long projectId;
|
||||
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
|
||||
required=true, description="domain ID of the account owning a VLAN")
|
||||
private Long domainId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException, ResourceAllocationException {
|
||||
Vlan result = _configService.dedicatePublicIpRange(this);
|
||||
if (result != null) {
|
||||
VlanIpRangeResponse response = _responseGenerator.createVlanIpRangeResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to dedicate vlan ip range");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -14,34 +14,34 @@
|
|||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
package com.cloud.api.commands;
|
||||
package org.apache.cloudstack.api.command.admin.vlan;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
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.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.cloudstack.api.response.VlanIpRangeResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
//@APICommand(description="Destroys console proxy", responseObject=SuccessResponse.class)
|
||||
public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DestroyConsoleProxyCmd.class.getName());
|
||||
@APICommand(name = "releasePublicIpRange", description="Releases a Public IP range back to the system pool", responseObject=SuccessResponse.class)
|
||||
public class ReleasePublicIpRangeCmd extends BaseCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ReleasePublicIpRangeCmd.class.getName());
|
||||
|
||||
private static final String s_name = "destroyconsoleproxyresponse";
|
||||
private static final String s_name = "releasepubliciprangeresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="console proxy ID")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = VlanIpRangeResponse.class,
|
||||
required=true, description="the id of the Public IP range")
|
||||
private Long id;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -50,7 +50,6 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
|
|||
return id;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -62,32 +61,17 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = (Account)UserContext.current().getCaller();
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_PROXY_DESTROY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "destroying console proxy: " + getId();
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _consoleProxyService.destroyConsoleProxy(this);
|
||||
boolean result = _configService.releasePublicIpRange(this);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to destroy console proxy");
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to release public ip range");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ public class MigrateVMCmd extends BaseAsyncCmd {
|
|||
required=true, description="the ID of the virtual machine")
|
||||
private Long virtualMachineId;
|
||||
|
||||
@Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, entityType=StoragePoolResponse.class,
|
||||
@Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.UUID, entityType=StoragePoolResponse.class,
|
||||
required=false, description="Destination storage pool ID to migrate VM volumes to. Required for migrating the root disk volume")
|
||||
private Long storageId;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,160 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT 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.vm;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.api.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
|
||||
import org.apache.cloudstack.api.BaseCmd.CommandType;
|
||||
import org.apache.cloudstack.api.response.HostResponse;
|
||||
import org.apache.cloudstack.api.response.StoragePoolResponse;
|
||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ManagementServerException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.exception.VirtualMachineMigrationException;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.vm.VirtualMachine;
|
||||
|
||||
@APICommand(name = "migrateVirtualMachineWithVolume", description="Attempts Migration of a VM with its volumes to a different host", responseObject=UserVmResponse.class)
|
||||
public class MigrateVirtualMachineWithVolumeCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(MigrateVMCmd.class.getName());
|
||||
|
||||
private static final String s_name = "migratevirtualmachinewithvolumeresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name=ApiConstants.HOST_ID, type=CommandType.UUID, entityType=HostResponse.class,
|
||||
required=true, description="Destination Host ID to migrate VM to.")
|
||||
private Long hostId;
|
||||
|
||||
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType=UserVmResponse.class,
|
||||
required=true, description="the ID of the virtual machine")
|
||||
private Long virtualMachineId;
|
||||
|
||||
@Parameter(name = ApiConstants.MIGRATE_TO, type = CommandType.MAP, required=false,
|
||||
description = "Map of pool to which each volume should be migrated (volume/pool pair)")
|
||||
private Map migrateVolumeTo;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public Long getHostId() {
|
||||
return hostId;
|
||||
}
|
||||
|
||||
public Long getVirtualMachineId() {
|
||||
return virtualMachineId;
|
||||
}
|
||||
|
||||
public Map<String, String> getVolumeToPool() {
|
||||
Map<String, String> volumeToPoolMap = new HashMap<String, String>();
|
||||
if (migrateVolumeTo != null && !migrateVolumeTo.isEmpty()) {
|
||||
Collection<?> allValues = migrateVolumeTo.values();
|
||||
Iterator<?> iter = allValues.iterator();
|
||||
while (iter.hasNext()) {
|
||||
HashMap<String, String> volumeToPool = (HashMap<String, String>) iter.next();
|
||||
String volume = volumeToPool.get("volume");
|
||||
String pool = volumeToPool.get("pool");
|
||||
volumeToPoolMap.put(volume, pool);
|
||||
}
|
||||
}
|
||||
return volumeToPoolMap;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
UserVm userVm = _entityMgr.findById(UserVm.class, getVirtualMachineId());
|
||||
if (userVm != null) {
|
||||
return userVm.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_VM_MIGRATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Attempting to migrate VM Id: " + getVirtualMachineId() + " to host Id: "+ getHostId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
UserVm userVm = _userVmService.getUserVm(getVirtualMachineId());
|
||||
if (userVm == null) {
|
||||
throw new InvalidParameterValueException("Unable to find the VM by id=" + getVirtualMachineId());
|
||||
}
|
||||
|
||||
Host destinationHost = _resourceService.getHost(getHostId());
|
||||
if (destinationHost == null) {
|
||||
throw new InvalidParameterValueException("Unable to find the host to migrate the VM, host id =" + getHostId());
|
||||
}
|
||||
|
||||
try{
|
||||
VirtualMachine migratedVm = _userVmService.migrateVirtualMachineWithVolume(getVirtualMachineId(),
|
||||
destinationHost, getVolumeToPool());
|
||||
if (migratedVm != null) {
|
||||
UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", (UserVm)migratedVm).get(0);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to migrate vm");
|
||||
}
|
||||
} catch (ResourceUnavailableException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
|
||||
} catch (ConcurrentOperationException e) {
|
||||
s_logger.warn("Exception: ", e);
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
|
||||
} catch (ManagementServerException e) {
|
||||
s_logger.warn("Exception: ", e);
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
|
||||
} catch (VirtualMachineMigrationException e) {
|
||||
s_logger.warn("Exception: ", e);
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,38 +16,21 @@
|
|||
// under the License.
|
||||
package org.apache.cloudstack.api.command.user.address;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiErrorCode;
|
||||
import org.apache.cloudstack.api.BaseAsyncCmd;
|
||||
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.api.response.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.IPAddressResponse;
|
||||
import org.apache.cloudstack.api.response.NetworkResponse;
|
||||
import org.apache.cloudstack.api.response.ProjectResponse;
|
||||
import org.apache.cloudstack.api.response.VpcResponse;
|
||||
import org.apache.cloudstack.api.response.ZoneResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.DataCenter.NetworkType;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientAddressCapacityException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.exception.*;
|
||||
import com.cloud.network.IpAddress;
|
||||
import com.cloud.network.Network;
|
||||
import com.cloud.network.vpc.Vpc;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import org.apache.cloudstack.api.*;
|
||||
import org.apache.cloudstack.api.response.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@APICommand(name = "associateIpAddress", description="Acquires and associates a public IP to an account.", responseObject=IPAddressResponse.class)
|
||||
public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
|
||||
|
|
@ -213,7 +196,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
|
|||
@Override
|
||||
public void create() throws ResourceAllocationException{
|
||||
try {
|
||||
IpAddress ip = _networkService.allocateIP(_accountService.getAccount(getEntityOwnerId()), false, getZoneId());
|
||||
IpAddress ip = _networkService.allocateIP(_accountService.getAccount(getEntityOwnerId()), getZoneId(), getNetworkId());
|
||||
|
||||
if (ip != null) {
|
||||
this.setEntityId(ip.getId());
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
package org.apache.cloudstack.api.command.user.affinitygroup;
|
||||
|
||||
import org.apache.cloudstack.affinity.AffinityGroup;
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
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.DomainResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@APICommand(name = "createAffinityGroup", responseObject = AffinityGroupResponse.class, description = "Creates an affinity/anti-affinity group")
|
||||
public class CreateAffinityGroupCmd extends BaseAsyncCreateCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(CreateAffinityGroupCmd.class.getName());
|
||||
|
||||
private static final String s_name = "createaffinitygroupresponse";
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ////////////// API parameters /////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "an account for the affinity group. Must be used with domainId.")
|
||||
private String accountName;
|
||||
|
||||
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, description = "domainId of the account owning the affinity group", entityType = DomainResponse.class)
|
||||
private Long domainId;
|
||||
|
||||
@Parameter(name = ApiConstants.DESCRIPTION, type = CommandType.STRING, description = "optional description of the affinity group")
|
||||
private String description;
|
||||
|
||||
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "name of the affinity group")
|
||||
private String affinityGroupName;
|
||||
|
||||
@Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, required = true, description = "Type of the affinity group from the available affinity/anti-affinity group types")
|
||||
private String affinityGroupType;
|
||||
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////////// Accessors ///////////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
public String getAffinityGroupName() {
|
||||
return affinityGroupName;
|
||||
}
|
||||
|
||||
public String getAffinityGroupType() {
|
||||
return affinityGroupType;
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
// ///////////// API Implementation///////////////////
|
||||
// ///////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if ((account == null) || isAdmin(account.getType())) {
|
||||
if ((domainId != null) && (accountName != null)) {
|
||||
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
|
||||
if (userAccount != null) {
|
||||
return userAccount.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this
|
||||
// command to SYSTEM so ERROR events
|
||||
// are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
AffinityGroup group = _affinityGroupService.getAffinityGroup(getEntityId());
|
||||
if (group != null) {
|
||||
AffinityGroupResponse response = _responseGenerator.createAffinityGroupResponse(group);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create affinity group:"
|
||||
+ affinityGroupName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create() throws ResourceAllocationException {
|
||||
AffinityGroup result = _affinityGroupService.createAffinityGroup(accountName, domainId, affinityGroupName,
|
||||
affinityGroupType, description);
|
||||
if (result != null) {
|
||||
setEntityId(result.getId());
|
||||
setEntityUuid(result.getUuid());
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create affinity group entity" + affinityGroupName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_AFFINITY_GROUP_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "creating Affinity Group";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateEventType() {
|
||||
return EventTypes.EVENT_AFFINITY_GROUP_CREATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateEventDescription() {
|
||||
return "creating Affinity Group";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AffinityGroup;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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.
|
||||
package org.apache.cloudstack.api.command.user.affinitygroup;
|
||||
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
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.response.DomainResponse;
|
||||
import org.apache.cloudstack.api.response.SuccessResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceInUseException;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@APICommand(name = "deleteAffinityGroup", description = "Deletes affinity group", responseObject = SuccessResponse.class)
|
||||
public class DeleteAffinityGroupCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteAffinityGroupCmd.class.getName());
|
||||
private static final String s_name = "deleteaffinitygroupresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "the account of the affinity group. Must be specified with domain ID")
|
||||
private String accountName;
|
||||
|
||||
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, description = "the domain ID of account owning the affinity group", entityType = DomainResponse.class)
|
||||
private Long domainId;
|
||||
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, description = "The ID of the affinity group. Mutually exclusive with name parameter", entityType = AffinityGroupResponse.class)
|
||||
private Long id;
|
||||
|
||||
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "The name of the affinity group. Mutually exclusive with id parameter")
|
||||
private String name;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
public String getAccountName() {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
|
||||
public Long getId() {
|
||||
if (id != null && name != null) {
|
||||
throw new InvalidParameterValueException("name and id parameters are mutually exclusive");
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
id = _responseGenerator.getAffinityGroupId(name, getEntityOwnerId());
|
||||
if (id == null) {
|
||||
throw new InvalidParameterValueException("Unable to find affinity group by name " + name
|
||||
+ " for the account id=" + getEntityOwnerId());
|
||||
}
|
||||
}
|
||||
|
||||
if (id == null) {
|
||||
throw new InvalidParameterValueException(
|
||||
"Either id or name parameter is requred by deleteAffinityGroup command");
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
Account account = UserContext.current().getCaller();
|
||||
if ((account == null) || isAdmin(account.getType())) {
|
||||
if ((domainId != null) && (accountName != null)) {
|
||||
Account userAccount = _responseGenerator.findAccountByNameDomain(accountName, domainId);
|
||||
if (userAccount != null) {
|
||||
return userAccount.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (account != null) {
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this
|
||||
// command to SYSTEM so ERROR events
|
||||
// are tracked
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
try{
|
||||
boolean result = _affinityGroupService.deleteAffinityGroup(id, accountName, domainId, name);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete affinity group");
|
||||
}
|
||||
} catch (ResourceInUseException ex) {
|
||||
s_logger.warn("Exception: ", ex);
|
||||
throw new ServerApiException(ApiErrorCode.RESOURCE_IN_USE_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_AFFINITY_GROUP_DELETE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "Deleting Affinity Group";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AffinityGroup;
|
||||
}
|
||||
}
|
||||
|
|
@ -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.
|
||||
package org.apache.cloudstack.api.command.user.affinitygroup;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.affinity.AffinityGroupTypeResponse;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.BaseListCmd;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.user.Account;
|
||||
|
||||
@APICommand(name = "listAffinityGroupTypes", description = "Lists affinity group types available", responseObject = AffinityGroupTypeResponse.class)
|
||||
public class ListAffinityGroupTypesCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListAffinityGroupTypesCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listaffinitygrouptypesresponse";
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public long getEntityOwnerId() {
|
||||
return Account.ACCOUNT_ID_SYSTEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
List<String> result = _affinityGroupService.listAffinityGroupTypes();
|
||||
ListResponse<AffinityGroupTypeResponse> response = new ListResponse<AffinityGroupTypeResponse>();
|
||||
ArrayList<AffinityGroupTypeResponse> responses = new ArrayList<AffinityGroupTypeResponse>();
|
||||
if (result != null) {
|
||||
for (String type : result) {
|
||||
AffinityGroupTypeResponse affinityTypeResponse = new AffinityGroupTypeResponse();
|
||||
affinityTypeResponse.setType(type);
|
||||
affinityTypeResponse.setObjectName("affinityGroupType");
|
||||
responses.add(affinityTypeResponse);
|
||||
}
|
||||
}
|
||||
response.setResponses(responses);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
}
|
||||
}
|
||||
|
|
@ -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.command.user.affinitygroup;
|
||||
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseListCmd;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
|
||||
@APICommand(name = "listAffinityGroups", description = "Lists affinity groups", responseObject = AffinityGroupResponse.class)
|
||||
public class ListAffinityGroupsCmd extends BaseListCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(ListAffinityGroupsCmd.class.getName());
|
||||
|
||||
private static final String s_name = "listaffinitygroupsresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "lists affinity groups by name")
|
||||
private String affinityGroupName;
|
||||
|
||||
@Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, description = "lists affinity groups by virtual machine id", entityType = UserVmResponse.class)
|
||||
private Long virtualMachineId;
|
||||
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, description = "list the affinity group by the id provided", entityType = AffinityGroupResponse.class)
|
||||
private Long id;
|
||||
|
||||
@Parameter(name = ApiConstants.TYPE, type = CommandType.STRING, description = "lists affinity groups by type")
|
||||
private String affinityGroupType;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
public String getAffinityGroupName() {
|
||||
return affinityGroupName;
|
||||
}
|
||||
|
||||
public Long getVirtualMachineId() {
|
||||
return virtualMachineId;
|
||||
}
|
||||
|
||||
public Long getId(){
|
||||
return id;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(){
|
||||
|
||||
ListResponse<AffinityGroupResponse> response = _queryService.listAffinityGroups(id, affinityGroupName,
|
||||
affinityGroupType, virtualMachineId, this.getStartIndex(), this.getPageSizeVal());
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AffinityGroup;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 org.apache.cloudstack.api.command.user.affinitygroup;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import org.apache.cloudstack.api.ACL;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
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.ApiConstants.VMDetails;
|
||||
import org.apache.cloudstack.api.response.UserVmResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
|
||||
@APICommand(name = "updateVMAffinityGroup", description = "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.", responseObject = UserVmResponse.class)
|
||||
public class UpdateVMAffinityGroupCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger.getLogger(UpdateVMAffinityGroupCmd.class.getName());
|
||||
private static final String s_name = "updatevirtualmachineresponse";
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@ACL
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=UserVmResponse.class,
|
||||
required=true, description="The ID of the virtual machine")
|
||||
private Long id;
|
||||
|
||||
@ACL
|
||||
@Parameter(name = ApiConstants.AFFINITY_GROUP_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = AffinityGroupResponse.class, description = "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")
|
||||
private List<Long> affinityGroupIdList;
|
||||
|
||||
@ACL
|
||||
@Parameter(name = ApiConstants.AFFINITY_GROUP_NAMES, type = CommandType.LIST, collectionType = CommandType.STRING, entityType = AffinityGroupResponse.class, description = "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")
|
||||
private List<String> affinityGroupNameList;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public List<Long> getAffinityGroupIdList() {
|
||||
if (affinityGroupNameList != null && affinityGroupIdList != null) {
|
||||
throw new InvalidParameterValueException(
|
||||
"affinitygroupids parameter is mutually exclusive with affinitygroupnames parameter");
|
||||
}
|
||||
|
||||
// transform group names to ids here
|
||||
if (affinityGroupNameList != null) {
|
||||
List<Long> affinityGroupIds = new ArrayList<Long>();
|
||||
for (String groupName : affinityGroupNameList) {
|
||||
Long groupId = _responseGenerator.getAffinityGroupId(groupName, getEntityOwnerId());
|
||||
if (groupId == null) {
|
||||
throw new InvalidParameterValueException("Unable to find group by name " + groupName
|
||||
+ " for account " + getEntityOwnerId());
|
||||
} else {
|
||||
affinityGroupIds.add(groupId);
|
||||
}
|
||||
}
|
||||
return affinityGroupIds;
|
||||
} else {
|
||||
return affinityGroupIdList;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public static String getResultObjectName() {
|
||||
return "virtualmachine";
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getEntityOwnerId() {
|
||||
UserVm userVm = _entityMgr.findById(UserVm.class, getId());
|
||||
if (userVm != null) {
|
||||
return userVm.getAccountId();
|
||||
}
|
||||
|
||||
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() throws ResourceUnavailableException,
|
||||
InsufficientCapacityException, ServerApiException {
|
||||
UserContext.current().setEventDetails("Vm Id: "+getId());
|
||||
UserVm result = _affinityGroupService.updateVMAffinityGroups(getId(), getAffinityGroupIdList());
|
||||
ArrayList<VMDetails> dc = new ArrayList<VMDetails>();
|
||||
dc.add(VMDetails.valueOf("affgrp"));
|
||||
EnumSet<VMDetails> details = EnumSet.copyOf(dc);
|
||||
|
||||
if (result != null){
|
||||
UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", details, result).get(0);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update vm's affinity groups");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType() {
|
||||
return EventTypes.EVENT_VM_AFFINITY_GROUP_UPDATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventDescription() {
|
||||
return "updating VM Affinity Group";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncJob.Type getInstanceType() {
|
||||
return AsyncJob.Type.AffinityGroup;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -93,6 +93,9 @@ public class CreateGlobalLoadBalancerRuleCmd extends BaseAsyncCreateCmd {
|
|||
}
|
||||
|
||||
public String getStickyMethod() {
|
||||
if (stickyMethod == null) {
|
||||
return "sourceip";
|
||||
}
|
||||
return stickyMethod;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class ListGlobalLoadBalancerRuleCmd extends BaseListTaggedResourcesCmd {
|
|||
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = GlobalLoadBalancerResponse.class, description = "the ID of the global load balancer rule")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name = ApiConstants.REGION_ID, type = CommandType.UUID, entityType = RegionResponse.class, description = "region ID")
|
||||
@Parameter(name = ApiConstants.REGION_ID, type = CommandType.INTEGER, entityType = RegionResponse.class, description = "region ID")
|
||||
private Integer regionId;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import org.apache.log4j.Logger;
|
|||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.server.ResourceTag;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
@APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank")
|
||||
@APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0")
|
||||
public class CreateTagsCmd extends BaseAsyncCmd{
|
||||
public static final Logger s_logger = Logger.getLogger(CreateTagsCmd.class.getName());
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import org.apache.log4j.Logger;
|
|||
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.server.ResourceTag.TaggedResourceType;
|
||||
@APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank")
|
||||
@APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0")
|
||||
public class DeleteTagsCmd extends BaseAsyncCmd{
|
||||
public static final Logger s_logger = Logger.getLogger(DeleteTagsCmd.class.getName());
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import org.apache.cloudstack.api.Parameter;
|
|||
import org.apache.cloudstack.api.response.ListResponse;
|
||||
import org.apache.cloudstack.api.response.ResourceTagResponse;
|
||||
|
||||
@APICommand(name = "listTags", description = "List resource tag(s)", responseObject = ResourceTagResponse.class, since = "Burbank")
|
||||
@APICommand(name = "listTags", description = "List resource tag(s)", responseObject = ResourceTagResponse.class, since = "4.0.0")
|
||||
public class ListTagsCmd extends BaseListProjectAndAccountResourcesCmd{
|
||||
private static final String s_name = "listtagsresponse";
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
// under the License.
|
||||
package org.apache.cloudstack.api.command.user.vm;
|
||||
|
||||
import com.cloud.vm.NicSecondaryIp;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
|
|
@ -146,6 +147,7 @@ public class AddIpToVmNicCmd extends BaseAsyncCmd {
|
|||
|
||||
UserContext.current().setEventDetails("Nic Id: " + getNicId() );
|
||||
String ip;
|
||||
NicSecondaryIp result;
|
||||
String secondaryIp = null;
|
||||
if ((ip = getIpaddress()) != null) {
|
||||
if (!NetUtils.isValidIp(ip)) {
|
||||
|
|
@ -154,12 +156,13 @@ public class AddIpToVmNicCmd extends BaseAsyncCmd {
|
|||
}
|
||||
|
||||
try {
|
||||
secondaryIp = _networkService.allocateSecondaryGuestIP(_accountService.getAccount(getEntityOwnerId()), getZoneId(), getNicId(), getNetworkId(), getIpaddress());
|
||||
result = _networkService.allocateSecondaryGuestIP(_accountService.getAccount(getEntityOwnerId()), getZoneId(), getNicId(), getNetworkId(), getIpaddress());
|
||||
} catch (InsufficientAddressCapacityException e) {
|
||||
throw new InvalidParameterValueException("Allocating guest ip for nic failed");
|
||||
}
|
||||
|
||||
if (secondaryIp != null) {
|
||||
if (result != null) {
|
||||
secondaryIp = result.getIp4Address();
|
||||
if (getNetworkType() == NetworkType.Basic) {
|
||||
// add security group rules for the secondary ip addresses
|
||||
boolean success = false;
|
||||
|
|
@ -171,7 +174,7 @@ public class AddIpToVmNicCmd extends BaseAsyncCmd {
|
|||
|
||||
s_logger.info("Associated ip address to NIC : " + secondaryIp);
|
||||
NicSecondaryIpResponse response = new NicSecondaryIpResponse();
|
||||
response = _responseGenerator.createSecondaryIPToNicResponse(secondaryIp, getNicId(), getNetworkId());
|
||||
response = _responseGenerator.createSecondaryIPToNicResponse(result);
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import org.apache.cloudstack.api.ACL;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
|
|
@ -127,7 +128,7 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
|
|||
@Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the hypervisor on which to deploy the virtual machine")
|
||||
private String hypervisor;
|
||||
|
||||
@Parameter(name=ApiConstants.USER_DATA, type=CommandType.STRING, description="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. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.", length=2048)
|
||||
@Parameter(name=ApiConstants.USER_DATA, type=CommandType.STRING, description="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.", length=32768)
|
||||
private String userData;
|
||||
|
||||
@Parameter(name=ApiConstants.SSH_KEYPAIR, type=CommandType.STRING, description="name of the ssh key pair used to login to the virtual machine")
|
||||
|
|
@ -172,6 +173,16 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
|
|||
@Parameter(name=ApiConstants.START_VM, type=CommandType.BOOLEAN, description="true if network offering supports specifying ip ranges; defaulted to true if not specified")
|
||||
private Boolean startVm;
|
||||
|
||||
@ACL
|
||||
@Parameter(name = ApiConstants.AFFINITY_GROUP_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = AffinityGroupResponse.class, description = "comma separated list of affinity groups id that are going to be applied to the virtual machine."
|
||||
+ " Mutually exclusive with affinitygroupnames parameter")
|
||||
private List<Long> affinityGroupIdList;
|
||||
|
||||
@ACL
|
||||
@Parameter(name = ApiConstants.AFFINITY_GROUP_NAMES, type = CommandType.LIST, collectionType = CommandType.STRING, entityType = AffinityGroupResponse.class, description = "comma separated list of affinity groups names that are going to be applied to the virtual machine."
|
||||
+ "Mutually exclusive with affinitygroupids parameter")
|
||||
private List<String> affinityGroupNameList;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
@ -219,7 +230,7 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
|
|||
for (String groupName : securityGroupNameList) {
|
||||
Long groupId = _responseGenerator.getSecurityGroupId(groupName, getEntityOwnerId());
|
||||
if (groupId == null) {
|
||||
throw new InvalidParameterValueException("Unable to find group by name " + groupName + " for account " + getEntityOwnerId());
|
||||
throw new InvalidParameterValueException("Unable to find group by name " + groupName);
|
||||
} else {
|
||||
securityGroupIds.add(groupId);
|
||||
}
|
||||
|
|
@ -301,8 +312,8 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
|
|||
throw new InvalidParameterValueException("Unable to translate and find entity with networkId: " + ips.get("networkid"));
|
||||
}
|
||||
}
|
||||
String requestedIp = (String) ips.get("ip");
|
||||
String requestedIpv6 = (String) ips.get("ipv6");
|
||||
String requestedIp = ips.get("ip");
|
||||
String requestedIpv6 = ips.get("ipv6");
|
||||
if (requestedIpv6 != null) {
|
||||
requestedIpv6 = requestedIpv6.toLowerCase();
|
||||
}
|
||||
|
|
@ -321,6 +332,29 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
|
|||
return ip6Address.toLowerCase();
|
||||
}
|
||||
|
||||
public List<Long> getAffinityGroupIdList() {
|
||||
if (affinityGroupNameList != null && affinityGroupIdList != null) {
|
||||
throw new InvalidParameterValueException(
|
||||
"affinitygroupids parameter is mutually exclusive with affinitygroupnames parameter");
|
||||
}
|
||||
|
||||
// transform group names to ids here
|
||||
if (affinityGroupNameList != null) {
|
||||
List<Long> affinityGroupIds = new ArrayList<Long>();
|
||||
for (String groupName : affinityGroupNameList) {
|
||||
Long groupId = _responseGenerator.getAffinityGroupId(groupName, getEntityOwnerId());
|
||||
if (groupId == null) {
|
||||
throw new InvalidParameterValueException("Unable to find affinity group by name " + groupName);
|
||||
} else {
|
||||
affinityGroupIds.add(groupId);
|
||||
}
|
||||
}
|
||||
return affinityGroupIds;
|
||||
} else {
|
||||
return affinityGroupIdList;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -447,18 +481,18 @@ 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(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, keyboard);
|
||||
displayName, diskOfferingId, size, group, getHypervisor(), this.getHttpMethod(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, keyboard, getAffinityGroupIdList());
|
||||
}
|
||||
} else {
|
||||
if (zone.isSecurityGroupEnabled()) {
|
||||
vm = _userVmService.createAdvancedSecurityGroupVirtualMachine(zone, serviceOffering, template, getNetworkIds(), getSecurityGroupIdList(),
|
||||
owner, name, displayName, diskOfferingId, size, group, getHypervisor(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, keyboard);
|
||||
owner, name, displayName, diskOfferingId, size, group, getHypervisor(), this.getHttpMethod(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, keyboard, getAffinityGroupIdList());
|
||||
} 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(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, keyboard);
|
||||
diskOfferingId, size, group, getHypervisor(), this.getHttpMethod(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, keyboard, getAffinityGroupIdList());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import java.util.ArrayList;
|
|||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.cloudstack.affinity.AffinityGroupResponse;
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.ApiConstants.VMDetails;
|
||||
|
|
@ -74,10 +75,12 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
|
|||
@Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="state of the virtual machine")
|
||||
private String state;
|
||||
|
||||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
|
||||
description="the availability zone ID")
|
||||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class, description="the availability zone ID")
|
||||
private Long zoneId;
|
||||
|
||||
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
|
||||
private String zoneType;
|
||||
|
||||
@Parameter(name=ApiConstants.FOR_VIRTUAL_NETWORK, type=CommandType.BOOLEAN,
|
||||
description="list by network type; true if need to list vms using Virtual Network, false otherwise")
|
||||
private Boolean forVirtualNetwork;
|
||||
|
|
@ -95,7 +98,7 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
|
|||
|
||||
@Parameter(name=ApiConstants.DETAILS, type=CommandType.LIST, collectionType=CommandType.STRING,
|
||||
description="comma separated list of host details requested, " +
|
||||
"value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min]." +
|
||||
"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" )
|
||||
private List<String> viewDetails;
|
||||
|
||||
|
|
@ -110,6 +113,10 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
|
|||
@Parameter(name=ApiConstants.VPC_ID, type=CommandType.UUID, entityType=VpcResponse.class,
|
||||
description="list vms by vpc")
|
||||
private Long vpcId;
|
||||
|
||||
@Parameter(name = ApiConstants.AFFINITY_GROUP_ID, type = CommandType.UUID, entityType = AffinityGroupResponse.class, description = "list vms by affinity group")
|
||||
private Long affinityGroupId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -142,6 +149,10 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
|
|||
return zoneId;
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
public Boolean getForVirtualNetwork() {
|
||||
return forVirtualNetwork;
|
||||
}
|
||||
|
|
@ -174,6 +185,10 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
|
|||
return vpcId;
|
||||
}
|
||||
|
||||
public Long getAffinityGroupId() {
|
||||
return affinityGroupId;
|
||||
}
|
||||
|
||||
public EnumSet<VMDetails> getDetails() throws InvalidParameterValueException {
|
||||
EnumSet<VMDetails> dv;
|
||||
if (viewDetails==null || viewDetails.size() <=0){
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class UpdateVMCmd extends BaseCmd{
|
|||
description="the ID of the OS type that best represents this VM.")
|
||||
private Long osTypeId;
|
||||
|
||||
@Parameter(name=ApiConstants.USER_DATA, type=CommandType.STRING, description="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. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.", length=2048)
|
||||
@Parameter(name=ApiConstants.USER_DATA, type=CommandType.STRING, description="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.", length=32768)
|
||||
private String userData;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import com.cloud.user.UserContext;
|
|||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.vm.snapshot.VMSnapshot;
|
||||
|
||||
@APICommand(name = "createVMSnapshot", description = "Creates snapshot for a vm.", responseObject = VMSnapshotResponse.class)
|
||||
@APICommand(name = "createVMSnapshot", description = "Creates snapshot for a vm.", responseObject = VMSnapshotResponse.class, since="4.2.0")
|
||||
public class CreateVMSnapshotCmd extends BaseAsyncCreateCmd {
|
||||
|
||||
public static final Logger s_logger = Logger
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import com.cloud.user.Account;
|
|||
import com.cloud.user.UserContext;
|
||||
import com.cloud.vm.snapshot.VMSnapshot;
|
||||
|
||||
@APICommand(name="deleteVMSnapshot", description = "Deletes a vmsnapshot.", responseObject = SuccessResponse.class)
|
||||
@APICommand(name="deleteVMSnapshot", description = "Deletes a vmsnapshot.", responseObject = SuccessResponse.class, since="4.2.0")
|
||||
public class DeleteVMSnapshotCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger
|
||||
.getLogger(DeleteVMSnapshotCmd.class.getName());
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import org.apache.cloudstack.api.response.VMSnapshotResponse;
|
|||
|
||||
import com.cloud.vm.snapshot.VMSnapshot;
|
||||
|
||||
@APICommand(name="listVMSnapshot", description = "List virtual machine snapshot by conditions", responseObject = VMSnapshotResponse.class)
|
||||
@APICommand(name="listVMSnapshot", description = "List virtual machine snapshot by conditions", responseObject = VMSnapshotResponse.class, since="4.2.0")
|
||||
public class ListVMSnapshotCmd extends BaseListTaggedResourcesCmd {
|
||||
|
||||
private static final String s_name = "listvmsnapshotresponse";
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import com.cloud.user.UserContext;
|
|||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.vm.snapshot.VMSnapshot;
|
||||
|
||||
@APICommand(name = "revertToSnapshot",description = "Revert VM from a vmsnapshot.", responseObject = UserVmResponse.class)
|
||||
@APICommand(name = "revertToSnapshot",description = "Revert VM from a vmsnapshot.", responseObject = UserVmResponse.class, since="4.2.0")
|
||||
public class RevertToSnapshotCmd extends BaseAsyncCmd {
|
||||
public static final Logger s_logger = Logger
|
||||
.getLogger(RevertToSnapshotCmd.class.getName());
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ public class ListVolumesCmd extends BaseListTaggedResourcesCmd {
|
|||
description="the ID of the availability zone")
|
||||
private Long zoneId;
|
||||
|
||||
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
|
||||
private String zoneType;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -100,6 +103,10 @@ public class ListVolumesCmd extends BaseListTaggedResourcesCmd {
|
|||
return zoneId;
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ public class MigrateVolumeCmd extends BaseAsyncCmd {
|
|||
required=true, description="destination storage pool ID to migrate the volume to")
|
||||
private Long storageId;
|
||||
|
||||
@Parameter(name=ApiConstants.LIVE_MIGRATE, type=CommandType.BOOLEAN, required=false,
|
||||
description="if the volume should be live migrated when it is attached to a running vm")
|
||||
private Boolean liveMigrate;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -58,6 +62,10 @@ public class MigrateVolumeCmd extends BaseAsyncCmd {
|
|||
public Long getStoragePoolId() {
|
||||
return storageId;
|
||||
}
|
||||
|
||||
public boolean isLiveMigrate() {
|
||||
return (liveMigrate != null) ? liveMigrate : false;
|
||||
}
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ public class ListZonesByCmd extends BaseListCmd {
|
|||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the zone")
|
||||
private String name;
|
||||
|
||||
@Parameter(name=ApiConstants.NETWORK_TYPE, type=CommandType.STRING, description="the network type of the zone")
|
||||
private String networkType;
|
||||
|
||||
@Parameter(name=ApiConstants.SHOW_CAPACITIES, type=CommandType.BOOLEAN, description="flag to display the capacity of the zones")
|
||||
private Boolean showCapacities;
|
||||
|
||||
|
|
@ -79,6 +82,10 @@ public class ListZonesByCmd extends BaseListCmd {
|
|||
return name;
|
||||
}
|
||||
|
||||
public String getNetworkType(){
|
||||
return networkType;
|
||||
}
|
||||
|
||||
public Boolean getShowCapacities() {
|
||||
return showCapacities;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,6 +183,9 @@ public class AccountResponse extends BaseResponse {
|
|||
|
||||
@SerializedName(ApiConstants.ACCOUNT_DETAILS) @Param(description="details for the account")
|
||||
private Map<String, String> details;
|
||||
|
||||
@SerializedName(ApiConstants.IS_DEFAULT) @Param(description="true if account is default, false otherwise", since="4.2.0")
|
||||
private Boolean isDefault;
|
||||
|
||||
|
||||
@Override
|
||||
|
|
@ -381,4 +384,8 @@ public class AccountResponse extends BaseResponse {
|
|||
public void setDefaultZone(String defaultZoneId) {
|
||||
this.defaultZoneId = defaultZoneId;
|
||||
}
|
||||
|
||||
public void setIsDefault(Boolean isDefault) {
|
||||
this.isDefault = isDefault;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,10 @@ public class ClusterResponse extends BaseResponse {
|
|||
|
||||
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the cluster")
|
||||
private String zoneName;
|
||||
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_TYPE) @Param(description = "network type of the availability zone")
|
||||
private String zoneType;
|
||||
|
||||
@SerializedName("hypervisortype") @Param(description="the hypervisor type of the cluster")
|
||||
private String hypervisorType;
|
||||
|
||||
|
|
@ -116,6 +119,10 @@ public class ClusterResponse extends BaseResponse {
|
|||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public void setZoneType(String zoneType) {
|
||||
this.zoneType = zoneType;
|
||||
}
|
||||
|
||||
public String getClusterType() {
|
||||
return clusterType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,13 @@ public class ConfigurationResponse extends BaseResponse {
|
|||
@SerializedName(ApiConstants.VALUE) @Param(description="the value of the configuration")
|
||||
private String value;
|
||||
|
||||
@SerializedName(ApiConstants.SCOPE) @Param(description="scope(zone/cluster/pool/account) of the parameter that needs to be updated")
|
||||
private String scope;
|
||||
|
||||
@SerializedName(ApiConstants.DESCRIPTION) @Param(description="the description of the configuration")
|
||||
private String description;
|
||||
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
|
@ -66,4 +70,12 @@ public class ConfigurationResponse extends BaseResponse {
|
|||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
package org.apache.cloudstack.api.response;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class DeploymentPlannersResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.NAME)
|
||||
@Param(description = "Deployment Planner name")
|
||||
private String name;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
|
@ -42,6 +42,9 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView
|
|||
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name for the router")
|
||||
private String zoneName;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_TYPE) @Param(description = "network type of the availability zone")
|
||||
private String zoneType;
|
||||
|
||||
@SerializedName(ApiConstants.DNS1) @Param(description="the first DNS for the router")
|
||||
private String dns1;
|
||||
|
||||
|
|
@ -186,6 +189,14 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView
|
|||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
public void setZoneType(String zoneType) {
|
||||
this.zoneType = zoneType;
|
||||
}
|
||||
|
||||
public void setDns1(String dns1) {
|
||||
this.dns1 = dns1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,18 @@ public class FirewallRuleResponse extends BaseResponse {
|
|||
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with the rule", responseObject = ResourceTagResponse.class)
|
||||
private List<ResourceTagResponse> tags;
|
||||
|
||||
@SerializedName(ApiConstants.VM_GUEST_IP) @Param(description="the vm ip address for the port forwarding rule")
|
||||
private String destNatVmIp;
|
||||
|
||||
|
||||
public String getDestNatVmIp() {
|
||||
return destNatVmIp;
|
||||
}
|
||||
|
||||
public void setDestNatVmIp(String destNatVmIp) {
|
||||
this.destNatVmIp = destNatVmIp;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getObjectId() {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ import org.apache.cloudstack.api.ApiConstants;
|
|||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EntityReference(value= GlobalLoadBalancerRule.class)
|
||||
public class GlobalLoadBalancerResponse extends BaseResponse implements ControlledEntityResponse {
|
||||
|
||||
|
|
@ -50,6 +52,10 @@ public class GlobalLoadBalancerResponse extends BaseResponse implements Controll
|
|||
@Param(description = "session persistence method used for the global load balancer")
|
||||
private String stickyMethod;
|
||||
|
||||
@SerializedName(ApiConstants.GSLB_SERVICE_TYPE)
|
||||
@Param(description = "GSLB service type")
|
||||
private String serviceType;
|
||||
|
||||
@SerializedName(ApiConstants.REGION_ID)
|
||||
@Param(description = "Region Id in which global load balancer is created")
|
||||
private Integer regionId;
|
||||
|
|
@ -72,6 +78,10 @@ public class GlobalLoadBalancerResponse extends BaseResponse implements Controll
|
|||
@Param(description = "the domain of the load balancer rule")
|
||||
private String domainName;
|
||||
|
||||
@SerializedName(ApiConstants.LOAD_BALANCER_RULE)
|
||||
@Param(description="List of load balancer rules that are part of GSLB rule", responseObject = LoadBalancerResponse.class)
|
||||
private List<LoadBalancerResponse> siteLoadBalancers;
|
||||
|
||||
public void setRegionIdId(Integer regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
|
|
@ -96,6 +106,10 @@ public class GlobalLoadBalancerResponse extends BaseResponse implements Controll
|
|||
this.stickyMethod = stickyMethod;
|
||||
}
|
||||
|
||||
public void setServiceType(String serviceType) {
|
||||
this.serviceType = serviceType;
|
||||
}
|
||||
|
||||
public void setServiceDomainName(String domainName) {
|
||||
this.gslbDomainName = domainName;
|
||||
}
|
||||
|
|
@ -122,4 +136,8 @@ public class GlobalLoadBalancerResponse extends BaseResponse implements Controll
|
|||
public void setDomainName(String domainName) {
|
||||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
public void setSiteLoadBalancers(List<LoadBalancerResponse> siteLoadBalancers) {
|
||||
this.siteLoadBalancers = siteLoadBalancers;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,365 @@
|
|||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT 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 java.util.Date;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.host.Status;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@EntityReference(value=Host.class)
|
||||
public class HostForMigrationResponse extends BaseResponse {
|
||||
@SerializedName(ApiConstants.ID) @Param(description="the ID of the host")
|
||||
private String id;
|
||||
|
||||
@SerializedName(ApiConstants.NAME) @Param(description="the name of the host")
|
||||
private String name;
|
||||
|
||||
@SerializedName(ApiConstants.STATE) @Param(description="the state of the host")
|
||||
private Status state;
|
||||
|
||||
@SerializedName("disconnected") @Param(description="true if the host is disconnected. False otherwise.")
|
||||
private Date disconnectedOn;
|
||||
|
||||
@SerializedName(ApiConstants.TYPE) @Param(description="the host type")
|
||||
private Host.Type hostType;
|
||||
|
||||
@SerializedName("oscategoryid") @Param(description="the OS category ID of the host")
|
||||
private String osCategoryId;
|
||||
|
||||
@SerializedName("oscategoryname") @Param(description="the OS category name of the host")
|
||||
private String osCategoryName;
|
||||
|
||||
@SerializedName(ApiConstants.IP_ADDRESS) @Param(description="the IP address of the host")
|
||||
private String ipAddress;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_ID) @Param(description="the Zone ID of the host")
|
||||
private String zoneId;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the host")
|
||||
private String zoneName;
|
||||
|
||||
@SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID of the host")
|
||||
private String podId;
|
||||
|
||||
@SerializedName("podname") @Param(description="the Pod name of the host")
|
||||
private String podName;
|
||||
|
||||
@SerializedName("version") @Param(description="the host version")
|
||||
private String version;
|
||||
|
||||
@SerializedName(ApiConstants.HYPERVISOR) @Param(description="the host hypervisor")
|
||||
private HypervisorType hypervisor;
|
||||
|
||||
@SerializedName("cpunumber") @Param(description="the CPU number of the host")
|
||||
private Integer cpuNumber;
|
||||
|
||||
@SerializedName("cpuspeed") @Param(description="the CPU speed of the host")
|
||||
private Long cpuSpeed;
|
||||
|
||||
@SerializedName("cpuallocated") @Param(description="the amount of the host's CPU currently allocated")
|
||||
private String cpuAllocated;
|
||||
|
||||
@SerializedName("cpuused") @Param(description="the amount of the host's CPU currently used")
|
||||
private String cpuUsed;
|
||||
|
||||
@SerializedName("cpuwithoverprovisioning") @Param(description="the amount of the host's CPU after applying the cpu.overprovisioning.factor ")
|
||||
private String cpuWithOverprovisioning;
|
||||
|
||||
@SerializedName("averageload") @Param(description="the cpu average load on the host")
|
||||
private Long averageLoad;
|
||||
|
||||
@SerializedName("networkkbsread") @Param(description="the incoming network traffic on the host")
|
||||
private Long networkKbsRead;
|
||||
|
||||
@SerializedName("networkkbswrite") @Param(description="the outgoing network traffic on the host")
|
||||
private Long networkKbsWrite;
|
||||
|
||||
@SerializedName("memorytotal") @Param(description="the memory total of the host")
|
||||
private Long memoryTotal;
|
||||
|
||||
@SerializedName("memoryallocated") @Param(description="the amount of the host's memory currently allocated")
|
||||
private Long memoryAllocated;
|
||||
|
||||
@SerializedName("memoryused") @Param(description="the amount of the host's memory currently used")
|
||||
private Long memoryUsed;
|
||||
|
||||
@SerializedName("disksizetotal") @Param(description="the total disk size of the host")
|
||||
private Long diskSizeTotal;
|
||||
|
||||
@SerializedName("disksizeallocated") @Param(description="the host's currently allocated disk size")
|
||||
private Long diskSizeAllocated;
|
||||
|
||||
@SerializedName("capabilities") @Param(description="capabilities of the host")
|
||||
private String capabilities;
|
||||
|
||||
@SerializedName("lastpinged") @Param(description="the date and time the host was last pinged")
|
||||
private Date lastPinged;
|
||||
|
||||
@SerializedName("managementserverid") @Param(description="the management server ID of the host")
|
||||
private Long managementServerId;
|
||||
|
||||
@SerializedName("clusterid") @Param(description="the cluster ID of the host")
|
||||
private String clusterId;
|
||||
|
||||
@SerializedName("clustername") @Param(description="the cluster name of the host")
|
||||
private String clusterName;
|
||||
|
||||
@SerializedName("clustertype") @Param(description="the cluster type of the cluster that host belongs to")
|
||||
private String clusterType;
|
||||
|
||||
@SerializedName("islocalstorageactive") @Param(description="true if local storage is active, false otherwise")
|
||||
private Boolean localStorageActive;
|
||||
|
||||
@SerializedName(ApiConstants.CREATED) @Param(description="the date and time the host was created")
|
||||
private Date created;
|
||||
|
||||
@SerializedName("removed") @Param(description="the date and time the host was removed")
|
||||
private Date removed;
|
||||
|
||||
@SerializedName("events") @Param(description="events available for the host")
|
||||
private String events;
|
||||
|
||||
@SerializedName("hosttags") @Param(description="comma-separated list of tags for the host")
|
||||
private String hostTags;
|
||||
|
||||
@SerializedName("hasenoughcapacity") @Param(description="true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise")
|
||||
private Boolean hasEnoughCapacity;
|
||||
|
||||
@SerializedName("suitableformigration") @Param(description="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")
|
||||
private Boolean suitableForMigration;
|
||||
|
||||
@SerializedName("requiresStorageMotion") @Param(description="true if migrating a vm to this host requires storage motion, false otherwise")
|
||||
private Boolean requiresStorageMotion;
|
||||
|
||||
@SerializedName("resourcestate") @Param(description="the resource state of the host")
|
||||
private String resourceState;
|
||||
|
||||
@SerializedName(ApiConstants.HYPERVISOR_VERSION) @Param(description="the hypervisor version")
|
||||
private String hypervisorVersion;
|
||||
|
||||
@SerializedName(ApiConstants.HA_HOST) @Param(description="true if the host is Ha host (dedicated to vms started by HA process; false otherwise")
|
||||
private Boolean haHost;
|
||||
|
||||
@Override
|
||||
public String getObjectId() {
|
||||
return this.getId();
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setState(Status state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public void setDisconnectedOn(Date disconnectedOn) {
|
||||
this.disconnectedOn = disconnectedOn;
|
||||
}
|
||||
|
||||
public void setHostType(Host.Type hostType) {
|
||||
this.hostType = hostType;
|
||||
}
|
||||
|
||||
public void setOsCategoryId(String osCategoryId) {
|
||||
this.osCategoryId = osCategoryId;
|
||||
}
|
||||
|
||||
public void setOsCategoryName(String osCategoryName) {
|
||||
this.osCategoryName = osCategoryName;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public void setZoneName(String zoneName) {
|
||||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public void setPodId(String podId) {
|
||||
this.podId = podId;
|
||||
}
|
||||
|
||||
public void setPodName(String podName) {
|
||||
this.podName = podName;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public void setHypervisor(HypervisorType hypervisor) {
|
||||
this.hypervisor = hypervisor;
|
||||
}
|
||||
|
||||
public void setCpuNumber(Integer cpuNumber) {
|
||||
this.cpuNumber = cpuNumber;
|
||||
}
|
||||
|
||||
public void setCpuSpeed(Long cpuSpeed) {
|
||||
this.cpuSpeed = cpuSpeed;
|
||||
}
|
||||
|
||||
public String getCpuAllocated() {
|
||||
return cpuAllocated;
|
||||
}
|
||||
|
||||
public void setCpuAllocated(String cpuAllocated) {
|
||||
this.cpuAllocated = cpuAllocated;
|
||||
}
|
||||
|
||||
public void setCpuUsed(String cpuUsed) {
|
||||
this.cpuUsed = cpuUsed;
|
||||
}
|
||||
|
||||
public void setAverageLoad(Long averageLoad) {
|
||||
this.averageLoad = averageLoad;
|
||||
}
|
||||
|
||||
public void setNetworkKbsRead(Long networkKbsRead) {
|
||||
this.networkKbsRead = networkKbsRead;
|
||||
}
|
||||
|
||||
public void setNetworkKbsWrite(Long networkKbsWrite) {
|
||||
this.networkKbsWrite = networkKbsWrite;
|
||||
}
|
||||
|
||||
public void setMemoryTotal(Long memoryTotal) {
|
||||
this.memoryTotal = memoryTotal;
|
||||
}
|
||||
|
||||
public void setMemoryAllocated(Long memoryAllocated) {
|
||||
this.memoryAllocated = memoryAllocated;
|
||||
}
|
||||
|
||||
public void setMemoryUsed(Long memoryUsed) {
|
||||
this.memoryUsed = memoryUsed;
|
||||
}
|
||||
|
||||
public void setDiskSizeTotal(Long diskSizeTotal) {
|
||||
this.diskSizeTotal = diskSizeTotal;
|
||||
}
|
||||
|
||||
public void setDiskSizeAllocated(Long diskSizeAllocated) {
|
||||
this.diskSizeAllocated = diskSizeAllocated;
|
||||
}
|
||||
|
||||
public void setCapabilities(String capabilities) {
|
||||
this.capabilities = capabilities;
|
||||
}
|
||||
|
||||
public void setLastPinged(Date lastPinged) {
|
||||
this.lastPinged = lastPinged;
|
||||
}
|
||||
|
||||
public void setManagementServerId(Long managementServerId) {
|
||||
this.managementServerId = managementServerId;
|
||||
}
|
||||
|
||||
public void setClusterId(String clusterId) {
|
||||
this.clusterId = clusterId;
|
||||
}
|
||||
|
||||
public void setClusterName(String clusterName) {
|
||||
this.clusterName = clusterName;
|
||||
}
|
||||
|
||||
public void setClusterType(String clusterType) {
|
||||
this.clusterType = clusterType;
|
||||
}
|
||||
|
||||
public void setLocalStorageActive(Boolean localStorageActive) {
|
||||
this.localStorageActive = localStorageActive;
|
||||
}
|
||||
|
||||
public void setCreated(Date created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public void setRemoved(Date removed) {
|
||||
this.removed = removed;
|
||||
}
|
||||
|
||||
public void setEvents(String events) {
|
||||
this.events = events;
|
||||
}
|
||||
|
||||
public String getHostTags() {
|
||||
return hostTags;
|
||||
}
|
||||
|
||||
public void setHostTags(String hostTags) {
|
||||
this.hostTags = hostTags;
|
||||
}
|
||||
|
||||
public void setHasEnoughCapacity(Boolean hasEnoughCapacity) {
|
||||
this.hasEnoughCapacity = hasEnoughCapacity;
|
||||
}
|
||||
|
||||
public void setSuitableForMigration(Boolean suitableForMigration) {
|
||||
this.suitableForMigration = suitableForMigration;
|
||||
}
|
||||
|
||||
public void setRequiresStorageMotion(Boolean requiresStorageMotion) {
|
||||
this.requiresStorageMotion = requiresStorageMotion;
|
||||
}
|
||||
|
||||
public String getResourceState() {
|
||||
return resourceState;
|
||||
}
|
||||
|
||||
public void setResourceState(String resourceState) {
|
||||
this.resourceState = resourceState;
|
||||
}
|
||||
|
||||
public String getCpuWithOverprovisioning() {
|
||||
return cpuWithOverprovisioning;
|
||||
}
|
||||
|
||||
public void setCpuWithOverprovisioning(String cpuWithOverprovisioning) {
|
||||
this.cpuWithOverprovisioning = cpuWithOverprovisioning;
|
||||
}
|
||||
|
||||
public void setHypervisorVersion(String hypervisorVersion) {
|
||||
this.hypervisorVersion = hypervisorVersion;
|
||||
}
|
||||
|
||||
public void setHaHost(Boolean haHost) {
|
||||
this.haHost = haHost;
|
||||
}
|
||||
}
|
||||
|
|
@ -59,7 +59,10 @@ public class HostResponse extends BaseResponse {
|
|||
|
||||
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the host")
|
||||
private String zoneName;
|
||||
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_TYPE) @Param(description = "network type of the availability zone")
|
||||
private String zoneType;
|
||||
|
||||
@SerializedName(ApiConstants.POD_ID) @Param(description="the Pod ID of the host")
|
||||
private String podId;
|
||||
|
||||
|
|
@ -209,6 +212,10 @@ public class HostResponse extends BaseResponse {
|
|||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public void setZoneType(String zoneType) {
|
||||
this.zoneType = zoneType;
|
||||
}
|
||||
|
||||
public void setPodId(String podId) {
|
||||
this.podId = podId;
|
||||
}
|
||||
|
|
@ -330,7 +337,6 @@ public class HostResponse extends BaseResponse {
|
|||
this.hasEnoughCapacity = hasEnoughCapacity;
|
||||
}
|
||||
|
||||
|
||||
public void setSuitableForMigration(Boolean suitableForMigration) {
|
||||
this.suitableForMigration = suitableForMigration;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,6 +66,9 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
|
|||
|
||||
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the name of the zone the network belongs to")
|
||||
private String zoneName;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_TYPE) @Param(description="the networktype of the zone the network belongs to")
|
||||
private String zoneType;
|
||||
|
||||
@SerializedName("networkofferingid") @Param(description="network offering id the network is created from")
|
||||
private String networkOfferingId;
|
||||
|
|
@ -291,6 +294,10 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
|
|||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public void setZoneType(String zoneType) {
|
||||
this.zoneType = zoneType;
|
||||
}
|
||||
|
||||
public void setCidr(String cidr) {
|
||||
this.cidr = cidr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,10 +36,13 @@ public class PodResponse extends BaseResponse {
|
|||
|
||||
@SerializedName("zoneid") @Param(description="the Zone ID of the Pod")
|
||||
private String zoneId;
|
||||
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the Pod")
|
||||
private String zoneName;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_TYPE) @Param(description = "network type of the availability zone")
|
||||
private String zoneType;
|
||||
|
||||
@SerializedName("gateway") @Param(description="the gateway of the Pod")
|
||||
private String gateway;
|
||||
|
||||
|
|
@ -86,6 +89,10 @@ public class PodResponse extends BaseResponse {
|
|||
return zoneName;
|
||||
}
|
||||
|
||||
public void setZoneType(String zoneType) {
|
||||
this.zoneType = zoneType;
|
||||
}
|
||||
|
||||
public void setZoneName(String zoneName) {
|
||||
this.zoneName = zoneName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,14 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
|
|||
@Param(description = "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")
|
||||
private Snapshot.State state;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_NAME)
|
||||
@Param(description = "name of the availability zone")
|
||||
private String zoneName;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_TYPE)
|
||||
@Param(description = "network type of the availability zone")
|
||||
private String zoneType;
|
||||
|
||||
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with snapshot", responseObject = ResourceTagResponse.class)
|
||||
private List<ResourceTagResponse> tags;
|
||||
|
||||
|
|
@ -173,6 +181,14 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
|
|||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public void setZoneName(String zoneName) {
|
||||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public void setZoneType(String zoneType) {
|
||||
this.zoneType = zoneType;
|
||||
}
|
||||
|
||||
public void setTags(List<ResourceTagResponse> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 org.apache.cloudstack.api.response;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import com.cloud.serializer.Param;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.storage.StoragePoolStatus;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@EntityReference(value=StoragePool.class)
|
||||
public class StoragePoolForMigrationResponse extends BaseResponse {
|
||||
@SerializedName("id") @Param(description="the ID of the storage pool")
|
||||
private String id;
|
||||
|
||||
@SerializedName("zoneid") @Param(description="the Zone ID of the storage pool")
|
||||
private String zoneId;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the storage pool")
|
||||
private String zoneName;
|
||||
|
||||
@SerializedName("podid") @Param(description="the Pod ID of the storage pool")
|
||||
private String podId;
|
||||
|
||||
@SerializedName("podname") @Param(description="the Pod name of the storage pool")
|
||||
private String podName;
|
||||
|
||||
@SerializedName("name") @Param(description="the name of the storage pool")
|
||||
private String name;
|
||||
|
||||
@SerializedName("ipaddress") @Param(description="the IP address of the storage pool")
|
||||
private String ipAddress;
|
||||
|
||||
@SerializedName("path") @Param(description="the storage pool path")
|
||||
private String path;
|
||||
|
||||
@SerializedName("created") @Param(description="the date and time the storage pool was created")
|
||||
private Date created;
|
||||
|
||||
@SerializedName("type") @Param(description="the storage pool type")
|
||||
private String type;
|
||||
|
||||
@SerializedName("clusterid") @Param(description="the ID of the cluster for the storage pool")
|
||||
private String clusterId;
|
||||
|
||||
@SerializedName("clustername") @Param(description="the name of the cluster for the storage pool")
|
||||
private String clusterName;
|
||||
|
||||
@SerializedName("disksizetotal") @Param(description="the total disk size of the storage pool")
|
||||
private Long diskSizeTotal;
|
||||
|
||||
@SerializedName("disksizeallocated") @Param(description="the host's currently allocated disk size")
|
||||
private Long diskSizeAllocated;
|
||||
|
||||
@SerializedName("disksizeused") @Param(description="the host's currently used disk size")
|
||||
private Long diskSizeUsed;
|
||||
|
||||
@SerializedName("tags") @Param(description="the tags for the storage pool")
|
||||
private String tags;
|
||||
|
||||
@SerializedName(ApiConstants.STATE) @Param(description="the state of the storage pool")
|
||||
private StoragePoolStatus state;
|
||||
|
||||
@SerializedName(ApiConstants.SCOPE) @Param(description="the scope of the storage pool")
|
||||
private String scope;
|
||||
|
||||
@SerializedName("suitableformigration") @Param(description="true if this pool is suitable to migrate a volume," +
|
||||
" false otherwise")
|
||||
private Boolean suitableForMigration;
|
||||
|
||||
/**
|
||||
* @return the scope
|
||||
*/
|
||||
public String getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param scope the scope to set
|
||||
*/
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectId() {
|
||||
return this.getId();
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getZoneId() {
|
||||
return zoneId;
|
||||
}
|
||||
|
||||
public void setZoneId(String zoneId) {
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
|
||||
public String getZoneName() {
|
||||
return zoneName;
|
||||
}
|
||||
|
||||
public void setZoneName(String zoneName) {
|
||||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public String getPodId() {
|
||||
return podId;
|
||||
}
|
||||
|
||||
public void setPodId(String podId) {
|
||||
this.podId = podId;
|
||||
}
|
||||
|
||||
public String getPodName() {
|
||||
return podName;
|
||||
}
|
||||
|
||||
public void setPodName(String podName) {
|
||||
this.podName = podName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public Date getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
public void setCreated(Date created) {
|
||||
this.created = created;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getClusterId() {
|
||||
return clusterId;
|
||||
}
|
||||
|
||||
public void setClusterId(String clusterId) {
|
||||
this.clusterId = clusterId;
|
||||
}
|
||||
|
||||
public String getClusterName() {
|
||||
return clusterName;
|
||||
}
|
||||
|
||||
public void setClusterName(String clusterName) {
|
||||
this.clusterName = clusterName;
|
||||
}
|
||||
|
||||
public Long getDiskSizeTotal() {
|
||||
return diskSizeTotal;
|
||||
}
|
||||
|
||||
public void setDiskSizeTotal(Long diskSizeTotal) {
|
||||
this.diskSizeTotal = diskSizeTotal;
|
||||
}
|
||||
|
||||
public Long getDiskSizeAllocated() {
|
||||
return diskSizeAllocated;
|
||||
}
|
||||
|
||||
public void setDiskSizeAllocated(Long diskSizeAllocated) {
|
||||
this.diskSizeAllocated = diskSizeAllocated;
|
||||
}
|
||||
|
||||
public Long getDiskSizeUsed() {
|
||||
return diskSizeUsed;
|
||||
}
|
||||
|
||||
public void setDiskSizeUsed(Long diskSizeUsed) {
|
||||
this.diskSizeUsed = diskSizeUsed;
|
||||
}
|
||||
|
||||
public String getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(String tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public StoragePoolStatus getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(StoragePoolStatus state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public void setSuitableForMigration(Boolean suitableForMigration) {
|
||||
this.suitableForMigration = suitableForMigration;
|
||||
}
|
||||
}
|
||||
|
|
@ -38,12 +38,15 @@ public class StoragePoolResponse extends BaseResponse {
|
|||
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the storage pool")
|
||||
private String zoneName;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_TYPE) @Param(description = "network type of the availability zone")
|
||||
private String zoneType;
|
||||
|
||||
@SerializedName("podid") @Param(description="the Pod ID of the storage pool")
|
||||
private String podId;
|
||||
|
||||
@SerializedName("podname") @Param(description="the Pod name of the storage pool")
|
||||
private String podName;
|
||||
|
||||
private String podName;
|
||||
|
||||
@SerializedName("name") @Param(description="the name of the storage pool")
|
||||
private String name;
|
||||
|
||||
|
|
@ -79,8 +82,23 @@ public class StoragePoolResponse extends BaseResponse {
|
|||
|
||||
@SerializedName(ApiConstants.STATE) @Param(description="the state of the storage pool")
|
||||
private StoragePoolStatus state;
|
||||
|
||||
@SerializedName(ApiConstants.SCOPE) @Param(description="the scope of the storage pool")
|
||||
private String scope;
|
||||
|
||||
/**
|
||||
* @return the scope
|
||||
*/
|
||||
public String getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param scope the scope to set
|
||||
*/
|
||||
public void setScope(String scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectId() {
|
||||
|
|
@ -111,6 +129,14 @@ public class StoragePoolResponse extends BaseResponse {
|
|||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
public void setZoneType(String zoneType) {
|
||||
this.zoneType = zoneType;
|
||||
}
|
||||
|
||||
public String getPodId() {
|
||||
return podId;
|
||||
}
|
||||
|
|
@ -222,5 +248,4 @@ public class StoragePoolResponse extends BaseResponse {
|
|||
public void setState(StoragePoolStatus state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ public class SystemVmResponse extends BaseResponse {
|
|||
@SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name for the system VM")
|
||||
private String zoneName;
|
||||
|
||||
@SerializedName(ApiConstants.ZONE_TYPE) @Param(description = "network type of the availability zone")
|
||||
private String zoneType;
|
||||
|
||||
@SerializedName("dns1") @Param(description="the first DNS for the system VM")
|
||||
private String dns1;
|
||||
|
||||
|
|
@ -150,7 +153,15 @@ public class SystemVmResponse extends BaseResponse {
|
|||
public void setZoneName(String zoneName) {
|
||||
this.zoneName = zoneName;
|
||||
}
|
||||
|
||||
public String getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
public void setZoneType(String zoneType) {
|
||||
this.zoneType = zoneType;
|
||||
}
|
||||
|
||||
public String getDns1() {
|
||||
return dns1;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue