ucloudstack采用的是前後端分離的架構,就是說前端可以選擇使用web、swing甚至其它的界面,都可以。
我們來看cloudstack的UI資訊吧,所有的cloudstack的UI都在{cloudstack_home}/cloudstack/ui目錄下。

用firefox打開工程,打開firebug,找到login.js,在100行加上斷點。
執行登入,這時就會觸發斷點,讓我們看看發生了什麼:
最終是使用jquery的ajax來送出post請求給伺服器端,也就是說,manager server提供給我們的是一組API,我們可以通過http的請求方式送出請求。
看完了前端,我們繼續看一下後端處理。
在web.xml中,我們看到所有的api/請求都會到ApiServlet中處理。
在ApiServlet中,重點看下
這樣在web容器中就可以檢視spring中使用注解的接口了。
說實話這塊感覺設計的挺一般的,一個servlet裡邊承擔了太多的任務,我打了個斷點在
這個方法中,但是一個登入的操作就走了四次斷點,一個退出操作又走了兩次,不清楚這塊為什麼這樣設計。
而且很多業務代碼都在這個類中操作,感覺很備援。但這個不是我們重點關心的問題。
管理員。獲得雲的所有功能,包括虛拟和物理資源管理。
域管理員。進入到虛拟資源的雲屬于管理員的域。
用戶。隻訪問允許用戶管理的功能,虛拟實例,存儲,和網絡。
<a href="http://cloudstack.apache.org/docs/api/">http://cloudstack.apache.org/docs/api/</a>
可以看到不同角色的API的位址,進去之後,可以看到每個API的較長的描述。
在VM中重新配置實體網絡
支援IPV6
擴充VMX設定
重新設定SSH密鑰來通路虛拟機
在4.1中改變的API指令:
API Commands
Description
createNetworkOffering
The following request parameters have been added:
isPersistent
startipv6
endipv6
ip6gateway
ip6cidr
listNetworkOfferings
listNetworks
This parameter determines if the network or network offering listed are persistent or not.
createVlanIpRange
deployVirtualMachine
The following parameter has been added: ip6Address.
The following parameter is updated to accept the IPv6 address: iptonetworklist.
CreateZoneCmd
The following parameter have been added: ip6dns1, ip6dns2.
listRouters
listVirtualMachines
For nic responses, the following fields have been added.
ip6address
listVlanIpRanges
listZones
For DomainRouter and DataCenter response, the following fields have been added.
ip6dns1
ip6dns2
addF5LoadBalancer
configureNetscalerLoadBalancer
addNetscalerLoadBalancer
listF5LoadBalancers
configureF5LoadBalancer
listNetscalerLoadBalancers
The following response parameter is removed: inline.
listFirewallRules
createFirewallRule
The following request parameter is added: traffictype (optional).
listUsageRecords
The following response parameter is added: virtualsize.
deleteIso
The following request parameter is added: forced (optional).
createStoragePool
The following request parameters are made mandatory:
podid
clusterid
createAccount
The following new request parameters are added: accountid, userid
createUser
The following new request parameter is added: userid
createDomain
The following new request parameter is added: domainid
The following request parameters is added: securitygroupenabled
同時添加了一些新的API
createEgressFirewallRules (creates an egress firewall rule on the guest network.)
deleteEgressFirewallRules (deletes a egress firewall rule on the guest network.)
listEgressFirewallRules (lists the egress firewall rules configured for a guest network.)
resetSSHKeyForVirtualMachine (Resets the SSHkey for virtual machine.)
addBaremetalHost (Adds a new host.)
addNicToVirtualMachine (Adds a new NIC to the specified VM on a selected network.)
removeNicFromVirtualMachine (Removes the specified NIC from a selected VM.)
updateDefaultNicForVirtualMachine (Updates the specified NIC to be the default one for a selected VM.)
addRegion (Registers a Region into another Region.)
updateRegion (Updates Region details: ID, Name, Endpoint, User API Key, and User Secret Key.)
removeRegion (Removes a Region from current Region.)
listRegions (List all the Regions. Filter them by using the ID or Name.)
getUser (This API can only be used by the Admin. Get user details by using the API Key.)
8096端口, 不需要驗證即可進行API調用. 在所有的3.0.1版本全新安裝時, 這個端口都是默認被禁用的. 你可以通過下面的設置啟用8096(或使用其它端口号):
确保第一個管理服務器安裝并運行.
設置你期望的端口号到全局配置參數 integration.api.port.
重啟管理服務器.
在管理服務器的節點上, 創建一個防火牆規則以便允許訪問這個端口.
所有CloudStack API請求都是以HTTP GET/POST形式提交, 同時附上相關的命令和參數. 無論是HTTP或HTTPS, 一個請求都有以下内容組成:
CloudStack API URL: 這是Web服務API入口(例如, http://www.cloud.com:8080/client/api)
命令: 你想要執行的Web服務命令, 比如開啟一個虛拟機或創建一個磁盤卷
參數: 命令所需的任何必要或可選的參數
一個API GET請求的樣例看起來像這樣:
更容易讀的方式: