status_cake 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 003277d2a8a28afccfaed832d41ad05e6f75ee11
4
+ data.tar.gz: 416fd4112622f82266865a83d86a62c8e4746449
5
+ SHA512:
6
+ metadata.gz: 77087c2eec51b86173b94abce5d8ce4492024e4571f56cab23cab5b2e793258be677ff120a79ee4bd1c157958a6a006d86fecbc9e552149dc0f32bee879570a0
7
+ data.tar.gz: d365ab1977cd34c996e3f5239db36ec0677900cdc41121e5ff756bbf4d44663ad3d757d61b9c8fa0d39a04d22d9fae5bcce8a13906e6d5007ad227f22b11f660
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.env ADDED
@@ -0,0 +1,3 @@
1
+ STATUSCAKE_USER=YOURSTATUSCAKEUSER
2
+ STATUSCAKE_APIKEY=YOURSTATUSCAKEAPIKEY
3
+ STATUSCAKE_VERBOSE=true
data/Gemfile ADDED
@@ -0,0 +1,18 @@
1
+ source "http://rubygems.org"
2
+ gem 'httparty', '~> 0.13'
3
+
4
+ # Add dependencies to develop your gem here.
5
+ # Include everything needed to run rake, tests, features, etc.
6
+ group :development do
7
+ gem "shoulda", "~> 3.5"
8
+ gem "rdoc", "~> 3.12"
9
+ gem "bundler", "~> 1.0"
10
+ gem "jeweler", "~> 2.0"
11
+ gem "simplecov", "~> 0.8"
12
+ gem "dotenv", '~> 0.10'
13
+ gem "webmock", '~> 1.18'
14
+ gem "rspec", '~> 3.0'
15
+ gem "guard", '~> 2.6'
16
+ gem "guard-rspec", '~> 4.2'
17
+ gem "vcr", '~> 2.9'
18
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,141 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activesupport (4.1.1)
5
+ i18n (~> 0.6, >= 0.6.9)
6
+ json (~> 1.7, >= 1.7.7)
7
+ minitest (~> 5.1)
8
+ thread_safe (~> 0.1)
9
+ tzinfo (~> 1.1)
10
+ addressable (2.3.6)
11
+ builder (3.2.2)
12
+ celluloid (0.15.2)
13
+ timers (~> 1.1.0)
14
+ coderay (1.1.0)
15
+ crack (0.4.2)
16
+ safe_yaml (~> 1.0.0)
17
+ descendants_tracker (0.0.4)
18
+ thread_safe (~> 0.3, >= 0.3.1)
19
+ diff-lcs (1.2.5)
20
+ docile (1.1.3)
21
+ dotenv (0.10.0)
22
+ faraday (0.9.0)
23
+ multipart-post (>= 1.2, < 3)
24
+ ffi (1.9.3)
25
+ formatador (0.2.5)
26
+ git (1.2.6)
27
+ github_api (0.11.3)
28
+ addressable (~> 2.3)
29
+ descendants_tracker (~> 0.0.1)
30
+ faraday (~> 0.8, < 0.10)
31
+ hashie (>= 1.2)
32
+ multi_json (>= 1.7.5, < 2.0)
33
+ nokogiri (~> 1.6.0)
34
+ oauth2
35
+ guard (2.6.1)
36
+ formatador (>= 0.2.4)
37
+ listen (~> 2.7)
38
+ lumberjack (~> 1.0)
39
+ pry (>= 0.9.12)
40
+ thor (>= 0.18.1)
41
+ guard-rspec (4.2.9)
42
+ guard (~> 2.1)
43
+ rspec (>= 2.14, < 4.0)
44
+ hashie (2.1.1)
45
+ highline (1.6.21)
46
+ httparty (0.13.1)
47
+ json (~> 1.8)
48
+ multi_xml (>= 0.5.2)
49
+ i18n (0.6.9)
50
+ jeweler (2.0.1)
51
+ builder
52
+ bundler (>= 1.0)
53
+ git (>= 1.2.5)
54
+ github_api
55
+ highline (>= 1.6.15)
56
+ nokogiri (>= 1.5.10)
57
+ rake
58
+ rdoc
59
+ json (1.8.1)
60
+ jwt (1.0.0)
61
+ listen (2.7.6)
62
+ celluloid (>= 0.15.2)
63
+ rb-fsevent (>= 0.9.3)
64
+ rb-inotify (>= 0.9)
65
+ lumberjack (1.0.6)
66
+ method_source (0.8.2)
67
+ mini_portile (0.6.0)
68
+ minitest (5.3.4)
69
+ multi_json (1.10.1)
70
+ multi_xml (0.5.5)
71
+ multipart-post (2.0.0)
72
+ nokogiri (1.6.2.1)
73
+ mini_portile (= 0.6.0)
74
+ oauth2 (0.9.4)
75
+ faraday (>= 0.8, < 0.10)
76
+ jwt (~> 1.0)
77
+ multi_json (~> 1.3)
78
+ multi_xml (~> 0.5)
79
+ rack (~> 1.2)
80
+ pry (0.9.12.6)
81
+ coderay (~> 1.0)
82
+ method_source (~> 0.8)
83
+ slop (~> 3.4)
84
+ rack (1.5.2)
85
+ rake (10.3.2)
86
+ rb-fsevent (0.9.4)
87
+ rb-inotify (0.9.4)
88
+ ffi (>= 0.5.0)
89
+ rdoc (3.12.2)
90
+ json (~> 1.4)
91
+ rspec (3.0.0)
92
+ rspec-core (~> 3.0.0)
93
+ rspec-expectations (~> 3.0.0)
94
+ rspec-mocks (~> 3.0.0)
95
+ rspec-core (3.0.0)
96
+ rspec-support (~> 3.0.0)
97
+ rspec-expectations (3.0.0)
98
+ diff-lcs (>= 1.2.0, < 2.0)
99
+ rspec-support (~> 3.0.0)
100
+ rspec-mocks (3.0.0)
101
+ rspec-support (~> 3.0.0)
102
+ rspec-support (3.0.0)
103
+ safe_yaml (1.0.3)
104
+ shoulda (3.5.0)
105
+ shoulda-context (~> 1.0, >= 1.0.1)
106
+ shoulda-matchers (>= 1.4.1, < 3.0)
107
+ shoulda-context (1.2.1)
108
+ shoulda-matchers (2.6.1)
109
+ activesupport (>= 3.0.0)
110
+ simplecov (0.8.2)
111
+ docile (~> 1.1.0)
112
+ multi_json
113
+ simplecov-html (~> 0.8.0)
114
+ simplecov-html (0.8.0)
115
+ slop (3.5.0)
116
+ thor (0.19.1)
117
+ thread_safe (0.3.4)
118
+ timers (1.1.0)
119
+ tzinfo (1.2.1)
120
+ thread_safe (~> 0.1)
121
+ vcr (2.9.2)
122
+ webmock (1.18.0)
123
+ addressable (>= 2.3.6)
124
+ crack (>= 0.3.2)
125
+
126
+ PLATFORMS
127
+ ruby
128
+
129
+ DEPENDENCIES
130
+ bundler (~> 1.0)
131
+ dotenv (~> 0.10)
132
+ guard (~> 2.6)
133
+ guard-rspec (~> 4.2)
134
+ httparty (~> 0.13)
135
+ jeweler (~> 2.0)
136
+ rdoc (~> 3.12)
137
+ rspec (~> 3.0)
138
+ shoulda (~> 3.5)
139
+ simplecov (~> 0.8)
140
+ vcr (~> 2.9)
141
+ webmock (~> 1.18)
data/Guardfile ADDED
@@ -0,0 +1,5 @@
1
+ guard 'rspec' do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
+ watch('spec/spec_helper.rb') { "spec" }
5
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,174 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
data/README.rdoc ADDED
@@ -0,0 +1,42 @@
1
+ = status_cake
2
+
3
+ StatusCake gem for Ruby. See the StatusCake API documentation at http://kb.statuscake.com/api
4
+
5
+ == Usage
6
+
7
+ @sc = StatusCake.new(:username => 'username', :api_key => 'apikey')
8
+
9
+ == Logging
10
+
11
+ Override the debug_output, see Net::HTTP#set_debug_output for options.
12
+
13
+ class StatusCake
14
+ debug_output $stdout
15
+ end
16
+
17
+ === Updating and Inserting Tests
18
+
19
+ response = @sc.update_test({
20
+ 'WebsiteName' => 'google.com',
21
+ 'WebsiteURL' => 'https://google.com',
22
+ 'CheckRate' => '300',
23
+ 'ContactGroup' => '10395',
24
+ 'TestType' => 'HTTP',
25
+ 'Paused' => 1
26
+ })
27
+
28
+ === Retrieving Tests
29
+
30
+ Please be aware that although filtering is supported on any criteria via the gem, only the CUID and Status are supported by the API and therefore filtering is done on the resultset. If you have a large number of tests, you will probably want to group by CUID.
31
+
32
+ @sc.tests('CUID' => '10395', 'WebsiteURL' => 'https://mysite.example.com')
33
+
34
+ === Pausing/Unpausing Tests
35
+
36
+ t = @sc.tests('WebsiteName' => 'example.com')
37
+ @sc.pause_test(t)
38
+ @sc.unpause_test(t)
39
+
40
+ == License
41
+
42
+ Apache 2.0 License. See LICENSE.txt for further details.
data/Rakefile ADDED
@@ -0,0 +1,50 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
+ gem.name = "status_cake"
18
+ gem.homepage = "http://github.com/coupacooke/status_cake"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Ruby gem for StatusCake API}
21
+ gem.description = %Q{Ruby gem for StatusCake API - supports basic functions on tests}
22
+ gem.email = "charles@coupa.com"
23
+ gem.authors = ["Charles Cooke"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rspec/core/rake_task'
29
+
30
+ RSpec::Core::RakeTask.new(:spec) do |t|
31
+ t.fail_on_error = false
32
+ end
33
+
34
+ task :default => :spec
35
+
36
+ desc "Code coverage detail"
37
+ task :simplecov do
38
+ ENV['COVERAGE'] = "true"
39
+ Rake::Task['test'].execute
40
+ end
41
+
42
+ require 'rdoc/task'
43
+ Rake::RDocTask.new do |rdoc|
44
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
45
+
46
+ rdoc.rdoc_dir = 'rdoc'
47
+ rdoc.title = "status_cake #{version}"
48
+ rdoc.rdoc_files.include('README*')
49
+ rdoc.rdoc_files.include('lib/**/*.rb')
50
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,71 @@
1
+ class Hash
2
+ def &(other)
3
+ reject { |k, v| !(other.include?(k) && other[k] == v) }
4
+ end
5
+ end
6
+
7
+ class StatusCake
8
+ include HTTParty
9
+
10
+ base_uri 'https://www.statuscake.com/API'
11
+
12
+ # We can only filter on these in the API. Hopefully they will support more.
13
+ SUPPORTED_QUERIES = ['CUID','Status']
14
+
15
+ def initialize(opts)
16
+ @auth = {'Username' => opts[:username], 'API' => opts[:api_key]}
17
+ end
18
+
19
+ def tests(options={})
20
+ # Hash#slice w/o activesupport
21
+ query_opts = options.select { |k,v| SUPPORTED_QUERIES.index(k) }
22
+ filter_opts = options.reject { |k,v| SUPPORTED_QUERIES.index(k) }
23
+
24
+ @opts = {headers:@auth, query:query_opts}
25
+ tests = respond(self.class.get("/Tests", @opts))
26
+
27
+ unless filter_opts.empty?
28
+ tests.find_all { |t| (t & filter_opts) == filter_opts }
29
+ else
30
+ tests
31
+ end
32
+ end
33
+
34
+ def update_test(test={})
35
+ @opts = {headers:@auth, body:test }
36
+ respond(self.class.put("/Tests/Update",@opts))
37
+ end
38
+
39
+ def delete_test(test={})
40
+ @opts = {headers:@auth, body:{ 'TestID' => test['TestID'] } }
41
+ respond(self.class.delete("/Tests/Details",@opts))
42
+ end
43
+
44
+ def pause_test(t)
45
+ if t
46
+ t['Paused'] = '1'
47
+ update_test(t)
48
+ end
49
+ end
50
+
51
+ def unpause_test(t)
52
+ if t
53
+ t['Paused'] = '0'
54
+ update_test(t)
55
+ end
56
+ end
57
+
58
+ protected
59
+
60
+ def respond(response)
61
+ if response.success?
62
+ if response.is_a?(Hash) && response.has_key?('Error')
63
+ raise response["Error"]
64
+ else
65
+ response
66
+ end
67
+ else
68
+ raise response.response
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,8 @@
1
+ class StatusCake
2
+ module Version
3
+ MAJOR = 0
4
+ MINOR = 1
5
+ PATCH = 0
6
+ STRING = "#{MAJOR}.#{MINOR}.#{PATH}"
7
+ end
8
+ end
@@ -0,0 +1,2 @@
1
+ require 'httparty'
2
+ require 'status_cake/status_cake'
@@ -0,0 +1,44 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://www.statuscake.com/API/Tests/Update
6
+ body:
7
+ encoding: UTF-8
8
+ string: WebsiteName=google.com&WebsiteURL=https%3A%2F%2Fgoogle.com&CheckRate=300&ContactGroup=10395&TestType=HTTP&Paused=1
9
+ headers:
10
+ Username:
11
+ - <USER>
12
+ Api:
13
+ - <APIKEY>
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Tue, 03 Jun 2014 20:34:30 GMT
21
+ Server:
22
+ - LiteSpeed
23
+ Connection:
24
+ - close
25
+ X-Powered-By:
26
+ - PHP/5.4.9
27
+ Set-Cookie:
28
+ - PHPSESSID=517b8f8d6c65911541a75034d04688ca; path=/
29
+ Expires:
30
+ - Thu, 19 Nov 1981 08:52:00 GMT
31
+ Cache-Control:
32
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
33
+ Pragma:
34
+ - no-cache
35
+ Content-Type:
36
+ - application/json
37
+ Content-Length:
38
+ - '235'
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"Success":true,"Message":"Test Inserted","Issues":null,"Data":{"Paused":"1","WebsiteName":"google.com","WebsiteURL":"https:\/\/google.com","CheckRate":"300","TestType":"HTTP","ContactGroup":"10395","Client":"14818"},"InsertID":169665}'
42
+ http_version:
43
+ recorded_at: Tue, 03 Jun 2014 20:34:33 GMT
44
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,88 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://www.statuscake.com/API/Tests?CUID=10395
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Username:
11
+ - <USER>
12
+ Api:
13
+ - <APIKEY>
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Tue, 03 Jun 2014 20:34:38 GMT
21
+ Server:
22
+ - LiteSpeed
23
+ Connection:
24
+ - close
25
+ X-Powered-By:
26
+ - PHP/5.4.9
27
+ Set-Cookie:
28
+ - PHPSESSID=32f1e8dab318cec7dce236a231638bf2; path=/
29
+ Expires:
30
+ - Thu, 19 Nov 1981 08:52:00 GMT
31
+ Cache-Control:
32
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
33
+ Pragma:
34
+ - no-cache
35
+ Content-Type:
36
+ - application/json
37
+ Content-Length:
38
+ - '353'
39
+ body:
40
+ encoding: UTF-8
41
+ string: '[{"TestID":169662,"Paused":true,"TestType":"HTTP","WebsiteName":"google.com","ContactGroup":"All
42
+ Sites","ContactID":10395,"Public":0,"Status":"Up","Uptime":100,"Performance":0.178},{"TestID":169665,"Paused":true,"TestType":"HTTP","WebsiteName":"google.com","ContactGroup":"All
43
+ Sites","ContactID":10395,"Public":0,"Status":"","Uptime":0,"Performance":0}]'
44
+ http_version:
45
+ recorded_at: Tue, 03 Jun 2014 20:34:40 GMT
46
+ - request:
47
+ method: delete
48
+ uri: https://www.statuscake.com/API/Tests/Details
49
+ body:
50
+ encoding: UTF-8
51
+ string: TestID=169662
52
+ headers:
53
+ Username:
54
+ - <USER>
55
+ Api:
56
+ - <APIKEY>
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: OK
61
+ headers:
62
+ Date:
63
+ - Tue, 03 Jun 2014 20:34:39 GMT
64
+ Server:
65
+ - LiteSpeed
66
+ Connection:
67
+ - close
68
+ X-Powered-By:
69
+ - PHP/5.4.9
70
+ Set-Cookie:
71
+ - PHPSESSID=8551e23593569718375b23697e088898; path=/
72
+ Expires:
73
+ - Thu, 19 Nov 1981 08:52:00 GMT
74
+ Cache-Control:
75
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
76
+ Pragma:
77
+ - no-cache
78
+ Content-Type:
79
+ - application/json
80
+ Content-Length:
81
+ - '111'
82
+ body:
83
+ encoding: UTF-8
84
+ string: '{"TestID":169662,"Affected":1,"Success":true,"Message":"This Check
85
+ Has Been Deleted. It can not be recovered."}'
86
+ http_version:
87
+ recorded_at: Tue, 03 Jun 2014 20:34:41 GMT
88
+ recorded_with: VCR 2.9.2