Skip to content

Latest commit

 

History

History
341 lines (254 loc) · 8.82 KB

ServiceApi.md

File metadata and controls

341 lines (254 loc) · 8.82 KB

Fastly::ServiceApi

require 'fastly'
api_instance = Fastly::ServiceApi.new

Methods

Note

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()

create_service(opts): <ServiceResponse> # Create a service

Create a service.

Examples

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

Options

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]

Return type

ServiceResponse

[Back to top] [Back to API list] [Back to README]

delete_service()

delete_service(opts): <InlineResponse200> # Delete a service

Delete a service.

Examples

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

Options

Name Type Description Notes
service_id String Alphanumeric string identifying the service.

Return type

InlineResponse200

[Back to top] [Back to API list] [Back to README]

get_service()

get_service(opts): <ServiceResponse> # Get a service

Get a specific service by id.

Examples

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

Options

Name Type Description Notes
service_id String Alphanumeric string identifying the service.

Return type

ServiceResponse

[Back to top] [Back to API list] [Back to README]

get_service_detail()

get_service_detail(opts): <ServiceDetail> # Get service details

List detailed information on a specified service.

Examples

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.
}

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

Options

Name Type Description Notes
service_id String Alphanumeric string identifying the service.
version Integer Number identifying a version of the service. [optional]

Return type

ServiceDetail

[Back to top] [Back to API list] [Back to README]

list_service_domains()

list_service_domains(opts): <Array<DomainResponse>> # List the domains within a service

List the domains within a service.

Examples

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

Options

Name Type Description Notes
service_id String Alphanumeric string identifying the service.

Return type

Array<DomainResponse>

[Back to top] [Back to API list] [Back to README]

list_services()

list_services(opts): <Array<ServiceListResponse>> # List services

List services.

Examples

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

Options

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']

Return type

Array<ServiceListResponse>

[Back to top] [Back to API list] [Back to README]

search_service()

search_service(opts): <ServiceResponse> # Search for a service by name

Get a specific service by name.

Examples

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

Options

Name Type Description Notes
name String The name of the service.

Return type

ServiceResponse

[Back to top] [Back to API list] [Back to README]

update_service()

update_service(opts): <ServiceResponse> # Update a service

Update a service.

Examples

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

Options

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]

Return type

ServiceResponse

[Back to top] [Back to API list] [Back to README]