Skip to content

Commit

Permalink
Merge pull request #46 from Jimdo/clone_versions
Browse files Browse the repository at this point in the history
Clone Old Versions When Updating Services
  • Loading branch information
smon authored Apr 10, 2018
2 parents f1b3609 + 5d231b6 commit 3c2db0f
Show file tree
Hide file tree
Showing 40 changed files with 11,435 additions and 2,737 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
*.pyc
.*.sw?
venv/
380 changes: 296 additions & 84 deletions library/fastly_service.py

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions tests/fixtures/cassettes/TestFastlyCacheSettings_tearDown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,82 +6,82 @@ interactions:
method: GET
uri: https://api.fastly.com/service/search?name=Fastly%20Ansible%20Module%20Test
response:
body: {string: !!python/unicode '{"name":"Fastly Ansible Module Test","deleted_at":null,"versions":[{"testing":false,"locked":false,"number":1,"active":false,"service_id":"3QhmHI5SRhK6mQ8YK5Gmz2","staging":false,"created_at":"2017-10-10T10:33:22Z","deleted_at":null,"comment":"","updated_at":"2017-10-10T10:33:22Z","deployed":false},{"testing":false,"number":2,"service_id":"3QhmHI5SRhK6mQ8YK5Gmz2","staging":false,"deployed":false,"locked":true,"active":true,"comment":""}],"created_at":"2017-10-10T10:33:22Z","customer_id":"1z3ENiEMpKOrsGqTBLhkF2","comment":"","updated_at":"2017-10-10T10:33:22Z","id":"3QhmHI5SRhK6mQ8YK5Gmz2"}'}
body: {string: !!python/unicode '{"name":"Fastly Ansible Module Test","deleted_at":null,"versions":[{"testing":false,"locked":false,"number":1,"active":false,"service_id":"2T6RaPUWpO8jsWHVVNXvc","staging":false,"created_at":"2018-04-10T14:39:42Z","deleted_at":null,"comment":"","updated_at":"2018-04-10T14:39:42Z","deployed":false},{"testing":false,"number":2,"service_id":"2T6RaPUWpO8jsWHVVNXvc","staging":false,"updated_at":"2018-04-10T14:39:51Z","deployed":false,"locked":true,"active":true,"deleted_at":null,"created_at":"2018-04-10T14:39:43Z","comment":""}],"created_at":"2018-04-10T14:39:42Z","customer_id":"31RPDMBpiruA1yfGA2djLm","comment":"","updated_at":"2018-04-10T14:39:42Z","id":"2T6RaPUWpO8jsWHVVNXvc"}'}
headers:
accept-ranges: [bytes]
age: ['0']
cache-control: [no-cache]
connection: [keep-alive]
content-length: ['596']
content-length: ['683']
content-type: [application/json]
date: ['Tue, 10 Oct 2017 10:33:29 GMT']
date: ['Tue, 10 Apr 2018 14:39:53 GMT']
status: [200 OK]
vary: [Accept-Encoding]
via: [1.1 varnish, 1.1 varnish]
x-cache: ['MISS, MISS']
x-cache-hits: ['0, 0']
x-served-by: ['app-slwdc9051-SL, cache-ams4430-AMS']
x-timer: ['S1507631609.073426,VS0,VE135']
x-served-by: ['app-slwdc9051-SL, cache-fra19136-FRA']
x-timer: ['S1523371193.167579,VS0,VE143']
status: {code: 200, message: OK}
- request:
body: null
headers:
Content-Type: [application/json]
method: GET
uri: https://api.fastly.com/service/3QhmHI5SRhK6mQ8YK5Gmz2/details
uri: https://api.fastly.com/service/2T6RaPUWpO8jsWHVVNXvc/details
response:
body: {string: !!python/unicode '{"name":"Fastly Ansible Module Test","deleted_at":null,"versions":[{"testing":false,"locked":false,"number":1,"active":false,"service_id":"3QhmHI5SRhK6mQ8YK5Gmz2","staging":false,"created_at":"2017-10-10T10:33:22Z","deleted_at":null,"comment":"","updated_at":"2017-10-10T10:33:22Z","deployed":false},{"testing":false,"locked":true,"number":2,"active":true,"service_id":"3QhmHI5SRhK6mQ8YK5Gmz2","staging":false,"created_at":"2017-10-10T10:33:23Z","deleted_at":null,"comment":"","updated_at":"2017-10-10T10:33:27Z","deployed":false}],"created_at":"2017-10-10T10:33:22Z","customer_id":"1z3ENiEMpKOrsGqTBLhkF2","comment":"","updated_at":"2017-10-10T10:33:22Z","id":"3QhmHI5SRhK6mQ8YK5Gmz2","version":{"testing":false,"number":2,"service_id":"3QhmHI5SRhK6mQ8YK5Gmz2","staging":false,"updated_at":"2017-10-10T10:33:27Z","deployed":false,"locked":true,"active":true,"deleted_at":null,"created_at":"2017-10-10T10:33:23Z","comment":"","acls":[],"backends":[{"max_tls_version":null,"ssl_ca_cert":null,"auto_loadbalance":false,"ssl_check_cert":true,"shield":null,"hostname":null,"ssl_client_cert":null,"error_threshold":0,"request_condition":"","first_byte_timeout":15000,"ssl_cert_hostname":null,"weight":100,"client_cert":null,"address":"127.0.0.1","ssl_hostname":null,"ssl_sni_hostname":null,"min_tls_version":null,"ipv6":null,"ipv4":"127.0.0.1","connect_timeout":1000,"ssl_ciphers":null,"name":"localhost","healthcheck":null,"port":80,"max_conn":200,"use_ssl":false,"comment":"","between_bytes_timeout":10000,"ssl_client_key":null}],"cache_settings":[{"stale_ttl":"10","ttl":null,"name":"cache-settings-config-name","action":null,"cache_condition":""}],"conditions":[],"dictionaries":[],"directors":[],"domains":[{"comment":"","name":"example8000.com"}],"gzips":[],"headers":[{"priority":"100","src":"\"https://u.jimcdn.com\"
body: {string: !!python/unicode '{"name":"Fastly Ansible Module Test","deleted_at":null,"versions":[{"testing":false,"locked":false,"number":1,"active":false,"service_id":"2T6RaPUWpO8jsWHVVNXvc","staging":false,"created_at":"2018-04-10T14:39:42Z","deleted_at":null,"comment":"","updated_at":"2018-04-10T14:39:42Z","deployed":false},{"testing":false,"locked":true,"number":2,"active":true,"service_id":"2T6RaPUWpO8jsWHVVNXvc","staging":false,"created_at":"2018-04-10T14:39:43Z","deleted_at":null,"comment":"","updated_at":"2018-04-10T14:39:51Z","deployed":false}],"created_at":"2018-04-10T14:39:42Z","customer_id":"31RPDMBpiruA1yfGA2djLm","comment":"","updated_at":"2018-04-10T14:39:42Z","id":"2T6RaPUWpO8jsWHVVNXvc","version":{"testing":false,"number":2,"service_id":"2T6RaPUWpO8jsWHVVNXvc","staging":false,"updated_at":"2018-04-10T14:39:51Z","deployed":false,"locked":true,"active":true,"deleted_at":null,"created_at":"2018-04-10T14:39:43Z","comment":"","acls":[],"backends":[{"max_tls_version":null,"ssl_ca_cert":null,"auto_loadbalance":false,"ssl_check_cert":true,"shield":null,"hostname":null,"ssl_client_cert":null,"error_threshold":0,"request_condition":"","first_byte_timeout":15000,"ssl_cert_hostname":null,"weight":100,"client_cert":null,"address":"127.0.0.1","ssl_hostname":null,"ssl_sni_hostname":null,"min_tls_version":null,"ipv6":null,"ipv4":"127.0.0.1","connect_timeout":1000,"ssl_ciphers":null,"name":"localhost","healthcheck":null,"port":80,"max_conn":200,"use_ssl":false,"comment":"","between_bytes_timeout":10000,"ssl_client_key":null}],"cache_settings":[{"stale_ttl":"10","ttl":null,"name":"cache-settings-config-name","action":null,"cache_condition":""}],"conditions":[],"dictionaries":[],"directors":[],"domains":[{"comment":"","name":"example8000.com"}],"gzips":[],"headers":[{"priority":"100","src":"\"https://u.jimcdn.com\"
req.url.path","name":"Set Location header","substitution":"","ignore_if_set":"0","cache_condition":null,"request_condition":null,"regex":"","response_condition":null,"action":"set","type":"response","dst":"http.Location"}],"healthchecks":[],"request_settings":[],"response_objects":[{"request_condition":"","content_type":"","status":"200","response":"Ok","name":"Set
200 status code","content":"","cache_condition":""}],"snippets":[],"vcls":[],"wordpress":[],"settings":{"general.default_ttl":3600,"general.default_host":"","general.default_pci":0}},"active_version":{"testing":false,"number":2,"service_id":"3QhmHI5SRhK6mQ8YK5Gmz2","staging":false,"updated_at":"2017-10-10T10:33:27Z","deployed":false,"locked":true,"active":true,"deleted_at":null,"created_at":"2017-10-10T10:33:23Z","comment":"","acls":[],"backends":[{"max_tls_version":null,"ssl_ca_cert":null,"auto_loadbalance":false,"ssl_check_cert":true,"shield":null,"hostname":null,"ssl_client_cert":null,"error_threshold":0,"request_condition":"","first_byte_timeout":15000,"ssl_cert_hostname":null,"weight":100,"client_cert":null,"address":"127.0.0.1","ssl_hostname":null,"ssl_sni_hostname":null,"min_tls_version":null,"ipv6":null,"ipv4":"127.0.0.1","connect_timeout":1000,"ssl_ciphers":null,"name":"localhost","healthcheck":null,"port":80,"max_conn":200,"use_ssl":false,"comment":"","between_bytes_timeout":10000,"ssl_client_key":null}],"cache_settings":[{"stale_ttl":"10","ttl":null,"name":"cache-settings-config-name","action":null,"cache_condition":""}],"conditions":[],"dictionaries":[],"directors":[],"domains":[{"comment":"","name":"example8000.com"}],"gzips":[],"headers":[{"priority":"100","src":"\"https://u.jimcdn.com\"
200 status code","content":"","cache_condition":""}],"snippets":[],"vcls":[],"wordpress":[],"settings":{"general.default_ttl":3600,"general.default_host":"","general.default_pci":0}},"active_version":{"testing":false,"number":2,"service_id":"2T6RaPUWpO8jsWHVVNXvc","staging":false,"updated_at":"2018-04-10T14:39:51Z","deployed":false,"locked":true,"active":true,"deleted_at":null,"created_at":"2018-04-10T14:39:43Z","comment":"","acls":[],"backends":[{"max_tls_version":null,"ssl_ca_cert":null,"auto_loadbalance":false,"ssl_check_cert":true,"shield":null,"hostname":null,"ssl_client_cert":null,"error_threshold":0,"request_condition":"","first_byte_timeout":15000,"ssl_cert_hostname":null,"weight":100,"client_cert":null,"address":"127.0.0.1","ssl_hostname":null,"ssl_sni_hostname":null,"min_tls_version":null,"ipv6":null,"ipv4":"127.0.0.1","connect_timeout":1000,"ssl_ciphers":null,"name":"localhost","healthcheck":null,"port":80,"max_conn":200,"use_ssl":false,"comment":"","between_bytes_timeout":10000,"ssl_client_key":null}],"cache_settings":[{"stale_ttl":"10","ttl":null,"name":"cache-settings-config-name","action":null,"cache_condition":""}],"conditions":[],"dictionaries":[],"directors":[],"domains":[{"comment":"","name":"example8000.com"}],"gzips":[],"headers":[{"priority":"100","src":"\"https://u.jimcdn.com\"
req.url.path","name":"Set Location header","substitution":"","ignore_if_set":"0","cache_condition":null,"request_condition":null,"regex":"","response_condition":null,"action":"set","type":"response","dst":"http.Location"}],"healthchecks":[],"request_settings":[],"response_objects":[{"request_condition":"","content_type":"","status":"200","response":"Ok","name":"Set
200 status code","content":"","cache_condition":""}],"snippets":[],"vcls":[],"wordpress":[],"settings":{"general.default_ttl":3600,"general.default_host":"","general.default_pci":0}}}'}
headers:
accept-ranges: [bytes]
age: ['0']
cache-control: [no-cache]
connection: [keep-alive]
content-length: ['4061']
content-length: ['4056']
content-type: [application/json]
date: ['Tue, 10 Oct 2017 10:33:29 GMT']
date: ['Tue, 10 Apr 2018 14:39:53 GMT']
status: [200 OK]
vary: [Accept-Encoding]
via: [1.1 varnish, 1.1 varnish]
x-cache: ['MISS, MISS']
x-cache-hits: ['0, 0']
x-served-by: ['app-slwdc9051-SL, cache-ams4133-AMS']
x-timer: ['S1507631609.335051,VS0,VE121']
x-served-by: ['app-slwdc9051-SL, cache-fra19142-FRA']
x-timer: ['S1523371193.375692,VS0,VE109']
status: {code: 200, message: OK}
- request:
body: null
headers:
Content-Type: [application/json]
method: PUT
uri: https://api.fastly.com/service/3QhmHI5SRhK6mQ8YK5Gmz2/version/2/deactivate
uri: https://api.fastly.com/service/2T6RaPUWpO8jsWHVVNXvc/version/2/deactivate
response:
body: {string: !!python/unicode '{"testing":false,"locked":true,"number":2,"active":false,"service_id":"3QhmHI5SRhK6mQ8YK5Gmz2","staging":false,"created_at":"2017-10-10T10:33:23Z","deleted_at":null,"comment":"","updated_at":"2017-10-10T10:33:27Z","deployed":false}'}
body: {string: !!python/unicode '{"testing":false,"locked":true,"number":2,"active":false,"service_id":"2T6RaPUWpO8jsWHVVNXvc","staging":false,"created_at":"2018-04-10T14:39:43Z","deleted_at":null,"comment":"","updated_at":"2018-04-10T14:39:51Z","deployed":false}'}
headers:
accept-ranges: [bytes]
cache-control: [no-cache]
connection: [keep-alive]
content-length: ['231']
content-length: ['230']
content-type: [application/json]
date: ['Tue, 10 Oct 2017 10:33:30 GMT']
fastly-ratelimit-remaining: ['984']
fastly-ratelimit-reset: ['1507633200']
date: ['Tue, 10 Apr 2018 14:39:54 GMT']
fastly-ratelimit-remaining: ['990']
fastly-ratelimit-reset: ['1523372400']
status: [200 OK]
vary: [Accept-Encoding]
via: [1.1 varnish, 1.1 varnish]
x-cache: ['MISS, MISS']
x-cache-hits: ['0, 0']
x-served-by: ['app-slwdc9051-SL, cache-ams4422-AMS']
x-timer: ['S1507631610.534354,VS0,VE497']
x-served-by: ['app-slwdc9051-SL, cache-fra19137-FRA']
x-timer: ['S1523371194.550275,VS0,VE507']
status: {code: 200, message: OK}
- request:
body: null
headers:
Content-Type: [application/json]
method: DELETE
uri: https://api.fastly.com/service/3QhmHI5SRhK6mQ8YK5Gmz2
uri: https://api.fastly.com/service/2T6RaPUWpO8jsWHVVNXvc
response:
body: {string: !!python/unicode '{"status":"ok"}'}
headers:
Expand All @@ -90,15 +90,15 @@ interactions:
connection: [keep-alive]
content-length: ['15']
content-type: [application/json]
date: ['Tue, 10 Oct 2017 10:33:30 GMT']
fastly-ratelimit-remaining: ['983']
fastly-ratelimit-reset: ['1507633200']
date: ['Tue, 10 Apr 2018 14:39:54 GMT']
fastly-ratelimit-remaining: ['989']
fastly-ratelimit-reset: ['1523372400']
status: [200 OK]
vary: [Accept-Encoding]
via: [1.1 varnish, 1.1 varnish]
x-cache: ['MISS, MISS']
x-cache-hits: ['0, 0']
x-served-by: ['app-slwdc9051-SL, cache-ams4149-AMS']
x-timer: ['S1507631610.112493,VS0,VE445']
x-served-by: ['app-slwdc9051-SL, cache-fra19139-FRA']
x-timer: ['S1523371194.307502,VS0,VE140']
status: {code: 200, message: OK}
version: 1
Loading

0 comments on commit 3c2db0f

Please sign in to comment.