require 'fastly'
api_instance = Fastly::ResourceApi.newNote
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| create_resource | POST /service/{service_id}/version/{version_id}/resource | Create a resource link |
| delete_resource | DELETE /service/{service_id}/version/{version_id}/resource/{id} | Delete a resource link |
| get_resource | GET /service/{service_id}/version/{version_id}/resource/{id} | Display a resource link |
| list_resources | GET /service/{service_id}/version/{version_id}/resource | List resource links |
| update_resource | PUT /service/{service_id}/version/{version_id}/resource/{id} | Update a resource link |
create_resource(opts): <ResourceResponse> # Create a resource linkCreate a link between a resource and a service version.
api_instance = Fastly::ResourceApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
resource_id: 'resource_id_example', # String | The ID of the underlying linked resource.
name: 'name_example', # String | The name of the resource link. Note this is separate from the resource store name and might not match the store name.
}
begin
# Create a resource link
result = api_instance.create_resource(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ResourceApi->create_resource: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| version_id | Integer | Integer identifying a service version. | |
| resource_id | String | The ID of the underlying linked resource. | [optional] |
| name | String | The name of the resource link. Note this is separate from the resource store name and might not match the store name. | [optional] |
[Back to top] [Back to API list] [Back to README]
delete_resource(opts): <InlineResponse200> # Delete a resource linkDelete a link between a resource and a service version.
api_instance = Fastly::ResourceApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
id: 'id_example', # String | An alphanumeric string identifying the resource link.
}
begin
# Delete a resource link
result = api_instance.delete_resource(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ResourceApi->delete_resource: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| version_id | Integer | Integer identifying a service version. | |
| id | String | An alphanumeric string identifying the resource link. |
[Back to top] [Back to API list] [Back to README]
get_resource(opts): <ResourceResponse> # Display a resource linkDisplay a resource link by its identifier.
api_instance = Fastly::ResourceApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
id: 'id_example', # String | An alphanumeric string identifying the resource link.
}
begin
# Display a resource link
result = api_instance.get_resource(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ResourceApi->get_resource: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| version_id | Integer | Integer identifying a service version. | |
| id | String | An alphanumeric string identifying the resource link. |
[Back to top] [Back to API list] [Back to README]
list_resources(opts): <Array<ResourceResponse>> # List resource linksList links between resources and services
api_instance = Fastly::ResourceApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
}
begin
# List resource links
result = api_instance.list_resources(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ResourceApi->list_resources: #{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]
update_resource(opts): <ResourceResponse> # Update a resource linkUpdate a link between a resource and a service version.
api_instance = Fastly::ResourceApi.new
opts = {
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
version_id: 56, # Integer | Integer identifying a service version.
id: 'id_example', # String | An alphanumeric string identifying the resource link.
resource_id: 'resource_id_example', # String | The ID of the underlying linked resource.
name: 'name_example', # String | The name of the resource link. Note this is separate from the resource store name and might not match the store name.
}
begin
# Update a resource link
result = api_instance.update_resource(opts)
p result
rescue Fastly::ApiError => e
puts "Error when calling ResourceApi->update_resource: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| service_id | String | Alphanumeric string identifying the service. | |
| version_id | Integer | Integer identifying a service version. | |
| id | String | An alphanumeric string identifying the resource link. | |
| resource_id | String | The ID of the underlying linked resource. | [optional] |
| name | String | The name of the resource link. Note this is separate from the resource store name and might not match the store name. | [optional] |