Note
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| ComputeAclCreateAcls | POST /resources/acls |
Create a new ACL |
| ComputeAclDeleteSAclId | DELETE /resources/acls/{acl_id} |
Delete an ACL |
| ComputeAclListAclEntries | GET /resources/acls/{acl_id}/entries |
List an ACL |
| ComputeAclListAcls | GET /resources/acls |
List ACLs |
| ComputeAclListAclsSAclId | GET /resources/acls/{acl_id} |
Describe an ACL |
| ComputeAclLookupAcls | GET /resources/acls/{acl_id}/entry/{acl_ip} |
Lookup an ACL |
| ComputeAclUpdateAcls | PATCH /resources/acls/{acl_id}/entries |
Update an ACL |
Create a new ACL
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
computeAclCreateAclsRequest := *openapiclient.NewComputeAclCreateAclsRequest() // ComputeAclCreateAclsRequest | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AclsInComputeAPI.ComputeAclCreateAcls(ctx).ComputeAclCreateAclsRequest(computeAclCreateAclsRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AclsInComputeAPI.ComputeAclCreateAcls`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ComputeAclCreateAcls`: ComputeAclCreateAclsResponse
fmt.Fprintf(os.Stdout, "Response from `AclsInComputeAPI.ComputeAclCreateAcls`: %v\n", resp)
}Other parameters are passed through a pointer to a apiComputeAclCreateAclsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| computeAclCreateAclsRequest | ComputeAclCreateAclsRequest |
- Content-Type: application/json
- Accept: application/json
Back to top | Back to API list | Back to README
Delete an ACL
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
aclId := "aclId_example" // string |
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AclsInComputeAPI.ComputeAclDeleteSAclId(ctx, aclId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AclsInComputeAPI.ComputeAclDeleteSAclId`: %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. | |
| aclId | string |
Other parameters are passed through a pointer to a apiComputeAclDeleteSAclIdRequest 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
List an ACL
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
aclId := "aclId_example" // string |
cursor := "cursor_example" // string | (optional)
limit := int32(56) // int32 | (optional) (default to 100)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AclsInComputeAPI.ComputeAclListAclEntries(ctx, aclId).Cursor(cursor).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AclsInComputeAPI.ComputeAclListAclEntries`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ComputeAclListAclEntries`: ComputeAclListEntries
fmt.Fprintf(os.Stdout, "Response from `AclsInComputeAPI.ComputeAclListAclEntries`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| aclId | string |
Other parameters are passed through a pointer to a apiComputeAclListAclEntriesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| cursor | string | limit |
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
List ACLs
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.AclsInComputeAPI.ComputeAclListAcls(ctx).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AclsInComputeAPI.ComputeAclListAcls`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ComputeAclListAcls`: ComputeAclList
fmt.Fprintf(os.Stdout, "Response from `AclsInComputeAPI.ComputeAclListAcls`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiComputeAclListAclsRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
Back to top | Back to API list | Back to README
Describe an ACL
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
aclId := "aclId_example" // string |
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AclsInComputeAPI.ComputeAclListAclsSAclId(ctx, aclId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AclsInComputeAPI.ComputeAclListAclsSAclId`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ComputeAclListAclsSAclId`: ComputeAclCreateAclsResponse
fmt.Fprintf(os.Stdout, "Response from `AclsInComputeAPI.ComputeAclListAclsSAclId`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| aclId | string |
Other parameters are passed through a pointer to a apiComputeAclListAclsSAclIdRequest 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
Lookup an ACL
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
aclId := "aclId_example" // string |
aclIp := "aclIp_example" // string |
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AclsInComputeAPI.ComputeAclLookupAcls(ctx, aclId, aclIp).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AclsInComputeAPI.ComputeAclLookupAcls`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ComputeAclLookupAcls`: ComputeAclLookup
fmt.Fprintf(os.Stdout, "Response from `AclsInComputeAPI.ComputeAclLookupAcls`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| aclId | string | ||
| aclIp | string |
Other parameters are passed through a pointer to a apiComputeAclLookupAclsRequest 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 an ACL
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
aclId := "aclId_example" // string |
computeAclUpdate := *openapiclient.NewComputeAclUpdate() // ComputeAclUpdate | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AclsInComputeAPI.ComputeAclUpdateAcls(ctx, aclId).ComputeAclUpdate(computeAclUpdate).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AclsInComputeAPI.ComputeAclUpdateAcls`: %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. | |
| aclId | string |
Other parameters are passed through a pointer to a apiComputeAclUpdateAclsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| computeAclUpdate | ComputeAclUpdate |
(empty response body)
- Content-Type: application/json
- Accept: Not defined