Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ESA::NetworkOptimization

Última atualização: Jun 27, 2026

Adiciona configurações de otimização de rede a um site.

Sintaxe

{
  "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
  }
}

Propriedades

Nome da propriedade

Tipo

Obrigatório

Atualização permitida

Descrição

Restrições

SiteId

Integer

Sim

Não

ID do site.

Nenhuma

Grpc

String

Não

Sim

Ativa ou desativa o gRPC.

Desativado por padrão. Valores válidos:

  • on

  • off

Http2Origin

String

Não

Sim

Ativa ou desativa o HTTP/2 para origem.

Desativado por padrão. Valores válidos:

  • on

  • off

RuleEnable

String

Não

Sim

Chave de ativação da regra.

Não defina este parâmetro para configurações globais. Valores válidos:

  • on

  • off

Rule

String

Não

Sim

Conteúdo da regra.

Use uma expressão condicional para corresponder às solicitações do usuário. Não defina este parâmetro para configurações globais. Cenários:

  • Corresponder a todas as solicitações recebidas: defina o valor como true.

  • Corresponder a uma solicitação específica: defina o valor como uma expressão personalizada, como (http.host eq "video.example.com").

RuleName

String

Não

Sim

Nome da regra.

Não defina este parâmetro para configurações globais.

SmartRouting

String

Não

Sim

Ativa ou desativa o serviço de roteamento inteligente.

Desativado por padrão. Valores válidos:

  • On

  • off

Sequence

Integer

Não

Sim

Ordem de execução da regra.

Um valor menor indica maior prioridade.

SiteVersion

Integer

Não

Não

Número da versão da configuração do site.

Especifica a versão na qual a configuração entra em vigor. Aplica-se apenas a sites com gerenciamento de versões ativado. Valor padrão: 0.

UploadMaxFilesize

Integer

Não

Sim

Tamanho máximo de upload de arquivo.

Unidade: MB. Valores válidos: 100 a 500.

Websocket

String

Não

Sim

Ativa ou desativa o WebSocket.

Ativado por padrão. Valores válidos:

  • on

  • off

Valores de retorno

