Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
AddServiceGroupServices | POST /service-groups/{service_group_id}/services |
Add services in a service group |
CreateAServiceGroup | POST /service-groups |
Create a service group |
DeleteAServiceGroup | DELETE /service-groups/{service_group_id} |
Delete a service group |
GetAServiceGroup | GET /service-groups/{service_group_id} |
Get a service group |
ListServiceGroupServices | GET /service-groups/{service_group_id}/services |
List services to a service group |
ListServiceGroups | GET /service-groups |
List service groups |
RemoveServiceGroupServices | DELETE /service-groups/{service_group_id}/services |
Remove services from a service group |
UpdateAServiceGroup | PATCH /service-groups/{service_group_id} |
Update a service group |
Add services in a service group
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.
requestBody := map[string]map[string]any{"key": map[string]any(123)} // map[string]map[string]any | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.IamServiceGroupsAPI.AddServiceGroupServices(ctx, serviceGroupID).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.AddServiceGroupServices`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AddServiceGroupServices`: map[string]any
fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.AddServiceGroupServices`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceGroupID | string | Alphanumeric string identifying the service group. |
Other parameters are passed through a pointer to a apiAddServiceGroupServicesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
requestBody | map[string]map[string]any |
map[string]any
- Content-Type: application/json
- Accept: application/json
Back to top | Back to API list | Back to README
Create a service group
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
requestBody := map[string]map[string]any{"key": map[string]any(123)} // map[string]map[string]any | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.IamServiceGroupsAPI.CreateAServiceGroup(ctx).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.CreateAServiceGroup`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateAServiceGroup`: map[string]any
fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.CreateAServiceGroup`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateAServiceGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
requestBody | map[string]map[string]any |
map[string]any
- Content-Type: application/json
- Accept: application/json
Back to top | Back to API list | Back to README
Delete a service group
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.IamServiceGroupsAPI.DeleteAServiceGroup(ctx, serviceGroupID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.DeleteAServiceGroup`: %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. | |
serviceGroupID | string | Alphanumeric string identifying the service group. |
Other parameters are passed through a pointer to a apiDeleteAServiceGroupRequest 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
Get a service group
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.IamServiceGroupsAPI.GetAServiceGroup(ctx, serviceGroupID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.GetAServiceGroup`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAServiceGroup`: map[string]any
fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.GetAServiceGroup`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceGroupID | string | Alphanumeric string identifying the service group. |
Other parameters are passed through a pointer to a apiGetAServiceGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
map[string]any
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
List services to a service group
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.
perPage := int32(20) // int32 | Number of records per page. (optional) (default to 20)
page := int32(1) // int32 | Current page. (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.IamServiceGroupsAPI.ListServiceGroupServices(ctx, serviceGroupID).PerPage(perPage).Page(page).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.ListServiceGroupServices`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListServiceGroupServices`: map[string]any
fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.ListServiceGroupServices`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceGroupID | string | Alphanumeric string identifying the service group. |
Other parameters are passed through a pointer to a apiListServiceGroupServicesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
perPage | int32 | Number of records per page. | [default to 20] page |
map[string]any
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
List service groups
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
perPage := int32(20) // int32 | Number of records per page. (optional) (default to 20)
page := int32(1) // int32 | Current page. (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.IamServiceGroupsAPI.ListServiceGroups(ctx).PerPage(perPage).Page(page).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.ListServiceGroups`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListServiceGroups`: map[string]any
fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.ListServiceGroups`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListServiceGroupsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
perPage | int32 | Number of records per page. | [default to 20] page |
map[string]any
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
Remove services from a service group
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.
requestBody := map[string]map[string]any{"key": map[string]any(123)} // map[string]map[string]any | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.IamServiceGroupsAPI.RemoveServiceGroupServices(ctx, serviceGroupID).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.RemoveServiceGroupServices`: %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. | |
serviceGroupID | string | Alphanumeric string identifying the service group. |
Other parameters are passed through a pointer to a apiRemoveServiceGroupServicesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
requestBody | map[string]map[string]any |
(empty response body)
- Content-Type: application/json
- Accept: Not defined
Back to top | Back to API list | Back to README
Update a service group
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceGroupID := "serviceGroupId_example" // string | Alphanumeric string identifying the service group.
requestBody := map[string]map[string]any{"key": map[string]any(123)} // map[string]map[string]any | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.IamServiceGroupsAPI.UpdateAServiceGroup(ctx, serviceGroupID).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IamServiceGroupsAPI.UpdateAServiceGroup`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateAServiceGroup`: map[string]any
fmt.Fprintf(os.Stdout, "Response from `IamServiceGroupsAPI.UpdateAServiceGroup`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceGroupID | string | Alphanumeric string identifying the service group. |
Other parameters are passed through a pointer to a apiUpdateAServiceGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
requestBody | map[string]map[string]any |
map[string]any
- Content-Type: application/json
- Accept: application/json