Skip to content

Latest commit

 

History

History
271 lines (169 loc) · 7.67 KB

File metadata and controls

271 lines (169 loc) · 7.67 KB

ProductImageOptimizerAPI

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

DisableProductImageOptimizer

Disable product

Example

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)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
serviceId string Alphanumeric string identifying the service.

Other Parameters

Other parameters are passed through a pointer to a apiDisableProductImageOptimizerRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

Back to top | Back to API list | Back to README

EnableProductImageOptimizer

Enable product

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
serviceId string Alphanumeric string identifying the service.

Other Parameters

Other parameters are passed through a pointer to a apiEnableProductImageOptimizerRequest struct via the builder pattern

Name Type Description Notes

Return type

ImageOptimizerResponseBodyEnable

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Back to top | Back to API list | Back to README

GetProductImageOptimizer

Get product enablement status

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
serviceId string Alphanumeric string identifying the service.

Other Parameters

Other parameters are passed through a pointer to a apiGetProductImageOptimizerRequest struct via the builder pattern

Name Type Description Notes

Return type

ImageOptimizerResponseBodyEnable

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Back to top | Back to API list | Back to README

GetServicesProductImageOptimizer

Get services with product enabled

Example

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)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetServicesProductImageOptimizerRequest struct via the builder pattern

Return type

ImageOptimizerResponseBodyGetAllServices

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Back to top | Back to API list | Back to README