-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(resource): implement Resource API (#390)
* feat(resource): implement Resource API * feat(resource): resource tests * fix(resources): tests now have fixtures generated * fix(resources): validation test checks expected error type * fix(resource): tests weren't correct
- Loading branch information
1 parent
0774f09
commit cfc27ee
Showing
12 changed files
with
904 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
User-Agent: | ||
- FastlyGo/7.0.0 (+github.com/fastly/go-fastly; go1.16.15) | ||
url: https://api.fastly.com/resources/stores/object/2dem3bjbpie7k1vyy70fh5 | ||
method: DELETE | ||
response: | ||
body: "" | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Date: | ||
- Thu, 19 Jan 2023 11:28:16 GMT | ||
Strict-Transport-Security: | ||
- max-age=31536000 | ||
Via: | ||
- 1.1 varnish | ||
X-Cache: | ||
- MISS | ||
X-Cache-Hits: | ||
- "0" | ||
X-Served-By: | ||
- cache-fty21339-FTY, cache-man4131-MAN | ||
X-Timer: | ||
- S1674127696.810292,VS0,VE563 | ||
status: 204 No Content | ||
code: 204 | ||
duration: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
User-Agent: | ||
- FastlyGo/7.0.0 (+github.com/fastly/go-fastly; go1.16.15) | ||
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/5/resource/rn6c7YSyRxBJMejpyvoQa1 | ||
method: DELETE | ||
response: | ||
body: '{"msg":"Record not found","detail":"Couldn''t find Link ''{ deleted =\u003e | ||
0000-00-00 00:00:00, id =\u003e rn6c7YSyRxBJMejpyvoQa1, service =\u003e 7i6HN3TK9wS159v2gPAZ8A, | ||
version =\u003e 5 }''"}' | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Cache-Control: | ||
- no-store | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Thu, 19 Jan 2023 11:28:15 GMT | ||
Fastly-Ratelimit-Remaining: | ||
- "9990" | ||
Fastly-Ratelimit-Reset: | ||
- "1674129600" | ||
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-cp-aws-us-east-1-prod-5-CONTROL-AWS, cache-man4131-MAN | ||
X-Timer: | ||
- S1674127695.461054,VS0,VE322 | ||
status: 404 Not Found | ||
code: 404 | ||
duration: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: '{"name":"test-object-store"}' | ||
form: {} | ||
headers: | ||
Accept: | ||
- application/json | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- FastlyGo/7.0.0 (+github.com/fastly/go-fastly; go1.16.15) | ||
url: https://api.fastly.com/resources/stores/object | ||
method: POST | ||
response: | ||
body: '{"id":"2dem3bjbpie7k1vyy70fh5","name":"test-object-store","created_at":"2023-01-19T11:28:13.754Z","updated_at":"2023-01-19T11:28:13.754Z"}' | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Thu, 19 Jan 2023 11:28:13 GMT | ||
Strict-Transport-Security: | ||
- max-age=31536000 | ||
Via: | ||
- 1.1 varnish | ||
X-Cache: | ||
- MISS | ||
X-Cache-Hits: | ||
- "0" | ||
X-Served-By: | ||
- cache-fty21339-FTY, cache-man4131-MAN | ||
X-Timer: | ||
- S1674127692.140623,VS0,VE1665 | ||
status: 201 Created | ||
code: 201 | ||
duration: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: name=test-object-store-name-for-linking&resource_id=2dem3bjbpie7k1vyy70fh5 | ||
form: | ||
name: | ||
- test-object-store-name-for-linking | ||
resource_id: | ||
- 2dem3bjbpie7k1vyy70fh5 | ||
headers: | ||
Content-Type: | ||
- application/x-www-form-urlencoded | ||
User-Agent: | ||
- FastlyGo/7.0.0 (+github.com/fastly/go-fastly; go1.16.15) | ||
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/5/resource | ||
method: POST | ||
response: | ||
body: '{"id":"rn6c7YSyRxBJMejpyvoQa1","name":"test-object-store-name-for-linking","service_id":"7i6HN3TK9wS159v2gPAZ8A","version":5,"created_at":"2023-01-19T11:28:14Z","updated_at":"2023-01-19T11:28:14Z","deleted_at":null,"resource_id":"2dem3bjbpie7k1vyy70fh5","resource_type":"object-store","href":null}' | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Cache-Control: | ||
- no-store | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Thu, 19 Jan 2023 11:28:14 GMT | ||
Fastly-Ratelimit-Remaining: | ||
- "9993" | ||
Fastly-Ratelimit-Reset: | ||
- "1674129600" | ||
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-cp-aws-us-east-1-prod-3-CONTROL-AWS, cache-man4131-MAN | ||
X-Timer: | ||
- S1674127694.832397,VS0,VE381 | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
User-Agent: | ||
- FastlyGo/7.0.0 (+github.com/fastly/go-fastly; go1.16.15) | ||
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/5/resource/rn6c7YSyRxBJMejpyvoQa1 | ||
method: DELETE | ||
response: | ||
body: '{"status":"ok"}' | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Cache-Control: | ||
- no-store | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Thu, 19 Jan 2023 11:28:15 GMT | ||
Fastly-Ratelimit-Remaining: | ||
- "9991" | ||
Fastly-Ratelimit-Reset: | ||
- "1674129600" | ||
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-cp-aws-us-east-1-prod-5-CONTROL-AWS, cache-man4131-MAN | ||
X-Timer: | ||
- S1674127695.215445,VS0,VE220 | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
User-Agent: | ||
- FastlyGo/7.0.0 (+github.com/fastly/go-fastly; go1.16.15) | ||
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/5/resource/rn6c7YSyRxBJMejpyvoQa1 | ||
method: GET | ||
response: | ||
body: '{"id":"rn6c7YSyRxBJMejpyvoQa1","name":"test-object-store-name-for-linking","service_id":"7i6HN3TK9wS159v2gPAZ8A","version":5,"created_at":"2023-01-19T11:28:14Z","updated_at":"2023-01-19T11:28:14Z","deleted_at":null,"resource_id":"2dem3bjbpie7k1vyy70fh5","resource_type":"object-store","href":null}' | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Cache-Control: | ||
- no-store | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Thu, 19 Jan 2023 11:28:14 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-cp-aws-us-east-1-prod-3-CONTROL-AWS, cache-man4131-MAN | ||
X-Timer: | ||
- S1674127695.594823,VS0,VE341 | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
User-Agent: | ||
- FastlyGo/7.0.0 (+github.com/fastly/go-fastly; go1.16.15) | ||
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/5/resource | ||
method: GET | ||
response: | ||
body: '[{"id":"rn6c7YSyRxBJMejpyvoQa1","name":"test-object-store-name-for-linking","service_id":"7i6HN3TK9wS159v2gPAZ8A","version":5,"created_at":"2023-01-19T11:28:14Z","updated_at":"2023-01-19T11:28:14Z","deleted_at":null,"resource_id":"2dem3bjbpie7k1vyy70fh5","resource_type":"object-store","href":null}]' | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Cache-Control: | ||
- no-store | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Thu, 19 Jan 2023 11:28:14 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-cp-aws-us-east-1-prod-1-CONTROL-AWS, cache-man4131-MAN | ||
X-Timer: | ||
- S1674127694.241459,VS0,VE328 | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: name=new-object-store-alias-for-my-service | ||
form: | ||
name: | ||
- new-object-store-alias-for-my-service | ||
headers: | ||
Content-Type: | ||
- application/x-www-form-urlencoded | ||
User-Agent: | ||
- FastlyGo/7.0.0 (+github.com/fastly/go-fastly; go1.16.15) | ||
url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/5/resource/rn6c7YSyRxBJMejpyvoQa1 | ||
method: PUT | ||
response: | ||
body: '{"id":"rn6c7YSyRxBJMejpyvoQa1","name":"new-object-store-alias-for-my-service","service_id":"7i6HN3TK9wS159v2gPAZ8A","version":5,"created_at":"2023-01-19T11:28:14Z","updated_at":"2023-01-19T11:28:14Z","deleted_at":null,"resource_id":"2dem3bjbpie7k1vyy70fh5","resource_type":"object-store","href":null}' | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Cache-Control: | ||
- no-store | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Thu, 19 Jan 2023 11:28:15 GMT | ||
Fastly-Ratelimit-Remaining: | ||
- "9992" | ||
Fastly-Ratelimit-Reset: | ||
- "1674129600" | ||
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-cp-aws-us-east-1-prod-1-CONTROL-AWS, cache-man4131-MAN | ||
X-Timer: | ||
- S1674127695.965974,VS0,VE222 | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
Oops, something went wrong.