tencent cloud

Feedback

DeployApplication

Last updated: 2023-12-04 16:38:13

    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. (Disused. Please use APIs for auto scaling policy combinations)
    CronHorizontalAutoscaler.N No Array of CronHorizontalAutoscaler Scheduled scaling policy (Disused. Please use APIs for auto scaling policy combinations)
    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 Configuration of metrics of this application
    EnableTracing No Integer 1: Automatically enable APM tracing (Skywalking)
    0: Disable APM tracing
    EnableMetrics No Integer 1: Automatically enable metrics collection (open-telemetry)
    0: Disable metrics collection
    TcrInstanceId No String ID of the TCR instance used for image deployment
    RepoServer No String Image server address for image deployment
    RepoType No Integer Type of the repository. 0: TCR Personal; 1: TCR Enterprise; 2: Public repository; 3: TEM hosted repository; 4: Demo repository

    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
    FailedOperation.ActionReadTimeout Request timed out
    FailedOperation.CreateServiceError Failed to create the service.
    FailedOperation.DefaultInternalError The server is busy. Retry later.
    FailedOperation.DescribeServiceListError Failed to query the service list
    InternalError.ActionReadTimeout Request timed out
    InternalError.CreateApmResourceError Failed to create the APM resource
    InternalError.CreateServiceError Failed to create the service.
    InternalError.DefaultInternalError The server is busy. Retry later.
    InternalError.DeployVersionError Failed to invoke the version deployment
    InvalidParameterValue.ApmNotBind The APM is not bound with the current environment.
    InvalidParameterValue.AutoScalerLargerThanOne Only one auto scaler can be specified.
    InvalidParameterValue.CannotOverWriteOtherApplicationService The access mode of other applications cannot be overwritten.
    InvalidParameterValue.InvalidDeployVersion The version number is invalid.
    InvalidParameterValue.InvalidEnvName Invalid environment parameter name. It must be a combination of [a-z], [A-Z], [0-9] and [._-]. It cannot start with a digit.
    InvalidParameterValue.InvalidEnvValue The length of environment variable cannot exceed 1,000.
    InvalidParameterValue.InvalidMountPath Invalid mounting path. It cannot be /app.
    InvalidParameterValue.InvalidTenantInfo Unable to identify the tenant information
    InvalidParameterValue.JdkVersionRequired The JDK version is required.
    InvalidParameterValue.MustProvidePortMappingRules The PortMapping rule is required.
    InvalidParameterValue.NamespaceNotBelongToAppid The namespace does not belong to the current account.
    InvalidParameterValue.OsNotSupport The operating system is not supported.
    InvalidParameterValue.PostStartNotValid Invalid post start
    InvalidParameterValue.PreStopNotValid
    InvalidParameterValue.RegistryNotBind The registry is not associated with the current environment.
    InvalidParameterValue.ServiceNameDuplicateError This application name already exists.
    InvalidParameterValue.ServiceNotBelongToAppid You are not the owner of this application.
    InvalidParameterValue.ServicePodReachMaximum Failed to create the instance. The upper limit is reached.
    InvalidParameterValue.ServiceUseReserveSuffix The suffix of the application name is not allowed.
    InvalidParameterValue.TemIdInvalid The TEM ID is incorrect.
    InvalidParameterValue.TraitsTracingNotSupported Linkage tracing is not available for non-JAVA applications.
    InvalidParameterValue.VersionLengthLimit The value of version cannot exceed 128 characters.
    InvalidParameterValue.VersionLowerCase The version must be in lower case.
    MissingParameter.DeployModeNull The deployment method is required.
    MissingParameter.DeployVersionNull The deployment version cannot be empty.
    MissingParameter.ImgRepoNull The image repository is required.
    MissingParameter.LogsetOrTopicNull The logset and topic are required.
    MissingParameter.PkgNameNull The package name cannot be left empty.
    MissingParameter.RepoServerNull
    MissingParameter.ServiceIdNull The service ID cannot be empty.
    MissingParameter.SvcRepoNotReady The image repository is not ready.
    MissingParameter.VpcServiceSubnetNull For intra-VPC acess, the subnet ID is required.
    ResourceInUse.ServiceDeploying The application is being deployed.
    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
    UnauthorizedOperation.MissingEksLogRole TKE does not have the permission to access CLS. Please assign the permission first.
    UnauthorizedOperation.UnauthorizedOperation Not authorized
    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