const apiInstance = new Fastly.ServiceApi();
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({ , [comment, ][name, ][customer_id, ][type] })
Create a service.
const options = {
comment: "comment_example",
name: "name_example",
customer_id: "customer_id_example",
type: "vcl",
};
apiInstance.createService(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
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"] |
deleteService({ service_id })
Delete a service.
const options = {
service_id: "service_id_example", // required
};
apiInstance.deleteService(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. |
getService({ service_id })
Get a specific service by id.
const options = {
service_id: "service_id_example", // required
};
apiInstance.getService(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. |
getServiceDetail({ service_id, [version] })
List detailed information on a specified service.
const options = {
service_id: "service_id_example", // required
version: 56,
};
apiInstance.getServiceDetail(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version | Number | Number identifying a version of the service. | [optional] |
listServiceDomains({ service_id })
List the domains within a service.
const options = {
service_id: "service_id_example", // required
};
apiInstance.listServiceDomains(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. |
listServices({ , [page, ][per_page, ][sort, ][direction] })
List services.
const options = {
page: 1,
per_page: 20,
sort: created,
direction: "ascend",
};
apiInstance.listServices(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
page | Number | Current page. | [optional] |
per_page | Number | 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"] |
searchService({ name })
Get a specific service by name.
const options = {
name: "name_example", // required
};
apiInstance.searchService(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
name | String | The name of the service. |
updateService({ service_id, [comment, ][name, ][customer_id] })
Update a service.
const options = {
service_id: "service_id_example", // required
comment: "comment_example",
name: "name_example",
customer_id: "customer_id_example",
};
apiInstance.updateService(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
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] |