Skip to content

Commit

Permalink
Merge pull request #28 from selectel/add_invalid_values_field_to_conf…
Browse files Browse the repository at this point in the history
…iguration_parameters

Add invalid values field to configuration parameters
  • Loading branch information
Gogen120 authored Jan 18, 2024
2 parents 0379146 + 1214646 commit bbc2cb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions configuration_parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type ConfigurationParameter struct {
Max interface{} `json:"max"`
DefaultValue interface{} `json:"default_value"`
Choices []interface{} `json:"choices"`
InvalidValues []interface{} `json:"invalid_values"`
IsRestartRequired bool `json:"is_restart_required"`
IsChangeable bool `json:"is_changeable"`
}
Expand Down
12 changes: 9 additions & 3 deletions configuration_parameter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const testConfigurationParametersResponse = `{
"default_value": -1,
"unit": "kB",
"is_restart_required": false,
"is_changeable": true
"is_changeable": true,
"invalid_values": null
},
{
"id": "20d7bcf4-f8d6-4bf6-b8f6-46cb440a87f4",
Expand All @@ -53,7 +54,8 @@ const testConfigurationParametersResponse = `{
"default_value": "AUTO",
"unit": "",
"is_restart_required": false,
"is_changeable": true
"is_changeable": true,
"invalid_values": ["0"]
}
]
}`
Expand All @@ -70,7 +72,8 @@ const testConfigurationParameterResponse = `{
"default_value": null,
"unit": "",
"is_restart_required": true,
"is_changeable": true
"is_changeable": true,
"invalid_values": null
}
}`

Expand All @@ -96,6 +99,7 @@ func TestConfigurationParameters(t *testing.T) {
Choices: nil,
IsRestartRequired: false,
IsChangeable: true,
InvalidValues: nil,
},
{
ID: "20d7bcf4-f8d6-4bf6-b8f6-46cb440a87f4",
Expand All @@ -109,6 +113,7 @@ func TestConfigurationParameters(t *testing.T) {
Choices: choices,
IsRestartRequired: false,
IsChangeable: true,
InvalidValues: []interface{}{"0"},
},
}

Expand Down Expand Up @@ -138,6 +143,7 @@ func TestConfigurationParameter(t *testing.T) {
Choices: nil,
IsRestartRequired: true,
IsChangeable: true,
InvalidValues: nil,
}

actual, err := testClient.ConfigurationParameter(context.Background(), configurationParameterID)
Expand Down

0 comments on commit bbc2cb3

Please sign in to comment.