require 'fastly'
api_instance = Fastly::VclApi.new
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
create_custom_vcl | POST /service/{service_id}/version/{version_id}/vcl | Create a custom VCL file |
delete_custom_vcl | DELETE /service/{service_id}/version/{version_id}/vcl/{vcl_name} | Delete a custom VCL file |
get_custom_vcl | GET /service/{service_id}/version/{version_id}/vcl/{vcl_name} | Get a custom VCL file |
get_custom_vcl_boilerplate | GET /service/{service_id}/version/{version_id}/boilerplate | Get boilerplate VCL |
get_custom_vcl_generated | GET /service/{service_id}/version/{version_id}/generated_vcl | Get the generated VCL for a service |
get_custom_vcl_generated_highlighted | GET /service/{service_id}/version/{version_id}/generated_vcl/content | Get the generated VCL with syntax highlighting |
get_custom_vcl_highlighted | GET /service/{service_id}/version/{version_id}/vcl/{vcl_name}/content | Get a custom VCL file with syntax highlighting |
get_custom_vcl_raw | GET /service/{service_id}/version/{version_id}/vcl/{vcl_name}/download | Download a custom VCL file |
lint_vcl_default | POST /vcl_lint | Lint (validate) VCL using a default set of flags. |
lint_vcl_for_service | POST /service/{service_id}/lint | Lint (validate) VCL using flags set for the service. |
list_custom_vcl | GET /service/{service_id}/version/{version_id}/vcl | List custom VCL files |
set_custom_vcl_main | PUT /service/{service_id}/version/{version_id}/vcl/{vcl_name}/main | Set a custom VCL file as main |
update_custom_vcl | PUT /service/{service_id}/version/{version_id}/vcl/{vcl_name} | Update a custom VCL file |
create_custom_vcl(opts): <VclResponse> # Create a custom VCL file
Upload a VCL for a particular service and version.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
content: 'content_example', # String | The VCL code to be included.
main: true, # Boolean | Set to `true` when this is the main VCL, otherwise `false`.
name: 'name_example', # String | The name of this VCL.
}
begin
# Create a custom VCL file
result = api_instance.create_custom_vcl(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->create_custom_vcl: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. | |
content | String | The VCL code to be included. | [optional] |
main | Boolean | Set to true when this is the main VCL, otherwise false . |
[optional] |
name | String | The name of this VCL. | [optional] |
[Back to top] [Back to API list] [Back to README]
delete_custom_vcl(opts): <InlineResponse200> # Delete a custom VCL file
Delete the uploaded VCL for a particular service and version.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
vcl_name: 'vcl_name_example', # String | The name of this VCL.
}
begin
# Delete a custom VCL file
result = api_instance.delete_custom_vcl(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->delete_custom_vcl: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. | |
vcl_name | String | The name of this VCL. |
[Back to top] [Back to API list] [Back to README]
get_custom_vcl(opts): <VclResponse> # Get a custom VCL file
Get the uploaded VCL for a particular service and version.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
vcl_name: 'vcl_name_example', # String | The name of this VCL.
no_content: 'no_content_example', # String | Omit VCL content.
}
begin
# Get a custom VCL file
result = api_instance.get_custom_vcl(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->get_custom_vcl: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. | |
vcl_name | String | The name of this VCL. | |
no_content | String | Omit VCL content. | [optional][default to '0'] |
[Back to top] [Back to API list] [Back to README]
get_custom_vcl_boilerplate(opts): String # Get boilerplate VCL
Return boilerplate VCL with the service's TTL from the settings.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
}
begin
# Get boilerplate VCL
result = api_instance.get_custom_vcl_boilerplate(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->get_custom_vcl_boilerplate: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. |
String
[Back to top] [Back to API list] [Back to README]
get_custom_vcl_generated(opts): <VclResponse> # Get the generated VCL for a service
Display the generated VCL for a particular service and version.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
}
begin
# Get the generated VCL for a service
result = api_instance.get_custom_vcl_generated(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->get_custom_vcl_generated: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. |
[Back to top] [Back to API list] [Back to README]
get_custom_vcl_generated_highlighted(opts): <VclSyntaxHighlightingResponse> # Get the generated VCL with syntax highlighting
Display the content of generated VCL with HTML syntax highlighting. Include line numbers by sending lineno=true
as a request parameter.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
}
begin
# Get the generated VCL with syntax highlighting
result = api_instance.get_custom_vcl_generated_highlighted(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->get_custom_vcl_generated_highlighted: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. |
[Back to top] [Back to API list] [Back to README]
get_custom_vcl_highlighted(opts): <VclSyntaxHighlightingResponse> # Get a custom VCL file with syntax highlighting
Get the uploaded VCL for a particular service and version with HTML syntax highlighting. Include line numbers by sending lineno=true
as a request parameter.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
vcl_name: 'vcl_name_example', # String | The name of this VCL.
}
begin
# Get a custom VCL file with syntax highlighting
result = api_instance.get_custom_vcl_highlighted(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->get_custom_vcl_highlighted: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. | |
vcl_name | String | The name of this VCL. |
[Back to top] [Back to API list] [Back to README]
get_custom_vcl_raw(opts): String # Download a custom VCL file
Download the specified VCL.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
vcl_name: 'vcl_name_example', # String | The name of this VCL.
}
begin
# Download a custom VCL file
result = api_instance.get_custom_vcl_raw(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->get_custom_vcl_raw: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. | |
vcl_name | String | The name of this VCL. |
String
[Back to top] [Back to API list] [Back to README]
lint_vcl_default(opts): <ValidatorResult> # Lint (validate) VCL using a default set of flags.
This endpoint validates the submitted VCL against a default set of enabled flags. Consider using the /service/{service_id}/lint
operation to validate VCL in the context of a specific service.
api_instance = Fastly::VclApi.new
opts = {
inline_object1: Fastly::InlineObject1.new({vcl: 'vcl_example'}), # InlineObject1 |
}
begin
# Lint (validate) VCL using a default set of flags.
result = api_instance.lint_vcl_default(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->lint_vcl_default: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
inline_object1 | InlineObject1 |
[Back to top] [Back to API list] [Back to README]
lint_vcl_for_service(opts): <ValidatorResult> # Lint (validate) VCL using flags set for the service.
Services may have flags set by a Fastly employee or by the purchase of products as addons to the service, which modify the way VCL is interpreted by that service. This endpoint validates the submitted VCL in the context of the specified service.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
inline_object: Fastly::InlineObject.new({vcl: 'vcl_example'}), # InlineObject |
}
begin
# Lint (validate) VCL using flags set for the service.
result = api_instance.lint_vcl_for_service(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->lint_vcl_for_service: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
inline_object | InlineObject |
[Back to top] [Back to API list] [Back to README]
list_custom_vcl(opts): <Array<VclResponse>> # List custom VCL files
List the uploaded VCLs for a particular service and version.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
}
begin
# List custom VCL files
result = api_instance.list_custom_vcl(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->list_custom_vcl: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. |
[Back to top] [Back to API list] [Back to README]
set_custom_vcl_main(opts): <VclResponse> # Set a custom VCL file as main
Set the specified VCL as the main.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
vcl_name: 'vcl_name_example', # String | The name of this VCL.
}
begin
# Set a custom VCL file as main
result = api_instance.set_custom_vcl_main(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->set_custom_vcl_main: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. | |
vcl_name | String | The name of this VCL. |
[Back to top] [Back to API list] [Back to README]
update_custom_vcl(opts): <VclResponse> # Update a custom VCL file
Update the uploaded VCL for a particular service and version.
api_instance = Fastly::VclApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
vcl_name: 'vcl_name_example', # String | The name of this VCL.
content: 'content_example', # String | The VCL code to be included.
main: true, # Boolean | Set to `true` when this is the main VCL, otherwise `false`.
name: 'name_example', # String | The name of this VCL.
}
begin
# Update a custom VCL file
result = api_instance.update_custom_vcl(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling VclApi->update_custom_vcl: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Integer | Integer identifying a service version. | |
vcl_name | String | The name of this VCL. | |
content | String | The VCL code to be included. | [optional] |
main | Boolean | Set to true when this is the main VCL, otherwise false . |
[optional] |
name | String | The name of this VCL. | [optional] |