Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 40 additions & 6 deletions monitor_log_destinations.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type LogsDestinationType string
const (
LogsDestinationTypeAkamaiObjectStorage LogsDestinationType = "akamai_object_storage"
LogsDestinationTypeCustomHTTPS LogsDestinationType = "custom_https"
LogsDestinationTypeTrafficPeak LogsDestinationType = "traffic_peak"
)

// LogsDestinationStatus represents the status of a logs destination.
Expand All @@ -33,13 +34,15 @@ type LogsDestinationDetails struct {
Host string `json:"host,omitzero"`
Path string `json:"path,omitzero"`

// custom_https fields
// custom_https and traffic_peak fields
EndpointURL string `json:"endpoint_url,omitzero"`
Authentication *LogsDestinationCustomHTTPSAuthDetails `json:"authentication,omitzero"`
ClientCertificateDetails *LogsDestinationClientCertificateDetails `json:"client_certificate_details,omitzero"`
ContentType string `json:"content_type,omitzero"`
CustomHeaders []LogsDestinationCustomHTTPSHeader `json:"custom_headers,omitzero"`
DataCompression string `json:"data_compression,omitzero"`

// custom_https only
CustomHeaders []LogsDestinationCustomHTTPSHeader `json:"custom_headers,omitzero"`
}

// LogsDestinationDetailsCreateOptions represents the details block used when creating
Expand Down Expand Up @@ -79,6 +82,17 @@ type LogsDestinationCustomHTTPSHeader struct {
Value string `json:"value"`
}

// LogsDestinationTrafficPeakBasicAuthDetails holds TrafficPeak basic authentication credentials.
type LogsDestinationTrafficPeakBasicAuthDetails struct {
Username string `json:"basic_authentication_user"`
Password string `json:"basic_authentication_password"`
}

// LogsDestinationTrafficPeakAuthDetails wraps TrafficPeak authentication credentials.
type LogsDestinationTrafficPeakAuthDetails struct {
Details LogsDestinationTrafficPeakBasicAuthDetails `json:"details"`
}

// LogsDestinationClientCertificateDetails contains TLS client certificate information
type LogsDestinationClientCertificateDetails struct {
ClientCACertificate string `json:"client_ca_certificate"`
Expand All @@ -98,6 +112,15 @@ type LogsDestinationCustomHTTPSDetailsCreateOptions struct {
DataCompression string `json:"data_compression,omitzero"`
}

// LogsDestinationTrafficPeakDetailsCreateOptions represents the details block used when
// creating a traffic_peak LogsDestination.
type LogsDestinationTrafficPeakDetailsCreateOptions struct {
EndpointURL string `json:"endpoint_url"`
Authentication LogsDestinationTrafficPeakAuthDetails `json:"authentication"`
ContentType *string `json:"content_type,omitzero"`
DataCompression *string `json:"data_compression,omitzero"`
}

// LogsDestination represents a logs destination object.
type LogsDestination struct {
Created *time.Time `json:"-"`
Expand Down Expand Up @@ -144,8 +167,8 @@ type LogsDestinationCreateOptions struct {
Details any `json:"details"`
}

// LogsDestinationDetailsUpdateOptions represents the details block used when updating
// an akamai_object_storage LogsDestination.
// LogsDestinationDetailsUpdateOptions represents the details block used when
// updating an akamai_object_storage LogsDestination.
type LogsDestinationDetailsUpdateOptions struct {
AccessKeyID string `json:"access_key_id,omitzero"`
AccessKeySecret string `json:"access_key_secret,omitzero"`
Expand All @@ -165,9 +188,20 @@ type LogsDestinationCustomHTTPSDetailsUpdateOptions struct {
DataCompression string `json:"data_compression,omitzero"`
}

// LogsDestinationTrafficPeakDetailsUpdateOptions represents the details block used when
// updating a traffic_peak LogsDestination.
type LogsDestinationTrafficPeakDetailsUpdateOptions struct {
EndpointURL *string `json:"endpoint_url,omitzero"`
Authentication *LogsDestinationTrafficPeakAuthDetails `json:"authentication,omitzero"`
ContentType *string `json:"content_type,omitzero"`
DataCompression *string `json:"data_compression,omitzero"`
}

// LogsDestinationUpdateOptions are the options used to update a LogsDestination.
// Set Details to *LogsDestinationDetailsUpdateOptions for akamai_object_storage,
// or *LogsDestinationCustomHTTPSDetailsUpdateOptions for custom_https.
// Set Details to
// *LogsDestinationDetailsUpdateOptions for akamai_object_storage,
// *LogsDestinationCustomHTTPSDetailsUpdateOptions for custom_https, or
// *LogsDestinationTrafficPeakDetailsUpdateOptions for traffic_peak.
type LogsDestinationUpdateOptions struct {
Label string `json:"label,omitzero"`
Details any `json:"details,omitzero"`
Expand Down
2 changes: 2 additions & 0 deletions monitor_log_streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const (
StreamDestinationTypeAkamaiObjectStorage StreamDestinationType = "akamai_object_storage"
// StreamDestinationTypeCustomHTTPS sends logs to a custom HTTPS endpoint.
StreamDestinationTypeCustomHTTPS StreamDestinationType = "custom_https"
// StreamDestinationTypeTrafficPeak sends logs to a TrafficPeak destination.
StreamDestinationTypeTrafficPeak StreamDestinationType = "traffic_peak"
)

// StreamDetails contains additional details for a logs stream.
Expand Down
Loading
Loading