// This file is auto-generated, don't edit it import * as $dara from '@darabonba/typescript'; export class CreateRuleRequestRuleActionsCorsConfig extends $dara.Model { /** * @remarks * Specifies whether credentials are allowed. Valid values: * * - **on**: allowed. * - **off**: not allowed. * * @example * on */ allowCredentials?: string; /** * @remarks * The list of headers allowed for CORS requests. */ allowHeaders?: string[]; /** * @remarks * The HTTP methods allowed for CORS requests. */ allowMethods?: string[]; /** * @remarks * The list of allowed origins. You can configure a single element `*`, or configure one or more values. * - Each value must start with `http://` or `https://`, followed by a valid domain name or a first-level wildcard domain name (for example, `http://*.test.abc.example.com`). * - Each value can optionally include a port. The port range is **1** to **65535**. */ allowOrigin?: string[]; /** * @remarks * The list of headers that can be exposed. */ exposeHeaders?: string[]; /** * @remarks * The maximum cache time for preflight requests in the browser. Unit: seconds. * * Valid values: **-1** to **172800**. * * @example * 1000 */ maxAge?: number; static names(): { [key: string]: string } { return { allowCredentials: 'AllowCredentials', allowHeaders: 'AllowHeaders', allowMethods: 'AllowMethods', allowOrigin: 'AllowOrigin', exposeHeaders: 'ExposeHeaders', maxAge: 'MaxAge', }; } static types(): { [key: string]: any } { return { allowCredentials: 'string', allowHeaders: { 'type': 'array', 'itemType': 'string' }, allowMethods: { 'type': 'array', 'itemType': 'string' }, allowOrigin: { 'type': 'array', 'itemType': 'string' }, exposeHeaders: { 'type': 'array', 'itemType': 'string' }, maxAge: 'number', }; } validate() { if(Array.isArray(this.allowHeaders)) { $dara.Model.validateArray(this.allowHeaders); } if(Array.isArray(this.allowMethods)) { $dara.Model.validateArray(this.allowMethods); } if(Array.isArray(this.allowOrigin)) { $dara.Model.validateArray(this.allowOrigin); } if(Array.isArray(this.exposeHeaders)) { $dara.Model.validateArray(this.exposeHeaders); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsFixedResponseConfig extends $dara.Model { /** * @remarks * The fixed content to return. The content can be up to 1 KB in size and can contain only ASCII characters. * * @example * dssacav */ content?: string; /** * @remarks * The format of the fixed content. * * Valid values: **text/plain**, **text/css**, **text/html**, **application/javascript**, and **application/json**. * * @example * text/plain */ contentType?: string; /** * @remarks * The HTTP response code to return. Only **2xx**, **4xx**, and **5xx** numeric strings are supported, where **x** is any digit. * * @example * 200 */ httpCode?: string; static names(): { [key: string]: string } { return { content: 'Content', contentType: 'ContentType', httpCode: 'HttpCode', }; } static types(): { [key: string]: any } { return { content: 'string', contentType: 'string', httpCode: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsForwardGroupConfigServerGroupStickySession extends $dara.Model { /** * @remarks * Specifies whether to enable session persistence. Valid values: * * - **true**: enabled. * - **false** (default): disabled. * * @example * false */ enabled?: boolean; /** * @remarks * The timeout period. Unit: seconds. Valid values: **1** to **86400**. Default value: **1000**. * * @example * 100 */ timeout?: number; static names(): { [key: string]: string } { return { enabled: 'Enabled', timeout: 'Timeout', }; } static types(): { [key: string]: any } { return { enabled: 'boolean', timeout: 'number', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsForwardGroupConfigServerGroupTuples extends $dara.Model { /** * @remarks * The destination server group to which requests are forwarded. * * @example * sgp-k86c1ov501id6p**** */ serverGroupId?: string; /** * @remarks * The weight. A larger value indicates a higher weight, which means more requests are forwarded to the server group. Valid values: **0** to **100**. * * - If only one destination server group is specified and no weight is specified, the default value is **100**. * * - If more than one destination server group is specified, you must specify the weight value. * * @example * 100 */ weight?: number; static names(): { [key: string]: string } { return { serverGroupId: 'ServerGroupId', weight: 'Weight', }; } static types(): { [key: string]: any } { return { serverGroupId: 'string', weight: 'number', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsForwardGroupConfig extends $dara.Model { /** * @remarks * The session persistence configuration between server groups. */ serverGroupStickySession?: CreateRuleRequestRuleActionsForwardGroupConfigServerGroupStickySession; /** * @remarks * The list of destination server groups to which requests are forwarded. A maximum of 5 destination server groups can be added to a forwarding rule. */ serverGroupTuples?: CreateRuleRequestRuleActionsForwardGroupConfigServerGroupTuples[]; static names(): { [key: string]: string } { return { serverGroupStickySession: 'ServerGroupStickySession', serverGroupTuples: 'ServerGroupTuples', }; } static types(): { [key: string]: any } { return { serverGroupStickySession: CreateRuleRequestRuleActionsForwardGroupConfigServerGroupStickySession, serverGroupTuples: { 'type': 'array', 'itemType': CreateRuleRequestRuleActionsForwardGroupConfigServerGroupTuples }, }; } validate() { if(this.serverGroupStickySession && typeof (this.serverGroupStickySession as any).validate === 'function') { (this.serverGroupStickySession as any).validate(); } if(Array.isArray(this.serverGroupTuples)) { $dara.Model.validateArray(this.serverGroupTuples); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsInsertHeaderConfig extends $dara.Model { /** * @remarks * The name of the header field to insert. The name must be 1 to 40 characters in length and can contain lowercase and uppercase letters a to z, digits, underscores (_), and hyphens (-). The header field name specified in **InsertHeaderConfig** must be unique. * * > You cannot set the header name to the following fields (case-insensitive): `slb-id`, `slb-ip`, `x-forwarded-for`, `x-forwarded-proto`, `x-forwarded-eip`, `x-forwarded-port`, `x-forwarded-client-srcport`, `connection`, `upgrade`, `content-length`, `transfer-encoding`, `keep-alive`, `te`, `host`, `cookie`, `remoteip`, `authority`, `x-forwarded-host`. * * @example * key */ key?: string; /** * @remarks * The value of the header field to insert. * * - If **ValueType** is set to **SystemDefined**, valid values are: * - **ClientSrcPort**: the client port. * - **ClientSrcIp**: the client IP address. * - **Protocol**: the protocol used by the client request (HTTP or HTTPS). * - **SLBId**: the Application Load Balancing instance ID. * - **SLBPort**: the Application Load Balancing instance listener port. * - If **ValueType** is set to **UserDefined**: you can specify a custom header value. The value must be 1 to 128 characters in length and can contain wildcards asterisks (\\*), question marks (?), and printable characters in the ASCII range `ch >= 32 && ch < 127`. The value cannot contain `"`. The value cannot start or end with a space. The value cannot end with `\\`. * - If **ValueType** is set to **ReferenceHeader**: you can reference a field in the request header. The value must be 1 to 128 characters in length and can contain lowercase letters a to z, digits, hyphens (-), and underscores (_). * * @example * UserDefined */ value?: string; /** * @remarks * The content type of the header field value. Valid values: * * - **UserDefined**: a custom value. * * - **ReferenceHeader**: references a field in the request header. * * - **SystemDefined**: a system-defined value. * * @example * UserDefined */ valueType?: string; static names(): { [key: string]: string } { return { key: 'Key', value: 'Value', valueType: 'ValueType', }; } static types(): { [key: string]: any } { return { key: 'string', value: 'string', valueType: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsRedirectConfig extends $dara.Model { /** * @remarks * The host to which requests are redirected. Valid values: * - **${host}** (default): This value cannot be concatenated with other characters. * - Other values. Character set and format restrictions are as follows: * - The hostname must be 3 to 256 characters in length and can contain lowercase letters a to z, digits, hyphens (-), periods (.), and wildcards asterisks (\\*), equals signs (=), tildes (~), underscores (_), plus signs (+), backslashes (\\), carets (^), exclamation marks (!), dollar signs ($), ampersands (&), vertical bars (|), parentheses (()), brackets ([\\]), and question marks (?). * - The hostname must contain at least one period (.) and cannot start or end with a period (.). * - The rightmost domain label can contain only letters and wildcards, and cannot contain digits or hyphens (-). The leftmost `domainlable` can be an asterisk (\\*). * - Hyphens (-) cannot appear at the beginning or end of other domain labels. * - Wildcards asterisks (\\*) and question marks (?) can appear at any position in a domain label. * * @example * ${host} */ host?: string; /** * @remarks * The redirect type. Valid values: **301**, **302**, **303**, **307**, and **308**. * * @example * 301 */ httpCode?: string; /** * @remarks * The path to which requests are redirected. Valid values: * - **${path}** (default): You can reference **${host}**, **${protocol}**, and **${port}**. Each variable can appear at most once. These variables can be used together or concatenated with characters within the allowed character set described below. * - Other values. Character set and format restrictions are as follows: * - The value must be 1 to 256 characters in length, is case-sensitive, and supports wildcards asterisks (\\*) and question marks (?) as wildcards. * - The value must start with a forward slash (/), and can contain uppercase and lowercase letters, digits, and special characters `$-_.+/&~@:\\"*?`. The value cannot contain `"%#;!()[]^,"\\"`. Wildcards asterisks (\\*) and question marks (?) are supported. * * @example * /test */ path?: string; /** * @remarks * The port to which requests are redirected. * - **${port}** (default): This value cannot be used together with other characters. * - Other values: **1 to 63335**. * * @example * 10 */ port?: string; /** * @remarks * The protocol to which requests are redirected. Valid values: * - **${protocol}** (default): This value can only be used alone and cannot be modified or concatenated with other characters. * - **HTTP** * - **HTTPS** * > * > - HTTPS listeners support redirection to HTTPS only. * > - HTTP listeners support redirection to both HTTP and HTTPS. * * @example * HTTP */ protocol?: string; /** * @remarks * The query string to which requests are redirected. * - **${query}** (default): You can reference **${host}**, **${protocol}**, and **${port}**. Each variable can appear at most once. These variables can be used together or concatenated with characters within the allowed character set described below. * - Other values. Character set and format restrictions are as follows: * - The value must be 1 to 128 characters in length. * - The value can contain printable characters but cannot contain spaces or `#[]{}\\|<>"`. Letters must be lowercase. * * @example * ${query} */ query?: string; static names(): { [key: string]: string } { return { host: 'Host', httpCode: 'HttpCode', path: 'Path', port: 'Port', protocol: 'Protocol', query: 'Query', }; } static types(): { [key: string]: any } { return { host: 'string', httpCode: 'string', path: 'string', port: 'string', protocol: 'string', query: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsRemoveHeaderConfig extends $dara.Model { /** * @remarks * The name of the header field to remove. The name must be 1 to 40 characters in length and can contain uppercase and lowercase letters a to z, digits, underscores (_), and hyphens (-). The header field name cannot be duplicated in RemoveHeader. * * - Request direction (Direction is set to Request): You cannot set the header name to the following fields (case-insensitive): `slb-id`, `slb-ip`, `x-forwarded-for`, `x-forwarded-proto`, `x-forwarded-eip`, `x-forwarded-port`, `x-forwarded-client-srcport`, `connection`, `upgrade`, `content-length`, `transfer-encoding`, `keep-alive`, `te`, `host`, `cookie`, `remoteip`, `authority`, `x-forwarded-host`. * - Response direction (Direction is set to Response): You cannot set the header name to the following fields (case-insensitive): `connection`, `upgrade`, `content-length`, `transfer-encoding`. * * @example * test */ key?: string; static names(): { [key: string]: string } { return { key: 'Key', }; } static types(): { [key: string]: any } { return { key: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsRewriteConfig extends $dara.Model { /** * @remarks * The destination hostname for internal redirection. Valid values: * - **${host}** (default): This value cannot be concatenated with other characters. * * - Other values. Character set and format restrictions are as follows: * * - The hostname must be 3 to 256 characters in length and can contain lowercase letters a to z, digits, hyphens (-), periods (.), and wildcards asterisks (\\*), equals signs (=), tildes (~), underscores (_), plus signs (+), backslashes (\\), carets (^), exclamation marks (!), dollar signs ($), ampersands (&), vertical bars (|), parentheses (()), brackets ([\\]), and question marks (?). * * - The hostname must contain at least one period (.) and cannot start or end with a period (.). * * - The rightmost domain label can contain only letters and wildcards, and cannot contain digits or hyphens (-). The leftmost `domainlable` can be an asterisk (\\*). * * - Hyphens (-) cannot appear at the beginning or end of other domain labels. Wildcards asterisks (\\*) and question marks (?) can appear at any position in a domain label. * * @example * www.example.com */ host?: string; /** * @remarks * The path to which requests are redirected. Valid values: * - **${path}** (default): You can reference **${host}**, **${protocol}**, and **${port}**. Each variable can appear at most once. These variables can be used together or concatenated with characters within the allowed character set described below. * - Other values. Character set and format restrictions are as follows: * - The value must be 1 to 256 characters in length, is case-sensitive, and supports wildcards asterisks (\\*) and question marks (?) as wildcards. * - The value must start with a forward slash (/), and can contain uppercase and lowercase letters, digits, and special characters `$-_.+/&~@:\\"*?`. The value cannot contain `"%#;!()[]^,"\\"`. Wildcards asterisks (\\*) and question marks (?) are supported. * * @example * /tsdf */ path?: string; /** * @remarks * The query string for internal redirection. * - **${query}** (default): You can reference **${host}**, **${protocol}**, and **${port}**. Each variable can appear at most once. These variables can be used together or concatenated with characters within the allowed character set described below. * - Other values. Character set and format restrictions are as follows: * - The value must be 1 to 128 characters in length. * - The value can contain printable characters but cannot contain spaces or `#[]{}\\|<>"`. Letters must be lowercase. * * @example * ${query} */ query?: string; static names(): { [key: string]: string } { return { host: 'Host', path: 'Path', query: 'Query', }; } static types(): { [key: string]: any } { return { host: 'string', path: 'string', query: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsTrafficLimitConfig extends $dara.Model { /** * @remarks * The number of requests per second per IP address. Valid values: **1 to 1000000**. * * > If you configure both the **QPS** and **PerIpQps** parameters, the value of **PerIpQps** must be smaller than the value of **QPS**. * * @example * 80 */ perIpQps?: number; /** * @remarks * The number of requests per second. Valid values: **1 to 1000000**. * * @example * 100 */ QPS?: number; static names(): { [key: string]: string } { return { perIpQps: 'PerIpQps', QPS: 'QPS', }; } static types(): { [key: string]: any } { return { perIpQps: 'number', QPS: 'number', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsTrafficMirrorConfigMirrorGroupConfigServerGroupTuples extends $dara.Model { /** * @remarks * The server group ID. * * @example * sgp-00mkgijak0w4qgz9**** */ serverGroupId?: string; static names(): { [key: string]: string } { return { serverGroupId: 'ServerGroupId', }; } static types(): { [key: string]: any } { return { serverGroupId: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsTrafficMirrorConfigMirrorGroupConfig extends $dara.Model { /** * @remarks * The configuration for mirroring traffic to a server group. */ serverGroupTuples?: CreateRuleRequestRuleActionsTrafficMirrorConfigMirrorGroupConfigServerGroupTuples[]; static names(): { [key: string]: string } { return { serverGroupTuples: 'ServerGroupTuples', }; } static types(): { [key: string]: any } { return { serverGroupTuples: { 'type': 'array', 'itemType': CreateRuleRequestRuleActionsTrafficMirrorConfigMirrorGroupConfigServerGroupTuples }, }; } validate() { if(Array.isArray(this.serverGroupTuples)) { $dara.Model.validateArray(this.serverGroupTuples); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActionsTrafficMirrorConfig extends $dara.Model { /** * @remarks * The configuration for mirroring traffic to a server group. */ mirrorGroupConfig?: CreateRuleRequestRuleActionsTrafficMirrorConfigMirrorGroupConfig; /** * @remarks * The type of the mirror target. Valid values: * - **ForwardGroupMirror**: mirrors traffic to a server group. * * @example * ForwardGroupMirror */ targetType?: string; static names(): { [key: string]: string } { return { mirrorGroupConfig: 'MirrorGroupConfig', targetType: 'TargetType', }; } static types(): { [key: string]: any } { return { mirrorGroupConfig: CreateRuleRequestRuleActionsTrafficMirrorConfigMirrorGroupConfig, targetType: 'string', }; } validate() { if(this.mirrorGroupConfig && typeof (this.mirrorGroupConfig as any).validate === 'function') { (this.mirrorGroupConfig as any).validate(); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleActions extends $dara.Model { /** * @remarks * The CORS configuration. */ corsConfig?: CreateRuleRequestRuleActionsCorsConfig; /** * @remarks * The configuration of the fixed response. */ fixedResponseConfig?: CreateRuleRequestRuleActionsFixedResponseConfig; /** * @remarks * The list of destination server groups to which requests are forwarded. A maximum of 5 destination server groups can be added to a forwarding rule. */ forwardGroupConfig?: CreateRuleRequestRuleActionsForwardGroupConfig; /** * @remarks * The configuration for inserting a header field. */ insertHeaderConfig?: CreateRuleRequestRuleActionsInsertHeaderConfig; /** * @remarks * The order in which the forwarding rule action is executed. Valid values: **1 to 50000**. Actions are executed in ascending order of values. This parameter cannot be left empty and the value cannot be duplicated. * * This parameter is required. * * @example * 1 */ order?: number; /** * @remarks * The redirect configuration. * * > For the parameters in **RedirectConfig**, parameters other than **httpCode** cannot all use default values. */ redirectConfig?: CreateRuleRequestRuleActionsRedirectConfig; /** * @remarks * The configuration for removing an HTTP header field. */ removeHeaderConfig?: CreateRuleRequestRuleActionsRemoveHeaderConfig; /** * @remarks * The rewrite configuration. * * > When you configure multiple actions for a forwarding rule, the **RewriteConfig** action must be used together with the **ForwardGroup** action type. */ rewriteConfig?: CreateRuleRequestRuleActionsRewriteConfig; /** * @remarks * The traffic throttling configuration. */ trafficLimitConfig?: CreateRuleRequestRuleActionsTrafficLimitConfig; /** * @remarks * The traffic mirroring configuration. */ trafficMirrorConfig?: CreateRuleRequestRuleActionsTrafficMirrorConfig; /** * @remarks * The action type. Valid values: * * - **ForwardGroup**: forwards requests to multiple virtual services. * * - **Redirect**: redirects requests. * * - **FixedResponse**: returns a fixed response. * * - **Rewrite**: rewrites requests. * * - **InsertHeader**: inserts a header field. * * - **RemoveHeader**: deletes a header field. * * - **TrafficLimit**: throttles traffic. * * - **TrafficMirror**: mirrors traffic. * * - **Cors**: enables cross-origin resource sharing (CORS). * * * > A forwarding rule must contain one **ForwardGroup** (forward to), **Redirect** (redirect), or **FixedResponse** (return a fixed response) action. When this action coexists with other action types, it must be executed last. * * This parameter is required. * * @example * ForwardGroup */ type?: string; static names(): { [key: string]: string } { return { corsConfig: 'CorsConfig', fixedResponseConfig: 'FixedResponseConfig', forwardGroupConfig: 'ForwardGroupConfig', insertHeaderConfig: 'InsertHeaderConfig', order: 'Order', redirectConfig: 'RedirectConfig', removeHeaderConfig: 'RemoveHeaderConfig', rewriteConfig: 'RewriteConfig', trafficLimitConfig: 'TrafficLimitConfig', trafficMirrorConfig: 'TrafficMirrorConfig', type: 'Type', }; } static types(): { [key: string]: any } { return { corsConfig: CreateRuleRequestRuleActionsCorsConfig, fixedResponseConfig: CreateRuleRequestRuleActionsFixedResponseConfig, forwardGroupConfig: CreateRuleRequestRuleActionsForwardGroupConfig, insertHeaderConfig: CreateRuleRequestRuleActionsInsertHeaderConfig, order: 'number', redirectConfig: CreateRuleRequestRuleActionsRedirectConfig, removeHeaderConfig: CreateRuleRequestRuleActionsRemoveHeaderConfig, rewriteConfig: CreateRuleRequestRuleActionsRewriteConfig, trafficLimitConfig: CreateRuleRequestRuleActionsTrafficLimitConfig, trafficMirrorConfig: CreateRuleRequestRuleActionsTrafficMirrorConfig, type: 'string', }; } validate() { if(this.corsConfig && typeof (this.corsConfig as any).validate === 'function') { (this.corsConfig as any).validate(); } if(this.fixedResponseConfig && typeof (this.fixedResponseConfig as any).validate === 'function') { (this.fixedResponseConfig as any).validate(); } if(this.forwardGroupConfig && typeof (this.forwardGroupConfig as any).validate === 'function') { (this.forwardGroupConfig as any).validate(); } if(this.insertHeaderConfig && typeof (this.insertHeaderConfig as any).validate === 'function') { (this.insertHeaderConfig as any).validate(); } if(this.redirectConfig && typeof (this.redirectConfig as any).validate === 'function') { (this.redirectConfig as any).validate(); } if(this.removeHeaderConfig && typeof (this.removeHeaderConfig as any).validate === 'function') { (this.removeHeaderConfig as any).validate(); } if(this.rewriteConfig && typeof (this.rewriteConfig as any).validate === 'function') { (this.rewriteConfig as any).validate(); } if(this.trafficLimitConfig && typeof (this.trafficLimitConfig as any).validate === 'function') { (this.trafficLimitConfig as any).validate(); } if(this.trafficMirrorConfig && typeof (this.trafficMirrorConfig as any).validate === 'function') { (this.trafficMirrorConfig as any).validate(); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsCookieConfigValues extends $dara.Model { /** * @remarks * The cookie key. * - The value must be 1 to 100 characters in length. * - The value can contain printable characters, wildcards asterisks (\\*), and question marks (?). Letters must be lowercase. * - The value cannot contain spaces or `;#[]{}\\|<>&"`. * * @example * test */ key?: string; /** * @remarks * The cookie value. * * - The value must be 1 to 100 characters in length. * - The value can contain printable characters, wildcards asterisks (\\*), and question marks (?). Letters must be lowercase. * - The value cannot contain spaces or `;#[]{}\\|<>&"`. * * @example * test */ value?: string; static names(): { [key: string]: string } { return { key: 'Key', value: 'Value', }; } static types(): { [key: string]: any } { return { key: 'string', value: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsCookieConfig extends $dara.Model { /** * @remarks * The list of cookie values. */ values?: CreateRuleRequestRuleConditionsCookieConfigValues[]; static names(): { [key: string]: string } { return { values: 'Values', }; } static types(): { [key: string]: any } { return { values: { 'type': 'array', 'itemType': CreateRuleRequestRuleConditionsCookieConfigValues }, }; } validate() { if(Array.isArray(this.values)) { $dara.Model.validateArray(this.values); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsHeaderConfig extends $dara.Model { /** * @remarks * The header field key. * * - The value must be 1 to 40 characters in length. * - The value can contain letters a to z, digits, hyphens (-), and underscores (_). * - Cookie and Host are not supported. * * @example * Port */ key?: string; /** * @remarks * The list of header field values. */ values?: string[]; static names(): { [key: string]: string } { return { key: 'Key', values: 'Values', }; } static types(): { [key: string]: any } { return { key: 'string', values: { 'type': 'array', 'itemType': 'string' }, }; } validate() { if(Array.isArray(this.values)) { $dara.Model.validateArray(this.values); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsHostConfig extends $dara.Model { /** * @remarks * The list of hostnames. */ values?: string[]; static names(): { [key: string]: string } { return { values: 'Values', }; } static types(): { [key: string]: any } { return { values: { 'type': 'array', 'itemType': 'string' }, }; } validate() { if(Array.isArray(this.values)) { $dara.Model.validateArray(this.values); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsMethodConfig extends $dara.Model { /** * @remarks * The list of request methods. */ values?: string[]; static names(): { [key: string]: string } { return { values: 'Values', }; } static types(): { [key: string]: any } { return { values: { 'type': 'array', 'itemType': 'string' }, }; } validate() { if(Array.isArray(this.values)) { $dara.Model.validateArray(this.values); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsPathConfig extends $dara.Model { /** * @remarks * The list of forwarding paths. */ values?: string[]; static names(): { [key: string]: string } { return { values: 'Values', }; } static types(): { [key: string]: any } { return { values: { 'type': 'array', 'itemType': 'string' }, }; } validate() { if(Array.isArray(this.values)) { $dara.Model.validateArray(this.values); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsQueryStringConfigValues extends $dara.Model { /** * @remarks * The query string key. * * - The value must be 1 to 100 characters in length. * - The value can contain printable characters, wildcards asterisks (\\*), and question marks (?). Letters must be lowercase. The value cannot contain spaces or `#[]{}\\|<>&"`. * * @example * test */ key?: string; /** * @remarks * The query string value. * * - The value must be 1 to 128 characters in length. * - The value can contain lowercase letters, printable characters, wildcards asterisks (\\*), and question marks (?). The value cannot contain spaces or `#[]{}\\|<>&"`. * * @example * test */ value?: string; static names(): { [key: string]: string } { return { key: 'Key', value: 'Value', }; } static types(): { [key: string]: any } { return { key: 'string', value: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsQueryStringConfig extends $dara.Model { /** * @remarks * The list of query strings. */ values?: CreateRuleRequestRuleConditionsQueryStringConfigValues[]; static names(): { [key: string]: string } { return { values: 'Values', }; } static types(): { [key: string]: any } { return { values: { 'type': 'array', 'itemType': CreateRuleRequestRuleConditionsQueryStringConfigValues }, }; } validate() { if(Array.isArray(this.values)) { $dara.Model.validateArray(this.values); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsResponseHeaderConfig extends $dara.Model { /** * @remarks * The header field key. * - The key must be 1 to 40 characters in length. * - The key can contain lowercase letters, digits, hyphens (-), and underscores (_). * - Cookie and Host are not supported. * * @example * test */ key?: string; /** * @remarks * The list of header field values. */ values?: string[]; static names(): { [key: string]: string } { return { key: 'Key', values: 'Values', }; } static types(): { [key: string]: any } { return { key: 'string', values: { 'type': 'array', 'itemType': 'string' }, }; } validate() { if(Array.isArray(this.values)) { $dara.Model.validateArray(this.values); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsResponseStatusCodeConfig extends $dara.Model { /** * @remarks * The list of response status codes. */ values?: string[]; static names(): { [key: string]: string } { return { values: 'Values', }; } static types(): { [key: string]: any } { return { values: { 'type': 'array', 'itemType': 'string' }, }; } validate() { if(Array.isArray(this.values)) { $dara.Model.validateArray(this.values); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditionsSourceIpConfig extends $dara.Model { /** * @remarks * The list of source IP addresses for service traffic matching. */ values?: string[]; static names(): { [key: string]: string } { return { values: 'Values', }; } static types(): { [key: string]: any } { return { values: { 'type': 'array', 'itemType': 'string' }, }; } validate() { if(Array.isArray(this.values)) { $dara.Model.validateArray(this.values); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestRuleConditions extends $dara.Model { /** * @remarks * The cookie configuration. */ cookieConfig?: CreateRuleRequestRuleConditionsCookieConfig; /** * @remarks * The header field configuration. */ headerConfig?: CreateRuleRequestRuleConditionsHeaderConfig; /** * @remarks * The hostname configuration. */ hostConfig?: CreateRuleRequestRuleConditionsHostConfig; /** * @remarks * The request method configuration. */ methodConfig?: CreateRuleRequestRuleConditionsMethodConfig; /** * @remarks * The forwarding path configuration. */ pathConfig?: CreateRuleRequestRuleConditionsPathConfig; /** * @remarks * The query string configuration. */ queryStringConfig?: CreateRuleRequestRuleConditionsQueryStringConfig; /** * @remarks * The response header configuration. */ responseHeaderConfig?: CreateRuleRequestRuleConditionsResponseHeaderConfig; /** * @remarks * The response status code configuration. * [_single.params.RuleConditions.items.ResponseStatusCodeConfig.Values. */ responseStatusCodeConfig?: CreateRuleRequestRuleConditionsResponseStatusCodeConfig; /** * @remarks * The configuration for source IP-based service traffic matching. This parameter is required and takes effect only when **Type** is set to **SourceIP**. */ sourceIpConfig?: CreateRuleRequestRuleConditionsSourceIpConfig; /** * @remarks * The type of the forwarding rule. Valid values: * * - **Host**: host. * * - **Path**: path. * * - **Header**: HTTP header field. * * - **QueryString**: query string. * * - **Method**: request method. * * - **Cookie**: cookie. * * - **SourceIp**: source IP address. * * - **ResponseHeader**: response HTTP header field. * * - **ResponseStatusCode**: response status code. * * This parameter is required. * * @example * Host */ type?: string; static names(): { [key: string]: string } { return { cookieConfig: 'CookieConfig', headerConfig: 'HeaderConfig', hostConfig: 'HostConfig', methodConfig: 'MethodConfig', pathConfig: 'PathConfig', queryStringConfig: 'QueryStringConfig', responseHeaderConfig: 'ResponseHeaderConfig', responseStatusCodeConfig: 'ResponseStatusCodeConfig', sourceIpConfig: 'SourceIpConfig', type: 'Type', }; } static types(): { [key: string]: any } { return { cookieConfig: CreateRuleRequestRuleConditionsCookieConfig, headerConfig: CreateRuleRequestRuleConditionsHeaderConfig, hostConfig: CreateRuleRequestRuleConditionsHostConfig, methodConfig: CreateRuleRequestRuleConditionsMethodConfig, pathConfig: CreateRuleRequestRuleConditionsPathConfig, queryStringConfig: CreateRuleRequestRuleConditionsQueryStringConfig, responseHeaderConfig: CreateRuleRequestRuleConditionsResponseHeaderConfig, responseStatusCodeConfig: CreateRuleRequestRuleConditionsResponseStatusCodeConfig, sourceIpConfig: CreateRuleRequestRuleConditionsSourceIpConfig, type: 'string', }; } validate() { if(this.cookieConfig && typeof (this.cookieConfig as any).validate === 'function') { (this.cookieConfig as any).validate(); } if(this.headerConfig && typeof (this.headerConfig as any).validate === 'function') { (this.headerConfig as any).validate(); } if(this.hostConfig && typeof (this.hostConfig as any).validate === 'function') { (this.hostConfig as any).validate(); } if(this.methodConfig && typeof (this.methodConfig as any).validate === 'function') { (this.methodConfig as any).validate(); } if(this.pathConfig && typeof (this.pathConfig as any).validate === 'function') { (this.pathConfig as any).validate(); } if(this.queryStringConfig && typeof (this.queryStringConfig as any).validate === 'function') { (this.queryStringConfig as any).validate(); } if(this.responseHeaderConfig && typeof (this.responseHeaderConfig as any).validate === 'function') { (this.responseHeaderConfig as any).validate(); } if(this.responseStatusCodeConfig && typeof (this.responseStatusCodeConfig as any).validate === 'function') { (this.responseStatusCodeConfig as any).validate(); } if(this.sourceIpConfig && typeof (this.sourceIpConfig as any).validate === 'function') { (this.sourceIpConfig as any).validate(); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequestTag extends $dara.Model { /** * @remarks * The tag key. The tag key can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://. * * @example * env */ key?: string; /** * @remarks * The tag value. The tag value can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://. * * @example * product */ value?: string; static names(): { [key: string]: string } { return { key: 'Key', value: 'Value', }; } static types(): { [key: string]: any } { return { key: 'string', value: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateRuleRequest 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** value as the **ClientToken** value. The **RequestId** value is different for each API request. * * @example * 5A2CFF0E-5718-45B5-9D4D-70B****** */ clientToken?: string; /** * @remarks * The direction of the forwarding rule. Valid values: * * - **Request** (default): The rule matches requests sent from clients to ALB and performs the corresponding actions. * * - **Response**: The rule matches responses returned from backend server groups to ALB and performs the corresponding actions. * * > ALB instances of Basic Edition do not support the **Response** type. * * @example * Request */ direction?: string; /** * @remarks * Specifies whether to perform only a dry run, without performing the actual request. Valid values: * * - **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the `DryRunOperation` error code is returned. * * - **false** (default): performs a dry run and performs the actual request. If the request passes the dry run, an `HTTP 2xx` status code is returned and the operation is performed. * * @example * false */ dryRun?: boolean; /** * @remarks * The ID of the Application Load Balancing (ALB) instance listener. * * This parameter is required. * * @example * lsn-l16uo9y****** */ listenerId?: string; /** * @remarks * The priority of the forwarding rule. Valid values: **1 to 10000**. A smaller value indicates a higher priority. * * > The priority of each rule within a listener must be unique. * * This parameter is required. * * @example * 10 */ priority?: number; /** * @remarks * The list of forwarding rule actions. * * This parameter is required. */ ruleActions?: CreateRuleRequestRuleActions[]; /** * @remarks * The list of forwarding rule conditions. * * This parameter is required. */ ruleConditions?: CreateRuleRequestRuleConditions[]; /** * @remarks * The name of the forwarding rule. * - The name must be 2 to 128 characters in length. * - The name must start with a letter, Chinese character, or digit. It can contain digits, periods (.), underscores (_), hyphens (-), and spaces. * * This parameter is required. * * @example * rule-doc */ ruleName?: string; /** * @remarks * The list of tags. */ tag?: CreateRuleRequestTag[]; static names(): { [key: string]: string } { return { clientToken: 'ClientToken', direction: 'Direction', dryRun: 'DryRun', listenerId: 'ListenerId', priority: 'Priority', ruleActions: 'RuleActions', ruleConditions: 'RuleConditions', ruleName: 'RuleName', tag: 'Tag', }; } static types(): { [key: string]: any } { return { clientToken: 'string', direction: 'string', dryRun: 'boolean', listenerId: 'string', priority: 'number', ruleActions: { 'type': 'array', 'itemType': CreateRuleRequestRuleActions }, ruleConditions: { 'type': 'array', 'itemType': CreateRuleRequestRuleConditions }, ruleName: 'string', tag: { 'type': 'array', 'itemType': CreateRuleRequestTag }, }; } validate() { if(Array.isArray(this.ruleActions)) { $dara.Model.validateArray(this.ruleActions); } if(Array.isArray(this.ruleConditions)) { $dara.Model.validateArray(this.ruleConditions); } if(Array.isArray(this.tag)) { $dara.Model.validateArray(this.tag); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } }