Note
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| CreateAccessKey | POST /resources/object-storage/access-keys |
Create an access key |
| DeleteAccessKey | DELETE /resources/object-storage/access-keys/{access_key} |
Delete an access key |
| GetAccessKey | GET /resources/object-storage/access-keys/{access_key} |
Get an access key |
| ListAccessKeys | GET /resources/object-storage/access-keys |
List access keys |
Create an access key
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
accessKey := *openapiclient.NewAccessKey("Description_example", "Permission_example") // AccessKey | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ObjectStorageAccessKeysAPI.CreateAccessKey(ctx).AccessKey(accessKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ObjectStorageAccessKeysAPI.CreateAccessKey`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateAccessKey`: AccessKeyResponse
fmt.Fprintf(os.Stdout, "Response from `ObjectStorageAccessKeysAPI.CreateAccessKey`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateAccessKeyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| accessKey | AccessKey |
- Content-Type: application/json
- Accept: application/json
Back to top | Back to API list | Back to README
Delete an access key
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
accessKey := "accessKey_example" // string |
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ObjectStorageAccessKeysAPI.DeleteAccessKey(ctx, accessKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ObjectStorageAccessKeysAPI.DeleteAccessKey`: %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. | |
| accessKey | string |
Other parameters are passed through a pointer to a apiDeleteAccessKeyRequest 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 an access key
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
accessKey := "accessKey_example" // string |
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ObjectStorageAccessKeysAPI.GetAccessKey(ctx, accessKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ObjectStorageAccessKeysAPI.GetAccessKey`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAccessKey`: AccessKey
fmt.Fprintf(os.Stdout, "Response from `ObjectStorageAccessKeysAPI.GetAccessKey`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| accessKey | string |
Other parameters are passed through a pointer to a apiGetAccessKeyRequest 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
List access keys
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.ObjectStorageAccessKeysAPI.ListAccessKeys(ctx).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ObjectStorageAccessKeysAPI.ListAccessKeys`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListAccessKeys`: AccessKeyResponse
fmt.Fprintf(os.Stdout, "Response from `ObjectStorageAccessKeysAPI.ListAccessKeys`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListAccessKeysRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json