Skip to content

Latest commit

 

History

History
384 lines (258 loc) · 18.8 KB

LoggingPubsubAPI.md

File metadata and controls

384 lines (258 loc) · 18.8 KB

LoggingPubsubAPI

Note

All URIs are relative to https://api.fastly.com

Method HTTP request Description
CreateLogGcpPubsub POST /service/{service_id}/version/{version_id}/logging/pubsub Create a GCP Cloud Pub/Sub log endpoint
DeleteLogGcpPubsub DELETE /service/{service_id}/version/{version_id}/logging/pubsub/{logging_google_pubsub_name} Delete a GCP Cloud Pub/Sub log endpoint
GetLogGcpPubsub GET /service/{service_id}/version/{version_id}/logging/pubsub/{logging_google_pubsub_name} Get a GCP Cloud Pub/Sub log endpoint
ListLogGcpPubsub GET /service/{service_id}/version/{version_id}/logging/pubsub List GCP Cloud Pub/Sub log endpoints
UpdateLogGcpPubsub PUT /service/{service_id}/version/{version_id}/logging/pubsub/{logging_google_pubsub_name} Update a GCP Cloud Pub/Sub log endpoint

CreateLogGcpPubsub

Create a GCP Cloud Pub/Sub log endpoint

Example

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)
    user := "user_example" // string | Your Google Cloud Platform service account email address. The `client_email` field in your service account authentication JSON. Not required if `account_name` is specified. (optional)
    secretKey := "secretKey_example" // string | Your Google Cloud Platform account secret key. The `private_key` field in your service account authentication JSON. Not required if `account_name` is specified. (optional)
    accountName := "accountName_example" // string | The name of the Google Cloud Platform service account associated with the target log collection service. Not required if `user` and `secret_key` are provided. (optional)
    topic := "topic_example" // string | The Google Cloud Pub/Sub topic to which logs will be published. Required. (optional)
    projectID := "projectId_example" // string | Your Google Cloud Platform project ID. Required (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.LoggingPubsubAPI.CreateLogGcpPubsub(ctx, serviceID, versionID).Name(name).Placement(placement).ResponseCondition(responseCondition).Format(format).FormatVersion(formatVersion).User(user).SecretKey(secretKey).AccountName(accountName).Topic(topic).ProjectID(projectID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LoggingPubsubAPI.CreateLogGcpPubsub`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateLogGcpPubsub`: LoggingGooglePubsubResponse
    fmt.Fprintf(os.Stdout, "Response from `LoggingPubsubAPI.CreateLogGcpPubsub`: %v\n", resp)
}

Path Parameters

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

Other parameters are passed through a pointer to a apiCreateLogGcpPubsubRequest struct via the builder pattern

Name Type Description Notes
name string The name for the real-time logging configuration. placement

Return type

LoggingGooglePubsubResponse

Authorization

API Token

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

Back to top | Back to API list | Back to README

DeleteLogGcpPubsub

Delete a GCP Cloud Pub/Sub log endpoint

Example

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.
    loggingGooglePubsubName := "loggingGooglePubsubName_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.LoggingPubsubAPI.DeleteLogGcpPubsub(ctx, serviceID, versionID, loggingGooglePubsubName).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LoggingPubsubAPI.DeleteLogGcpPubsub`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DeleteLogGcpPubsub`: InlineResponse200
    fmt.Fprintf(os.Stdout, "Response from `LoggingPubsubAPI.DeleteLogGcpPubsub`: %v\n", resp)
}

Path Parameters

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.
loggingGooglePubsubName string The name for the real-time logging configuration.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteLogGcpPubsubRequest struct via the builder pattern

Name Type Description Notes

Return type

InlineResponse200

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Back to top | Back to API list | Back to README

GetLogGcpPubsub

Get a GCP Cloud Pub/Sub log endpoint

Example

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.
    loggingGooglePubsubName := "loggingGooglePubsubName_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.LoggingPubsubAPI.GetLogGcpPubsub(ctx, serviceID, versionID, loggingGooglePubsubName).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LoggingPubsubAPI.GetLogGcpPubsub`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetLogGcpPubsub`: LoggingGooglePubsubResponse
    fmt.Fprintf(os.Stdout, "Response from `LoggingPubsubAPI.GetLogGcpPubsub`: %v\n", resp)
}

Path Parameters

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.
loggingGooglePubsubName string The name for the real-time logging configuration.

Other Parameters

Other parameters are passed through a pointer to a apiGetLogGcpPubsubRequest struct via the builder pattern

Name Type Description Notes

Return type

LoggingGooglePubsubResponse

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Back to top | Back to API list | Back to README

ListLogGcpPubsub

List GCP Cloud Pub/Sub log endpoints

Example

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.LoggingPubsubAPI.ListLogGcpPubsub(ctx, serviceID, versionID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LoggingPubsubAPI.ListLogGcpPubsub`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListLogGcpPubsub`: []LoggingGooglePubsubResponse
    fmt.Fprintf(os.Stdout, "Response from `LoggingPubsubAPI.ListLogGcpPubsub`: %v\n", resp)
}

Path Parameters

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

Other parameters are passed through a pointer to a apiListLogGcpPubsubRequest struct via the builder pattern

Name Type Description Notes

Return type

[]LoggingGooglePubsubResponse

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

Back to top | Back to API list | Back to README

UpdateLogGcpPubsub

Update a GCP Cloud Pub/Sub log endpoint

Example

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.
    loggingGooglePubsubName := "loggingGooglePubsubName_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)
    user := "user_example" // string | Your Google Cloud Platform service account email address. The `client_email` field in your service account authentication JSON. Not required if `account_name` is specified. (optional)
    secretKey := "secretKey_example" // string | Your Google Cloud Platform account secret key. The `private_key` field in your service account authentication JSON. Not required if `account_name` is specified. (optional)
    accountName := "accountName_example" // string | The name of the Google Cloud Platform service account associated with the target log collection service. Not required if `user` and `secret_key` are provided. (optional)
    topic := "topic_example" // string | The Google Cloud Pub/Sub topic to which logs will be published. Required. (optional)
    projectID := "projectId_example" // string | Your Google Cloud Platform project ID. Required (optional)

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.LoggingPubsubAPI.UpdateLogGcpPubsub(ctx, serviceID, versionID, loggingGooglePubsubName).Name(name).Placement(placement).ResponseCondition(responseCondition).Format(format).FormatVersion(formatVersion).User(user).SecretKey(secretKey).AccountName(accountName).Topic(topic).ProjectID(projectID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `LoggingPubsubAPI.UpdateLogGcpPubsub`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateLogGcpPubsub`: LoggingGooglePubsubResponse
    fmt.Fprintf(os.Stdout, "Response from `LoggingPubsubAPI.UpdateLogGcpPubsub`: %v\n", resp)
}

Path Parameters

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.
loggingGooglePubsubName string The name for the real-time logging configuration.

Other Parameters

Other parameters are passed through a pointer to a apiUpdateLogGcpPubsubRequest struct via the builder pattern

Name Type Description Notes
name string The name for the real-time logging configuration. placement

Return type

LoggingGooglePubsubResponse

Authorization

API Token

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

Back to top | Back to API list | Back to README