Feature Request: Export Corp/Site Rule Configuration to JSON

Could a feature to export a corp or site rule (whether saved, unsaved, active or inactive), be exportable in JSON format from the web UI?

Having been a past WAF/CDN client of both StackPath & Edgio and having to manage many sites, it would be beneficial for me to use the web UI to initially create a test rule and then export it as JSON for archival purposes or to be applied to multiple sites via the API or CLI. (Edgio provided the ability to export most configurations, and the JSON data has been extremely beneficial during our migration to Fastly.)

Thanks.

1 Like

Could a feature to export a corp or site rule (whether saved, unsaved, active or inactive), be exportable in JSON format from the web UI?

You can retrieve individual rules through the API by their rule ID and it will return it in JSON format. Here’s an example:

curl 'https://dashboard.signalsciences.net/api/v0/corps/dcorbett/sites/sandbox/rules/673363edb48b23a67b37d30f' {"id":"673363edb48b23a67b37d30f","siteNames":["sandbox"],"type":"request","enabled":true,"groupOperator":"all","conditions":[{"type":"single","field":"ipremote","operator":"equals","value":"192.168.22.22"}],"actions":[{"type":"block","responseCode":null}],"requestLogging":"sampled","reason":"test","expiration":"","createdBy":"dcorbett","created":"2024-11-12T14:19:25Z","updated":"2024-11-12T14:19:25Z"}

or to be applied to multiple sites via the API or CLI.

This is also where a Corp level rule is helpful as you can selectively apply it to whatever sites you want without recreating the rule.

Outside of the above options I have added you to an internal feature request regarding broad export/import capabilities.

I updated a corp rule using the webUI and noticed a PUT request & response in the F12 dev tools Network tab contains the same JSON info. For clarification, I’m requesting a way to expose this JSON string via the web interface for both review & export/archive.

CURRENT: The only way to access this generated JSON via the admin tool is to edit a rule, save and use F12 dev tools to capture the PUT request. (I’d like to access it on-demand without having to perform any edits.)

As a comparison, when working with the CDN configuration, VCL rules and Logger formats can both be previewed via the web UI without having to edit or use API/CLI. There’s even an option for “diff” (which is awesome).

Thanks.

For clarification, I’m requesting a way to expose this JSON string via the web interface for both review & export/archive.

Ah ok, thanks for clarifying! Unfortunately it is only accessible through the API today but I have noted your request within our internal feature request tracker.

As a comparison, when working with the CDN configuration, VCL rules and Logger formats can both be previewed via the web UI without having to edit or use API/CLI. There’s even an option for “diff” (which is awesome).

Completely understood! Thanks for the additional context.