CreateService

Last updated: 2021-12-03 10:27:58

1. API Description

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

This API is used to create a service.
The maximum unit in API Gateway is service. Multiple APIs can be created in one service, and each service has a default domain name for users to call. You can also bind your own custom domain name to a service.

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 parameter. The value used for this API: CreateService.
Version Yes String Common parameter. The value used for this API: 2018-08-08.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
ServiceName Yes String Custom service name.
Protocol Yes String Service frontend request type, such as http, https, and http&https.
ServiceDesc No String Custom service description.
ExclusiveSetName No String Dedicated cluster name, which is used to specify the dedicated cluster where the service is to be created.
NetTypes.N No Array of String Network type list, which is used to specify the supported network types. INNER: private network access; OUTER: public network access. Default value: OUTER.
IpVersion No String IP version number. Valid values: IPv4, IPv6. Default value: IPv4.
SetServerName No String Cluster name, which is reserved and used by the tsf serverless type.
AppIdType No String User type, which is reserved and can be used by serverless users.
Tags.N No Array of Tag Tag information.
InstanceId No String Dedicated instance ID

3. Output Parameters

Parameter Name Type Description
ServiceId String Unique service ID.
ServiceName String Custom service name.
ServiceDesc String Custom service description.
OuterSubDomain String Default public domain name.
InnerSubDomain String Default VPC domain name.
CreatedTime Timestamp ISO8601 Service creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
NetTypes Array of String Network type list. INNER: private network access; OUTER: public network access.
IpVersion String IP version number.
Note: this field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 CreateService

Input Example

https://apigateway.tencentcloudapi.com/?Action=CreateService
&ServiceName=test_https
&ServiceDesc=https
&Protocol=https
&<Common request parameters>

Output Example

{
  "Response": {
    "ServiceId": "service-0c96l2bo",
    "ServiceName": "test_https",
    "ServiceDesc": "https",
    "OuterSubDomain": "service-0c96l2bo-1251006373.ap-guangzhou.apigateway.myqcloud.com",
    "InnerSubDomain": "",
    "IpVersion": "IPv4",
    "CreatedTime": "2020-09-22T00:00:00+00:00",
    "NetTypes": [
      "OUTER"
    ],
    "RequestId": "e3705d00-bfe0-4fde-942c-cebd6b12431b"
  }
}

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
AuthFailure Error with CAM signature/authentication.
DryRunOperation DryRun Operation. It means that the request would have succeeded, but the DryRun parameter was used.
FailedOperation Operation failed.
FailedOperation.InstanceNotExist The instance does not exist or is invalid.
FailedOperation.TagBindServiceError The tag was not bound to the specified service.
InternalError Internal error.
InternalError.CauthException CAuth internal request error. Please try again later. If the problem persists, please submit a ticket.
InternalError.OssException OSS internal request error. Please try again. If the problem persists, please contact the smart customer service or submit a ticket.
InternalError.VpcException VPC internal request error. Please try again. If the problem persists, please contact the smart customer service or submit a ticket.
InvalidParameter.FormatError Incorrect parameter format.
InvalidParameterValue The parameter value is incorrect.
InvalidParameterValue.InvalidRegion Incorrect region.
InvalidParameterValue.NotInOptions The parameter value is incorrect, as it is not an available option.
InvalidParameterValue.ParameterValueLimitExceeded The number of parameters exceeded limit.
LimitExceeded The quota limit is exceeded.
LimitExceeded.IpStrategyLimitExceeded The number of IP policies exceeds the limit.
LimitExceeded.ServiceCountLimitExceeded The number of services exceeds the limit. Please delete some services or increase the limit and try again.
MissingParameter Missing parameter.
RequestLimitExceeded The number of requests exceeds the frequency limit.
ResourceInUse The resource is in use.
ResourceInsufficient Insufficient resource.
ResourceNotFound The resource does not exist.
UnauthorizedOperation.UncertifiedUser The user has not passed identity verification.
UnsupportedOperation.InvalidAction API error.