Fn::GetAtt

  • SmartRouting: Indica se o roteamento inteligente está ativado.

  • Websocket: Indica se o WebSocket está ativado.

  • RuleEnable: Indica se a regra está ativada.

  • Sequence: Ordem de execução da regra.

  • Rule: Conteúdo da regra.

  • ConfigId: ID da configuração.

  • Grpc: Indica se o gRPC está ativado.

  • SiteVersion: Número da versão da configuração do site.

  • ConfigType: Tipo de configuração.

  • Http2Origin: Indica se o HTTP/2 para origem está ativado.

  • RuleName: Nome da regra.

  • UploadMaxFilesize: Tamanho máximo de upload de arquivo.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SiteId:
    Type: Number
    Description: The site ID.
    Required: true
  RuleEnable:
    Type: String
    Description: |-
      The switch for the rule. This parameter is not required for a global configuration. Valid values:
      - 'on'
      - 'off'
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  Rule:
    Type: String
    Description: |-
      The content of the rule, which uses a conditional expression to match user requests. This parameter is not required for a global configuration. Scenarios:
      - To match all incoming requests, set the value to true.
      - To match a specific request, set the value to a custom expression, such as (http.host eq \"video.example.com\").
    Required: false
  SiteVersion:
    Type: Number
    Description: The version number of the site configuration. For sites with configuration version management enabled, this parameter specifies the version for which the configuration takes effect. The default value is 0.
    Required: false
  RuleName:
    Type: String
    Description: The name of the rule.
    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: Specifies whether the smart routing service is enabled. This service is disabled by default.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SmartRouting
  Websocket:
    Description: Specifies whether WebSocket is enabled. This service is enabled by default.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Websocket
  RuleEnable:
    Description: The switch for the rule. This parameter is not required for a global configuration.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleEnable
  Sequence:
    Description: The execution order of the rule. A smaller value indicates a higher priority.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Sequence
  Rule:
    Description: The content of the rule, which uses a conditional expression to match user requests. This parameter is not required for a global configuration.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Rule
  ConfigId:
    Description: The ID of the configuration. Call the ListNetworkOptimizations operation to obtain the ID.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigId
  Grpc:
    Description: Specifies whether gRPC is enabled. This feature is disabled by default.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Grpc
  SiteVersion:
    Description: The version number of the site configuration. For sites with configuration version management enabled, this parameter specifies the version for which the configuration takes effect. The default value is 0.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SiteVersion
  ConfigType:
    Description: The configuration type. Use this parameter to query global or rule-based configurations.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigType
  Http2Origin:
    Description: Specifies whether HTTP/2 back-to-origin is enabled. This feature is disabled by default.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Http2Origin
  RuleName:
    Description: The name of the rule.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleName
  UploadMaxFilesize:
    Description: 'The maximum size of a file that can be uploaded, in MB. The value must be in the range of 100 to 500.'
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UploadMaxFilesize
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SiteId": {
      "Type": "Number",
      "Description": "The site ID.",
      "Required": true
    },
    "RuleEnable": {
      "Type": "String",
      "Description": "The switch for the rule. This parameter is not required for a global configuration. Valid values:\n- on\n- off",
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "Rule": {
      "Type": "String",
      "Description": "The content of the rule, which uses a conditional expression to match user requests. This parameter is not required for a global configuration. Scenarios:\n- To match all incoming requests, set the value to true.\n- To match a specific request, set the value to a custom expression, such as (http.host eq \\\"video.example.com\\\").",
      "Required": false
    },
    "SiteVersion": {
      "Type": "Number",
      "Description": "The version number of the site configuration. For sites with configuration version management enabled, this parameter specifies the version for which the configuration takes effect. The default value is 0.",
      "Required": false
    },
    "RuleName": {
      "Type": "String",
      "Description": "The name of the rule.",
      "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": "Specifies whether the smart routing service is enabled. This service is disabled by default.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SmartRouting"
        ]
      }
    },
    "Websocket": {
      "Description": "Specifies whether WebSocket is enabled. This service is enabled by default.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Websocket"
        ]
      }
    },
    "RuleEnable": {
      "Description": "The switch for the rule. This parameter is not required for a global configuration.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleEnable"
        ]
      }
    },
    "Sequence": {
      "Description": "The execution order of the rule. A smaller value indicates a higher priority.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Sequence"
        ]
      }
    },
    "Rule": {
      "Description": "The content of the rule, which uses a conditional expression to match user requests. This parameter is not required for a global configuration.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Rule"
        ]
      }
    },
    "ConfigId": {
      "Description": "The ID of the configuration. Call the ListNetworkOptimizations operation to obtain the ID.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigId"
        ]
      }
    },
    "Grpc": {
      "Description": "Specifies whether gRPC is enabled. This feature is disabled by default.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Grpc"
        ]
      }
    },
    "SiteVersion": {
      "Description": "The version number of the site configuration. For sites with configuration version management enabled, this parameter specifies the version for which the configuration takes effect. The default value is 0.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SiteVersion"
        ]
      }
    },
    "ConfigType": {
      "Description": "The configuration type. Use this parameter to query global or rule-based configurations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigType"
        ]
      }
    },
    "Http2Origin": {
      "Description": "Specifies whether HTTP/2 back-to-origin is enabled. This feature is disabled by default.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Http2Origin"
        ]
      }
    },
    "RuleName": {
      "Description": "The name of the rule.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleName"
        ]
      }
    },
    "UploadMaxFilesize": {
      "Description": "The maximum size of a file that can be uploaded, in MB. The value must be in the range of 100 to 500.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UploadMaxFilesize"
        ]
      }
    }
  }
}