@@ -9,19 +9,39 @@ import (
99// ConfigTags is the key, value for tag
1010type ConfigTags map [string ]interface {}
1111
12- // ConfigValues is the key, value for env
13- type ConfigValues map [string ]interface {}
12+ // ConfigValues value for env
13+ type KV struct {
14+ Name string `json:"name,omitempty"`
15+ Value interface {} `json:"value,omitempty"`
16+ }
17+
18+ type ConfigValue struct {
19+ Ptype string `json:"ptype,omitempty"`
20+ Group string `json:"group,omitempty"`
21+ KV
22+ }
23+
24+ type PtypeValue struct {
25+ Env []KV `json:"env,omitempty"`
26+ Ref []string `json:"ref,omitempty"`
27+ }
28+
29+ type ConfigInfo struct {
30+ Ptype map [string ]PtypeValue `json:"ptype,omitempty"`
31+ Group map [string ][]KV `json:"group,omitempty"`
32+ }
33+
34+ // ValuesRefs is the key, value for refs
35+ type ValuesRefs map [string ][]string
1436
1537// ConfigSet is the definition of POST /v2/apps/<app id>/config/.
1638type ConfigSet struct {
17- Values ConfigValues `json:"values"`
18- TypedValues map [string ]ConfigValues `json:"typed_values"`
39+ Values []ConfigValue `json:"values"`
1940}
2041
2142// ConfigUnset is the definition of POST /v2/apps/<app id>/config/.
2243type ConfigUnset struct {
23- Values ConfigValues `json:"values"`
24- TypedValues map [string ]ConfigValues `json:"typed_values"`
44+ Values []ConfigValue `json:"values"`
2545}
2646
2747// Config is the structure of an app's config.
@@ -31,9 +51,9 @@ type Config struct {
3151 // App is the app name. It cannot be updated at all right now.
3252 App string `json:"app,omitempty"`
3353 // Values are exposed as environment variables to the app.
34- Values ConfigValues `json:"values,omitempty"`
54+ Values [] ConfigValue `json:"values,omitempty"`
3555 // Typed values are exposed as environment variables to the app.
36- TypedValues map [ string ] ConfigValues `json:"typed_values ,omitempty"`
56+ ValuesRefs ValuesRefs `json:"values_refs ,omitempty"`
3757 // Limits is used to set process resources limits. The key is the process name
3858 // and the value is a limit plan. Ex: std1.xlarge.c1m1
3959 Limits map [string ]interface {} `json:"limits,omitempty"`
@@ -46,7 +66,7 @@ type Config struct {
4666 Tags map [string ]ConfigTags `json:"tags,omitempty"`
4767 // Registry is a key-value pair to provide authentication for container registries.
4868 // The key is the username and the value is the password.
49- Registry map [string ]interface {} `json:"registry,omitempty"`
69+ Registry map [string ]map [ string ] interface {} `json:"registry,omitempty"`
5070 // Created is the time that the application was created and cannot be updated.
5171 Created string `json:"created,omitempty"`
5272 // Updated is the last time the configuration was changed and cannot be updated.
0 commit comments