You can call this operation to set the Tomcat parameters for an application or an instance group.

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 the sample code of the operation for different SDKs.

Request headers

This operation only uses common request headers. For more information, see the Common request parameters topic.

Request syntax

POST /pop/v5/app/container_config HTTPS|HTTP

Request parameters

Parameter Type Required Example Description
AppId String Yes c627c157-560d-43ff-************

The ID of the application for which you want to set the Tomcat parameters.

GroupId String No ""

The ID of the instance group for which you want to set the Tomcat parameters. If you set this parameter to a specific ID, the Tomcat parameters are set for the specified instance group. If you set this parameter to "", the Tomcat parameters are set for the application.

ContextPath String No ""

The Tomcat context path that you want to set. The value can be an empty string or null, which indicates a web application archive (WAR) package name, the root directory, or a non-empty custom string. The value can contain letters, English characters, numbers, and underscores (_).

Note
  1. This parameter cannot be specified in the group configuration. The value specified in the application configuration is applied.
  2. If this parameter is not specified in the application configuration, the root directory is applied.
HttpPort Integer No 8080

The application port number for the Tomcat container, which you want to set. Note: 1. This parameter cannot be specified in the group configuration. The value specified in the application configuration is applied. 2. If this parameter is not specified in the application configuration, the default value 8080 is applied.

MaxThreads Integer No 20

The maximum number of threads in the Tomcat container, which you want to set. Note: 1. If this parameter is not specified in the group configuration, the value specified in the application configuration is applied. 2. If this parameter is not specified in the application configuration, the default value 250 is applied.

URIEncoding String No ISO-8859-1

The uniform resource identifier (URI) encoding scheme in the Tomcat container. Valid values: ISO-8859-1, GBK, GBK213, and UTF-8. Note: 1. If this parameter is not specified in the group configuration, the value specified in the application configuration is applied. 2. If this parameter is not specified in the application configuration, the default value in Tomcat settings is applied.

UseBodyEncoding Boolean No true

Specifies whether to enable useBodyEncodingForURI in the Tomcat container. Note: 1. If this parameter is not specified in the group configuration, the value specified in the application configuration is applied. 2. If this parameter is not specified in the application configuration, the default value false is applied.

Response parameters

Parameter Type Example Description
Code Integer 200

The returned code.

Message String success

The returned message.

RequestId String D16979DC-4D42-***************
ContainerConfiguration Struct

The returned parameters of the Tomcat container.

ContextPath String ""

The context path of the application that runs in the Tomcat container.

HttpPort Integer 8080

The port number of the application that runs in the Tomcat container.

MaxThreads Integer 20

The maximum number of threads in the Tomcat container.

URIEncoding String ISO-8859-1

The URI encoding scheme in the Tomcat container. Valid values: ISO-8859-1, GBK, GB2312, and UTF-8.

UseBodyEncoding Boolean true

Indicates whether useBodyEncodingForURI is enabled in the Tomcat container.

Examples

Sample requests

POST /pop/v5/app/container_config HTTP/1.1
Common request headers
{
  "AppId": ""
}

Sample success responses

JSON format

{
    "Message": "success",
    "ContainerConfiguration": {
        "UseBodyEncoding": true,
        "MaxThreads": 20,
        "HttpPort": 8080,
        "URIEncoding": "ISO-8859-1"
    },
    "Code": 200
}

XML format

<Message>success</Message>
<ContainerConfiguration>
    <UseBodyEncoding>true</UseBodyEncoding>
    <MaxThreads>20</MaxThreads>
    <HttpPort>8080</HttpPort>
    <URIEncoding>ISO-8859-1</URIEncoding>
</ContainerConfiguration>
<Code>200</Code>

Error codes

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