From 9f532be4ed40592f8c85fd5ab16b9835f6879b29 Mon Sep 17 00:00:00 2001 From: mduda Date: Mon, 14 Sep 2026 14:59:22 +0200 Subject: [PATCH 1/2] DPS-45438: ACLP Logs - add new TrafficPeak destination type --- monitor_log_destinations.go | 50 +- monitor_log_streams.go | 2 + .../TestLogStream_CustomHTTPSDestination.yaml | 2193 +++++++++++++++++ ...TestLogsDestination_CustomHTTPSCreate.yaml | 194 ++ ...TestLogsDestination_CustomHTTPSDelete.yaml | 219 ++ .../TestLogsDestination_CustomHTTPSGet.yaml | 261 ++ .../TestLogsDestination_CustomHTTPSList.yaml | 253 ++ ...stination_CustomHTTPSUpdateAndHistory.yaml | 328 +++ test/integration/integration_suite_test.go | 43 +- test/integration/monitor_logs_test.go | 347 +++ .../monitor_log_destination_traffic_peak.json | 22 + .../monitor_log_stream_traffic_peak.json | 29 + test/unit/monitor_logs_test.go | 188 +- 13 files changed, 4098 insertions(+), 31 deletions(-) create mode 100644 test/integration/fixtures/TestLogStream_CustomHTTPSDestination.yaml create mode 100644 test/integration/fixtures/TestLogsDestination_CustomHTTPSCreate.yaml create mode 100644 test/integration/fixtures/TestLogsDestination_CustomHTTPSDelete.yaml create mode 100644 test/integration/fixtures/TestLogsDestination_CustomHTTPSGet.yaml create mode 100644 test/integration/fixtures/TestLogsDestination_CustomHTTPSList.yaml create mode 100644 test/integration/fixtures/TestLogsDestination_CustomHTTPSUpdateAndHistory.yaml create mode 100644 test/unit/fixtures/monitor_log_destination_traffic_peak.json create mode 100644 test/unit/fixtures/monitor_log_stream_traffic_peak.json diff --git a/monitor_log_destinations.go b/monitor_log_destinations.go index 2b22b8bd3..1075a11a6 100644 --- a/monitor_log_destinations.go +++ b/monitor_log_destinations.go @@ -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. @@ -33,7 +34,7 @@ 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"` @@ -79,6 +80,23 @@ 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"` +} + +// LogsDestinationTrafficPeakHeader represents a custom HTTP header sent to TrafficPeak. +type LogsDestinationTrafficPeakHeader struct { + Name string `json:"name"` + Value string `json:"value"` +} + // LogsDestinationClientCertificateDetails contains TLS client certificate information type LogsDestinationClientCertificateDetails struct { ClientCACertificate string `json:"client_ca_certificate"` @@ -98,6 +116,16 @@ 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"` + CustomHeaders []LogsDestinationTrafficPeakHeader `json:"custom_headers,omitzero"` + DataCompression *string `json:"data_compression,omitzero"` +} + // LogsDestination represents a logs destination object. type LogsDestination struct { Created *time.Time `json:"-"` @@ -144,8 +172,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"` @@ -165,9 +193,21 @@ 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"` + CustomHeaders []LogsDestinationTrafficPeakHeader `json:"custom_headers,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"` diff --git a/monitor_log_streams.go b/monitor_log_streams.go index deb793589..7c6c6d10f 100644 --- a/monitor_log_streams.go +++ b/monitor_log_streams.go @@ -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. diff --git a/test/integration/fixtures/TestLogStream_CustomHTTPSDestination.yaml b/test/integration/fixtures/TestLogStream_CustomHTTPSDestination.yaml new file mode 100644 index 000000000..2b4aee98f --- /dev/null +++ b/test/integration/fixtures/TestLogStream_CustomHTTPSDestination.yaml @@ -0,0 +1,2193 @@ +--- +version: 1 +interactions: +- request: + body: '{"label":"go-test-logs-monitoring-1789372929673125000","type":"custom_https","details":{"endpoint_url":"https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth","authentication":{"type":"none"},"content_type":"application/json","custom_headers":[{"name":"X-Logs-Custom-Path","value":"linodego-e2e-test"}],"data_compression":"gzip"}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations + method: POST + response: + body: '{"id": 308, "label": "go-test-logs-monitoring-1789372929673125000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "589" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams?page=1 + method: GET + response: + body: '{"pages": 0, "page": 1, "results": 0, "data": []}' + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"destinations":[308],"label":"go-test-http-destination-stream-1789372932952823000","type":"audit_logs"}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams + method: POST + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "provisioning", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "728" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-http-destination-stream-1789372932952823000", + "type": "audit_logs", "destinations": [{"id": 308, "type": "custom_https", "label": + "go-test-logs-monitoring-1789372929673125000", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}}], "details": null, "version": 1, "status": "active", + "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "722" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/95 + method: GET + response: + body: '{"errors": [{"reason": "Stream not found"}]}' + headers: + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + Connection: + - keep-alive + Content-Length: + - "44" + Content-Type: + - application/json + Server: + - nginx + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Frame-Options: + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + status: 404 NOT FOUND + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/308 + method: GET + response: + body: '{"id": 308, "label": "go-test-logs-monitoring-1789372929673125000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "589" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/308 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestLogsDestination_CustomHTTPSCreate.yaml b/test/integration/fixtures/TestLogsDestination_CustomHTTPSCreate.yaml new file mode 100644 index 000000000..13d7875a8 --- /dev/null +++ b/test/integration/fixtures/TestLogsDestination_CustomHTTPSCreate.yaml @@ -0,0 +1,194 @@ +--- +version: 1 +interactions: +- request: + body: '{"label":"go-test-logs-monitoring-1789125812021703000","type":"custom_https","details":{"endpoint_url":"https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth","authentication":{"type":"none"},"content_type":"application/json","custom_headers":[{"name":"X-Logs-Custom-Path","value":"linodego-e2e-test"}],"data_compression":"gzip"}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations + method: POST + response: + body: '{"id": 93, "label": "go-test-logs-monitoring-1789125812021703000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "588" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/93 + method: GET + response: + body: '{"id": 93, "label": "go-test-logs-monitoring-1789125812021703000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "588" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/93 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestLogsDestination_CustomHTTPSDelete.yaml b/test/integration/fixtures/TestLogsDestination_CustomHTTPSDelete.yaml new file mode 100644 index 000000000..bdf040451 --- /dev/null +++ b/test/integration/fixtures/TestLogsDestination_CustomHTTPSDelete.yaml @@ -0,0 +1,219 @@ +--- +version: 1 +interactions: +- request: + body: '{"label":"go-test-logs-monitoring-1789125846736611000","type":"custom_https","details":{"endpoint_url":"https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth","authentication":{"type":"none"},"content_type":"application/json","custom_headers":[{"name":"X-Logs-Custom-Path","value":"linodego-e2e-test"}],"data_compression":"gzip"}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations + method: POST + response: + body: '{"id": 97, "label": "go-test-logs-monitoring-1789125846736611000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "588" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/97 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/97 + method: GET + response: + body: '{"errors": [{"reason": "Destination not found"}]}' + headers: + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + Connection: + - keep-alive + Content-Length: + - "49" + Content-Type: + - application/json + Server: + - nginx + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Frame-Options: + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + status: 404 NOT FOUND + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/97 + method: GET + response: + body: '{"errors": [{"reason": "Destination not found"}]}' + headers: + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + Connection: + - keep-alive + Content-Length: + - "49" + Content-Type: + - application/json + Server: + - nginx + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Frame-Options: + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + status: 404 NOT FOUND + code: 404 + duration: "" diff --git a/test/integration/fixtures/TestLogsDestination_CustomHTTPSGet.yaml b/test/integration/fixtures/TestLogsDestination_CustomHTTPSGet.yaml new file mode 100644 index 000000000..b52ce7daf --- /dev/null +++ b/test/integration/fixtures/TestLogsDestination_CustomHTTPSGet.yaml @@ -0,0 +1,261 @@ +--- +version: 1 +interactions: +- request: + body: '{"label":"go-test-logs-monitoring-1789125817730901000","type":"custom_https","details":{"endpoint_url":"https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth","authentication":{"type":"none"},"content_type":"application/json","custom_headers":[{"name":"X-Logs-Custom-Path","value":"linodego-e2e-test"}],"data_compression":"gzip"}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations + method: POST + response: + body: '{"id": 94, "label": "go-test-logs-monitoring-1789125817730901000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "588" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/94 + method: GET + response: + body: '{"id": 94, "label": "go-test-logs-monitoring-1789125817730901000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "588" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/94 + method: GET + response: + body: '{"id": 94, "label": "go-test-logs-monitoring-1789125817730901000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "588" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/94 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestLogsDestination_CustomHTTPSList.yaml b/test/integration/fixtures/TestLogsDestination_CustomHTTPSList.yaml new file mode 100644 index 000000000..9c6e64869 --- /dev/null +++ b/test/integration/fixtures/TestLogsDestination_CustomHTTPSList.yaml @@ -0,0 +1,253 @@ +--- +version: 1 +interactions: +- request: + body: '{"label":"go-test-logs-monitoring-1789125823239069000","type":"custom_https","details":{"endpoint_url":"https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth","authentication":{"type":"none"},"content_type":"application/json","custom_headers":[{"name":"X-Logs-Custom-Path","value":"linodego-e2e-test"}],"data_compression":"gzip"}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations + method: POST + response: + body: '{"id": 95, "label": "go-test-logs-monitoring-1789125823239069000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - "*" + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - '588' + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - "*" + X-Ratelimit-Limit: + - '400' + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: '' +- request: + body: '' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + X-Filter: + - '{"id":95}' + url: https://api.linode.com/v4beta/monitor/streams/destinations?page=1 + method: GET + response: + body: '{"pages":1,"page":1,"results":1,"data":[{"id":95,"label":"go-test-logs-monitoring-1789125823239069000","type":"custom_https","details":{"endpoint_url":"https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth","authentication":{"type":"none"},"data_compression":"gzip","content_type":"application/json","custom_headers":[{"name":"X-Logs-Custom-Path","value":"linodego-e2e-test"}]},"version":1,"status":"active","created_by": "[SANITIZED]","created":"2018-01-02T03:04:05","updated_by": "[SANITIZED]","updated":"2018-01-02T03:04:05"}]}' + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - "*" + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - "*" + X-Ratelimit-Limit: + - '400' + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: '' +- request: + body: '' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/95 + method: GET + response: + body: '{"id": 95, "label": "go-test-logs-monitoring-1789125823239069000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - "*" + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - '588' + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - "*" + X-Ratelimit-Limit: + - '400' + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: '' +- request: + body: '' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/95 + method: DELETE + response: + body: "{}" + headers: + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - "*" + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - '2' + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - "*" + X-Ratelimit-Limit: + - '400' + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: '' diff --git a/test/integration/fixtures/TestLogsDestination_CustomHTTPSUpdateAndHistory.yaml b/test/integration/fixtures/TestLogsDestination_CustomHTTPSUpdateAndHistory.yaml new file mode 100644 index 000000000..200e6607e --- /dev/null +++ b/test/integration/fixtures/TestLogsDestination_CustomHTTPSUpdateAndHistory.yaml @@ -0,0 +1,328 @@ +--- +version: 1 +interactions: +- request: + body: '{"label":"go-test-logs-monitoring-1789125838603717000","type":"custom_https","details":{"endpoint_url":"https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth","authentication":{"type":"none"},"content_type":"application/json","custom_headers":[{"name":"X-Logs-Custom-Path","value":"linodego-e2e-test"}],"data_compression":"gzip"}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations + method: POST + response: + body: '{"id": 96, "label": "go-test-logs-monitoring-1789125838603717000", "type": + "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "active", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": + "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "588" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"label":"go-test-logs-monitoring-1789125838603717000-updated","details":{"endpoint_url":"https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth","authentication":{"type":"none"},"content_type":"application/json; + charset=utf-8","custom_headers":[{"name":"X-Logs-Custom-Path","value":"linodego-e2e-test"}],"data_compression":"gzip"}}' + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/96 + method: PUT + response: + body: '{"id": 96, "label": "go-test-logs-monitoring-1789125838603717000-updated", + "type": "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json; charset=utf-8", "custom_headers": [{"name": "X-Logs-Custom-Path", + "value": "linodego-e2e-test"}]}, "version": 2, "status": "active", "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", + "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "611" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/96/history?page=1 + method: GET + response: + body: '{"pages": 1, "page": 1, "results": 2, "data": [{"id": 96, "label": "go-test-logs-monitoring-1789125838603717000-updated", + "type": "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json; charset=utf-8", "custom_headers": [{"name": "X-Logs-Custom-Path", + "value": "linodego-e2e-test"}]}, "version": 2, "status": "active", "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", + "updated": "2018-01-02T03:04:05"}, {"id": 96, "label": "go-test-logs-monitoring-1789125838603717000", + "type": "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json", "custom_headers": [{"name": "X-Logs-Custom-Path", "value": + "linodego-e2e-test"}]}, "version": 1, "status": "inactive", "created_by": "[SANITIZED]", + "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", "updated": + "2018-01-02T03:04:05"}]}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/96 + method: GET + response: + body: '{"id": 96, "label": "go-test-logs-monitoring-1789125838603717000-updated", + "type": "custom_https", "details": {"endpoint_url": "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth", + "authentication": {"type": "none"}, "data_compression": "gzip", "content_type": + "application/json; charset=utf-8", "custom_headers": [{"name": "X-Logs-Custom-Path", + "value": "linodego-e2e-test"}]}, "version": 2, "status": "active", "created_by": "[SANITIZED]", "created": "2018-01-02T03:04:05", "updated_by": "[SANITIZED]", + "updated": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "611" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/monitor/streams/destinations/96 + method: DELETE + response: + body: '{}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Akamai-Internal-Account: + - '*' + Cache-Control: + - private, max-age=60, s-maxage=60 + Connection: + - keep-alive + Content-Length: + - "2" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - monitor:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "400" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/integration_suite_test.go b/test/integration/integration_suite_test.go index c70fda655..633aa6619 100644 --- a/test/integration/integration_suite_test.go +++ b/test/integration/integration_suite_test.go @@ -118,28 +118,27 @@ func testRecorder(t *testing.T, fixturesYaml string, testingMode recorder.Mode, // keys are available to test code during recording (e.g. for creating a // LogsDestination that requires valid object-storage credentials). - // Object Storage access_key / secret_key (response and request bodies) - re := regexp.MustCompile(`"access_key":\s*"[^"]*"`) - i.Response.Body = re.ReplaceAllString(i.Response.Body, `"access_key": "[SANITIZED]"`) - i.Request.Body = re.ReplaceAllString(i.Request.Body, `"access_key": "[SANITIZED]"`) - re = regexp.MustCompile(`"secret_key":\s*"[^"]*"`) - i.Response.Body = re.ReplaceAllString(i.Response.Body, `"secret_key": "[SANITIZED]"`) - i.Request.Body = re.ReplaceAllString(i.Request.Body, `"secret_key": "[SANITIZED]"`) - - // LogsDestination credentials (access_key_id / access_key_secret) - re = regexp.MustCompile(`"access_key_id":\s*"[^"]*"`) - i.Response.Body = re.ReplaceAllString(i.Response.Body, `"access_key_id": "[SANITIZED]"`) - i.Request.Body = re.ReplaceAllString(i.Request.Body, `"access_key_id":"[SANITIZED]"`) - re = regexp.MustCompile(`"access_key_secret":\s*"[^"]*"`) - i.Response.Body = re.ReplaceAllString(i.Response.Body, `"access_key_secret": "[SANITIZED]"`) - i.Request.Body = re.ReplaceAllString(i.Request.Body, `"access_key_secret":"[SANITIZED]"`) - - // Custom HTTPS basic authentication password - re = regexp.MustCompile(`"basic_authentication_password":\s*"[^"]*"`) - i.Response.Body = re.ReplaceAllString(i.Response.Body, `"basic_authentication_password": "[SANITIZED]"`) - i.Request.Body = re.ReplaceAllString(i.Request.Body, `"basic_authentication_password":"[SANITIZED]"`) - - re = regexp.MustCompile("AWSAccessKeyId=[[:alnum:]]{20}") + // LogsDestination fields that may contain sensitive information + for _, field := range []string{ + "access_key", + "secret_key", + "access_key_id", + "access_key_secret", + "basic_authentication_user", + "basic_authentication_password", + "created_by", + "updated_by", + "client_ca_certificate", + "client_certificate", + "client_private_key", + } { + re := regexp.MustCompile(fmt.Sprintf(`"%s":\s*"([^"\\]|\\.)*"`, field)) + replacement := fmt.Sprintf(`"%s": "[SANITIZED]"`, field) + i.Response.Body = re.ReplaceAllString(i.Response.Body, replacement) + i.Request.Body = re.ReplaceAllString(i.Request.Body, replacement) + } + + re := regexp.MustCompile("AWSAccessKeyId=[[:alnum:]]{20}") i.Response.Body = re.ReplaceAllString(i.Response.Body, "AWSAccessKeyID=SANITIZED") i.Request.URL = re.ReplaceAllString(i.Request.URL, "AWSAccessKeyID=SANITIZED") return nil diff --git a/test/integration/monitor_logs_test.go b/test/integration/monitor_logs_test.go index 41435d842..2a48d8f83 100644 --- a/test/integration/monitor_logs_test.go +++ b/test/integration/monitor_logs_test.go @@ -15,6 +15,15 @@ import ( "github.com/stretchr/testify/require" ) +const ( + testCustomHTTPSEndpointURL = "https://pl-labkrk-2-https-server-dev.cloud-streams-dev.akadns.net/stream-custom-https-server-api/logs/no-auth" + testCustomHTTPSContentType = "application/json" + testCustomHTTPSUpdatedContentType = "application/json; charset=utf-8" + testCustomHTTPSDataCompression = "gzip" + testCustomHTTPSHeaderName = "X-Logs-Custom-Path" + testCustomHTTPSHeaderValue = "linodego-e2e-test" +) + // requireACLPLogsStreamTests skips the test if RUN_ACLP_LOGS_STREAM_TESTS is not set. // Call this before creating a test client so the env check short-circuits early. func requireACLPLogsStreamTests(t *testing.T) { @@ -28,6 +37,34 @@ func requireACLPLogsStreamTests(t *testing.T) { } } +// requireTrafficPeakDestinationTests skips TrafficPeak tests if +// RUN_TRAFFIC_PEAK_DESTINATION_TESTS is not set +// Unlike requireACLPLogsStreamTests, replay mode also +// requires the flag because TrafficPeak fixtures do not exist yet. +func requireTrafficPeakDestinationTests(t *testing.T) { + t.Helper() + + val := os.Getenv("RUN_TRAFFIC_PEAK_DESTINATION_TESTS") + if val != "yes" && val != "true" { + t.Skipf("RUN_TRAFFIC_PEAK_DESTINATION_TESTS must be set to 'yes' or 'true' to run TrafficPeak tests") + } +} + +// requireCustomHTTPSDestinationTests skips live Custom HTTPS integration tests +// unless they are explicitly enabled. +func requireCustomHTTPSDestinationTests(t *testing.T) { + t.Helper() + + if testingMode == recorder.ModeReplaying { + return + } + + val := os.Getenv("RUN_CUSTOM_HTTPS_DESTINATION_TESTS") + if val != "yes" && val != "true" { + t.Skipf("RUN_CUSTOM_HTTPS_DESTINATION_TESTS must be set to 'yes' or 'true' to run Custom HTTPS tests") + } +} + // creates a object storage and access keys for use in tests func setupObjectStorageForLogs(t *testing.T, client *linodego.Client) (*linodego.ObjectStorageBucket, *linodego.ObjectStorageKey, func()) { t.Helper() @@ -151,6 +188,99 @@ func setupLogsDestination(t *testing.T, fixturesYaml string) (*linodego.Client, return client, dest, storageKey, teardown } +// setupHTTPLogsDestination creates either a TrafficPeak or Custom HTTPS +// destination and returns a teardown that tolerates deletion by the test itself. +func setupHTTPLogsDestination( + t *testing.T, + fixturesYaml string, + destinationType linodego.LogsDestinationType, + details any, +) (*linodego.Client, *linodego.LogsDestination, func()) { + t.Helper() + + client, fixtureTeardown := createTestClient(t, fixturesYaml) + destination, err := client.CreateLogsDestination(context.Background(), linodego.LogsDestinationCreateOptions{ + Label: testLabel(), + Type: destinationType, + Details: details, + }) + if err != nil { + fixtureTeardown() + } + require.NoError(t, err) + require.NotNil(t, destination) + + teardown := func() { + defer fixtureTeardown() + + _, err := client.GetLogsDestination(context.Background(), destination.ID) + if apiErr, ok := err.(*linodego.Error); ok && apiErr.Code == http.StatusNotFound { + return + } + if err != nil { + t.Errorf("failed to check destination before cleanup: %v", err) + } + if err := client.DeleteLogsDestination(context.Background(), destination.ID); err != nil { + t.Errorf("failed to delete logs destination: %v", err) + } + } + + return client, destination, teardown +} + +func setupTrafficPeakLogsDestination( + t *testing.T, + fixturesYaml string, +) (*linodego.Client, *linodego.LogsDestination, func()) { + t.Helper() + requireTrafficPeakDestinationTests(t) + + return setupHTTPLogsDestination( + t, + fixturesYaml, + linodego.LogsDestinationTypeTrafficPeak, + linodego.LogsDestinationTrafficPeakDetailsCreateOptions{ + EndpointURL: "https://example.com/", + ContentType: linodego.Pointer("application/json"), + DataCompression: linodego.Pointer("None"), + CustomHeaders: []linodego.LogsDestinationTrafficPeakHeader{ + {Name: "x-test-header", Value: "traffic-peak"}, + }, + Authentication: linodego.LogsDestinationTrafficPeakAuthDetails{ + Details: linodego.LogsDestinationTrafficPeakBasicAuthDetails{ + Username: "user", + Password: "password", + }, + }, + }, + ) +} + +func setupCustomHTTPSLogsDestination( + t *testing.T, + fixturesYaml string, +) (*linodego.Client, *linodego.LogsDestination, func()) { + t.Helper() + requireCustomHTTPSDestinationTests(t) + + return setupHTTPLogsDestination( + t, + fixturesYaml, + linodego.LogsDestinationTypeCustomHTTPS, + linodego.LogsDestinationCustomHTTPSDetailsCreateOptions{ + EndpointURL: testCustomHTTPSEndpointURL, + Authentication: &linodego.LogsDestinationCustomHTTPSAuthDetails{ + Type: linodego.LogsDestinationCustomHTTPSAuthTypeNone, + }, + ContentType: testCustomHTTPSContentType, + DataCompression: testCustomHTTPSDataCompression, + CustomHeaders: []linodego.LogsDestinationCustomHTTPSHeader{ + {Name: testCustomHTTPSHeaderName, Value: testCustomHTTPSHeaderValue}, + }, + }, + ) +} + func testLabel() string { return "go-test-logs-monitoring-" + getUniqueText() } @@ -365,6 +495,223 @@ func TestLogsDestination_UpdateAndHistory(t *testing.T) { assert.Equal(t, newLabel, v2.Label) } +func TestLogsDestination_TrafficPeakCreate(t *testing.T) { + _, destination, teardown := setupTrafficPeakLogsDestination(t, "fixtures/TestLogsDestination_TrafficPeakCreate") + defer teardown() + + assert.Equal(t, linodego.LogsDestinationTypeTrafficPeak, destination.Type) + assert.Equal(t, "https://example.com", destination.Details.EndpointURL) + assert.Equal(t, "application/json", destination.Details.ContentType) + assert.Equal(t, "None", destination.Details.DataCompression) +} + +func TestLogsDestination_TrafficPeakGet(t *testing.T) { + client, destination, teardown := setupTrafficPeakLogsDestination(t, "fixtures/TestLogsDestination_TrafficPeakGet") + defer teardown() + + fetched, err := client.GetLogsDestination(context.Background(), destination.ID) + require.NoError(t, err) + assert.Equal(t, destination.ID, fetched.ID) + assert.Equal(t, linodego.LogsDestinationTypeTrafficPeak, fetched.Type) + assert.Equal(t, destination.Details.EndpointURL, fetched.Details.EndpointURL) +} + +func TestLogsDestination_TrafficPeakList(t *testing.T) { + client, destination, teardown := setupTrafficPeakLogsDestination(t, "fixtures/TestLogsDestination_TrafficPeakList") + defer teardown() + + destinations, err := client.ListLogsDestinations(context.Background(), nil) + require.NoError(t, err) + var found *linodego.LogsDestination + for i := range destinations { + if destinations[i].ID == destination.ID { + found = &destinations[i] + break + } + } + require.NotNil(t, found) + assert.Equal(t, linodego.LogsDestinationTypeTrafficPeak, found.Type) +} + +func TestLogsDestination_TrafficPeakUpdateAndHistory(t *testing.T) { + client, destination, teardown := setupTrafficPeakLogsDestination(t, "fixtures/TestLogsDestination_TrafficPeakUpdateAndHistory") + defer teardown() + + updatedLabel := destination.Label + "-updated" + updated, err := client.UpdateLogsDestination(context.Background(), destination.ID, linodego.LogsDestinationUpdateOptions{ + Label: updatedLabel, + Details: &linodego.LogsDestinationTrafficPeakDetailsUpdateOptions{ + ContentType: linodego.Pointer("application/x-ndjson"), + }, + }) + require.NoError(t, err) + assert.Equal(t, updatedLabel, updated.Label) + assert.Equal(t, "application/x-ndjson", updated.Details.ContentType) + + history, err := client.ListLogsDestinationHistory(context.Background(), destination.ID, nil) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(history), 2) +} + +func TestLogsDestination_TrafficPeakDelete(t *testing.T) { + client, destination, teardown := setupTrafficPeakLogsDestination(t, "fixtures/TestLogsDestination_TrafficPeakDelete") + defer teardown() + + require.NoError(t, client.DeleteLogsDestination(context.Background(), destination.ID)) + _, err := client.GetLogsDestination(context.Background(), destination.ID) + require.Error(t, err) + apiErr, ok := err.(*linodego.Error) + require.True(t, ok) + assert.Equal(t, http.StatusNotFound, apiErr.Code) +} + +func TestLogsDestination_CustomHTTPSCreate(t *testing.T) { + _, destination, teardown := setupCustomHTTPSLogsDestination(t, "fixtures/TestLogsDestination_CustomHTTPSCreate") + defer teardown() + + assert.Equal(t, linodego.LogsDestinationTypeCustomHTTPS, destination.Type) + assert.Equal(t, testCustomHTTPSEndpointURL, destination.Details.EndpointURL) + assert.Equal(t, testCustomHTTPSContentType, destination.Details.ContentType) + assert.Equal(t, testCustomHTTPSDataCompression, destination.Details.DataCompression) + require.NotNil(t, destination.Details.Authentication) + assert.Equal(t, linodego.LogsDestinationCustomHTTPSAuthTypeNone, destination.Details.Authentication.Type) + assert.Nil(t, destination.Details.Authentication.Details) + assert.Equal(t, []linodego.LogsDestinationCustomHTTPSHeader{ + {Name: testCustomHTTPSHeaderName, Value: testCustomHTTPSHeaderValue}, + }, destination.Details.CustomHeaders) +} + +func TestLogsDestination_CustomHTTPSGet(t *testing.T) { + client, destination, teardown := setupCustomHTTPSLogsDestination(t, "fixtures/TestLogsDestination_CustomHTTPSGet") + defer teardown() + + fetched, err := client.GetLogsDestination(context.Background(), destination.ID) + require.NoError(t, err) + assert.Equal(t, destination.ID, fetched.ID) + assert.Equal(t, linodego.LogsDestinationTypeCustomHTTPS, fetched.Type) + assert.Equal(t, testCustomHTTPSEndpointURL, fetched.Details.EndpointURL) + require.NotNil(t, fetched.Details.Authentication) + assert.Equal(t, linodego.LogsDestinationCustomHTTPSAuthTypeNone, fetched.Details.Authentication.Type) +} + +func TestLogsDestination_CustomHTTPSList(t *testing.T) { + client, destination, teardown := setupCustomHTTPSLogsDestination(t, "fixtures/TestLogsDestination_CustomHTTPSList") + defer teardown() + + destinations, err := client.ListLogsDestinations(context.Background(), &linodego.ListOptions{ + Filter: fmt.Sprintf(`{"id":%d}`, destination.ID), + }) + require.NoError(t, err) + require.Len(t, destinations, 1) + assert.Equal(t, destination.ID, destinations[0].ID) + assert.Equal(t, linodego.LogsDestinationTypeCustomHTTPS, destinations[0].Type) + assert.Equal(t, testCustomHTTPSEndpointURL, destinations[0].Details.EndpointURL) +} + +func TestLogsDestination_CustomHTTPSUpdateAndHistory(t *testing.T) { + client, destination, teardown := setupCustomHTTPSLogsDestination(t, "fixtures/TestLogsDestination_CustomHTTPSUpdateAndHistory") + defer teardown() + + updatedLabel := destination.Label + "-updated" + updated, err := client.UpdateLogsDestination(context.Background(), destination.ID, linodego.LogsDestinationUpdateOptions{ + Label: updatedLabel, + Details: &linodego.LogsDestinationCustomHTTPSDetailsUpdateOptions{ + ContentType: testCustomHTTPSUpdatedContentType, + EndpointURL: testCustomHTTPSEndpointURL, + Authentication: &linodego.LogsDestinationCustomHTTPSAuthDetails{ + Type: linodego.LogsDestinationCustomHTTPSAuthTypeNone, + }, + DataCompression: testCustomHTTPSDataCompression, + CustomHeaders: []linodego.LogsDestinationCustomHTTPSHeader{ + {Name: testCustomHTTPSHeaderName, Value: testCustomHTTPSHeaderValue}, + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, updatedLabel, updated.Label) + assert.Equal(t, testCustomHTTPSUpdatedContentType, updated.Details.ContentType) + assert.Equal(t, testCustomHTTPSEndpointURL, updated.Details.EndpointURL) + + history, err := client.ListLogsDestinationHistory(context.Background(), destination.ID, nil) + require.NoError(t, err) + assert.GreaterOrEqual(t, len(history), 2) +} + +func TestLogsDestination_CustomHTTPSDelete(t *testing.T) { + client, destination, teardown := setupCustomHTTPSLogsDestination(t, "fixtures/TestLogsDestination_CustomHTTPSDelete") + defer teardown() + + require.NoError(t, client.DeleteLogsDestination(context.Background(), destination.ID)) + _, err := client.GetLogsDestination(context.Background(), destination.ID) + require.Error(t, err) + apiErr, ok := err.(*linodego.Error) + require.True(t, ok) + assert.Equal(t, http.StatusNotFound, apiErr.Code) +} + +type setupHTTPLogsDestinationFunc func( + t *testing.T, + fixturesYaml string, +) (*linodego.Client, *linodego.LogsDestination, func()) + +func testLogStreamHTTPDestination( + t *testing.T, + fixturesYaml string, + setupDestination setupHTTPLogsDestinationFunc, + expectedType linodego.StreamDestinationType, +) { + t.Helper() + requireACLPLogsStreamTests(t) + + client, destination, destinationTeardown := setupDestination(t, fixturesYaml) + defer destinationTeardown() + + requireNoExistingStreams(t, client) + + stream, err := client.CreateLogStream(context.Background(), linodego.StreamCreateOptions{ + Destinations: []int{destination.ID}, + Label: fmt.Sprintf("go-test-http-destination-stream-%d", time.Now().UnixNano()), + Type: linodego.StreamTypeAuditLogs, + }) + require.NoError(t, err) + require.NotNil(t, stream) + + defer func() { + if err := client.DeleteLogStream(context.Background(), stream.ID); err != nil { + t.Errorf("failed to delete HTTP destination stream: %v", err) + return + } + if err := waitForLogStreamDeleted(context.Background(), client, stream.ID, 60, 3600); err != nil { + t.Errorf("failed waiting for HTTP destination stream deletion: %v", err) + } + }() + + provisioned, err := waitForLogStreamProvisioned(context.Background(), client, stream.ID, 60, 3600) + require.NoError(t, err) + require.Len(t, provisioned.Destinations, 1) + assert.Equal(t, destination.ID, provisioned.Destinations[0].ID) + assert.Equal(t, expectedType, provisioned.Destinations[0].Type) + assert.Equal(t, destination.Details.EndpointURL, provisioned.Destinations[0].Details.EndpointURL) +} + +func TestLogStream_TrafficPeakDestination(t *testing.T) { + testLogStreamHTTPDestination( + t, + "fixtures/TestLogStream_TrafficPeakDestination", + setupTrafficPeakLogsDestination, + linodego.StreamDestinationTypeTrafficPeak, + ) +} + +func TestLogStream_CustomHTTPSDestination(t *testing.T) { + testLogStreamHTTPDestination( + t, + "fixtures/TestLogStream_CustomHTTPSDestination", + setupCustomHTTPSLogsDestination, + linodego.StreamDestinationTypeCustomHTTPS, + ) +} + func TestLogsDestination_Create_InvalidSecret(t *testing.T) { client, teardown := createTestClient(t, "fixtures/TestLogsDestination_Create_InvalidSecret") defer teardown() diff --git a/test/unit/fixtures/monitor_log_destination_traffic_peak.json b/test/unit/fixtures/monitor_log_destination_traffic_peak.json new file mode 100644 index 000000000..4c8fd3065 --- /dev/null +++ b/test/unit/fixtures/monitor_log_destination_traffic_peak.json @@ -0,0 +1,22 @@ +{ + "id": 98765, + "version": 1, + "type": "traffic_peak", + "label": "TrafficPeak logs", + "status": "active", + "created_by": "user", + "created": "2025-09-01T10:00:00", + "updated_by": "user", + "updated": "2025-09-01T10:00:00", + "details": { + "endpoint_url": "https://example.com", + "data_compression": "None", + "content_type": "application/json", + "custom_headers": [ + { + "name": "x", + "value": "y" + } + ] + } +} diff --git a/test/unit/fixtures/monitor_log_stream_traffic_peak.json b/test/unit/fixtures/monitor_log_stream_traffic_peak.json new file mode 100644 index 000000000..9dc9c3143 --- /dev/null +++ b/test/unit/fixtures/monitor_log_stream_traffic_peak.json @@ -0,0 +1,29 @@ +{ + "created": "2025-03-20T01:41:09", + "created_by": "user", + "destinations": [ + { + "details": { + "endpoint_url": "https://example.com", + "data_compression": "None", + "content_type": "application/json", + "custom_headers": [ + { + "name": "x", + "value": "y" + } + ] + }, + "id": 98765, + "label": "TrafficPeak logs", + "type": "traffic_peak" + } + ], + "id": 456, + "label": "AuditLog-config", + "status": "active", + "type": "audit_logs", + "updated": "2025-03-20T01:41:09", + "updated_by": "user", + "version": 1 +} diff --git a/test/unit/monitor_logs_test.go b/test/unit/monitor_logs_test.go index 2811e69bd..df01d8de0 100644 --- a/test/unit/monitor_logs_test.go +++ b/test/unit/monitor_logs_test.go @@ -2,6 +2,7 @@ package unit import ( "context" + "encoding/json" "testing" "github.com/linode/linodego/v2" @@ -46,7 +47,7 @@ func TestCreateLogsDestination(t *testing.T) { assert.Equal(t, "OBJ_logs_destination", dest.Label) assert.Equal(t, linodego.LogsDestinationStatusActive, dest.Status) assert.Equal(t, linodego.LogsDestinationTypeAkamaiObjectStorage, dest.Type) - assert.Equal(t, "1ABCD23EFG4HIJKLMNO5", string(dest.Details.AccessKeyID)) + assert.Equal(t, "1ABCD23EFG4HIJKLMNO5", dest.Details.AccessKeyID) assert.Equal(t, "primary-bucket", dest.Details.BucketName) assert.Equal(t, "primary-bucket-1.us-iad-12.linodeobjects.com", dest.Details.Host) assert.Equal(t, "audit-logs", dest.Details.Path) @@ -102,7 +103,7 @@ func TestGetLogsDestination(t *testing.T) { assert.Equal(t, "user", dest.CreatedBy) assert.Equal(t, "user", dest.UpdatedBy) assert.Equal(t, 1, dest.Version) - assert.Equal(t, "1ABCD23EFG4HIJKLMNO5", string(dest.Details.AccessKeyID)) + assert.Equal(t, "1ABCD23EFG4HIJKLMNO5", dest.Details.AccessKeyID) assert.Equal(t, "primary-bucket", dest.Details.BucketName) assert.Equal(t, "primary-bucket-1.us-iad-12.linodeobjects.com", dest.Details.Host) assert.Equal(t, "audit-logs", dest.Details.Path) @@ -239,11 +240,10 @@ func TestUpdateLogsDestination_CustomHTTPS(t *testing.T) { base.MockPut("monitor/streams/destinations/67890", fixtureData) - newURL := "https://my-site.com/log-storage/v2" opts := linodego.LogsDestinationUpdateOptions{ Label: "HTTPS_logs_destination_renamed", Details: &linodego.LogsDestinationCustomHTTPSDetailsUpdateOptions{ - EndpointURL: newURL, + EndpointURL: "https://my-site.com/log-storage/v2", Authentication: &linodego.LogsDestinationCustomHTTPSAuthDetails{ Type: linodego.LogsDestinationCustomHTTPSAuthTypeBasic, Details: &linodego.LogsDestinationCustomHTTPSBasicAuthDetails{ @@ -261,6 +261,162 @@ func TestUpdateLogsDestination_CustomHTTPS(t *testing.T) { assert.Equal(t, linodego.LogsDestinationTypeCustomHTTPS, dest.Type) } +func TestCreateLogsDestination_TrafficPeak(t *testing.T) { + fixtureData, err := fixtures.GetFixture("monitor_log_destination_traffic_peak") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockPost("monitor/streams/destinations", fixtureData) + + opts := linodego.LogsDestinationCreateOptions{ + Label: "TrafficPeak logs", + Type: linodego.LogsDestinationTypeTrafficPeak, + Details: linodego.LogsDestinationTrafficPeakDetailsCreateOptions{ + EndpointURL: "https://example.com/", + DataCompression: linodego.Pointer("None"), + ContentType: linodego.Pointer("application/json"), + CustomHeaders: []linodego.LogsDestinationTrafficPeakHeader{ + {Name: "header", Value: "header_value"}, + }, + Authentication: linodego.LogsDestinationTrafficPeakAuthDetails{ + Details: linodego.LogsDestinationTrafficPeakBasicAuthDetails{ + Username: "user", + Password: "password", + }, + }, + }, + } + + requestJSON, err := json.Marshal(opts) + assert.NoError(t, err) + assert.JSONEq(t, `{ + "label": "TrafficPeak logs", + "type": "traffic_peak", + "details": { + "endpoint_url": "https://example.com/", + "data_compression": "None", + "content_type": "application/json", + "custom_headers": [{"name": "header", "value": "header_value"}], + "authentication": { + "details": { + "basic_authentication_user": "user", + "basic_authentication_password": "password" + } + } + } + }`, string(requestJSON)) + + dest, err := base.Client.CreateLogsDestination(context.Background(), opts) + assert.NoError(t, err) + assert.NotNil(t, dest) + assert.Equal(t, 98765, dest.ID) + assert.Equal(t, linodego.LogsDestinationTypeTrafficPeak, dest.Type) + assert.Equal(t, "https://example.com", dest.Details.EndpointURL) + assert.Equal(t, "None", dest.Details.DataCompression) + assert.Equal(t, "application/json", dest.Details.ContentType) + assert.Equal(t, []linodego.LogsDestinationCustomHTTPSHeader{ + {Name: "x", Value: "y"}, + }, dest.Details.CustomHeaders) +} + +func TestUpdateLogsDestination_TrafficPeak(t *testing.T) { + endpointURL := "https://example.com/v2" + opts := linodego.LogsDestinationUpdateOptions{ + Details: &linodego.LogsDestinationTrafficPeakDetailsUpdateOptions{ + EndpointURL: &endpointURL, + CustomHeaders: []linodego.LogsDestinationTrafficPeakHeader{ + {Name: "x-environment", Value: "production"}, + }, + }, + } + + requestJSON, err := json.Marshal(opts) + assert.NoError(t, err) + assert.JSONEq(t, `{ + "details": { + "endpoint_url": "https://example.com/v2", + "custom_headers": [{"name": "x-environment", "value": "production"}] + } + }`, string(requestJSON)) +} + +func TestLogsDestinationDetails_MarshalOmitsFieldsForOtherTypes(t *testing.T) { + details := linodego.LogsDestinationDetails{ + EndpointURL: "https://example.com", + ContentType: "application/json", + DataCompression: "None", + } + + detailsJSON, err := json.Marshal(details) + assert.NoError(t, err) + assert.JSONEq(t, `{ + "endpoint_url": "https://example.com", + "content_type": "application/json", + "data_compression": "None" + }`, string(detailsJSON)) +} + +func TestLogsDestinationAuthenticationDetails_MarshalJSON(t *testing.T) { + customHTTPSBasicDetails := &linodego.LogsDestinationCustomHTTPSBasicAuthDetails{ + Username: "user", + Password: "password", + } + + tests := []struct { + name string + details any + expected string + }{ + { + name: "authentication basic", + details: linodego.LogsDestinationCustomHTTPSAuthDetails{ + Type: linodego.LogsDestinationCustomHTTPSAuthTypeBasic, + Details: customHTTPSBasicDetails, + }, + expected: `{ + "type": "basic", + "details": { + "basic_authentication_user": "user", + "basic_authentication_password": "password" + } + }`, + }, + { + name: "authentication none", + details: linodego.LogsDestinationCustomHTTPSAuthDetails{ + Type: linodego.LogsDestinationCustomHTTPSAuthTypeNone, + }, + expected: `{"type": "none"}`, + }, + { + name: "TrafficPeak authentication", + details: linodego.LogsDestinationTrafficPeakAuthDetails{ + Details: linodego.LogsDestinationTrafficPeakBasicAuthDetails{ + Username: "user", + Password: "password", + }, + }, + expected: `{ + "details": { + "basic_authentication_user": "user", + "basic_authentication_password": "password" + } + }`, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result, err := json.Marshal(tt.details) + assert.NoError(t, err) + assert.JSONEq(t, tt.expected, string(result)) + }) + } +} + func TestListLogsDestinationHistory(t *testing.T) { fixtureData, err := fixtures.GetFixture("monitor_log_destinations_history_list") assert.NoError(t, err) @@ -429,6 +585,30 @@ func TestGetLogStream_DestinationDetails(t *testing.T) { assert.Equal(t, "audit-logs", dest.Details.Path) } +func TestGetLogStream_TrafficPeakDestination(t *testing.T) { + fixtureData, err := fixtures.GetFixture("monitor_log_stream_traffic_peak") + assert.NoError(t, err) + + var base ClientBaseCase + base.SetUp(t) + defer base.TearDown(t) + + base.MockGet("monitor/streams/456", fixtureData) + + stream, err := base.Client.GetLogStream(context.Background(), testLogStreamID) + assert.NoError(t, err) + assert.Len(t, stream.Destinations, 1) + + dest := stream.Destinations[0] + assert.Equal(t, linodego.StreamDestinationTypeTrafficPeak, dest.Type) + assert.Equal(t, "https://example.com", dest.Details.EndpointURL) + assert.Equal(t, "application/json", dest.Details.ContentType) + assert.Equal(t, "None", dest.Details.DataCompression) + assert.Equal(t, []linodego.LogsDestinationCustomHTTPSHeader{ + {Name: "x", Value: "y"}, + }, dest.Details.CustomHeaders) +} + func TestUpdateLogStream_DestinationsOnly(t *testing.T) { fixtureData, err := fixtures.GetFixture("monitor_log_stream") assert.NoError(t, err) From 2b9ddf37043e552c6ae88239fdadecaefcb28e25 Mon Sep 17 00:00:00 2001 From: mduda Date: Wed, 7 Oct 2026 09:05:23 +0200 Subject: [PATCH 2/2] DPS-45438: Remove custom headers due to API changes --- monitor_log_destinations.go | 12 +++-------- test/integration/monitor_logs_test.go | 14 ++++--------- .../monitor_log_destination_traffic_peak.json | 8 +------- .../monitor_log_stream_traffic_peak.json | 8 +------- test/unit/monitor_logs_test.go | 20 +++---------------- 5 files changed, 12 insertions(+), 50 deletions(-) diff --git a/monitor_log_destinations.go b/monitor_log_destinations.go index 1075a11a6..d733c0253 100644 --- a/monitor_log_destinations.go +++ b/monitor_log_destinations.go @@ -39,8 +39,10 @@ type LogsDestinationDetails struct { 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 @@ -91,12 +93,6 @@ type LogsDestinationTrafficPeakAuthDetails struct { Details LogsDestinationTrafficPeakBasicAuthDetails `json:"details"` } -// LogsDestinationTrafficPeakHeader represents a custom HTTP header sent to TrafficPeak. -type LogsDestinationTrafficPeakHeader struct { - Name string `json:"name"` - Value string `json:"value"` -} - // LogsDestinationClientCertificateDetails contains TLS client certificate information type LogsDestinationClientCertificateDetails struct { ClientCACertificate string `json:"client_ca_certificate"` @@ -122,7 +118,6 @@ type LogsDestinationTrafficPeakDetailsCreateOptions struct { EndpointURL string `json:"endpoint_url"` Authentication LogsDestinationTrafficPeakAuthDetails `json:"authentication"` ContentType *string `json:"content_type,omitzero"` - CustomHeaders []LogsDestinationTrafficPeakHeader `json:"custom_headers,omitzero"` DataCompression *string `json:"data_compression,omitzero"` } @@ -199,7 +194,6 @@ type LogsDestinationTrafficPeakDetailsUpdateOptions struct { EndpointURL *string `json:"endpoint_url,omitzero"` Authentication *LogsDestinationTrafficPeakAuthDetails `json:"authentication,omitzero"` ContentType *string `json:"content_type,omitzero"` - CustomHeaders []LogsDestinationTrafficPeakHeader `json:"custom_headers,omitzero"` DataCompression *string `json:"data_compression,omitzero"` } diff --git a/test/integration/monitor_logs_test.go b/test/integration/monitor_logs_test.go index 2a48d8f83..a6c4b51cd 100644 --- a/test/integration/monitor_logs_test.go +++ b/test/integration/monitor_logs_test.go @@ -78,7 +78,7 @@ func setupObjectStorageForLogs(t *testing.T, client *linodego.Client) (*linodego Region: regions[0], Label: testLabel(), ACL: "private", - CorsEnabled: linodego.Pointer(false), + CorsEnabled: new(false), }) if err != nil { t.Fatalf("Error creating storage bucket, got error %v", err) @@ -241,11 +241,8 @@ func setupTrafficPeakLogsDestination( linodego.LogsDestinationTypeTrafficPeak, linodego.LogsDestinationTrafficPeakDetailsCreateOptions{ EndpointURL: "https://example.com/", - ContentType: linodego.Pointer("application/json"), - DataCompression: linodego.Pointer("None"), - CustomHeaders: []linodego.LogsDestinationTrafficPeakHeader{ - {Name: "x-test-header", Value: "traffic-peak"}, - }, + ContentType: new("application/json"), + DataCompression: new("None"), Authentication: linodego.LogsDestinationTrafficPeakAuthDetails{ Details: linodego.LogsDestinationTrafficPeakBasicAuthDetails{ Username: "user", @@ -541,7 +538,7 @@ func TestLogsDestination_TrafficPeakUpdateAndHistory(t *testing.T) { updated, err := client.UpdateLogsDestination(context.Background(), destination.ID, linodego.LogsDestinationUpdateOptions{ Label: updatedLabel, Details: &linodego.LogsDestinationTrafficPeakDetailsUpdateOptions{ - ContentType: linodego.Pointer("application/x-ndjson"), + ContentType: new("application/x-ndjson"), }, }) require.NoError(t, err) @@ -576,9 +573,6 @@ func TestLogsDestination_CustomHTTPSCreate(t *testing.T) { require.NotNil(t, destination.Details.Authentication) assert.Equal(t, linodego.LogsDestinationCustomHTTPSAuthTypeNone, destination.Details.Authentication.Type) assert.Nil(t, destination.Details.Authentication.Details) - assert.Equal(t, []linodego.LogsDestinationCustomHTTPSHeader{ - {Name: testCustomHTTPSHeaderName, Value: testCustomHTTPSHeaderValue}, - }, destination.Details.CustomHeaders) } func TestLogsDestination_CustomHTTPSGet(t *testing.T) { diff --git a/test/unit/fixtures/monitor_log_destination_traffic_peak.json b/test/unit/fixtures/monitor_log_destination_traffic_peak.json index 4c8fd3065..830ec9df6 100644 --- a/test/unit/fixtures/monitor_log_destination_traffic_peak.json +++ b/test/unit/fixtures/monitor_log_destination_traffic_peak.json @@ -11,12 +11,6 @@ "details": { "endpoint_url": "https://example.com", "data_compression": "None", - "content_type": "application/json", - "custom_headers": [ - { - "name": "x", - "value": "y" - } - ] + "content_type": "application/json" } } diff --git a/test/unit/fixtures/monitor_log_stream_traffic_peak.json b/test/unit/fixtures/monitor_log_stream_traffic_peak.json index 9dc9c3143..ba3a3b06e 100644 --- a/test/unit/fixtures/monitor_log_stream_traffic_peak.json +++ b/test/unit/fixtures/monitor_log_stream_traffic_peak.json @@ -6,13 +6,7 @@ "details": { "endpoint_url": "https://example.com", "data_compression": "None", - "content_type": "application/json", - "custom_headers": [ - { - "name": "x", - "value": "y" - } - ] + "content_type": "application/json" }, "id": 98765, "label": "TrafficPeak logs", diff --git a/test/unit/monitor_logs_test.go b/test/unit/monitor_logs_test.go index df01d8de0..b14fb3684 100644 --- a/test/unit/monitor_logs_test.go +++ b/test/unit/monitor_logs_test.go @@ -276,11 +276,8 @@ func TestCreateLogsDestination_TrafficPeak(t *testing.T) { Type: linodego.LogsDestinationTypeTrafficPeak, Details: linodego.LogsDestinationTrafficPeakDetailsCreateOptions{ EndpointURL: "https://example.com/", - DataCompression: linodego.Pointer("None"), - ContentType: linodego.Pointer("application/json"), - CustomHeaders: []linodego.LogsDestinationTrafficPeakHeader{ - {Name: "header", Value: "header_value"}, - }, + DataCompression: new("None"), + ContentType: new("application/json"), Authentication: linodego.LogsDestinationTrafficPeakAuthDetails{ Details: linodego.LogsDestinationTrafficPeakBasicAuthDetails{ Username: "user", @@ -299,7 +296,6 @@ func TestCreateLogsDestination_TrafficPeak(t *testing.T) { "endpoint_url": "https://example.com/", "data_compression": "None", "content_type": "application/json", - "custom_headers": [{"name": "header", "value": "header_value"}], "authentication": { "details": { "basic_authentication_user": "user", @@ -317,9 +313,6 @@ func TestCreateLogsDestination_TrafficPeak(t *testing.T) { assert.Equal(t, "https://example.com", dest.Details.EndpointURL) assert.Equal(t, "None", dest.Details.DataCompression) assert.Equal(t, "application/json", dest.Details.ContentType) - assert.Equal(t, []linodego.LogsDestinationCustomHTTPSHeader{ - {Name: "x", Value: "y"}, - }, dest.Details.CustomHeaders) } func TestUpdateLogsDestination_TrafficPeak(t *testing.T) { @@ -327,9 +320,6 @@ func TestUpdateLogsDestination_TrafficPeak(t *testing.T) { opts := linodego.LogsDestinationUpdateOptions{ Details: &linodego.LogsDestinationTrafficPeakDetailsUpdateOptions{ EndpointURL: &endpointURL, - CustomHeaders: []linodego.LogsDestinationTrafficPeakHeader{ - {Name: "x-environment", Value: "production"}, - }, }, } @@ -337,8 +327,7 @@ func TestUpdateLogsDestination_TrafficPeak(t *testing.T) { assert.NoError(t, err) assert.JSONEq(t, `{ "details": { - "endpoint_url": "https://example.com/v2", - "custom_headers": [{"name": "x-environment", "value": "production"}] + "endpoint_url": "https://example.com/v2" } }`, string(requestJSON)) } @@ -604,9 +593,6 @@ func TestGetLogStream_TrafficPeakDestination(t *testing.T) { assert.Equal(t, "https://example.com", dest.Details.EndpointURL) assert.Equal(t, "application/json", dest.Details.ContentType) assert.Equal(t, "None", dest.Details.DataCompression) - assert.Equal(t, []linodego.LogsDestinationCustomHTTPSHeader{ - {Name: "x", Value: "y"}, - }, dest.Details.CustomHeaders) } func TestUpdateLogStream_DestinationsOnly(t *testing.T) {