Class: TencentCloud::Teo::V20220901::UpstreamURLRewriteParameters

Inherits:
Common::AbstractModel
  • Object
show all
Defined in:
lib/v20220901/models.rb

Overview

回源 URL 重写 配置参数。

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type = nil, action = nil, value = nil, regex = nil) ⇒ UpstreamURLRewriteParameters

Returns a new instance of UpstreamURLRewriteParameters.



22785
22786
22787
22788
22789
22790
# File 'lib/v20220901/models.rb', line 22785

def initialize(type=nil, action=nil, value=nil, regex=nil)
  @Type = type
  @Action = action
  @Value = value
  @Regex = regex
end

Instance Attribute Details

#ActionObject

<li>replace:指替换完整路径。用于将完整的请求 URL Path 替换为指定路径。</li> <li>addPrefix:指增加路径前缀。用于增加指定路径前缀至请求 URL Path。</li> <li>rmvPrefix:指移除路径前缀。用于移除请求 URL Path 的指定路径前缀。</li> <li>regexReplace:指正则替换完整路径。用于通过 Google RE2 正则表达式匹配和替换完整路径。</li>

Parameters:

  • Type:

    回源 URL 重写类型。仅支持填写 Path。

  • Action:

    回源 URL 重写动作。取值有:

  • Value:

    回源 URL 重写值。需要满足 URL Path 规范,且保证重写后的 Path 以 / 开头,以防止回源 URL 的 Host 被修改,长度范围为 1~1024。当 Action 为 addPrefix 时,不能以 / 结尾;当 Action 为 rmvPrefix 时,不能存在 *;当 Action 为 regexReplace 时,支持用 $NUM 引用正则捕获组,其中 NUM 代表组编号,如 $1,最多支持 $9。

  • Regex:

    回源 URL 重写用于正则替换匹配完整路径的正则表达式。需要满足 Google RE2 规范,长度范围为 1~1024。当 Action 为 regexReplace 时,此字段必填,否则无需填写此字段。



22783
22784
22785
# File 'lib/v20220901/models.rb', line 22783

def Action
  @Action
end

#RegexObject

<li>replace:指替换完整路径。用于将完整的请求 URL Path 替换为指定路径。</li> <li>addPrefix:指增加路径前缀。用于增加指定路径前缀至请求 URL Path。</li> <li>rmvPrefix:指移除路径前缀。用于移除请求 URL Path 的指定路径前缀。</li> <li>regexReplace:指正则替换完整路径。用于通过 Google RE2 正则表达式匹配和替换完整路径。</li>

Parameters:

  • Type:

    回源 URL 重写类型。仅支持填写 Path。

  • Action:

    回源 URL 重写动作。取值有:

  • Value:

    回源 URL 重写值。需要满足 URL Path 规范,且保证重写后的 Path 以 / 开头,以防止回源 URL 的 Host 被修改,长度范围为 1~1024。当 Action 为 addPrefix 时,不能以 / 结尾;当 Action 为 rmvPrefix 时,不能存在 *;当 Action 为 regexReplace 时,支持用 $NUM 引用正则捕获组,其中 NUM 代表组编号,如 $1,最多支持 $9。

  • Regex:

    回源 URL 重写用于正则替换匹配完整路径的正则表达式。需要满足 Google RE2 规范,长度范围为 1~1024。当 Action 为 regexReplace 时,此字段必填,否则无需填写此字段。



22783
22784
22785
# File 'lib/v20220901/models.rb', line 22783

def Regex
  @Regex
end

#TypeObject

<li>replace:指替换完整路径。用于将完整的请求 URL Path 替换为指定路径。</li> <li>addPrefix:指增加路径前缀。用于增加指定路径前缀至请求 URL Path。</li> <li>rmvPrefix:指移除路径前缀。用于移除请求 URL Path 的指定路径前缀。</li> <li>regexReplace:指正则替换完整路径。用于通过 Google RE2 正则表达式匹配和替换完整路径。</li>

Parameters:

  • Type:

    回源 URL 重写类型。仅支持填写 Path。

  • Action:

    回源 URL 重写动作。取值有:

  • Value:

    回源 URL 重写值。需要满足 URL Path 规范,且保证重写后的 Path 以 / 开头,以防止回源 URL 的 Host 被修改,长度范围为 1~1024。当 Action 为 addPrefix 时,不能以 / 结尾;当 Action 为 rmvPrefix 时,不能存在 *;当 Action 为 regexReplace 时,支持用 $NUM 引用正则捕获组,其中 NUM 代表组编号,如 $1,最多支持 $9。

  • Regex:

    回源 URL 重写用于正则替换匹配完整路径的正则表达式。需要满足 Google RE2 规范,长度范围为 1~1024。当 Action 为 regexReplace 时,此字段必填,否则无需填写此字段。



22783
22784
22785
# File 'lib/v20220901/models.rb', line 22783

def Type
  @Type
end

#ValueObject

<li>replace:指替换完整路径。用于将完整的请求 URL Path 替换为指定路径。</li> <li>addPrefix:指增加路径前缀。用于增加指定路径前缀至请求 URL Path。</li> <li>rmvPrefix:指移除路径前缀。用于移除请求 URL Path 的指定路径前缀。</li> <li>regexReplace:指正则替换完整路径。用于通过 Google RE2 正则表达式匹配和替换完整路径。</li>

Parameters:

  • Type:

    回源 URL 重写类型。仅支持填写 Path。

  • Action:

    回源 URL 重写动作。取值有:

  • Value:

    回源 URL 重写值。需要满足 URL Path 规范,且保证重写后的 Path 以 / 开头,以防止回源 URL 的 Host 被修改,长度范围为 1~1024。当 Action 为 addPrefix 时,不能以 / 结尾;当 Action 为 rmvPrefix 时,不能存在 *;当 Action 为 regexReplace 时,支持用 $NUM 引用正则捕获组,其中 NUM 代表组编号,如 $1,最多支持 $9。

  • Regex:

    回源 URL 重写用于正则替换匹配完整路径的正则表达式。需要满足 Google RE2 规范,长度范围为 1~1024。当 Action 为 regexReplace 时,此字段必填,否则无需填写此字段。



22783
22784
22785
# File 'lib/v20220901/models.rb', line 22783

def Value
  @Value
end

Instance Method Details

#deserialize(params) ⇒ Object



22792
22793
22794
22795
22796
22797
# File 'lib/v20220901/models.rb', line 22792

def deserialize(params)
  @Type = params['Type']
  @Action = params['Action']
  @Value = params['Value']
  @Regex = params['Regex']
end