功能介紹
返回指定版本的信息。
為了支持功能不斷擴(kuò)展,Nova API支持版本號區(qū)分。Nova中有兩種形式的版本號:
- "主版本號": 具有獨(dú)立的url。
- "微版本號": 通過Http請求頭X-OpenStack-Nova-API-Version來使用,從 2.27 版本開始支持新的微版本頭:OpenStack-API-Version。
如果使用OpenStack-API-Version的請求頭,version對應(yīng)的value取值格式為 compute 微版本號。
例如:key為OpenStack-API-Version的時(shí)候value需要填compute 2.27。
調(diào)試
您可以在API Explorer中調(diào)試該接口。
請求消息
無
響應(yīng)消息
響應(yīng)參數(shù)如表2所示。
參數(shù) |
參數(shù)類型 |
描述 |
---|---|---|
id |
string |
所討論的版本的通用名稱。僅僅是信息性的,它沒有真正的語義。 |
links |
Object |
鏈接到資源的問題。有關(guān)更多信息,請參見OpenStack Documentation。 |
media-types |
Object |
|
min_version |
string |
|
status |
string |
API版本的狀態(tài):
|
updated |
string |
一個(gè)有特定值的字符串。API版本為2.0時(shí),值為2011-01-21T11:33:21Z ,API版本是2.1時(shí),值為2013-07-23T11:33:21Z。 |
version |
string |
|
請求示例
查詢指定API的版本信息。
GET https://{endpoint}/v2
響應(yīng)示例
{ "version": { "min_version": "", "media-types": [{ "type": "application/vnd.openstack.compute+json;version=2", "base": "application/json" }], "links": [{ "rel": "self", "href": "https://ecs.service.domain.com:443/v2/" }, { "rel": "describedby", "href": "http://docs.openstack.org/", "type": "text/html" }], "id": "v2.0", "updated": "1999-02-20T11:33:21Z", "version": "", "status": "SUPPORTED" } }
返回值
請參考通用請求返回值。