tencent cloud

Feedback

DeployApplication

Last updated: 2022-06-24 10:58:37

1. API Description

Domain name for API request: tem.tencentcloudapi.com.

This API is used to deploy an application.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DeployApplication.
Version Yes String Common Params. The value used for this API: 2021-07-01.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ApplicationId Yes String Application ID
InitPodNum Yes Integer Number of initialized pods
CpuSpec Yes Float CPU specification
MemorySpec Yes Float Memory specification
EnvironmentId Yes String Environment ID
ImgRepo No String Image repository
VersionDesc No String Version description
JvmOpts No String Launch parameters
EsInfo No EsInfo Auto scaling configuration (This field is disused. Please use HorizontalAutoscaler to set the auto scaling policy.)
EnvConf.N No Array of Pair Environment variable configuration
LogConfs.N No Array of String Log configuration
StorageConfs.N No Array of StorageConf Data volume configuration
StorageMountConfs.N No Array of StorageMountConf Data volume mount configuration
DeployMode No String Deployment type
- JAR: deployment through JAR package
- WAR: deployment through WAR package
- IMAGE: deployment through image
DeployVersion No String When the deployment type is IMAGE, this parameter indicates the image tag
When the deployment type is JAR or WAR, this parameter indicates the package version number
PkgName No String Package name, which is required when using JAR or WAR packages for deployment
JdkVersion No String JDK version
- KONA: use KONA JDK
- OPEN: use open JDK
- KONA: use KONA JDK
- OPEN: use open JDK
SecurityGroupIds.N No Array of String Security group IDs
LogOutputConf No LogOutputConf Log output configuration
SourceChannel No Integer Source channel
Description No String Version description
ImageCommand No String Image command
ImageArgs.N No Array of String Image command parameters
UseRegistryDefaultConfig No Boolean Whether to add the registry's default configurations
SettingConfs.N No Array of MountedSettingConf Mounting configurations
Service No EksService Application access configuration
VersionId No String ID of the version that you want to roll back to
PostStart No String The script to run after startup
PreStop No String The script to run before stop
Liveness No HealthCheckConfig Configuration of aliveness probe
Readiness No HealthCheckConfig Configuration of readiness probe
DeployStrategyConf No DeployStrategyConf Configuration of batch release policies
HorizontalAutoscaler.N No Array of HorizontalAutoscaler Auto scaling policy
CronHorizontalAutoscaler.N No Array of CronHorizontalAutoscaler Scheduled auto scaling policy
LogEnable No Integer Specifies whether to enable logging. 1: enable; 0: do not enable
ConfEdited No Boolean Whether the configuration is modified (except for the image configuration)
SpeedUp No Boolean Whether the application acceleration is enabled
StartupProbe No HealthCheckConfig Whether to enable probing
OsFlavour No String The version of the operating system
If openjdk is selected, the value can be:
- ALPINE
- CENTOS
If konajdk is selected, the value can be:
- ALPINE
- TENCENTOS
EnablePrometheusConf No EnablePrometheusConf Specifies whether to enable Prometheus metric

3. Output Parameters

Parameter Name Type Description
Result String Version ID (which can be ignored for the frontend)
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Deploying an application

This example shows you how to deploy an application.

Input Example

POST / HTTP/1.1
Host: tem.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DeployApplication
<Common request parameters>

{
    "Service": {
        "ApplicationName": "xx",
        "ExternalIp": "xx",
        "Name": "xx",
        "PortMappings": [
            {
                "Protocol": "xx",
                "TargetPort": 0,
                "Port": 0
            }
        ],
        "Yaml": "xx",
        "LoadBalanceId": "xx",
        "VersionName": "xx",
        "ClusterIp": [
            "xx"
        ],
        "SubnetId": "xx",
        "Type": "xx",
        "Ports": [
            0
        ]
    },
    "JvmOpts": "xx",
    "StorageConfs": [
        {
            "StorageVolName": "xx",
            "StorageVolIp": "xx",
            "StorageVolPath": "xx"
        }
    ],
    "ImgRepo": "xx",
    "EnvConf": [
        {
            "Value": "xx",
            "Key": "xx"
        }
    ],
    "ImageCommand": "xx",
    "Description": "xx",
    "JdkVersion": "xx",
    "ApplicationId": "xx",
    "LogOutputConf": {
        "ClsLogTopicId": "xx",
        "ClsLogsetName": "xx",
        "ClsLogsetId": "xx",
        "ClsLogTopicName": "xx",
        "OutputType": "xx"
    },
    "UseRegistryDefaultConfig": true,
    "CpuSpec": 0.0,
    "DeployMode": "xx",
    "SecurityGroupIds": [
        "xx"
    ],
    "SourceChannel": 0,
    "DeployVersion": "xx",
    "InitPodNum": 1,
    "VersionDesc": "xx",
    "ImageArgs": [
        "xx"
    ],
    "MemorySpec": 0.0,
    "EnvironmentId": "xx",
    "LogConfs": [
        "xx"
    ],
    "PkgName": "xx",
    "StorageMountConfs": [
        {
            "VolumeName": "xx",
            "MountPath": "xx"
        }
    ],
    "EsInfo": {
        "MinAliveInstances": 0,
        "EsStrategy": 0,
        "VersionId": "xx",
        "Threshold": 1,
        "MaxAliveInstances": 2
    },
    "VersionId": "xx",
    "SettingConfs": [
        {
            "ConfigDataName": "xx",
            "MountedPath": "xx",
            "Data": [
                {
                    "Value": "xx",
                    "Key": "xx"
                }
            ]
        }
    ],
    "OsFlavour": "ALPINE"
}

