Jamie Hannaford | ed7f453 | 2015-02-17 14:56:30 +0100 | [diff] [blame] | 1 | package configurations |
| 2 | |
| 3 | import "fmt" |
| 4 | |
| 5 | const 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 | |
| 18 | const 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 | |
| 36 | var ( |
Jamie Hannaford | d2b755f | 2015-10-07 14:01:57 +0200 | [diff] [blame^] | 37 | ListConfigsJSON = fmt.Sprintf(`{"configurations": [%s]}`, singleConfigJSON) |
| 38 | GetConfigJSON = fmt.Sprintf(`{"configuration": %s}`, singleConfigJSON) |
| 39 | CreateConfigJSON = fmt.Sprintf(`{"configuration": %s}`, singleConfigWithValuesJSON) |
Jamie Hannaford | ed7f453 | 2015-02-17 14:56:30 +0100 | [diff] [blame] | 40 | ) |
| 41 | |
Jamie Hannaford | d2b755f | 2015-10-07 14:01:57 +0200 | [diff] [blame^] | 42 | var CreateReq = ` |
Jamie Hannaford | ed7f453 | 2015-02-17 14:56:30 +0100 | [diff] [blame] | 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 | |
Jamie Hannaford | d2b755f | 2015-10-07 14:01:57 +0200 | [diff] [blame^] | 59 | var UpdateReq = ` |
Jamie Hannaford | ed7f453 | 2015-02-17 14:56:30 +0100 | [diff] [blame] | 60 | { |
| 61 | "configuration": { |
| 62 | "values": { |
| 63 | "connect_timeout": 300 |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | ` |
| 68 | |
Jamie Hannaford | d2b755f | 2015-10-07 14:01:57 +0200 | [diff] [blame^] | 69 | var ListInstancesJSON = ` |
Jamie Hannaford | ed7f453 | 2015-02-17 14:56:30 +0100 | [diff] [blame] | 70 | { |
| 71 | "instances": [ |
| 72 | { |
| 73 | "id": "d4603f69-ec7e-4e9b-803f-600b9205576f", |
| 74 | "name": "json_rack_instance" |
| 75 | } |
| 76 | ] |
| 77 | } |
| 78 | ` |
| 79 | |
Jamie Hannaford | d2b755f | 2015-10-07 14:01:57 +0200 | [diff] [blame^] | 80 | var ListParamsJSON = ` |
Jamie Hannaford | 23867bb | 2015-02-17 15:56:48 +0100 | [diff] [blame] | 81 | { |
| 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 Hannaford | d2b755f | 2015-10-07 14:01:57 +0200 | [diff] [blame^] | 115 | var GetParamJSON = ` |
Jamie Hannaford | 23867bb | 2015-02-17 15:56:48 +0100 | [diff] [blame] | 116 | { |
| 117 | "max": 1, |
| 118 | "min": 0, |
| 119 | "name": "innodb_file_per_table", |
| 120 | "restart_required": true, |
| 121 | "type": "integer" |
| 122 | } |
| 123 | ` |
| 124 | |
Jamie Hannaford | d2b755f | 2015-10-07 14:01:57 +0200 | [diff] [blame^] | 125 | var ExampleConfig = Config{ |
Jamie Hannaford | ed7f453 | 2015-02-17 14:56:30 +0100 | [diff] [blame] | 126 | 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 Hannaford | d2b755f | 2015-10-07 14:01:57 +0200 | [diff] [blame^] | 136 | var ExampleConfigWithValues = Config{ |
Jamie Hannaford | ed7f453 | 2015-02-17 14:56:30 +0100 | [diff] [blame] | 137 | 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 | } |