$apiInstance = new Fastly\Api\ServiceApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);Note
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| createService() | POST /service | Create a service |
| deleteService() | DELETE /service/{service_id} | Delete a service |
| getService() | GET /service/{service_id} | Get a service |
| getServiceDetail() | GET /service/{service_id}/details | Get service details |
| listServiceDomains() | GET /service/{service_id}/domain | List the domains within a service |
| listServices() | GET /service | List services |
| searchService() | GET /service/search | Search for a service by name |
| updateService() | PUT /service/{service_id} | Update a service |
createService($options): \Fastly\Model\ServiceResponse // Create a serviceCreate a service.
$options['comment'] = 'comment_example'; // string | A freeform descriptive note.
$options['name'] = 'name_example'; // string | The name of the service.
$options['customer_id'] = 'customer_id_example'; // string | Alphanumeric string identifying the customer.
$options['type'] = 'type_example'; // string | The type of this service.
try {
$result = $apiInstance->createService($options);
} catch (Exception $e) {
echo 'Exception when calling ServiceApi->createService: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| 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] [one of: 'vcl', 'wasm'] |
[Back to top] [Back to API list] [Back to README]
deleteService($options): \Fastly\Model\InlineResponse200 // Delete a serviceDelete a service.
$options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service.
try {
$result = $apiInstance->deleteService($options);
} catch (Exception $e) {
echo 'Exception when calling ServiceApi->deleteService: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | string | Alphanumeric string identifying the service. |
\Fastly\Model\InlineResponse200
[Back to top] [Back to API list] [Back to README]
getService($options): \Fastly\Model\ServiceResponse // Get a serviceGet a specific service by id.
$options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service.
try {
$result = $apiInstance->getService($options);
} catch (Exception $e) {
echo 'Exception when calling ServiceApi->getService: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | string | Alphanumeric string identifying the service. |
[Back to top] [Back to API list] [Back to README]
getServiceDetail($options): \Fastly\Model\ServiceDetail // Get service detailsList detailed information on a specified service.
$options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service.
$options['version'] = 56; // int | Number identifying a version of the service.
$options['filter_versions_active'] = True; // bool | Limits the versions array to the active versions. Accepts `true` or `false` (defaults to false).
try {
$result = $apiInstance->getServiceDetail($options);
} catch (Exception $e) {
echo 'Exception when calling ServiceApi->getServiceDetail: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | string | Alphanumeric string identifying the service. | |
| version | int | Number identifying a version of the service. | [optional] |
| filter_versions_active | bool | 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]
listServiceDomains($options): \Fastly\Model\DomainResponse[] // List the domains within a serviceList the domains within a service.
$options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service.
try {
$result = $apiInstance->listServiceDomains($options);
} catch (Exception $e) {
echo 'Exception when calling ServiceApi->listServiceDomains: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | string | Alphanumeric string identifying the service. |
\Fastly\Model\DomainResponse[]
[Back to top] [Back to API list] [Back to README]
listServices($options): \Fastly\Model\ServiceListResponse[] // List servicesList services.
$options['page'] = 1; // int | Current page.
$options['per_page'] = 20; // int | Number of records per page.
$options['sort'] = created; // string | Field on which to sort.
$options['direction'] = ascend; // string | Direction in which to sort results.
try {
$result = $apiInstance->listServices($options);
} catch (Exception $e) {
echo 'Exception when calling ServiceApi->listServices: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| page | int | Current page. | [optional] |
| per_page | int | Number of records per page. | [optional] [defaults to 20] |
| sort | string | Field on which to sort. | [optional] [defaults to 'created'] |
| direction | string | Direction in which to sort results. | [optional] [one of: 'ascend', 'descend'] [defaults to 'ascend'] |
\Fastly\Model\ServiceListResponse[]
[Back to top] [Back to API list] [Back to README]
searchService($options): \Fastly\Model\ServiceResponse // Search for a service by nameGet a specific service by name.
$options['name'] = 'name_example'; // string | The name of the service.
try {
$result = $apiInstance->searchService($options);
} catch (Exception $e) {
echo 'Exception when calling ServiceApi->searchService: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| name | string | The name of the service. |
[Back to top] [Back to API list] [Back to README]
updateService($options): \Fastly\Model\ServiceResponse // Update a serviceUpdate a service.
$options['service_id'] = 'service_id_example'; // string | Alphanumeric string identifying the service.
$options['comment'] = 'comment_example'; // string | A freeform descriptive note.
$options['name'] = 'name_example'; // string | The name of the service.
$options['customer_id'] = 'customer_id_example'; // string | Alphanumeric string identifying the customer.
try {
$result = $apiInstance->updateService($options);
} catch (Exception $e) {
echo 'Exception when calling ServiceApi->updateService: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| 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] |