VCL snippet

VCL Snippets are blocks of VCL logic inserted into your service's configuration that don't require custom VCL.

Data model

nameStringThe name for the snippet.
dynamicIntegerSets the snippet version to regular (0) or dynamic (1).
typeStringThe location in generated VCL where the snippet should be placed.
initPlace the snippet above all subroutines.
recvPlace the snippet within the vcl_recv subroutine but below the boilerplate VCL and above any objects.
hashPlace the snippet within the vcl_hash subroutine.
hitPlace the snippet within the vcl_hit subroutine.
missPlace the snippet within the vcl_miss subroutine.
passPlace the snippet within the vcl_pass subroutine.
fetchPlace the snippet within the vcl_fetch subroutine.
errorPlace the snippet within the vcl_error subroutine.
deliverPlace the snippet within the vcl_deliver subroutine.
logPlace the snippet within the vcl_log subroutine.
noneDon't render the snippet in VCL so it can be manually included in custom VCL.
contentStringThe VCL code that specifies exactly what the snippet does.
priorityIntegerPriority determines the ordering for multiple snippets. Lower numbers execute first.

Endpoints

Get a dynamic snippet

GET/service/service_id/snippet/snippet_id

List snippets

GET/service/service_id/version/version/snippet

Get a versioned snippet

GET/service/service_id/version/version/snippet/name

Create a snippet

POST/service/service_id/version/version/snippet

Update a dynamic snippet

PUT/service/service_id/snippet/snippet_id

Update a versioned snippet

PUT/service/service_id/version/version/snippet/old_name

Delete a snippet

DELETE/service/service_id/version/version/snippet/name