Note
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| CreateResource | POST /service/{service_id}/version/{version_id}/resource |
Create a resource link |
| DeleteResource | DELETE /service/{service_id}/version/{version_id}/resource/{id} |
Delete a resource link |
| GetResource | GET /service/{service_id}/version/{version_id}/resource/{id} |
Display a resource link |
| ListResources | GET /service/{service_id}/version/{version_id}/resource |
List resource links |
| UpdateResource | PUT /service/{service_id}/version/{version_id}/resource/{id} |
Update a resource link |
Create a resource link
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.
versionId := int32(56) // int32 | Integer identifying a service version.
resourceId := "resourceId_example" // string | The ID of the underlying linked resource. (optional)
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. (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ResourceAPI.CreateResource(ctx, serviceId, versionId).ResourceId(resourceId).Name(name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ResourceAPI.CreateResource`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateResource`: ResourceResponse
fmt.Fprintf(os.Stdout, "Response from `ResourceAPI.CreateResource`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| serviceId | string | Alphanumeric string identifying the service. | |
| versionId | int32 | Integer identifying a service version. |
Other parameters are passed through a pointer to a apiCreateResourceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| resourceId | string | The ID of the underlying linked resource. | name |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Back to top | Back to API list | Back to README
Delete a resource link
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.
versionId := int32(56) // int32 | Integer identifying a service version.
id := "id_example" // string | An alphanumeric string identifying the resource link.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ResourceAPI.DeleteResource(ctx, serviceId, versionId, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ResourceAPI.DeleteResource`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteResource`: InlineResponse200
fmt.Fprintf(os.Stdout, "Response from `ResourceAPI.DeleteResource`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| serviceId | string | Alphanumeric string identifying the service. | |
| versionId | int32 | Integer identifying a service version. | |
| id | string | An alphanumeric string identifying the resource link. |
Other parameters are passed through a pointer to a apiDeleteResourceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
Display a resource link
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.
versionId := int32(56) // int32 | Integer identifying a service version.
id := "id_example" // string | An alphanumeric string identifying the resource link.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ResourceAPI.GetResource(ctx, serviceId, versionId, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ResourceAPI.GetResource`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetResource`: ResourceResponse
fmt.Fprintf(os.Stdout, "Response from `ResourceAPI.GetResource`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| serviceId | string | Alphanumeric string identifying the service. | |
| versionId | int32 | Integer identifying a service version. | |
| id | string | An alphanumeric string identifying the resource link. |
Other parameters are passed through a pointer to a apiGetResourceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
List resource links
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.
versionId := int32(56) // int32 | Integer identifying a service version.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ResourceAPI.ListResources(ctx, serviceId, versionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ResourceAPI.ListResources`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListResources`: []ResourceResponse
fmt.Fprintf(os.Stdout, "Response from `ResourceAPI.ListResources`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| serviceId | string | Alphanumeric string identifying the service. | |
| versionId | int32 | Integer identifying a service version. |
Other parameters are passed through a pointer to a apiListResourcesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
Update a resource link
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.
versionId := int32(56) // int32 | Integer identifying a service version.
id := "id_example" // string | An alphanumeric string identifying the resource link.
resourceId := "resourceId_example" // string | The ID of the underlying linked resource. (optional)
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. (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ResourceAPI.UpdateResource(ctx, serviceId, versionId, id).ResourceId(resourceId).Name(name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ResourceAPI.UpdateResource`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateResource`: ResourceResponse
fmt.Fprintf(os.Stdout, "Response from `ResourceAPI.UpdateResource`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| serviceId | string | Alphanumeric string identifying the service. | |
| versionId | int32 | Integer identifying a service version. | |
| id | string | An alphanumeric string identifying the resource link. |
Other parameters are passed through a pointer to a apiUpdateResourceRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| resourceId | string | The ID of the underlying linked resource. | name |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json