Note
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| DisableProductImageOptimizer | DELETE /enabled-products/v1/image_optimizer/services/{service_id} |
Disable product |
| EnableProductImageOptimizer | PUT /enabled-products/v1/image_optimizer/services/{service_id} |
Enable product |
| GetProductImageOptimizer | GET /enabled-products/v1/image_optimizer/services/{service_id} |
Get product enablement status |
| GetServicesProductImageOptimizer | GET /enabled-products/v1/image_optimizer/services |
Get services with product enabled |
Disable product
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ProductImageOptimizerAPI.DisableProductImageOptimizer(ctx, serviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProductImageOptimizerAPI.DisableProductImageOptimizer`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| serviceId | string | Alphanumeric string identifying the service. |
Other parameters are passed through a pointer to a apiDisableProductImageOptimizerRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
Back to top | Back to API list | Back to README
Enable product
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ProductImageOptimizerAPI.EnableProductImageOptimizer(ctx, serviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProductImageOptimizerAPI.EnableProductImageOptimizer`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `EnableProductImageOptimizer`: ImageOptimizerResponseBodyEnable
fmt.Fprintf(os.Stdout, "Response from `ProductImageOptimizerAPI.EnableProductImageOptimizer`: %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. |
Other parameters are passed through a pointer to a apiEnableProductImageOptimizerRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
ImageOptimizerResponseBodyEnable
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
Get product enablement status
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ProductImageOptimizerAPI.GetProductImageOptimizer(ctx, serviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProductImageOptimizerAPI.GetProductImageOptimizer`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetProductImageOptimizer`: ImageOptimizerResponseBodyEnable
fmt.Fprintf(os.Stdout, "Response from `ProductImageOptimizerAPI.GetProductImageOptimizer`: %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. |
Other parameters are passed through a pointer to a apiGetProductImageOptimizerRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
ImageOptimizerResponseBodyEnable
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
Get services with product enabled
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ProductImageOptimizerAPI.GetServicesProductImageOptimizer(ctx).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProductImageOptimizerAPI.GetServicesProductImageOptimizer`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetServicesProductImageOptimizer`: ImageOptimizerResponseBodyGetAllServices
fmt.Fprintf(os.Stdout, "Response from `ProductImageOptimizerAPI.GetServicesProductImageOptimizer`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetServicesProductImageOptimizerRequest struct via the builder pattern
ImageOptimizerResponseBodyGetAllServices
- Content-Type: Not defined
- Accept: application/json