Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
CreateLogCloudfiles | POST /service/{service_id}/version/{version_id}/logging/cloudfiles |
Create a Cloud Files log endpoint |
DeleteLogCloudfiles | DELETE /service/{service_id}/version/{version_id}/logging/cloudfiles/{logging_cloudfiles_name} |
Delete the Cloud Files log endpoint |
GetLogCloudfiles | GET /service/{service_id}/version/{version_id}/logging/cloudfiles/{logging_cloudfiles_name} |
Get a Cloud Files log endpoint |
ListLogCloudfiles | GET /service/{service_id}/version/{version_id}/logging/cloudfiles |
List Cloud Files log endpoints |
UpdateLogCloudfiles | PUT /service/{service_id}/version/{version_id}/logging/cloudfiles/{logging_cloudfiles_name} |
Update the Cloud Files log endpoint |
Create a Cloud Files log endpoint
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
versionID := int32(56) // int32 | Integer identifying a service version.
name := "name_example" // string | The name for the real-time logging configuration. (optional)
placement := "placement_example" // string | Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. (optional)
responseCondition := "responseCondition_example" // string | The name of an existing condition in the configured endpoint, or leave blank to always execute. (optional)
format := "format_example" // string | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (optional) (default to "%h %l %u %t \"%r\" %>s %b")
formatVersion := int32(56) // int32 | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (optional) (default to 2)
messageType := "messageType_example" // string | How the message should be formatted. (optional) (default to "classic")
timestampFormat := "timestampFormat_example" // string | A timestamp format (optional)
compressionCodec := "compressionCodec_example" // string | The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional)
period := int32(56) // int32 | How frequently log files are finalized so they can be available for reading (in seconds). (optional) (default to 3600)
gzipLevel := int32(56) // int32 | The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional) (default to 0)
accessKey := "accessKey_example" // string | Your Cloud Files account access key. (optional)
bucketName := "bucketName_example" // string | The name of your Cloud Files container. (optional)
path := "path_example" // string | The path to upload logs to. (optional) (default to "null")
region := "region_example" // string | The region to stream logs to. (optional)
publicKey := "publicKey_example" // string | A PGP public key that Fastly will use to encrypt your log files before writing them to disk. (optional) (default to "null")
user := "user_example" // string | The username for your Cloud Files account. (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.LoggingCloudfilesAPI.CreateLogCloudfiles(ctx, serviceID, versionID).Name(name).Placement(placement).ResponseCondition(responseCondition).Format(format).FormatVersion(formatVersion).MessageType(messageType).TimestampFormat(timestampFormat).CompressionCodec(compressionCodec).Period(period).GzipLevel(gzipLevel).AccessKey(accessKey).BucketName(bucketName).Path(path).Region(region).PublicKey(publicKey).User(user).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LoggingCloudfilesAPI.CreateLogCloudfiles`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateLogCloudfiles`: LoggingCloudfilesResponse
fmt.Fprintf(os.Stdout, "Response from `LoggingCloudfilesAPI.CreateLogCloudfiles`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceID | string | Alphanumeric string identifying the service. | |
versionID | int32 | Integer identifying a service version. |
Other parameters are passed through a pointer to a apiCreateLogCloudfilesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
name | string | The name for the real-time logging configuration. | placement |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json
Back to top | Back to API list | Back to README
Delete the Cloud Files log endpoint
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
versionID := int32(56) // int32 | Integer identifying a service version.
loggingCloudfilesName := "loggingCloudfilesName_example" // string | The name for the real-time logging configuration.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.LoggingCloudfilesAPI.DeleteLogCloudfiles(ctx, serviceID, versionID, loggingCloudfilesName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LoggingCloudfilesAPI.DeleteLogCloudfiles`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteLogCloudfiles`: InlineResponse200
fmt.Fprintf(os.Stdout, "Response from `LoggingCloudfilesAPI.DeleteLogCloudfiles`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceID | string | Alphanumeric string identifying the service. | |
versionID | int32 | Integer identifying a service version. | |
loggingCloudfilesName | string | The name for the real-time logging configuration. |
Other parameters are passed through a pointer to a apiDeleteLogCloudfilesRequest 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
Get a Cloud Files log endpoint
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
versionID := int32(56) // int32 | Integer identifying a service version.
loggingCloudfilesName := "loggingCloudfilesName_example" // string | The name for the real-time logging configuration.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.LoggingCloudfilesAPI.GetLogCloudfiles(ctx, serviceID, versionID, loggingCloudfilesName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LoggingCloudfilesAPI.GetLogCloudfiles`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLogCloudfiles`: LoggingCloudfilesResponse
fmt.Fprintf(os.Stdout, "Response from `LoggingCloudfilesAPI.GetLogCloudfiles`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceID | string | Alphanumeric string identifying the service. | |
versionID | int32 | Integer identifying a service version. | |
loggingCloudfilesName | string | The name for the real-time logging configuration. |
Other parameters are passed through a pointer to a apiGetLogCloudfilesRequest 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 Cloud Files log endpoints
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
versionID := int32(56) // int32 | Integer identifying a service version.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.LoggingCloudfilesAPI.ListLogCloudfiles(ctx, serviceID, versionID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LoggingCloudfilesAPI.ListLogCloudfiles`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListLogCloudfiles`: []LoggingCloudfilesResponse
fmt.Fprintf(os.Stdout, "Response from `LoggingCloudfilesAPI.ListLogCloudfiles`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceID | string | Alphanumeric string identifying the service. | |
versionID | int32 | Integer identifying a service version. |
Other parameters are passed through a pointer to a apiListLogCloudfilesRequest 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 the Cloud Files log endpoint
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceID := "serviceId_example" // string | Alphanumeric string identifying the service.
versionID := int32(56) // int32 | Integer identifying a service version.
loggingCloudfilesName := "loggingCloudfilesName_example" // string | The name for the real-time logging configuration.
name := "name_example" // string | The name for the real-time logging configuration. (optional)
placement := "placement_example" // string | Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. (optional)
responseCondition := "responseCondition_example" // string | The name of an existing condition in the configured endpoint, or leave blank to always execute. (optional)
format := "format_example" // string | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (optional) (default to "%h %l %u %t \"%r\" %>s %b")
formatVersion := int32(56) // int32 | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (optional) (default to 2)
messageType := "messageType_example" // string | How the message should be formatted. (optional) (default to "classic")
timestampFormat := "timestampFormat_example" // string | A timestamp format (optional)
compressionCodec := "compressionCodec_example" // string | The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional)
period := int32(56) // int32 | How frequently log files are finalized so they can be available for reading (in seconds). (optional) (default to 3600)
gzipLevel := int32(56) // int32 | The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional) (default to 0)
accessKey := "accessKey_example" // string | Your Cloud Files account access key. (optional)
bucketName := "bucketName_example" // string | The name of your Cloud Files container. (optional)
path := "path_example" // string | The path to upload logs to. (optional) (default to "null")
region := "region_example" // string | The region to stream logs to. (optional)
publicKey := "publicKey_example" // string | A PGP public key that Fastly will use to encrypt your log files before writing them to disk. (optional) (default to "null")
user := "user_example" // string | The username for your Cloud Files account. (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.LoggingCloudfilesAPI.UpdateLogCloudfiles(ctx, serviceID, versionID, loggingCloudfilesName).Name(name).Placement(placement).ResponseCondition(responseCondition).Format(format).FormatVersion(formatVersion).MessageType(messageType).TimestampFormat(timestampFormat).CompressionCodec(compressionCodec).Period(period).GzipLevel(gzipLevel).AccessKey(accessKey).BucketName(bucketName).Path(path).Region(region).PublicKey(publicKey).User(user).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LoggingCloudfilesAPI.UpdateLogCloudfiles`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateLogCloudfiles`: LoggingCloudfilesResponse
fmt.Fprintf(os.Stdout, "Response from `LoggingCloudfilesAPI.UpdateLogCloudfiles`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceID | string | Alphanumeric string identifying the service. | |
versionID | int32 | Integer identifying a service version. | |
loggingCloudfilesName | string | The name for the real-time logging configuration. |
Other parameters are passed through a pointer to a apiUpdateLogCloudfilesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
name | string | The name for the real-time logging configuration. | placement |
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json