Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
DisableProduct | DELETE /enabled-products/v1/{product_id}/services/{service_id} |
Disable a product |
EnableProduct | PUT /enabled-products/v1/{product_id}/services/{service_id} |
Enable a product |
GetEnabledProduct | GET /enabled-products/v1/{product_id}/services/{service_id} |
Get enabled product |
GetProductConfiguration | GET /enabled-products/v1/{product_id}/services/{service_id}/configuration |
Get configuration for a product |
SetProductConfiguration | PATCH /enabled-products/v1/{product_id}/services/{service_id}/configuration |
Update configuration for a product |
Disable a product
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
productID := "ngwaf" // string |
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.EnabledProductsAPI.DisableProduct(ctx, productID, serviceID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnabledProductsAPI.DisableProduct`: %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. | |
productID | string | ||
serviceID | string | Alphanumeric string identifying the service. |
Other parameters are passed through a pointer to a apiDisableProductRequest 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 a product
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
productID := "ngwaf" // string |
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
setWorkspaceID := *openapiclient.NewSetWorkspaceID() // SetWorkspaceID | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.EnabledProductsAPI.EnableProduct(ctx, productID, serviceID).SetWorkspaceID(setWorkspaceID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnabledProductsAPI.EnableProduct`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `EnableProduct`: EnabledProductResponse
fmt.Fprintf(os.Stdout, "Response from `EnabledProductsAPI.EnableProduct`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
productID | string | ||
serviceID | string | Alphanumeric string identifying the service. |
Other parameters are passed through a pointer to a apiEnableProductRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
setWorkspaceID | SetWorkspaceID |
- Content-Type: application/json
- Accept: application/json
Back to top | Back to API list | Back to README
Get enabled product
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
productID := "ngwaf" // string |
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.EnabledProductsAPI.GetEnabledProduct(ctx, productID, serviceID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnabledProductsAPI.GetEnabledProduct`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetEnabledProduct`: EnabledProductResponse
fmt.Fprintf(os.Stdout, "Response from `EnabledProductsAPI.GetEnabledProduct`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
productID | string | ||
serviceID | string | Alphanumeric string identifying the service. |
Other parameters are passed through a pointer to a apiGetEnabledProductRequest 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
Get configuration for a product
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
productID := "ngwaf" // string |
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.EnabledProductsAPI.GetProductConfiguration(ctx, productID, serviceID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnabledProductsAPI.GetProductConfiguration`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetProductConfiguration`: ConfiguredProductResponse
fmt.Fprintf(os.Stdout, "Response from `EnabledProductsAPI.GetProductConfiguration`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
productID | string | ||
serviceID | string | Alphanumeric string identifying the service. |
Other parameters are passed through a pointer to a apiGetProductConfigurationRequest 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 configuration for a product
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
productID := "ngwaf" // string |
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
setConfiguration := *openapiclient.NewSetConfiguration() // SetConfiguration | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.EnabledProductsAPI.SetProductConfiguration(ctx, productID, serviceID).SetConfiguration(setConfiguration).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnabledProductsAPI.SetProductConfiguration`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SetProductConfiguration`: ConfiguredProductResponse
fmt.Fprintf(os.Stdout, "Response from `EnabledProductsAPI.SetProductConfiguration`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
productID | string | ||
serviceID | string | Alphanumeric string identifying the service. |
Other parameters are passed through a pointer to a apiSetProductConfigurationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
setConfiguration | SetConfiguration |
- Content-Type: application/json
- Accept: application/json