blob: df67e4c84e9c542436ad0b6fb0c66e53f523f4cf [file] [log] [blame]
Jamie Hannaforded7f4532015-02-17 14:56:30 +01001package configurations
2
3import "fmt"
4
5const singleConfigJSON = `
6{
7 "created": "2014-07-31T18:56:09",
8 "datastore_name": "mysql",
9 "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb",
10 "datastore_version_name": "5.6",
11 "description": "example_description",
12 "id": "005a8bb7-a8df-40ee-b0b7-fc144641abc2",
13 "name": "example-configuration-name",
14 "updated": "2014-07-31T18:56:09"
15}
16`
17
18const singleConfigWithValuesJSON = `
19{
20 "created": "2014-07-31T15:02:52",
21 "datastore_name": "mysql",
22 "datastore_version_id": "b00000b0-00b0-0b00-00b0-000b000000bb",
23 "datastore_version_name": "5.6",
24 "description": "example description",
25 "id": "005a8bb7-a8df-40ee-b0b7-fc144641abc2",
26 "instance_count": 0,
27 "name": "example-configuration-name",
28 "updated": "2014-07-31T15:02:52",
29 "values": {
30 "collation_server": "latin1_swedish_ci",
31 "connect_timeout": 120
32 }
33}
34`
35
36var (
37 listConfigsJSON = fmt.Sprintf(`{"configurations": [%s]}`, singleConfigJSON)
38 getConfigJSON = fmt.Sprintf(`{"configuration": %s}`, singleConfigJSON)
39 createConfigJSON = fmt.Sprintf(`{"configuration": %s}`, singleConfigWithValuesJSON)
40)
41
42var createReq = `
43{
44 "configuration": {
45 "datastore": {
46 "type": "a00000a0-00a0-0a00-00a0-000a000000aa",
47 "version": "b00000b0-00b0-0b00-00b0-000b000000bb"
48 },
49 "description": "example description",
50 "name": "example-configuration-name",
51 "values": {
52 "collation_server": "latin1_swedish_ci",
53 "connect_timeout": 120
54 }
55 }
56}
57`
58
59var updateReq = `
60{
61 "configuration": {
62 "values": {
63 "connect_timeout": 300
64 }
65 }
66}
67`
68
69var listInstancesJSON = `
70{
71 "instances": [
72 {
73 "id": "d4603f69-ec7e-4e9b-803f-600b9205576f",
74 "name": "json_rack_instance"
75 }
76 ]
77}
78`
79
80var exampleConfig = Config{
81 Created: "2014-07-31T18:56:09",
82 DatastoreName: "mysql",
83 DatastoreVersionID: "b00000b0-00b0-0b00-00b0-000b000000bb",
84 DatastoreVersionName: "5.6",
85 Description: "example_description",
86 ID: "005a8bb7-a8df-40ee-b0b7-fc144641abc2",
87 Name: "example-configuration-name",
88 Updated: "2014-07-31T18:56:09",
89}
90
91var exampleConfigWithValues = Config{
92 Created: "2014-07-31T15:02:52",
93 DatastoreName: "mysql",
94 DatastoreVersionID: "b00000b0-00b0-0b00-00b0-000b000000bb",
95 DatastoreVersionName: "5.6",
96 Description: "example description",
97 ID: "005a8bb7-a8df-40ee-b0b7-fc144641abc2",
98 Name: "example-configuration-name",
99 Updated: "2014-07-31T15:02:52",
100 Values: map[string]interface{}{
101 "collation_server": "latin1_swedish_ci",
102 "connect_timeout": 120,
103 },
104}