Output Example

{
  "Response": {
    "RequestId": "81f74023-563c-437d-abf7-8139449ef178",
    "Result": "version-xxx"
  }
}

Example2 nanjing-test-20220111

This example shows you how to deploy an application.

Input Example

POST / HTTP/1.1
Host: tem.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DeployApplication
<Common request parameters>

{
    "Service": {
        "Name": "String"
    },
    "JvmOpts": "Sting",
    "SpeedUp": "false",
    "PreStop": "String",
    "ImgRepo": "String",
    "EnvConf": [
        {
            "Config": "String",
            "Type": "String",
            "Key": "String",
            "Value": "String"
        }
    ],
    "ImageCommand": "String",
    "Description": "String",
    "JdkVersion": "String",
    "ApplicationId": "String",
    "LogOutputConf": {
        "ClsLogTopicName": "String",
        "ClsLogsetName": "String",
        "ClsLogTopicId": "String",
        "OutputType": "String",
        "ClsLogsetId": "String"
    },
    "ConfEdited": "false",
    "EnvironmentId": "String",
    "CpuSpec": "0.1",
    "DeployMode": "String",
    "SecurityGroupIds": [
        "String"
    ],
    "SourceChannel": "0",
    "LogEnable": "0",
    "InitPodNum": "2",
    "VersionDesc": "String",
    "ImageArgs": [
        "String"
    ],
    "MemorySpec": "1024",
    "UseRegistryDefaultConfig": "true",
    "LogConfs": [
        "String"
    ],
    "PkgName": "String",
    "StorageMountConfs": [
        {
            "VolumeName": "String",
            "MountPath": "String"
        }
    ],
    "DeployVersion": "String",
    "VersionId": "String",
    "SettingConfs": [
        {
            "ConfigDataName": "String",
            "MountedPath": "String",
            "Data": [
                {
                    "Config": "String",
                    "Type": "String",
                    "Key": "String",
                    "Value": "String"
                }
            ]
        }
    ],
    "StorageConfs": [
        {
            "StorageVolPath": "String",
            "StorageVolIp": "String",
            "StorageVolName": "String"
        }
    ],
    "PostStart": "String",
    "OsFlavour": "ALPINE"
}

Output Example

{
  "Response": {
    "RequestId": "422a54ac-9913-4d46-8439-9c05600003b3",
    "Result": "version-success"
  }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError.CreateApmResourceError Failed to create the APM resource
InternalError.DefaultInternalError The server is busy. Retry later.
InternalError.DeployVersionError Failed to invoke the version deployment
InvalidParameterValue.AutoScalerLargerThanOne Only one auto scaler can be specified.
InvalidParameterValue.InvalidDeployVersion The version number is invalid.
InvalidParameterValue.ServicePodReachMaximum
InvalidParameterValue.TraitsTracingNotSupported Linkage tracing is not available for non-JAVA applications.
InvalidParameterValue.VersionLowerCase The version must be in lower case.
MissingParameter.DeployVersionNull The deployment version cannot be empty.
MissingParameter.PkgNameNull The package name cannot be left empty.
MissingParameter.ServiceIdNull The service ID cannot be empty.
MissingParameter.SvcRepoNotReady
ResourceNotFound.MicroserviceOffline The target microservice is offline.
ResourceNotFound.ServiceNotFound The application is not found.
ResourceNotFound.VersionNamespaceNotFound The environment corresponding to this version is not found.
ResourceUnavailable.WaitForKruise Waiting for the installation of addon
Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support