云服务器内容精选

  • 脚本配置示例 { "cache_key": { "system_params": [ "$context.sourceIp", "$context.requestId" ], "parameters": [ "demo_parameters" ], "headers": [ "demo_header" ] }, "cache_http_status_and_ttl": [ { "http_status": [ 200 ], "ttl": 300 } ], "client_cache_control": { "mode": "apps", "datas": [ "demo_app_id_1,demo_app_id_2" ] }, "cacheable_headers": [ "demo_cacheable_headers_1,demo_cacheable_headers_2" ] }
  • 为策略绑定API 单击策略名称,进入策略详情。 在API列表区域选择环境后,单击“绑定API”。 筛选API分组以及发布环境,勾选所需的API。 支持通过API名称或标签筛选API,标签为创建API时定义的标签。 单击“确定”,绑定完成。 如果单个API不需要绑定此策略,单击API所在行的“解绑”。 如果批量API不需要绑定此策略,则勾选待解绑的API,单击列表上方“解绑”。最多同时解绑1000个API。
  • 脚本配置示例 { "breaker_condition":{ "breaker_type":"timeout", "breaker_mode":"counter", "unhealthy_threshold":30, "time_window":15, "open_breaker_time":15, "unhealthy_percentage":51, "min_call_threshold":20 }, "scope":"share", "downgrade_default":{ "type":"http", "passthrough_infos":null, "func_info":null, "mock_info":null, "http_info":{ "isVpc":false, "vpc_channel_id":"", "address":"10.10.10.10", "scheme":"HTTP", "method":"GET", "path":"/demo", "timeout":5000 }, "http_vpc_info":null }, "downgrade_parameters":[ { "name":"reqPath", "type":"path", "value":"path", "disabled":true, "focused":true, "id":"92002eqbpilg6g" }, { "name":"method", "type":"method", "value":"method", "disabled":true, "focused":true, "id":"tuvxetsdqvcos8" }], "downgrade_rules":[ { "rule_name":"rule-test1", "parameters":[ "reqPath", "method" ], "match_regex":"[\"reqPath\",\"==\",\"/test\"]", "downgrade_backend":{ "type":"mock", "passthrough_infos":null, "func_info":null, "mock_info":{ "status_code":200, "result_content":"{status: ok}", "headers":[] }, "http_info":null, "http_vpc_info":null }, "breaker_condition":{ "breaker_type":"timeout", "breaker_mode":"percentage", "unhealthy_threshold":30, "time_window":15, "open_breaker_time":15, "unhealthy_percentage":51, "min_call_threshold":20 } }] }
  • 脚本配置示例 { "breaker_condition":{ "breaker_type":"timeout", "breaker_mode":"counter", "unhealthy_threshold":30, "time_window":15, "open_breaker_time":15, "unhealthy_percentage":51, "min_call_threshold":20 }, "scope":"share", "downgrade_default":{ "type":"http", "passthrough_infos":null, "func_info":null, "mock_info":null, "http_info":{ "isVpc":false, "vpc_channel_id":"", "address":"10.10.10.10", "scheme":"HTTP", "method":"GET", "path":"/demo", "timeout":5000 }, "http_vpc_info":null }, "downgrade_parameters":[ { "name":"reqPath", "type":"path", "value":"path", "disabled":true, "focused":true, "id":"92002eqbpilg6g" }, { "name":"method", "type":"method", "value":"method", "disabled":true, "focused":true, "id":"tuvxetsdqvcos8" }], "downgrade_rules":[ { "rule_name":"rule-test1", "parameters":[ "reqPath", "method" ], "match_regex":"[\"reqPath\",\"==\",\"/test\"]", "downgrade_backend":{ "type":"mock", "passthrough_infos":null, "func_info":null, "mock_info":{ "status_code":200, "result_content":"{status: ok}", "headers":[] }, "http_info":null, "http_vpc_info":null }, "breaker_condition":{ "breaker_type":"timeout", "breaker_mode":"percentage", "unhealthy_threshold":30, "time_window":15, "open_breaker_time":15, "unhealthy_percentage":51, "min_call_threshold":20 } }] }