1 Star 0 Fork 0

zhuchance/kubernetes

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
fixtures.go 2.88 KB
一键复制 编辑 原始数据 按行查看 历史
Alberto Peon 提交于 2016-03-17 16:42 . Update gophercloud
package datastores
import (
"fmt"
"github.com/rackspace/gophercloud"
)
const version1JSON = `
{
"id": "b00000b0-00b0-0b00-00b0-000b000000bb",
"links": [
{
"href": "https://10.240.28.38:8779/v1.0/1234/datastores/versions/b00000b0-00b0-0b00-00b0-000b000000bb",
"rel": "self"
},
{
"href": "https://10.240.28.38:8779/datastores/versions/b00000b0-00b0-0b00-00b0-000b000000bb",
"rel": "bookmark"
}
],
"name": "5.1"
}
`
const version2JSON = `
{
"id": "c00000b0-00c0-0c00-00c0-000b000000cc",
"links": [
{
"href": "https://10.240.28.38:8779/v1.0/1234/datastores/versions/c00000b0-00c0-0c00-00c0-000b000000cc",
"rel": "self"
},
{
"href": "https://10.240.28.38:8779/datastores/versions/c00000b0-00c0-0c00-00c0-000b000000cc",
"rel": "bookmark"
}
],
"name": "5.2"
}
`
var versionsJSON = fmt.Sprintf(`"versions": [%s, %s]`, version1JSON, version2JSON)
var singleDSJSON = fmt.Sprintf(`
{
"default_version": "c00000b0-00c0-0c00-00c0-000b000000cc",
"id": "10000000-0000-0000-0000-000000000001",
"links": [
{
"href": "https://10.240.28.38:8779/v1.0/1234/datastores/10000000-0000-0000-0000-000000000001",
"rel": "self"
},
{
"href": "https://10.240.28.38:8779/datastores/10000000-0000-0000-0000-000000000001",
"rel": "bookmark"
}
],
"name": "mysql",
%s
}
`, versionsJSON)
var (
ListDSResp = fmt.Sprintf(`{"datastores":[%s]}`, singleDSJSON)
GetDSResp = fmt.Sprintf(`{"datastore":%s}`, singleDSJSON)
ListVersionsResp = fmt.Sprintf(`{%s}`, versionsJSON)
GetVersionResp = fmt.Sprintf(`{"version":%s}`, version1JSON)
)
var ExampleVersion1 = Version{
ID: "b00000b0-00b0-0b00-00b0-000b000000bb",
Links: []gophercloud.Link{
gophercloud.Link{Rel: "self", Href: "https://10.240.28.38:8779/v1.0/1234/datastores/versions/b00000b0-00b0-0b00-00b0-000b000000bb"},
gophercloud.Link{Rel: "bookmark", Href: "https://10.240.28.38:8779/datastores/versions/b00000b0-00b0-0b00-00b0-000b000000bb"},
},
Name: "5.1",
}
var exampleVersion2 = Version{
ID: "c00000b0-00c0-0c00-00c0-000b000000cc",
Links: []gophercloud.Link{
gophercloud.Link{Rel: "self", Href: "https://10.240.28.38:8779/v1.0/1234/datastores/versions/c00000b0-00c0-0c00-00c0-000b000000cc"},
gophercloud.Link{Rel: "bookmark", Href: "https://10.240.28.38:8779/datastores/versions/c00000b0-00c0-0c00-00c0-000b000000cc"},
},
Name: "5.2",
}
var ExampleVersions = []Version{ExampleVersion1, exampleVersion2}
var ExampleDatastore = Datastore{
DefaultVersion: "c00000b0-00c0-0c00-00c0-000b000000cc",
ID: "10000000-0000-0000-0000-000000000001",
Links: []gophercloud.Link{
gophercloud.Link{Rel: "self", Href: "https://10.240.28.38:8779/v1.0/1234/datastores/10000000-0000-0000-0000-000000000001"},
gophercloud.Link{Rel: "bookmark", Href: "https://10.240.28.38:8779/datastores/10000000-0000-0000-0000-000000000001"},
},
Name: "mysql",
Versions: ExampleVersions,
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/meoom/kubernetes.git
git@gitee.com:meoom/kubernetes.git
meoom
kubernetes
kubernetes
v1.3.0-alpha.3

搜索帮助

Cb406eda 1850385 E526c682 1850385