You need to enable JavaScript to run this app.
Load Balancer

Load Balancer

Copy page
Download PDF
Listener
CreateListener - Creating a listener
Copy page
Download PDF
CreateListener - Creating a listener
Call the CreateListener API to create a listener.​
Instructions​
Submit up to 5 API requests per second.​
Debug​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
The following only details request parameters specific to this API and key common parameters. More information can be found in Common parameters.​
Action string required Example: CreateListener​
Action to execute. Set the value to CreateListener.​
​
Version string required Example: 2020-04-01​
The API version. Value: 2020-04-01.​
​
XRealIpEnabled string optional Example: on​
Enable or disable the X-real-ip Header for the listener. Values: * on (default): Enable. * off: Disable.​
​
ListenerName string optional Example: test​
Listener name.​
  • If left blank, it defaults to the format "Protocol-Port".​
  • Cannot start with http:// or https://.​
  • Must start with a letter or Chinese character. May include numbers, periods (.), underscores (_), and hyphens (-).​
  • Length must be between 1 and 128 characters.​
​
Protocol string required Example: HTTP​
Listener protocol. Valid values:​
  • HTTP​
  • HTTPS​
​
Port integer required Example: 80​
Listening port range: 1 - 65535.​
​
Enabled string optional Example: on​
Enable/Disable the listener. Values:​
  • on (default): Enable.​
  • off: Disable.​
​
CertificateSource string optional Example: cert_center​
Default certificate source. This parameter is only valid for HTTPS listeners. Valid values are as follows:​
  • cert_center: Represents an SSL certificate purchased from or uploaded to the VolcanoEngine Certificate Center.​
​
CACertificateId string optional Example: cert-******​
ID of the CA certificate associated with the listener. This parameter is used for mutual authentication on HTTPS listeners.​
When the value of CACertificateSource is alb, the CACertificateId parameter must be specified.​
​
CertCenterCertificateId string optional Example: cert-********​
The certificate ID associated with the listener. Required when creating an HTTPS listener with the certificate source set to cert_center.​
​
EnableHttp2 string optional Example: off​
HTTP/2.0 feature switch. This parameter is only valid for HTTPS listeners. Valid values:​
  • on: Enable.​
  • off (default): Disable.​
​
Tags.N.Value string[] optional Example: Tags.1.Value=v1&Tags.2.Value=v2​
The tag value of the custom tag.​
  • To provide this parameter, provide Tags.N.Key first.​
  • The specific rules are as follows:​
  • The length limit is 0 to 256 characters.​
  • Case-sensitive.​
  • Must not start or end with a space.​
  • May include characters (any language), numbers, spaces ( ), underscores (_), periods (.), half-width colons (:), slashes (/), equal signs (=), plus signs (+), minus signs (-) and at signs (@).​
​
EnableQuic string optional Example: off​
QUIC feature switch. This parameter is only valid for HTTPS listeners. Valid values:​
  • on: Enable.​
  • off (default): Disable.​
  • Only standard edition ALB instances support QUIC. To use the QUIC feature, please contact your account manager.​
​
Tags.N.Key string[] optional Example: Tags.1.Key=k1&Tags.2.Key=k2​
The tag key of the custom tag. The specific rules are as follows:​
  • Must be 1 to 128 characters.​
  • Case-sensitive.​
  • It cannot start with volc: or sys: in any case form.​
  • Must not start or end with a space.​
  • May include characters (any language), numbers, spaces ( ), underscores (_), periods (.), half-width colons (:), slashes (/), equal signs (=), plus signs (+), minus signs (-) and at signs (@).​
  • Duplicate tag keys are not allowed for the same resource.​
​
AclStatus string optional Example: off​
Enable access control. Valid values:​
  • on: Enable.​
  • off (default): Do not enable.​
​
PcaLeafCertificateId string optional Example: cert-********​
The certificate ID associated with the listener. Required when creating an HTTPS listener with the certificate source set to pca_leaf.​
​
AclType string optional Example: black​
Method of access control. Valid values:​
  • white: Allowlist mode. Indicates that the listener forwards requests only from the IP addresses or CIDR blocks set in the selected access control policy group. If no IPs are added to the selected policy group, the listener does not forward any requests.​
  • black: Denylist mode. Indicates that the listener denies requests only from the IP addresses or CIDR blocks set in the selected access control policy group. If no IPs are added to the selected policy group, the listener forwards all requests.​
  • When the AclStatus parameter is set to on, AclType and AclIds.N are required.​
