Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
CreateLogKinesis | POST /service/{service_id}/version/{version_id}/logging/kinesis |
Create an Amazon Kinesis log endpoint |
DeleteLogKinesis | DELETE /service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name} |
Delete the Amazon Kinesis log endpoint |
GetLogKinesis | GET /service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name} |
Get an Amazon Kinesis log endpoint |
ListLogKinesis | GET /service/{service_id}/version/{version_id}/logging/kinesis |
List Amazon Kinesis log endpoints |
UpdateLogKinesis | PUT /service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name} |
Update the Amazon Kinesis log endpoint |
Create an Amazon Kinesis 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 := openapiclient.logging_placement("none") // LoggingPlacement | (optional)
format := "format_example" // string | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (optional) (default to "{\"timestamp\":\"%{begin:%Y-%m-%dT%H:%M:%S}t\",\"time_elapsed\":\"%{time.elapsed.usec}V\",\"is_tls\":\"%{if(req.is_ssl, \\\"true\\\", \\\"false\\\")}V\",\"client_ip\":\"%{req.http.Fastly-Client-IP}V\",\"geo_city\":\"%{client.geo.city}V\",\"geo_country_code\":\"%{client.geo.country_code}V\",\"request\":\"%{req.request}V\",\"host\":\"%{req.http.Fastly-Orig-Host}V\",\"url\":\"%{json.escape(req.url)}V\",\"request_referer\":\"%{json.escape(req.http.Referer)}V\",\"request_user_agent\":\"%{json.escape(req.http.User-Agent)}V\",\"request_accept_language\":\"%{json.escape(req.http.Accept-Language)}V\",\"request_accept_charset\":\"%{json.escape(req.http.Accept-Charset)}V\",\"cache_status\":\"%{regsub(fastly_info.state, \\\"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*\\\", \\\"\\\\2\\\\3\\\") }V\"}")
topic := "topic_example" // string | The Amazon Kinesis stream to send logs to. Required. (optional)
region := openapiclient.aws_region("us-east-1") // AwsRegion | (optional)
secretKey := "secretKey_example" // string | The secret key associated with the target Amazon Kinesis stream. Not required if `iam_role` is specified. (optional)
accessKey := "accessKey_example" // string | The access key associated with the target Amazon Kinesis stream. Not required if `iam_role` is specified. (optional)
iamRole := "iamRole_example" // string | The ARN for an IAM role granting Fastly access to the target Amazon Kinesis stream. Not required if `access_key` and `secret_key` are provided. (optional)
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)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.LoggingKinesisAPI.CreateLogKinesis(ctx, serviceID, versionID).Name(name).Placement(placement).Format(format).Topic(topic).Region(region).SecretKey(secretKey).AccessKey(accessKey).IamRole(iamRole).FormatVersion(formatVersion).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LoggingKinesisAPI.CreateLogKinesis`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateLogKinesis`: LoggingKinesisResponse
fmt.Fprintf(os.Stdout, "Response from `LoggingKinesisAPI.CreateLogKinesis`: %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 apiCreateLogKinesisRequest 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 Amazon Kinesis 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.
loggingKinesisName := "loggingKinesisName_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.LoggingKinesisAPI.DeleteLogKinesis(ctx, serviceID, versionID, loggingKinesisName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LoggingKinesisAPI.DeleteLogKinesis`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteLogKinesis`: InlineResponse200
fmt.Fprintf(os.Stdout, "Response from `LoggingKinesisAPI.DeleteLogKinesis`: %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. | |
loggingKinesisName | string | The name for the real-time logging configuration. |
Other parameters are passed through a pointer to a apiDeleteLogKinesisRequest 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 an Amazon Kinesis 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.
loggingKinesisName := "loggingKinesisName_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.LoggingKinesisAPI.GetLogKinesis(ctx, serviceID, versionID, loggingKinesisName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LoggingKinesisAPI.GetLogKinesis`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLogKinesis`: LoggingKinesisResponse
fmt.Fprintf(os.Stdout, "Response from `LoggingKinesisAPI.GetLogKinesis`: %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. | |
loggingKinesisName | string | The name for the real-time logging configuration. |
Other parameters are passed through a pointer to a apiGetLogKinesisRequest 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 Amazon Kinesis 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.LoggingKinesisAPI.ListLogKinesis(ctx, serviceID, versionID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LoggingKinesisAPI.ListLogKinesis`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListLogKinesis`: []LoggingKinesisResponse
fmt.Fprintf(os.Stdout, "Response from `LoggingKinesisAPI.ListLogKinesis`: %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 apiListLogKinesisRequest 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 Amazon Kinesis 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.
loggingKinesisName := "loggingKinesisName_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.LoggingKinesisAPI.UpdateLogKinesis(ctx, serviceID, versionID, loggingKinesisName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LoggingKinesisAPI.UpdateLogKinesis`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateLogKinesis`: LoggingKinesisResponse
fmt.Fprintf(os.Stdout, "Response from `LoggingKinesisAPI.UpdateLogKinesis`: %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. | |
loggingKinesisName | string | The name for the real-time logging configuration. |
Other parameters are passed through a pointer to a apiUpdateLogKinesisRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json