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`: []ComputeACLCreateAclsResponse
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
[]ComputeACLCreateAclsResponse
- 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 |
computeACLUpdateEntry := []openapiclient.ComputeACLUpdateEntry{*openapiclient.NewComputeACLUpdateEntry()} // []ComputeACLUpdateEntry | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ACLsInComputeAPI.ComputeACLUpdateAcls(ctx, aclID).ComputeACLUpdateEntry(computeACLUpdateEntry).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 |
---|---|---|---|
computeACLUpdateEntry | []ComputeACLUpdateEntry |
(empty response body)
- Content-Type: application/json
- Accept: Not defined