​
Description string optional Example: test​
Description of the listener.​
  • Cannot start with http:// or https://.​
  • Must start with a letter or Chinese character and may include numbers, half-width commas (,), periods (.), underscores (_), spaces ( ), equal signs (=), hyphens (-), full-width commas (,), and full-width periods (。).​
  • Must be 1 to 255 characters.​
  • If left blank, this parameter defaults to an empty string.​
​
CACertificateSource string optional Example: pca_root​
Source of the CA certificate associated with the listener. This parameter is only valid for HTTPS listeners and is used for mutual authentication. Valid values:​
  • alb (default): Indicates the certificate uploaded via ALB. Standard Edition ALB instances do not support certificates from this source.​
  • pca_root: Represents a private root CA certificate purchased from or uploaded to the VolcanoEngine Certificate Center.​
  • pca_sub: Represents a private sub CA certificate purchased from or uploaded to the VolcanoEngine Certificate Center.​
tip​
To enable mutual authentication for an HTTPS listener, you must specify both the CA certificate source and the CA certificate ID.​
  • When the value of CACertificateSource is alb, the CACertificateId parameter must be specified.​
  • When the value of CACertificateSource is pca_root, the PcaRootCACertificateId parameter must be specified.​
  • When the value of CACertificateSource is pca_sub, the PcaSubCACertificateId parameter must be specified.​
​
DomainExtensions.N.Domain string[] optional Example: DomainExtensions.1.Domain=abc.com&DomainExtensions.2.Domain=def.com​
Domain name.​
  • Parameter - N: Represents the sequence number of a domain. An HTTPS listener can associate with a maximum of 20 extended domains, with values ranging from 1 to 20.​
  • Specific format requirements are as follows:​
  • It generally cannot be empty. However, if the instance supports automatic extended certificate selection (i.e., SniAutoMatch is on), then DomainExtensions.N.Domain must be passed as an empty string.​
  • Must contain at least one '.', and cannot start or end with '.'.​
  • Only lowercase letters, numbers, '.', '-', and '*' are allowed.​
  • Length must be between 1 and 128 characters.​
  • Wildcard domain: Use "*" to replace one or more characters.​
  • The "*" must be at the beginning or end of the domain name.​
  • "*" cannot appear twice in the same domain name.​
  • No characters other than '.' are allowed before or after '*'.​
  • Valid example: .com, www.test..​
  • Invalid example: aaa.com, www..com​
  • Exact Domain Name​​: Must comply with domain name specifications (e.g., www.test.com).​
  • Domain names under the same HTTPS listener cannot be duplicated.​
  • Matching domain names is case-insensitive.​
​
DomainExtensions.N.CertificateSource string[] optional Example: DomainExtensions.1.CertificateSource=cert_center&DomainExtensions.2.CertificateSource=alb​
The server certificate source used by the domain name.​
  • Valid values:​
  • cert_center: Represents an SSL certificate purchased from or uploaded to the VolcanoEngine Certificate Center.​
  • Parameter - N: Represents the sequence number of a domain. An HTTPS listener can associate with a maximum of 20 extended domains, with values ranging from 1 to 20.​
​
PcaRootCACertificateId string optional Example: cert-******​
ID of the CA certificate associated with the listener. This parameter is used for mutual authentication on HTTPS listeners.​
When the value of CACertificateSource is pca_root, the PcaRootCACertificateId parameter must be specified.​
​
DomainExtensions.N.CertCenterCertificateId string[] optional Example: DomainExtensions.1.CertCenterCertificateId=cert-qwertyuqwert&DomainExtensions.2.CertCenterCertificateId=cert-zxcvbgasdfn​
The server certificate used by the domain.​
  • Effective when the certificate source is cert_center.​
  • Parameter - N: Represents the serial number of a domain. An HTTPS listener can associate with a maximum of 20 additional domains, with values ranging from 1 to 20.​
​
PcaSubCACertificateId string optional Example: cert-******​
ID of the CA certificate associated with the listener. This parameter is used for mutual authentication on HTTPS listeners.​
When the value of CACertificateSource is pca_sub, the PcaSubCACertificateId parameter must be specified.​
​
LoadBalancerId string required Example: alb-abcderf******​
The ALB instance ID to which the listener belongs.​
​
CertificateId string optional Example: cert-********​
The certificate ID associated with the listener. Required when creating an HTTPS listener with the certificate source set to alb.​
​
ServerGroupId string required Example: rsp-********​
The default server group ID associated with the listener.​
​
AclIds.N string[] optional Example: AclIds.1=acl-3cj44nv0jhhxc6c6rrtet****& AclIds.2=acl-2febxt4pu0zy85oxruw0t****​
The ID of the ACL bound to the listener.​
  • Parameter - N: Indicates the serial number of the access control list, with a maximum of 5.​
  • Separate multiple access control list IDs with ampersands ( & ).​
  • When the AclStatus parameter is set to on, AclType and AclIds.N are required.​
