Creates a common parameter.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates a sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateParameter

The operation that you want to perform. Set the value to CreateParameter.

Name String Yes MyParameter

The name of the common parameter. The name must be 1 to 200 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, ALICLOUD, or OOS.

Type String Yes String

The data type of the common parameter. Valid values: String and StringList.

Value String Yes parameter

The value of the common parameter. The value must be 1 to 4096 characters in length.

RegionId String No cn-hangzhou

The region ID of the resource.

Description String No parameter

The description of the common parameter. The description must be 1 to 200 characters in length.

ClientToken String No 123e4567-e89b-12d3-a456-42665544****

The client token that is used to ensure the idempotence of the request. The token is a unique string that is generated by the client.

The token must be 1 to 64 characters in length, and can contain letters, digits, hyphens (-), and underscores (_).

For more information, see How to ensure idempotence.

Constraints String No '{''AllowedValues":["parameter"],"AllowedPattern":"parameter","MinLength":0,"MaxLength":20}'

The constraints of the common parameter. By default, this parameter is null. Valid values:

  • AllowedValues: The value that is allowed for the common parameter. It must be an array string.
  • AllowedPattern: The pattern that is allowed for the common parameter. It must be a regular expression.
  • MinLength: The minimum length of the common parameter.
  • MaxLength: The maximum length of the common parameter.

Response parameters

Parameter Type Example Description
Parameter Struct

The information of the common parameter.

Constraints String "{'AllowedValues':['parameter'],'AllowedPattern':'parameter','MinLength':0,'MaxLength':20}"

The constraints of the common parameter.

CreatedBy String root(130900000)

The user who created the common parameter.

CreatedDate String 2020-09-01T08:01:43Z

The time when the common parameter was created.

Description String parameter

The description of the common parameter.

Id String p-4c4b401cab6747xxxxxx

The ID of the common parameter.

Name String MyParameter

The name of the common parameter.

ParameterVersion Integer 1

The version number of the common parameter.

ShareType String Private

The share type of the common parameter.

Type String String

The type of the common parameter.

UpdatedBy String root(130900000)

The user who updated the common parameter.

UpdatedDate String 2020-09-01T08:01:43Z

The time when the common parameter was updated.

RequestId String 0B419FF3-ABC6-4DF0-95E5-636DC8CBB8AF

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/? Action=CreateParameter
&Name=MyParameter
&Type=String
&Value=parameter
&<Common request parameters>

Sample success responses

XML format

<RequestId>0B419FF3-ABC6-4DF0-95E5-636DC8CBB8AF</RequestId>
<Parameter>
    <UpdatedBy>root(130900000)</UpdatedBy>
    <Type>String</Type>
    <CreatedBy>root(130900000)</CreatedBy>
    <Description>parameter</Description>
    <UpdatedDate>2020-09-01T08:01:43Z</UpdatedDate>
    <ParameterVersion>1</ParameterVersion>
    <CreatedDate>2020-09-01T08:01:43Z</CreatedDate>
    <Id>p-4c4b401cab6747xxxxxx</Id>
    <Name>MyParameter</Name>
    <ShareType>Private</ShareType>
    <Constraints>{'AllowedValues':['test'],'AllowedPattern':'test','MinLength':0,'MaxLength':20}</Constraints>
</Parameter>

JSON format

{
	"RequestId": "0B419FF3-ABC6-4DF0-95E5-636DC8CBB8AF",
	"Parameter": {
		"UpdatedBy": "root(130900000)",
		"Type": "String",
		"CreatedBy": "root(130900000)",
		"Description": "parameter",
		"UpdatedDate": "2020-09-01T08:01:43Z",
		"ParameterVersion": 1,
		"CreatedDate": "2020-09-01T08:01:43Z",
		"Id": "p-4c4b401cab6747xxxxxx",
		"Name": "MyParameter",
		"ShareType": "Private",
        "Constraints":"{'AllowedValues':['parameter'],'AllowedPattern':'parameter','MinLength':0,'MaxLength':20}"
	}
}

Error codes

For a list of error codes, visit the API Error Center.