// This file is auto-generated, don't edit it import * as $dara from '@darabonba/typescript'; export class UpdateServerGroupAttributeRequestConnectionDrainConfig extends $dara.Model { /** * @remarks * Specifies whether to enable connection draining. * * - **true**: enabled. * - **false**: disabled. * * @example * false */ connectionDrainEnabled?: boolean; /** * @remarks * The connection draining timeout period. * * Valid values: **0** to **900**. * * @example * 300 */ connectionDrainTimeout?: number; static names(): { [key: string]: string } { return { connectionDrainEnabled: 'ConnectionDrainEnabled', connectionDrainTimeout: 'ConnectionDrainTimeout', }; } static types(): { [key: string]: any } { return { connectionDrainEnabled: 'boolean', connectionDrainTimeout: 'number', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class UpdateServerGroupAttributeRequestHealthCheckConfig extends $dara.Model { /** * @remarks * The list of status codes that indicate healthy health checks. */ healthCheckCodes?: string[]; /** * @remarks * The port of the backend server that is used for health checks. * * Valid values: **0** to **65535**. * * Settings this parameter to **0** indicates that the port of the backend server is used for health checks. * * > This parameter settings take effect only when **HealthCheckEnabled** is set to **true** for the server group. * * @example * 80 */ healthCheckConnectPort?: number; /** * @remarks * Specifies whether to enable health checks. Valid values: * - **true**: enabled. * - **false**: disabled. * * @example * true */ healthCheckEnabled?: boolean; /** * @remarks * The domain name that is used for health checks. * * - **Use the internal IP address of the backend server** (default): The internal IP address of the backend server is used as the health check domain name. * * - **Specify a domain name**: Enter a domain name. * * - The domain name must be 1 to 80 characters in length. * * - The domain name can contain lowercase letters, digits, hyphens (-), and periods (.). * * - The domain name must contain at least one period (.). Periods (.) cannot appear at the beginning or end. * * - The rightmost domain label can contain only letters, not digits or hyphens (-). * * - Hyphens (-) cannot appear at the beginning or end. * * > This parameter takes effect only when **HealthCheckProtocol** is set to **HTTP**, **HTTPS**, or **gRPC**. * * @example * example.com */ healthCheckHost?: string; /** * @remarks * The HTTP version for health checks. Valid values: * * - **HTTP1.0** * - **HTTP1.1** * * > This parameter takes effect only when **HealthCheckEnabled** is set to true and **HealthCheckProtocol** is set to **HTTP** or **HTTPS** for the server group. * * @example * HTTP1.1 */ healthCheckHttpVersion?: string; /** * @remarks * The interval between two consecutive health checks. Unit: seconds. * * Valid values: **1** to **50**. * * > This parameter settings take effect only when **HealthCheckEnabled** is set to **true** for the server group. * * @example * 5 */ healthCheckInterval?: number; /** * @remarks * The health check method. Valid values: * * - **GET**: If the response body is longer than 8 KB, it is truncated. However, this does not affect the health check result. * * - **POST**: gRPC listener health checks use the POST method by default. * * - **HEAD**: HTTP and HTTPS listener health checks use the HEAD method by default. * * > This parameter takes effect only when **HealthCheckEnabled** is set to true and **HealthCheckProtocol** is set to **HTTP**, **HTTPS**, or **gRPC** for the server group. * * @example * HEAD */ healthCheckMethod?: string; /** * @remarks * The forwarding rule path for health checks. * * The path must be 1 to 80 characters in length and can contain only letters, digits, and the following characters: `-/.%?#&=` and the following extended characters: `_;~!()*[]@$^:\\",+`. The URL must start with `/`. * * > This parameter takes effect only when **HealthCheckEnabled** is set to **true** and **HealthCheckProtocol** is set to **HTTP** or **HTTPS** for the server group. * * @example * /test/index.html */ healthCheckPath?: string; /** * @remarks * The health check protocol. Valid values: * * - **HTTP**: The system sends HEAD or GET requests to simulate browser access behavior and checks whether the server application is healthy. * * - **HTTPS**: The system sends HEAD or GET requests to simulate browser access behavior and checks whether the server application is healthy. HTTPS provides data encryption and is more secure than HTTP. * * - **TCP**: The system sends SYN handshake packets to check whether the server port is alive. * * - **gRPC**: The system sends POST or GET requests to check whether the server application is healthy. * * @example * HTTP */ healthCheckProtocol?: string; /** * @remarks * The time to accept a response from a health check. If the backend ECS instance does not respond correctly within the specified time, the health check is considered failed. Unit: seconds. * * Valid values: **1** to **300**. * * > This parameter settings take effect only when **HealthCheckEnabled** is set to **true** for the server group. * * @example * 3 */ healthCheckTimeout?: number; /** * @remarks * The number of consecutive successful health checks required before the health check status of a backend server changes from **fail** to **success**. * * Valid values: **2** to **10**. * * @example * 4 */ healthyThreshold?: number; /** * @remarks * The number of consecutive failed health checks required before the health check status of a backend server changes from **success** to **fail**. * * Valid values: **2** to **10**. * * @example * 4 */ unhealthyThreshold?: number; static names(): { [key: string]: string } { return { healthCheckCodes: 'HealthCheckCodes', healthCheckConnectPort: 'HealthCheckConnectPort', healthCheckEnabled: 'HealthCheckEnabled', healthCheckHost: 'HealthCheckHost', healthCheckHttpVersion: 'HealthCheckHttpVersion', healthCheckInterval: 'HealthCheckInterval', healthCheckMethod: 'HealthCheckMethod', healthCheckPath: 'HealthCheckPath', healthCheckProtocol: 'HealthCheckProtocol', healthCheckTimeout: 'HealthCheckTimeout', healthyThreshold: 'HealthyThreshold', unhealthyThreshold: 'UnhealthyThreshold', }; } static types(): { [key: string]: any } { return { healthCheckCodes: { 'type': 'array', 'itemType': 'string' }, healthCheckConnectPort: 'number', healthCheckEnabled: 'boolean', healthCheckHost: 'string', healthCheckHttpVersion: 'string', healthCheckInterval: 'number', healthCheckMethod: 'string', healthCheckPath: 'string', healthCheckProtocol: 'string', healthCheckTimeout: 'number', healthyThreshold: 'number', unhealthyThreshold: 'number', }; } validate() { if(Array.isArray(this.healthCheckCodes)) { $dara.Model.validateArray(this.healthCheckCodes); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class UpdateServerGroupAttributeRequestSlowStartConfig extends $dara.Model { /** * @remarks * The slow start duration. * * Valid values: **30** to **900**. * * @example * 30 */ slowStartDuration?: number; /** * @remarks * Specifies whether to enable slow start. * * - **true**: enabled. * - **false**: disabled. * * @example * false */ slowStartEnabled?: boolean; static names(): { [key: string]: string } { return { slowStartDuration: 'SlowStartDuration', slowStartEnabled: 'SlowStartEnabled', }; } static types(): { [key: string]: any } { return { slowStartDuration: 'number', slowStartEnabled: 'boolean', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class UpdateServerGroupAttributeRequestStickySessionConfig extends $dara.Model { /** * @remarks * The cookie configured on the server. * * The cookie must be 1 to 200 characters in length and can contain only ASCII letters and digits. It cannot contain commas (,), semicolons (;), or spaces, and cannot start with a dollar sign ($). * * > This parameter takes effect only when **StickySessionEnabled** is set to **true** and **StickySessionType** is set to **Server** for the server group. * * @example * B490B5EBF6F3CD402E515D22B****** */ cookie?: string; /** * @remarks * The cookie timeout period. Unit: seconds. * * Valid values: **1** to **86400**. * * > This parameter takes effect only when **StickySessionEnabled** is set to **true** and **StickySessionType** is set to **Insert** for the server group. * * @example * 1000 */ cookieTimeout?: number; /** * @remarks * Specifies whether to enable session persistence. Valid values: * * - **true**: enabled. * - **false**: disabled. * * @example * false */ stickySessionEnabled?: boolean; /** * @remarks * The method used to handle cookies. Valid values: * * - **Insert**: inserts a cookie. * When a client accesses the server for the first time, the load balancing service inserts a cookie into the response (inserts SERVERID into the HTTP or HTTPS response). The next time the client sends a request with this cookie, the load balancing service forwards the request to the previously recorded backend server. * - **Server**: rewrites a cookie. * When the load balancing service detects a user-defined cookie, it rewrites the original cookie. The next time the client sends a request with the new cookie, the load balancing service forwards the request to the previously recorded backend server. * * > This parameter takes effect only when **StickySessionEnabled** is set to **true** for the server group. * * @example * Insert */ stickySessionType?: string; static names(): { [key: string]: string } { return { cookie: 'Cookie', cookieTimeout: 'CookieTimeout', stickySessionEnabled: 'StickySessionEnabled', stickySessionType: 'StickySessionType', }; } static types(): { [key: string]: any } { return { cookie: 'string', cookieTimeout: 'number', stickySessionEnabled: 'boolean', stickySessionType: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class UpdateServerGroupAttributeRequestUchConfig extends $dara.Model { /** * @remarks * The parameter type. Only QueryString is supported. * * This parameter is required. * * @example * QueryString */ type?: string; /** * @remarks * The consistent hashing parameter value. * * This parameter is required. * * @example * abc */ value?: string; static names(): { [key: string]: string } { return { type: 'Type', value: 'Value', }; } static types(): { [key: string]: any } { return { type: 'string', value: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class UpdateServerGroupAttributeRequest extends $dara.Model { /** * @remarks * The client token that is used to ensure the idempotence of the request. * * You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters. * * > If you do not specify this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId may be different for each API request. * * @example * 5A2CFF0E-5718-45B5-9D4D-70B3****** */ clientToken?: string; /** * @remarks * The connection draining configuration. * * After connection draining is enabled, when a backend server is removed or fails a health check, the load balancing service allows existing connections to continue transmitting data for a specified period of time without break. * > * > - Basic Edition instances do not support connection draining. Only Standard Edition and WAF Enhanced Edition instances support this feature. * > - Server type and IP type server groups support connection draining. Function Compute type server groups do not support this feature. */ connectionDrainConfig?: UpdateServerGroupAttributeRequestConnectionDrainConfig; /** * @remarks * Specifies whether to enable cross-zone load balancing for the server group. Valid values: * * - **true**: enabled (default). * * - **false**: disabled. * * > * > - Basic Edition instances do not support binding server groups with cross-zone load balancing disabled. Only Standard Edition and WAF Enhanced Edition instances support this feature. * > - Server type and IP type server groups support disabling cross-zone load balancing. Function Compute type server groups do not support this feature. * > - Session persistence is not supported when cross-zone load balancing is disabled. * * @example * true */ crossZoneEnabled?: boolean; /** * @remarks * Specifies whether to perform a dry run. Valid values: * - **true**: performs a dry run without modifying the resource. The system checks the required parameters, request syntax, and business restrictions. If the check fails, the corresponding error is returned. If the check succeeds, the `DryRunOperation` error code is returned. * - **false** (default): performs a dry run and sends the request. If the check succeeds, an HTTP `2xx` status code is returned and the operation is performed. * * @example * true */ dryRun?: boolean; /** * @remarks * The health check configuration. * * @example * true */ healthCheckConfig?: UpdateServerGroupAttributeRequestHealthCheckConfig; /** * @remarks * The IP version affinity mode. * * @example * Affinity */ ipVersionAffinityMode?: string; /** * @remarks * The scheduling algorithm. Valid values: * * - **Wrr**: weighted round-robin. Backend servers with higher weights receive more requests (higher probability) than those with lower weights. * - **Wlc**: weighted least connections. In addition to the weight assigned to each backend server, the actual server load (number of connections) is also considered. When the weights are the same, backend servers with fewer current connections receive more requests (higher probability). * - **Sch**: consistent hashing. Requests with the same hash factor are dispatched to the same backend server. If the UchConfig parameter is not configured, the default hash factor is the source IP address, and requests from the same source IP address are distributed to the same backend server. If the UchConfig parameter is configured, the hash factor is a URL parameter, and requests with the same URL parameter are distributed to the same backend server. * * @example * Wrr */ scheduler?: string; /** * @remarks * The server group ID. * * This parameter is required. * * @example * sgp-atstuj3rtop**** */ serverGroupId?: string; /** * @remarks * The server group name. * * The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), hyphens (-), and spaces. The name must start with a letter, a digit, or a Chinese character. * * @example * test */ serverGroupName?: string; /** * @remarks * This parameter is applicable only to ALB Ingress scenarios and specifies the `K8s Service` name that corresponds to the server group. * * @example * test2 */ serviceName?: string; /** * @remarks * The slow start configuration. * * After slow start is enabled, newly added backend servers in the server group are warmed up during a specified period of time, and the number of requests forwarded to these servers increases linearly. * > * > - Basic Edition instances do not support slow start. Only Standard Edition and WAF Enhanced Edition instances support this feature. * > - Server type and IP backend server groups support slow start configuration. Function Compute backend server groups do not support this feature. * > - Slow start can be enabled only when the backend scheduling algorithm is weighted round-robin. */ slowStartConfig?: UpdateServerGroupAttributeRequestSlowStartConfig; /** * @remarks * The session persistence configuration. */ stickySessionConfig?: UpdateServerGroupAttributeRequestStickySessionConfig; /** * @remarks * The URL consistent hashing parameter settings. */ uchConfig?: UpdateServerGroupAttributeRequestUchConfig; /** * @remarks * Specifies whether to enable upstream keepalive connections. * * - **true**: enabled. * * - **false**: disabled. * * @example * sgp-123 */ upstreamKeepaliveEnabled?: boolean; static names(): { [key: string]: string } { return { clientToken: 'ClientToken', connectionDrainConfig: 'ConnectionDrainConfig', crossZoneEnabled: 'CrossZoneEnabled', dryRun: 'DryRun', healthCheckConfig: 'HealthCheckConfig', ipVersionAffinityMode: 'IpVersionAffinityMode', scheduler: 'Scheduler', serverGroupId: 'ServerGroupId', serverGroupName: 'ServerGroupName', serviceName: 'ServiceName', slowStartConfig: 'SlowStartConfig', stickySessionConfig: 'StickySessionConfig', uchConfig: 'UchConfig', upstreamKeepaliveEnabled: 'UpstreamKeepaliveEnabled', }; } static types(): { [key: string]: any } { return { clientToken: 'string', connectionDrainConfig: UpdateServerGroupAttributeRequestConnectionDrainConfig, crossZoneEnabled: 'boolean', dryRun: 'boolean', healthCheckConfig: UpdateServerGroupAttributeRequestHealthCheckConfig, ipVersionAffinityMode: 'string', scheduler: 'string', serverGroupId: 'string', serverGroupName: 'string', serviceName: 'string', slowStartConfig: UpdateServerGroupAttributeRequestSlowStartConfig, stickySessionConfig: UpdateServerGroupAttributeRequestStickySessionConfig, uchConfig: UpdateServerGroupAttributeRequestUchConfig, upstreamKeepaliveEnabled: 'boolean', }; } validate() { if(this.connectionDrainConfig && typeof (this.connectionDrainConfig as any).validate === 'function') { (this.connectionDrainConfig as any).validate(); } if(this.healthCheckConfig && typeof (this.healthCheckConfig as any).validate === 'function') { (this.healthCheckConfig as any).validate(); } if(this.slowStartConfig && typeof (this.slowStartConfig as any).validate === 'function') { (this.slowStartConfig as any).validate(); } if(this.stickySessionConfig && typeof (this.stickySessionConfig as any).validate === 'function') { (this.stickySessionConfig as any).validate(); } if(this.uchConfig && typeof (this.uchConfig as any).validate === 'function') { (this.uchConfig as any).validate(); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } }