Note
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| CreateAutomationToken | POST /automation-tokens |
Create Automation Token |
| GetAutomationTokenId | GET /automation-tokens/{id} |
Retrieve an Automation Token by ID |
| GetAutomationTokensIdServices | GET /automation-tokens/{id}/services |
List Automation Token Services |
| ListAutomationTokens | GET /automation-tokens |
List Customer Automation Tokens |
| RevokeAutomationTokenId | DELETE /automation-tokens/{id} |
Revoke an Automation Token by ID |
Create Automation Token
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
automationTokenCreateRequest := *openapiclient.NewAutomationTokenCreateRequest() // AutomationTokenCreateRequest | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AutomationTokensAPI.CreateAutomationToken(ctx).AutomationTokenCreateRequest(automationTokenCreateRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AutomationTokensAPI.CreateAutomationToken`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateAutomationToken`: AutomationTokenCreateResponse
fmt.Fprintf(os.Stdout, "Response from `AutomationTokensAPI.CreateAutomationToken`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateAutomationTokenRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| automationTokenCreateRequest | AutomationTokenCreateRequest |
- Content-Type: application/json
- Accept: application/json
Back to top | Back to API list | Back to README
Retrieve an Automation Token by ID
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
id := "id_example" // string |
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AutomationTokensAPI.GetAutomationTokenId(ctx, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AutomationTokensAPI.GetAutomationTokenId`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAutomationTokenId`: AutomationTokenResponse
fmt.Fprintf(os.Stdout, "Response from `AutomationTokensAPI.GetAutomationTokenId`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string |
Other parameters are passed through a pointer to a apiGetAutomationTokenIdRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json, application/problem+json
Back to top | Back to API list | Back to README
List Automation Token Services
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
id := "id_example" // string |
perPage := int32(56) // int32 | (optional)
page := int32(56) // int32 | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AutomationTokensAPI.GetAutomationTokensIdServices(ctx, id).PerPage(perPage).Page(page).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AutomationTokensAPI.GetAutomationTokensIdServices`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAutomationTokensIdServices`: InlineResponse2004
fmt.Fprintf(os.Stdout, "Response from `AutomationTokensAPI.GetAutomationTokensIdServices`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string |
Other parameters are passed through a pointer to a apiGetAutomationTokensIdServicesRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| perPage | int32 | page |
- Content-Type: Not defined
- Accept: application/json, application/problem+json
Back to top | Back to API list | Back to README
List Customer Automation Tokens
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
perPage := int32(56) // int32 | (optional)
page := int32(56) // int32 | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AutomationTokensAPI.ListAutomationTokens(ctx).PerPage(perPage).Page(page).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AutomationTokensAPI.ListAutomationTokens`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListAutomationTokens`: []AutomationTokenResponse
fmt.Fprintf(os.Stdout, "Response from `AutomationTokensAPI.ListAutomationTokens`: %v\n", resp)
}Other parameters are passed through a pointer to a apiListAutomationTokensRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| perPage | int32 | page |
- Content-Type: Not defined
- Accept: application/json, application/problem+json
Back to top | Back to API list | Back to README
Revoke an Automation Token by ID
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
id := "id_example" // string |
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.AutomationTokensAPI.RevokeAutomationTokenId(ctx, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AutomationTokensAPI.RevokeAutomationTokenId`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RevokeAutomationTokenId`: AutomationTokenErrorResponse
fmt.Fprintf(os.Stdout, "Response from `AutomationTokensAPI.RevokeAutomationTokenId`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string |
Other parameters are passed through a pointer to a apiRevokeAutomationTokenIdRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json, application/problem+json