require 'fastly'
api_instance = Fastly::ServiceApi.newNote
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| create_service | POST /service | Create a service |
| delete_service | DELETE /service/{service_id} | Delete a service |
| get_service | GET /service/{service_id} | Get a service |
| get_service_detail | GET /service/{service_id}/details | Get service details |
| list_service_domains | GET /service/{service_id}/domain | List the domains within a service |
| list_services | GET /service | List services |
| search_service | GET /service/search | Search for a service by name |
| update_service | PUT /service/{service_id} | Update a service |
create_service(opts): <ServiceResponse> # Create a serviceCreate a service.
api_instance = Fastly::ServiceApi.new
opts = {
comment: 'comment_example', # String | A freeform descriptive note.
name: 'name_example', # String | The name of the service.
customer_id: 'customer_id_example', # String | Alphanumeric string identifying the customer.
type: 'vcl', # String | The type of this service.
}
begin
# Create a service
result = api_instance.create_service(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ServiceApi->create_service: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| comment | String | A freeform descriptive note. | [optional] |
| name | String | The name of the service. | [optional] |
| customer_id | String | Alphanumeric string identifying the customer. | [optional] |
| type | String | The type of this service. | [optional] |
[Back to top] [Back to API list] [Back to README]
delete_service(opts): <InlineResponse200> # Delete a serviceDelete a service.
api_instance = Fastly::ServiceApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
}
begin
# Delete a service
result = api_instance.delete_service(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ServiceApi->delete_service: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. |
[Back to top] [Back to API list] [Back to README]
get_service(opts): <ServiceResponse> # Get a serviceGet a specific service by id.
api_instance = Fastly::ServiceApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
}
begin
# Get a service
result = api_instance.get_service(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ServiceApi->get_service: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. |
[Back to top] [Back to API list] [Back to README]
get_service_detail(opts): <ServiceDetail> # Get service detailsList detailed information on a specified service.
api_instance = Fastly::ServiceApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version: 56, # Integer | Number identifying a version of the service.
filter_versions_active: true, # Boolean | Limits the versions array to the active versions. Accepts `true` or `false` (defaults to false).
}
begin
# Get service details
result = api_instance.get_service_detail(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ServiceApi->get_service_detail: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| version | Integer | Number identifying a version of the service. | [optional] |
| filter_versions_active | Boolean | Limits the versions array to the active versions. Accepts true or false (defaults to false). |
[optional] |
[Back to top] [Back to API list] [Back to README]
list_service_domains(opts): <Array<DomainResponse>> # List the domains within a serviceList the domains within a service.
api_instance = Fastly::ServiceApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
}
begin
# List the domains within a service
result = api_instance.list_service_domains(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ServiceApi->list_service_domains: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. |
[Back to top] [Back to API list] [Back to README]
list_services(opts): <Array<ServiceListResponse>> # List servicesList services.
api_instance = Fastly::ServiceApi.new
opts = {
page: 1, # Integer | Current page.
per_page: 20, # Integer | Number of records per page.
sort: 'created', # String | Field on which to sort.
direction: 'ascend', # String | Direction in which to sort results.
}
begin
# List services
result = api_instance.list_services(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ServiceApi->list_services: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| page | Integer | Current page. | [optional] |
| per_page | Integer | Number of records per page. | [optional][default to 20] |
| sort | String | Field on which to sort. | [optional][default to 'created'] |
| direction | String | Direction in which to sort results. | [optional][default to 'ascend'] |
[Back to top] [Back to API list] [Back to README]
search_service(opts): <ServiceResponse> # Search for a service by nameGet a specific service by name.
api_instance = Fastly::ServiceApi.new
opts = {
name: 'name_example', # String | The name of the service.
}
begin
# Search for a service by name
result = api_instance.search_service(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ServiceApi->search_service: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | The name of the service. |
[Back to top] [Back to API list] [Back to README]
update_service(opts): <ServiceResponse> # Update a serviceUpdate a service.
api_instance = Fastly::ServiceApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
comment: 'comment_example', # String | A freeform descriptive note.
name: 'name_example', # String | The name of the service.
customer_id: 'customer_id_example', # String | Alphanumeric string identifying the customer.
}
begin
# Update a service
result = api_instance.update_service(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ServiceApi->update_service: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| comment | String | A freeform descriptive note. | [optional] |
| name | String | The name of the service. | [optional] |
| customer_id | String | Alphanumeric string identifying the customer. | [optional] |