ALIYUN::ESA::NetworkOptimization

ALIYUN::ESA::NetworkOptimization类型用于添加站点网络优化配置。

语法

{
  "Type": "ALIYUN::ESA::NetworkOptimization",
  "Properties": {
    "SiteId": Integer,
    "Grpc": String,
    "Http2Origin": String,
    "RuleEnable": String,
    "Rule": String,
    "RuleName": String,
    "SmartRouting": String,
    "Sequence": Integer,
    "SiteVersion": Integer,
    "UploadMaxFilesize": Integer,
    "Websocket": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

SiteId

Integer

站点 ID。

Grpc

String

是否开启 GRPC。

默认关闭。取值范围:

  • on:开启

  • off:关闭

Http2Origin

String

是否开启 HTTP2 回源。

默认关闭。取值范围:

  • on:开启

  • off:关闭

RuleEnable

String

规则开关。

添加全局配置的时候不需要设置该参数。取值范围:

  • on:开启。

  • off:关闭。

Rule

String

规则内容。

使用条件表达式来匹配用户请求。添加全局配置的时候不需要设置该参数。存在两种使用场景:

  • 匹配所有传入请求:值设置为 true

  • 匹配指定请求:值设置为自定义表达式,例如:(http.host eq "video.example.com")

RuleName

String

规则名称。

添加全局配置的时候不需要设置该参数。

SmartRouting

String

是否开启智能路由服务。

默认关闭。取值范围:

  • on:开启

  • off:关闭

Sequence

Integer

规则执行顺序。

数值越小越优先执行。

SiteVersion

Integer

站点配置的版本号。

开启了配置版本管理的站点,可以通过该参数指定配置生效的站点版本,默认为版本 0。

UploadMaxFilesize

Integer

最大上传文件大小。

单位是 MB,取值范围:100~500。

Websocket

String

是否开启 Websocket。

默认开启。取值范围:

  • on:开启

  • off:关闭

返回值

Fn::GetAtt

  • SmartRouting:是否开启智能路由服务

  • Websocket:是否开启Websocket

  • RuleEnable:规则开关。

  • Sequence:规则执行顺序

  • Rule:规则内容

  • ConfigId:配置 ID。

  • Grpc:是否开启GRPC

  • SiteVersion:站点配置的版本号。

  • ConfigType:配置类型

  • Http2Origin:是否开启HTTP2回源

  • RuleName:规则名称。

  • UploadMaxFilesize:最大上传文件大小

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SiteId:
    Type: Number
    Description:
      en: Site ID.
    Required: true
  RuleEnable:
    Type: String
    Description:
      en: |-
        Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
        - `on`: open.
        - `off`: close.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  Rule:
    Type: String
    Description:
      en: |-
        Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
        - Match all incoming requests: value set to true
        - Match specified request: Set the value to a custom expression, for example: (http.host eq \"video.example.com\").
    Required: false
  SiteVersion:
    Type: Number
    Description:
      en: The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    Required: false
  RuleName:
    Type: String
    Description:
      en: Rule name.
    Required: false
Resources:
  ExtensionResource:
    Type: ALIYUN::ESA::NetworkOptimization
    Properties:
      SiteId:
        Ref: SiteId
      RuleEnable:
        Ref: RuleEnable
      Rule:
        Ref: Rule
      SiteVersion:
        Ref: SiteVersion
      RuleName:
        Ref: RuleName
Outputs:
  SmartRouting:
    Description: Whether to enable smart routing service, default is disabled.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SmartRouting
  Websocket:
    Description: Whether to enable Websocket, default is enabled.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Websocket
  RuleEnable:
    Description: Rule switch. When adding global configuration, this parameter does not need to be set.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleEnable
  Sequence:
    Description: Order of rule execution. The smaller the value, the higher the priority for execution.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Sequence
  Rule:
    Description: Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Rule
  ConfigId:
    Description: ConfigId of the configuration, which can be obtained by calling the ListNetworkOptimizations.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigId
  Grpc:
    Description: Whether to enable GRPC, default is disabled.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Grpc
  SiteVersion:
    Description: The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SiteVersion
  ConfigType:
    Description: Configuration type, which can be used to query global or rule configurations.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigType
  Http2Origin:
    Description: Whether to enable HTTP2 origin, default is disabled.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Http2Origin
  RuleName:
    Description: Rule name.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleName
  UploadMaxFilesize:
    Description: 'Maximum upload file size, in MB, value range: 100~500.'
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UploadMaxFilesize
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SiteId": {
      "Type": "Number",
      "Description": {
        "en": "Site ID."
      },
      "Required": true
    },
    "RuleEnable": {
      "Type": "String",
      "Description": {
        "en": "Rule switch. When adding global configuration, this parameter does not need to be set. Value range:\n- `on`: open.\n- `off`: close."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "Rule": {
      "Type": "String",
      "Description": {
        "en": "Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:\n- Match all incoming requests: value set to true\n- Match specified request: Set the value to a custom expression, for example: (http.host eq \\\"video.example.com\\\")."
      },
      "Required": false
    },
    "SiteVersion": {
      "Type": "Number",
      "Description": {
        "en": "The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0."
      },
      "Required": false
    },
    "RuleName": {
      "Type": "String",
      "Description": {
        "en": "Rule name."
      },
      "Required": false
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ESA::NetworkOptimization",
      "Properties": {
        "SiteId": {
          "Ref": "SiteId"
        },
        "RuleEnable": {
          "Ref": "RuleEnable"
        },
        "Rule": {
          "Ref": "Rule"
        },
        "SiteVersion": {
          "Ref": "SiteVersion"
        },
        "RuleName": {
          "Ref": "RuleName"
        }
      }
    }
  },
  "Outputs": {
    "SmartRouting": {
      "Description": "Whether to enable smart routing service, default is disabled.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SmartRouting"
        ]
      }
    },
    "Websocket": {
      "Description": "Whether to enable Websocket, default is enabled.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Websocket"
        ]
      }
    },
    "RuleEnable": {
      "Description": "Rule switch. When adding global configuration, this parameter does not need to be set.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleEnable"
        ]
      }
    },
    "Sequence": {
      "Description": "Order of rule execution. The smaller the value, the higher the priority for execution.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Sequence"
        ]
      }
    },
    "Rule": {
      "Description": "Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Rule"
        ]
      }
    },
    "ConfigId": {
      "Description": "ConfigId of the configuration, which can be obtained by calling the ListNetworkOptimizations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigId"
        ]
      }
    },
    "Grpc": {
      "Description": "Whether to enable GRPC, default is disabled.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Grpc"
        ]
      }
    },
    "SiteVersion": {
      "Description": "The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SiteVersion"
        ]
      }
    },
    "ConfigType": {
      "Description": "Configuration type, which can be used to query global or rule configurations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigType"
        ]
      }
    },
    "Http2Origin": {
      "Description": "Whether to enable HTTP2 origin, default is disabled.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Http2Origin"
        ]
      }
    },
    "RuleName": {
      "Description": "Rule name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleName"
        ]
      }
    },
    "UploadMaxFilesize": {
      "Description": "Maximum upload file size, in MB, value range: 100~500.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UploadMaxFilesize"
        ]
      }
    }
  }
}