blob: 95784ad31e7bfea72cfc1d96ef001a58501894c4 [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 (
Jamie Hannafordd2b755f2015-10-07 14:01:57 +020037 ListConfigsJSON = fmt.Sprintf(`{"configurations": [%s]}`, singleConfigJSON)
38 GetConfigJSON = fmt.Sprintf(`{"configuration": %s}`, singleConfigJSON)
39 CreateConfigJSON = fmt.Sprintf(`{"configuration": %s}`, singleConfigWithValuesJSON)
Jamie Hannaforded7f4532015-02-17 14:56:30 +010040)
41
Jamie Hannafordd2b755f2015-10-07 14:01:57 +020042var CreateReq = `
Jamie Hannaforded7f4532015-02-17 14:56:30 +010043{
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
Jamie Hannafordd2b755f2015-10-07 14:01:57 +020059var UpdateReq = `
Jamie Hannaforded7f4532015-02-17 14:56:30 +010060{
61 "configuration": {
62 "values": {
63 "connect_timeout": 300
64 }
65 }
66}
67`
68
Jamie Hannafordd2b755f2015-10-07 14:01:57 +020069var ListInstancesJSON = `
Jamie Hannaforded7f4532015-02-17 14:56:30 +010070{
71 "instances": [
72 {
73 "id": "d4603f69-ec7e-4e9b-803f-600b9205576f",
74 "name": "json_rack_instance"
75 }
76 ]
77}
78`
79
Jamie Hannafordd2b755f2015-10-07 14:01:57 +020080var ListParamsJSON = `
Jamie Hannaford23867bb2015-02-17 15:56:48 +010081{
82 "configuration-parameters": [
83 {
84 "max": 1,
85 "min": 0,
86 "name": "innodb_file_per_table",
87 "restart_required": true,
88 "type": "integer"
89 },
90 {
91 "max": 4294967296,
92 "min": 0,
93 "name": "key_buffer_size",
94 "restart_required": false,
95 "type": "integer"
96 },
97 {
98 "max": 65535,
99 "min": 2,
100 "name": "connect_timeout",
101 "restart_required": false,
102 "type": "integer"
103 },
104 {
105 "max": 4294967296,
106 "min": 0,
107 "name": "join_buffer_size",
108 "restart_required": false,
109 "type": "integer"
110 }
111 ]
112}
113`
114
Jamie Hannafordd2b755f2015-10-07 14:01:57 +0200115var GetParamJSON = `
Jamie Hannaford23867bb2015-02-17 15:56:48 +0100116{
117 "max": 1,
118 "min": 0,
119 "name": "innodb_file_per_table",
120 "restart_required": true,
121 "type": "integer"
122}
123`
124
Jamie Hannafordd2b755f2015-10-07 14:01:57 +0200125var ExampleConfig = Config{
Jamie Hannaforded7f4532015-02-17 14:56:30 +0100126 Created: "2014-07-31T18:56:09",
127 DatastoreName: "mysql",
128 DatastoreVersionID: "b00000b0-00b0-0b00-00b0-000b000000bb",
129 DatastoreVersionName: "5.6",
130 Description: "example_description",
131 ID: "005a8bb7-a8df-40ee-b0b7-fc144641abc2",
132 Name: "example-configuration-name",
133 Updated: "2014-07-31T18:56:09",
134}
135
Jamie Hannafordd2b755f2015-10-07 14:01:57 +0200136var ExampleConfigWithValues = Config{
Jamie Hannaforded7f4532015-02-17 14:56:30 +0100137 Created: "2014-07-31T15:02:52",
138 DatastoreName: "mysql",
139 DatastoreVersionID: "b00000b0-00b0-0b00-00b0-000b000000bb",
140 DatastoreVersionName: "5.6",
141 Description: "example description",
142 ID: "005a8bb7-a8df-40ee-b0b7-fc144641abc2",
143 Name: "example-configuration-name",
144 Updated: "2014-07-31T15:02:52",
145 Values: map[string]interface{}{
146 "collation_server": "latin1_swedish_ci",
147 "connect_timeout": 120,
148 },
149}