​
DomainExtensions.N.CertificateId string[] optional Example: DomainExtensions.1.CertificateId=cert-qwertyuqwert&DomainExtensions.2.CertificateId=cert-zxcvbgasdfn​
The server certificate used by the domain name.​
  • Effective only when the certificate source is alb.​
  • Parameter - N: Represents the serial number of a domain. An HTTPS listener can associate with a maximum of 20 additional domains, with values ranging from 1 to 20.​
​
DomainExtensions.N.PcaLeafCertificateId string[] optional Example: DomainExtensions.1.PcaLeafCertificateId=pca_leaf-qwertyuqwert&DomainExtensions.2.PcaLeafCertificateId=pca_leaf-zxcvbgasdfn​
The server certificate used by the domain name.​
  • Effective when the certificate source is pca_leaf.​
  • Parameter -N: Represents the serial number of a domain. An HTTPS listener can associate with a maximum of 20 extended domains, with values ranging from 1 to 20.​
​
AccessLogRecordCustomizedHeadersEnabled string optional Example: off​
Enable or disable header recording in the listener's access logs. Valid values:​
  • on: Enable.​
  • off (default): Disable.​
​
​
​
Response parameters​
Only the response parameters specific to this API are listed below. More information, see Response structure.​
RequestId string Example: 20210811152539010225146063030****​
Request ID.​
​
ListenerId string Example: lsn-2fek3rgsxhrsw5oxruwec****​
Listener ID.​
​
​
​
Request examples​
​
GET /?Action=CreateListener&CertificateId=&Description=test&Enabled=on&ListenerName=TEST&LoadBalancerId=alb-1g1f1c6a****88ibuxws5k0k3&Port=12&Protocol=HTTP&ServerGroupId=rsp-2ff2u2282****5oxruwe33hdz&Version=2020-04-01" HTTP/1.1​
Host: alb.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/alb/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
Response examples​
​
{​
"ResponseMetadata": {​
"RequestId": "20210816110638****2514606306AF947C",​
"Action": "CreateListener",​
"Version": "2020-04-01",​
"Service": "alb",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "202108161106****22514606306AF947C",​
"ListenerId": "lsn-1g0swqx5fnqbk8ibuxyfxp2rd"​
}​
}​
​
Error codes​
The following table lists the error codes related to the business logic for this API. For details, see Common error codes.​
​
Status code​
Error codes​
Error message​
Notes​
400​
Invalid%s.Malformed​
MismatchThe specified %s is malformed.​
The specified %s parameter format is invalid.​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, '%s'.​
This request is missing a required parameter. Please ensure the request includes all required parameters, such as: %s.​
400​
InvalidParameter​
Data unmarshal failed.​
Failed to parse the request.​
400​
OperationDenied.AccountArrears​
The request on the specified resource is denied due to the account being in arrears status.​
The request to operate on this resource was rejected because the account is in an overdue payment state.​
400​
InvalidPort.Malformed​
The specified Port is malformed.​
The format of the specified Port is invalid.​
400​
InvalidServerGroup.InvalidStatus​
The specified ServerGroup is not in the correct status for the request.​
The specified server group is in a status that cannot respond to the request.​
400​
InvalidVpcForServerGroup.LoadBalancerMismatch​
The specified VPC of ServerGroup and LoadBalancer do not match.​
The specified server group and the ALB instance do not belong to the same VPC.​
400​
InvalidListenerName.Malformed​
The specified ListenerName is malformed.​
The specified ListenerName format is invalid.​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
The format specified for Description is invalid.​
400​
InvalidAclStatus.Malformed​
The specified AclStatus is malformed.​
The specified AclStatus parameter format is invalid.​
400​
InvalidAclType.Malformed​
The specified AclType is malformed.​
The specified AclType parameter format is invalid.​
400​
InvalidAclId.Duplicated​
The specified AclId is duplicated.​
The specified AclId is duplicated.​
400​
OperationFailed.QueryProject​
The request on the specified resource failed due to the query on project failed.​
The request to operate on this resource failed because the project query failed.​
400​
MissingParameter​
The request is missing a required parameter. Ensure that you have supplied all the required parameters for the request; for example, 'CertificateId'.​
This request does not contain required parameters. Please ensure the request includes all required parameters, such as Certificate ID.​
400​
InvalidCertificateType.FunctionMismatch​
The specified Certificate's type and Function do not match.​
The type of the specified certificate does not match the expected functionality.​
400​
InvalidServerCertificate.InvalidStatus​
The specified Server Certificate is not in the correct status for the request.​
The specified server certificate is in a status that cannot respond to this request.​
400​
InvalidIndexOrder.Malformed​
The specified index order is malformed.​
The specified index order parameter format is invalid.​
400​
InvalidDomainExtensions.Domain.Malformed​
The specified DomainExtensions.Domain is malformed.​
The specified DomainExtensions.Domain parameter format is invalid.​
400​
InvalidDomainExtensions.Domain.Duplicated​
The specified DomainExtensions.Domain is duplicated. Domain Extensions in one listener can not be same.​
The specified DomainExtensions.Domain is duplicated. Additional domains associated with one listener cannot be duplicated.​
400​
InvalidDomainExtensions.Certificate.InvalidStatus​
The specified DomainExtension Certificate is not in the correct status for the request.​
The specified additional domain certificate is in a status that cannot respond to this request.​
400​
InvalidCACertificate.InvalidStatus​
The specified CA Certificate is not in the correct status for the request.​
The specified CA certificate is in a state that cannot respond to this request.​
400​
InvalidProtocol.Malformed​
The specified Protocol is malformed.​
The specified Protocol format is invalid.​
400​
InvalidEnabled.Malformed​
The specified Enabled is malformed.​
The specified Enabled format is invalid.​
400​
InvalidEnableHttp2.Malformed​
The specified EnableHttp2 is malformed.​
The specified EnableHttp2 parameter format is invalid.​
400​
InvalidEnableQuic.Malformed​
The specified EnableQuic is malformed.​
The specified EnableQuic parameter format is invalid.​
400​
OperationDenied.DualStackEnableQuicUnsupported​
The request on the specified Listener is denied due to the dual stack load balancer listener not support to enable quic.​
The request to operate on this listener was rejected because dual-stack ALB instances currently do not support enabling QUIC on listeners.​
400​
OperationFailed.OperateGtmFailed​
The request on the specified resource failed due to operating gtm failed.​
The request to operate on this resource failed because the operation on the GTM instance failed.​
400​
OperationFailed.AddIntoProjectFailed​
The request on the specified resource failed due to adding it into the project failed.​
The request to operate on this resource failed because adding the resource to the project failed.​
400​
QuotaExceed.ListenerPerInstance​
You've reached the limit on the number of listeners per ALB you can add in, resource xxx, usage xx/xx.​
The maximum number of listeners that can be created for a single ALB instance has been reached. The resource is xxx. Used: xxx. Quota: xxx​
400​
QuotaExceed.ServerPerInstance​
You've reached the limit on the number of backend servers per ALB you can associate with, resource xxx, usage xx/xx.​
The maximum number of backend servers that can be associated with a single instance has been reached. The resource is xxx. Used: xxx. Quota: xxx​
400​
QuotaExceed.SniDomainPerListener​
You've reached the limit on the number of sni domains per listener you can associate with, resource xxx, usage xx/xx.​
The maximum number of SNI domains that can be associated with a single listener has been reached. The resource is xxx. Used: xxx. Quota: xxx​
400​
QuotaExceed.AclPerListener​
You've reached the limit on the number of ACLs per listener you can associate with, resource xxx, usage xx/xx.​
The maximum number of ACLs that can be associated with a single listener has been reached. The resource is xxx. Used: xxx. Quota: xxx​
400​
QuotaExceed.ListenerPerAcl​
You've reached the limit on the number of listeners per ACL you can associate with, resource xxx, usage xx/xx.​
The maximum number of listeners that can be associated with a single ACL has been reached. The resource is xxx. Used: xxx. Quota: xxx​
400​
QuotaExceed.RulePerGroup​
You've reached the limit on the number of rules per server group you can associate with, resource xxx, usage xx/xx.​
The maximum number of forwarding rules that can be associated with a single server group has been reached. The resource is xxx. Used: xxx. Quota: xxx​
400​
InvalidDomainExtensions.CertificateSource.Malformed​
The specified DomainExtensions.CertificateSource is malformed.​
The specified DomainExtensions.CertificateSource parameter format is invalid.​
400​
OperationFailed.QueryCertificateService​
The request on the specified resource failed due to the query on Certificate Service failed.​
The request to operate on this resource failed because the request to the Certificate Center service failed.​
400​
OperationFailed.QueryIAM​
The request on the specified resource failed due to the query on IAM failed.​
The request to operate on this resource failed because the IAM request failed.​
400​
InvalidCertificateServiceSSLCertificate.InvalidStatus​
The specified Certificate Service SSL Certificate is not in the correct status for the request. Please check if the certificate has been issued.​
The specified Certificate Center SSL certificate is in a status that cannot respond to this request. Confirm the certificate has been issued.​
400​
InvalidCertificateSource.Malformed​
The specified CertificateSource is malformed.​
The format of the specified CertificateSource is invalid.​
400​
InvalidProxyProtocolDisabled.Malformed​
The specified ProxyProtocolDisabled is malformed.​
The specified ProxyProtocolDisabled parameter is invalid.​
400​
OperationFailed.AddTagFailed​
The request on the specified resource failed due to adding tag to the resource failed.​
The request to operate on this resource failed because adding tags to the resource failed.​
400​
InvalidCertificateId.Duplicated​
The specified CertificateId is duplicated. Certificates in one listener can not be same.​
The specified CertificateId is duplicated. Certificates under a single listener cannot be duplicated.​
400​
InvalidLoadBalancer.InvalidStatus​
The specified LoadBalancer is not in the correct status for the request.​
The specified ALB is in a state that cannot respond to this request.​
400​
InvalidTags.Key.Malformed​
The specified Tags.Key is malformed.​
The specified Tags.Key parameter format is invalid.​
400​
InvalidTags.Value.Malformed​
The specified Tags.Value is malformed.​
The specified Tags.Value parameter format is invalid.​
400​
InvalidTags.Key.Duplicated​
The specified Tags.Key is duplicated.​
The specified Tags.Key is duplicated.​
400​
InvalidXRealIpEnabled.Malformed​
The specified XRealIpEnabled is malformed.​
The specified XRealIpEnabled parameter format is invalid.​
400​
QuotaExceed.AclEntriesPerInstance​
You've reached the limit on the number of ACL entries per instance you can associate with, resource xxx, usage xx/xx.​
The maximum number of ACL entries that can be associated with a single instance has been reached. The resource is xxx. Used: xxx. Quota: xxx​
400​
OperationDenied.AclAndSecurityGroupConflict​
The request on the specified LoadBalancer is denied due to acls and security groups cannot be used at the same time.​
The operation request for this ALB instance is rejected because access control and security groups cannot be used simultaneously.​
400​
QuotaExceed.ListenerPerCert​
You've reached the limit on the number of listeners per server certificate you can associate with, resource xxx, usage xx/xx.​
The maximum number of listeners that can be associated with a single server certificate has been reached. The resource is xxx. Used: xxx. Quota: xxx​
400​
QuotaExceed.ListenerPerCACert​
You've reached the limit on the number of listeners per CA certificate you can associate with, resource xxx, usage xx/xx.​
The maximum number of listeners that can be associated with a single CA certificate has been reached. The resource is xxx. Used: xxx. Quota: xxx​
403​
Forbidden​
You are not authorized to enable quic for listener.​
You do not have permission to enable Quic on the listener.​
403​
Forbidden​
You are not authorized to disable X-real-ip header.​
You do not have permission to disable the X-real-ip header.​
404​
InvalidLoadBalancer.NotFound​
The specified LoadBalancer does not exist.​
The specified ALB instance does not exist.​
404​
InvalidServerGroup.NotFound​
The specified ServerGroup does not exist.​
The specified server group does not exist.​
404​
InvalidAcl.NotFound​
The specified ACL does not exist.​
The specified ACL does not exist.​
404​
InvalidProject.NotFound​
The specified Project does not exist.​
The specified project does not exist.​
404​
InvalidServerCertificate.NotFound​
The specified Server Certificate does not exist.​
The specified server certificate does not exist.​
404​
InvalidDomainExtensions.Certificate.NotFound​
The specified DomainExtension Certificate does not exist.​
The specified additional domain certificate does not exist.​
404​
InvalidCACertificate.NotFound​
The specified CA Certificate does not exist.​
The specified CA certificate does not exist.​
409​
InvalidPort.Conflict​
The specified Port already exists.​
The specified port already exists.​
500​
InternalError​
An internal error has occurred.​
An internal error occurred. Please try again later or contact an engineer for further consultation.​
​
Last updated: 2026.06.12 14:05:15