APIを介してルールを作成する
Rulesets APIを使用して、APIを介して圧縮ルールを作成します。
APIを介して圧縮ルールを作成する際は、以下の点に注意してください:
- ルールアクションを
compress_responseに設定します。 action_parametersフィールドで、マッチするリクエストに対して上書きしたい設定に従ってパラメータを定義します。- ルールをゾーンレベルの
http_response_compressionフェーズにデプロイします。
Follow this workflow to create 圧縮ルール for a given zone via API:
-
Use the List zone rulesets operation to check if there is already a ruleset for the
http_response_compressionphase at the zone level. -
If the phase ruleset does not exist, create it using the Create a zone ruleset operation. In the new ruleset properties, set the following values:
- kind:
zone - phase:
http_response_compression
- kind:
-
Use the Update a zone ruleset operation to add 圧縮ルール to the list of ruleset rules. Alternatively, include the rule in the Create a zone ruleset request mentioned in the previous step.
例のAPIリクエストについては、Rules examples galleryを参照してください。