You can call this operation to validate a configuration setting.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request headers

This operation uses common request headers, instead of special request headers. For more information, see the "Common request headers" section in "Common request and response headers."

Request syntax

POST /pop/v1/wam/config/configSetting/validate HTTP/1.1

Request parameters

Parameter Type Required? Example Description
EnvId String No we-5d3eaaea2977ca5251e*****

The ID of the deployment environment.

OptionSettings String No [{"path":"resources.ecs.autoScaling", "name":"instanceNum","value":"10"}, {"path":"application.option", "name":"port","value":"100"}]

The custom configuration item data, in the format of a JSON array. The array contains the following fields:

  • path: the path to the configuration item.
  • name: the name of the configuration item.
  • value: the value of the configuration item.
StackId String No ws-6c937c98a9c0296d0c48*****

The ID of the technology stack.

TemplateId String No wct-5d3e9d2a2977ca5251e*****

The ID of the configuration template.

Response parameters

Parameter Type Example Description
Code String OK

The response code. The value is OK if the request is successful.

ConfigValidationResults

The result of validating the configuration setting.

ConfigOption

The information about the configuration item.

ChangeSeverity String NoInterruption

The severity of the change.

DefaultValue String 8080

The default value of the configuration item.

EditorType String {\"component\":\"NumberPicker\",\"props\":{}}

The edit type of the configuration item.

HiddenOption Boolean false

Indicates whether the configuration item is hidden.

MaxLength Integer -1

The maximum length of the configuration item.

MaxValue Long 65535

The maximum value of the configuration item.

MinLength Integer 0

The minimum length of the configuration item.

MinValue Long 1024

The minimum value of the configuration item.

OptionDescription String This port will be used as the HTTP service port after the application is launched, and ports from 1024 to 65535 can be used.

The description of the configuration item.

OptionLabel String Server Port

The label of the configuration item.

OptionName String port

The name of the configuration item.

PathName String application.option

The path to the configuration item.

ReadonlyOption Boolean false

Indicates whether the configuration item is read-only.

RegexDesc String ""

The description of the regular expression.

RegexPattern String ""

The pattern of the regular expression.

ValueOptions String ""

The value options of the configuration item.

ValueType String Integer

The value type of the configuration item.

OptionName String port

The name of the configuration item.

PathName String application.option

The path to the configuration item.

ResultMessage String Parsing configuration values fails. Please make sure the value is consistent with the declared type. Currently supported types are: String, Integer, List, Boolean, Float, Json.

The validation result.

ResultSeverity String Error

The severity of the validation result.

Message String success

The response message. The value is success if the request is successful.

RequestId String 170E6BDE-8ACA-4013-B1D6-F0C2AAD*****

The ID of the request.

Examples

Sample request


http://webplus.cn-hangzhou.aliyuncs.com/pop/v1/wam/config/configSetting/validate&<Common request parameters>
{
  "EnvId":"we-5d3eaaea2977ca5251e*****",
  "TemplateId":"wct-5d3e9d2a2977ca5251e*****",
  "StackId":"ws-6c937c98a9c0296d0c48*****",
  "OptionSettings":"[{"path":"resources.ecs.autoScaling", "name":"instanceNum","value":"10"}, {"path":"application.option", "name":"port","value":"100"}]"
}

Sample success response

XML format

<ValidateConfigSettingResponse>
    <ConfigValidationResults>
        <ConfigValidationResult>
            <ResultSeverity>Error</ResultSeverity>
            <ConfigOption>
                <MinValue>1024</MinValue>
                <ValueType>Integer</ValueType>
                <RegexPattern></RegexPattern>
                <EditorType>{"component":"NumberPicker","props":{}}</EditorType>
                <DefaultValue>8080</DefaultValue>
                <MaxValue>65535</MaxValue>
                <RegexDesc></RegexDesc>
                <PathName>application.option</PathName>
                <OptionName>port</OptionName>
                <OptionLabel>Server Port</OptionLabel>
                <ChangeSeverity>NoInterruption</ChangeSeverity>
                <ReadonlyOption>false</ReadonlyOption>
                <MaxLength>-1</MaxLength>
                <ValueOptions></ValueOptions>
                <HiddenOption>false</HiddenOption>
                <MinLength>0</MinLength>
                <OptionDescription>This port will be used as the HTTP service port after the application is launched, and ports from 1024 to 65535 can be used. </OptionDescription>
            </ConfigOption>
            <ResultMessage>Parsing configuration values fails. Please make sure the value is consistent with the declared type. Currently supported types are: String, Integer, List, Boolean, Float, Json. </ResultMessage>
            <PathName>application.option</PathName>
            <OptionName>port</OptionName>
        </ConfigValidationResult>
    </ConfigValidationResults>
    <Message>success</Message>
    <RequestId>6112EBD9-E35E-4D98-91D5-5E302F7*****</RequestId>
    <Code>OK</Code>
</ValidateConfigSettingResponse>

JSON format

{
	"ConfigValidationResults":{
		"ConfigValidationResult":[
			{
				"ResultSeverity":"Error",
				"ConfigOption":{
					"MinValue":1024,
					"ValueType":"Integer",
					"RegexPattern":"",
					"EditorType":"{\"component\":\"NumberPicker\",\"props\":{}}",
					"DefaultValue":"8080",
					"RegexDesc":"",
					"MaxValue":65535,
					"PathName":"application.option",
					"OptionName":"port",
					"OptionLabel":"Server Port",
					"ChangeSeverity":"NoInterruption",
					"ReadonlyOption":false,
					"MaxLength":-1,
					"ValueOptions":"",
					"HiddenOption":false,
					"MinLength":0,
					"OptionDescription":"This port will be used as the HTTP service port after the application is launched, and ports from 1024 to 65535 can be used."
				},
				"ResultMessage":"Parsing configuration values fails. Please make sure the value is consistent with the declared type. Currently supported types are: String, Integer, List, Boolean, Float, Json.",
				"PathName":"application.option",
				"OptionName":"port"
			}
		]
	},
	"Message":"success",
	"RequestId":"170E6BDE-8ACA-4013-B1D6-F0C2AAD*****",
	"Code":"OK"
}

Error codes

For more information about error codes, see API Error Center.