Skip to content

Commit

Permalink
Add support for Kinesis logging endpoint (#234)
Browse files Browse the repository at this point in the history
* Add support for Kinesis logging endpoint

* Updates to make kinesis logging use v2 conventions

Updates to make kinesis logging use v2 conventions and some minor changes based
on review feedback.

* Address some comment consistency from review feedback
  • Loading branch information
kellymclaughlin authored Dec 11, 2020
1 parent 28e7868 commit b97b68b
Show file tree
Hide file tree
Showing 9 changed files with 911 additions and 0 deletions.
91 changes: 91 additions & 0 deletions fastly/fixtures/kineses/cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
version: 1
interactions:
- request:
body: ""
form: {}
headers:
User-Agent:
- FastlyGo/1.18.0 (+github.com/fastly/go-fastly; go1.15.2)
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/43/logging/kinesis/test-kinesis
method: DELETE
response:
body: '{"msg":"Record not found","detail":"Couldn''t find syslog ''{ deleted =\u003e
0000-00-00 00:00:00, name =\u003e test-kinesis, service =\u003e 7i6HN3TK9wS159v2gPAZ8A,
version =\u003e 43 }''"}'
headers:
Accept-Ranges:
- bytes
Cache-Control:
- no-cache
Content-Type:
- application/json
Date:
- Tue, 17 Nov 2020 17:45:09 GMT
Fastly-Ratelimit-Remaining:
- "983"
Fastly-Ratelimit-Reset:
- "1605636000"
Status:
- 404 Not Found
Strict-Transport-Security:
- max-age=31536000
Vary:
- Accept-Encoding
Via:
- 1.1 varnish, 1.1 varnish
X-Cache:
- MISS, MISS
X-Cache-Hits:
- 0, 0
X-Served-By:
- cache-control-slwdc9037-CONTROL-SLWDC, cache-den19634-DEN
X-Timer:
- S1605635110.578083,VS0,VE240
status: 404 Not Found
code: 404
duration: ""
- request:
body: ""
form: {}
headers:
User-Agent:
- FastlyGo/1.18.0 (+github.com/fastly/go-fastly; go1.15.2)
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/43/logging/kinesis/new-test-kinesis
method: DELETE
response:
body: '{"msg":"Record not found","detail":"Couldn''t find syslog ''{ deleted =\u003e
0000-00-00 00:00:00, name =\u003e new-test-kinesis, service =\u003e 7i6HN3TK9wS159v2gPAZ8A,
version =\u003e 43 }''"}'
headers:
Accept-Ranges:
- bytes
Cache-Control:
- no-cache
Content-Type:
- application/json
Date:
- Tue, 17 Nov 2020 17:45:09 GMT
Fastly-Ratelimit-Remaining:
- "982"
Fastly-Ratelimit-Reset:
- "1605636000"
Status:
- 404 Not Found
Strict-Transport-Security:
- max-age=31536000
Vary:
- Accept-Encoding
Via:
- 1.1 varnish, 1.1 varnish
X-Cache:
- MISS, MISS
X-Cache-Hits:
- 0, 0
X-Served-By:
- cache-control-slwdc9035-CONTROL-SLWDC, cache-den19634-DEN
X-Timer:
- S1605635110.831632,VS0,VE135
status: 404 Not Found
code: 404
duration: ""
67 changes: 67 additions & 0 deletions fastly/fixtures/kineses/create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
version: 1
interactions:
- request:
body: Service=7i6HN3TK9wS159v2gPAZ8A&Version=43&access_key=AKIAIOSFODNN7EXAMPLE&format=format&format_version=2&name=test-kinesis&placement=waf_debug&region=us-east-1&secret_key=wJalrXUtnFEMI%2FK7MDENG%2FbPxRfiCYEXAMPLEKEY&topic=stream-name
form:
Service:
- 7i6HN3TK9wS159v2gPAZ8A
Version:
- "43"
access_key:
- AKIAIOSFODNN7EXAMPLE
format:
- format
format_version:
- "2"
name:
- test-kinesis
placement:
- waf_debug
region:
- us-east-1
secret_key:
- wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
topic:
- stream-name
headers:
Content-Type:
- application/x-www-form-urlencoded
User-Agent:
- FastlyGo/1.18.0 (+github.com/fastly/go-fastly; go1.15.2)
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/43/logging/kinesis
method: POST
response:
body: '{"access_key":"AKIAIOSFODNN7EXAMPLE","format":"format","format_version":"2","name":"test-kinesis","placement":"waf_debug","region":"us-east-1","secret_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY","topic":"stream-name","service_id":"7i6HN3TK9wS159v2gPAZ8A","version":"43","created_at":"2020-11-17T17:45:07Z","updated_at":"2020-11-17T17:45:07Z","deleted_at":null}'
headers:
Accept-Ranges:
- bytes
Cache-Control:
- no-cache
Content-Type:
- application/json
Date:
- Tue, 17 Nov 2020 17:45:08 GMT
Fastly-Ratelimit-Remaining:
- "986"
Fastly-Ratelimit-Reset:
- "1605636000"
Status:
- 200 OK
Strict-Transport-Security:
- max-age=31536000
Vary:
- Accept-Encoding
Via:
- 1.1 varnish, 1.1 varnish
X-Cache:
- MISS, MISS
X-Cache-Hits:
- 0, 0
X-Served-By:
- cache-control-slwdc9036-CONTROL-SLWDC, cache-den19634-DEN
X-Timer:
- S1605635108.721871,VS0,VE568
status: 200 OK
code: 200
duration: ""
45 changes: 45 additions & 0 deletions fastly/fixtures/kineses/delete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
version: 1
interactions:
- request:
body: ""
form: {}
headers:
User-Agent:
- FastlyGo/1.18.0 (+github.com/fastly/go-fastly; go1.15.2)
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/43/logging/kinesis/new-test-kinesis
method: DELETE
response:
body: '{"status":"ok"}'
headers:
Accept-Ranges:
- bytes
Cache-Control:
- no-cache
Content-Type:
- application/json
Date:
- Tue, 17 Nov 2020 17:45:09 GMT
Fastly-Ratelimit-Remaining:
- "984"
Fastly-Ratelimit-Reset:
- "1605636000"
Status:
- 200 OK
Strict-Transport-Security:
- max-age=31536000
Vary:
- Accept-Encoding
Via:
- 1.1 varnish, 1.1 varnish
X-Cache:
- MISS, MISS
X-Cache-Hits:
- 0, 0
X-Served-By:
- cache-control-slwdc9036-CONTROL-SLWDC, cache-den19634-DEN
X-Timer:
- S1605635109.260099,VS0,VE258
status: 200 OK
code: 200
duration: ""
41 changes: 41 additions & 0 deletions fastly/fixtures/kineses/get.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
version: 1
interactions:
- request:
body: ""
form: {}
headers:
User-Agent:
- FastlyGo/1.18.0 (+github.com/fastly/go-fastly; go1.15.2)
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/43/logging/kinesis/test-kinesis
method: GET
response:
body: '{"topic":"stream-name","service_id":"7i6HN3TK9wS159v2gPAZ8A","created_at":"2020-11-17T17:45:07Z","access_key":"AKIAIOSFODNN7EXAMPLE","name":"test-kinesis","format":"format","deleted_at":null,"version":"43","updated_at":"2020-11-17T17:45:07Z","format_version":"2","secret_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY","region":"us-east-1","placement":"waf_debug"}'
headers:
Accept-Ranges:
- bytes
Cache-Control:
- no-cache
Content-Type:
- application/json
Date:
- Tue, 17 Nov 2020 17:45:08 GMT
Status:
- 200 OK
Strict-Transport-Security:
- max-age=31536000
Vary:
- Accept-Encoding
Via:
- 1.1 varnish, 1.1 varnish
X-Cache:
- MISS, MISS
X-Cache-Hits:
- 0, 0
X-Served-By:
- cache-control-slwdc9035-CONTROL-SLWDC, cache-den19634-DEN
X-Timer:
- S1605635109.543635,VS0,VE140
status: 200 OK
code: 200
duration: ""
41 changes: 41 additions & 0 deletions fastly/fixtures/kineses/list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
version: 1
interactions:
- request:
body: ""
form: {}
headers:
User-Agent:
- FastlyGo/1.18.0 (+github.com/fastly/go-fastly; go1.15.2)
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/43/logging/kinesis
method: GET
response:
body: '[{"access_key":"AKIAIOSFODNN7EXAMPLE","region":"us-east-1","placement":"waf_debug","format":"format","name":"test-kinesis","version":"43","created_at":"2020-11-17T17:45:07Z","topic":"stream-name","service_id":"7i6HN3TK9wS159v2gPAZ8A","secret_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY","updated_at":"2020-11-17T17:45:07Z","deleted_at":null,"format_version":"2"}]'
headers:
Accept-Ranges:
- bytes
Cache-Control:
- no-cache
Content-Type:
- application/json
Date:
- Tue, 17 Nov 2020 17:45:08 GMT
Status:
- 200 OK
Strict-Transport-Security:
- max-age=31536000
Vary:
- Accept-Encoding
Via:
- 1.1 varnish, 1.1 varnish
X-Cache:
- MISS, MISS
X-Cache-Hits:
- 0, 0
X-Served-By:
- cache-control-slwdc9035-CONTROL-SLWDC, cache-den19634-DEN
X-Timer:
- S1605635108.340873,VS0,VE173
status: 200 OK
code: 200
duration: ""
55 changes: 55 additions & 0 deletions fastly/fixtures/kineses/update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
version: 1
interactions:
- request:
body: Name=test-kinesis&Service=7i6HN3TK9wS159v2gPAZ8A&Version=43&name=new-test-kinesis
form:
Name:
- test-kinesis
Service:
- 7i6HN3TK9wS159v2gPAZ8A
Version:
- "43"
name:
- new-test-kinesis
headers:
Content-Type:
- application/x-www-form-urlencoded
User-Agent:
- FastlyGo/1.18.0 (+github.com/fastly/go-fastly; go1.15.2)
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/43/logging/kinesis/test-kinesis
method: PUT
response:
body: '{"created_at":"2020-11-17T17:45:07Z","service_id":"7i6HN3TK9wS159v2gPAZ8A","topic":"stream-name","format_version":"2","updated_at":"2020-11-17T17:45:07Z","version":"43","deleted_at":null,"format":"format","name":"new-test-kinesis","access_key":"AKIAIOSFODNN7EXAMPLE","region":"us-east-1","secret_key":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY","placement":"waf_debug"}'
headers:
Accept-Ranges:
- bytes
Cache-Control:
- no-cache
Content-Type:
- application/json
Date:
- Tue, 17 Nov 2020 17:45:09 GMT
Fastly-Ratelimit-Remaining:
- "985"
Fastly-Ratelimit-Reset:
- "1605636000"
Status:
- 200 OK
Strict-Transport-Security:
- max-age=31536000
Vary:
- Accept-Encoding
Via:
- 1.1 varnish, 1.1 varnish
X-Cache:
- MISS, MISS
X-Cache-Hits:
- 0, 0
X-Served-By:
- cache-control-slwdc9037-CONTROL-SLWDC, cache-den19634-DEN
X-Timer:
- S1605635109.701387,VS0,VE533
status: 200 OK
code: 200
duration: ""
49 changes: 49 additions & 0 deletions fastly/fixtures/kineses/version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
version: 1
interactions:
- request:
body: Service=7i6HN3TK9wS159v2gPAZ8A
form:
Service:
- 7i6HN3TK9wS159v2gPAZ8A
headers:
Content-Type:
- application/x-www-form-urlencoded
User-Agent:
- FastlyGo/1.18.0 (+github.com/fastly/go-fastly; go1.15.2)
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version
method: POST
response:
body: '{"service_id":"7i6HN3TK9wS159v2gPAZ8A","number":43}'
headers:
Accept-Ranges:
- bytes
Cache-Control:
- no-cache
Content-Type:
- application/json
Date:
- Tue, 17 Nov 2020 17:45:07 GMT
Fastly-Ratelimit-Remaining:
- "987"
Fastly-Ratelimit-Reset:
- "1605636000"
Status:
- 200 OK
Strict-Transport-Security:
- max-age=31536000
Vary:
- Accept-Encoding
Via:
- 1.1 varnish, 1.1 varnish
X-Cache:
- MISS, MISS
X-Cache-Hits:
- 0, 0
X-Served-By:
- cache-control-slwdc9035-CONTROL-SLWDC, cache-den19634-DEN
X-Timer:
- S1605635108.508372,VS0,VE194
status: 200 OK
code: 200
duration: ""
Loading

0 comments on commit b97b68b

Please sign in to comment.