synthetics 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +226 -0
- data/Rakefile +19 -0
- data/lib/synthetics.rb +21 -0
- data/lib/synthetics/api.rb +37 -0
- data/lib/synthetics/api/base.rb +15 -0
- data/lib/synthetics/api/label.rb +32 -0
- data/lib/synthetics/api/labels.rb +11 -0
- data/lib/synthetics/api/locations.rb +10 -0
- data/lib/synthetics/api/monitor.rb +33 -0
- data/lib/synthetics/api/monitors.rb +15 -0
- data/lib/synthetics/client.rb +48 -0
- data/lib/synthetics/constants.rb +6 -0
- data/lib/synthetics/errors.rb +12 -0
- data/lib/synthetics/util.rb +36 -0
- data/lib/synthetics/version.rb +4 -0
- data/synthetics.gemspec +33 -0
- metadata +168 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: faa9cfb4467b473fc3ff6f449700323299f6aabc
|
4
|
+
data.tar.gz: 0b299dd85fb09d6ba0f333713a1f05224bdae1ea
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 82a1c2b7c62cb41a33568e219e20b4b065ef240b98675b07476b30bdee11fb2a26f9f4f9833c9862bdceb083b3355c35eeff8a8432bae69a9a7d9c1e024cf1f5
|
7
|
+
data.tar.gz: 40b6128f9374855cdc657d8b6b9fbda6cd41cf315873242415bf38a9b485721512037e54d334c139dba5b8984da3e14f3da65e81dc739ff546aa82d086984e79
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.2.2
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Swipely, Inc
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,226 @@
|
|
1
|
+
# Synthetics
|
2
|
+
|
3
|
+
Synthetics is a rubygem that interfaces with New Relic Synthetics' [HTTP API](https://docs.newrelic.com/docs/apis/synthetics-rest-api/monitor-examples/manage-synthetics-monitors-via-rest-api).
|
4
|
+
It can be used to manage monitors and labels programatically.
|
5
|
+
The above link is useful for finding the possible options that can be passed to each method, particularly creating and updating monitors.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'synthetics'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
```bash
|
18
|
+
$ bundle
|
19
|
+
```
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
$ gem install synthetics
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
All interaction with the API starts by creating an API client.
|
30
|
+
The client requires an admin API key, which can be generated in the Web UI.
|
31
|
+
Once you have your API key, there are two ways you can pass it to the client:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
> # Set API key directly:
|
35
|
+
> synthetics = Synthetics.new('<YOUR-API-KEY>')
|
36
|
+
|
37
|
+
> # Set API key via environment variable:
|
38
|
+
> ENV['SYNTHETICS_API_KEY'] = 'YOUR-API-KEY'
|
39
|
+
> synthetics = Synthetics.new
|
40
|
+
```
|
41
|
+
|
42
|
+
### Locations
|
43
|
+
|
44
|
+
List locations:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
> synthetics.locations.list
|
48
|
+
[
|
49
|
+
{:private=>false, :name=>"AWS_US_EAST_1", :label=>"Washington, DC, USA"},
|
50
|
+
...
|
51
|
+
]
|
52
|
+
```
|
53
|
+
|
54
|
+
### Monitors
|
55
|
+
|
56
|
+
List monitors:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
> synthetics.monitors.list
|
60
|
+
{
|
61
|
+
:monitors => [
|
62
|
+
{
|
63
|
+
:id => "SOME-VALID-UUID",
|
64
|
+
:name => "Ping Google",
|
65
|
+
:type => "SIMPLE",
|
66
|
+
:frequency => 1440,
|
67
|
+
:uri => "https://google.com",
|
68
|
+
:locations => ["AWS_US_EAST_1", "AWS_EU_WEST_1"],
|
69
|
+
:status => "ENABLED",
|
70
|
+
:sla_threshold => 7.0,
|
71
|
+
:modified_at => "2016-02-26T15:10:58.515+0000",
|
72
|
+
:created_at => "2016-02-26T15:10:58.515+0000",
|
73
|
+
:user_id => 123,
|
74
|
+
:api_version => "0.2.2"
|
75
|
+
}
|
76
|
+
],
|
77
|
+
:count => 1
|
78
|
+
}
|
79
|
+
```
|
80
|
+
|
81
|
+
Create monitor:
|
82
|
+
|
83
|
+
```ruby
|
84
|
+
> synthetics.monitors.create(
|
85
|
+
> ... name: 'Google Monitor',
|
86
|
+
> ... frequency: 15,
|
87
|
+
> ... uri: 'https://google.com',
|
88
|
+
> ... locations: %w(AWS_US_WEST_1),
|
89
|
+
> ... type: 'simple'
|
90
|
+
> ... )
|
91
|
+
nil
|
92
|
+
```
|
93
|
+
|
94
|
+
### Monitor
|
95
|
+
|
96
|
+
These examples assume you have a valid monitor UUID, such as:
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
> uuid = 'SOME-VAILD-UUID'
|
100
|
+
```
|
101
|
+
|
102
|
+
Show monitor:
|
103
|
+
|
104
|
+
```ruby
|
105
|
+
> synthetics.monitor(uuid).show
|
106
|
+
{
|
107
|
+
:id => "SOME-VALID-UUID",
|
108
|
+
:name => "Ping Google",
|
109
|
+
:type => "SIMPLE",
|
110
|
+
:frequency => 15,
|
111
|
+
:uri => "https://google.com",
|
112
|
+
:locations => ["AWS_US_EAST_1", "AWS_EU_WEST_1"],
|
113
|
+
:status => "ENABLED",
|
114
|
+
:sla_threshold => 7.0,
|
115
|
+
:modified_at => "2016-02-26T15:10:58.515+0000",
|
116
|
+
:created_at => "2016-02-26T15:10:58.515+0000",
|
117
|
+
:user_id => 123,
|
118
|
+
:api_version => "0.2.2"
|
119
|
+
}
|
120
|
+
```
|
121
|
+
|
122
|
+
Update monitor:
|
123
|
+
|
124
|
+
```ruby
|
125
|
+
> synthetics.monitor(uuid).update(
|
126
|
+
> ... name: 'Google Monitor',
|
127
|
+
> ... frequency: 30,
|
128
|
+
> ... uri: 'https://google.com',
|
129
|
+
> ... locations: %w(AWS_US_WEST_1),
|
130
|
+
> ... type: 'simple'
|
131
|
+
> ... )
|
132
|
+
|
133
|
+
{
|
134
|
+
:id => "SOME-VALID-UUID",
|
135
|
+
:name => "Ping Google",
|
136
|
+
:type => "SIMPLE",
|
137
|
+
:frequency => 30,
|
138
|
+
:uri => "https://google.com",
|
139
|
+
:locations => ["AWS_US_EAST_1", "AWS_EU_WEST_1"],
|
140
|
+
:status => "ENABLED",
|
141
|
+
:sla_threshold => 7.0,
|
142
|
+
:modified_at => "2016-02-26T15:10:58.515+0000",
|
143
|
+
:created_at => "2016-02-26T15:10:58.515+0000",
|
144
|
+
:user_id => 123,
|
145
|
+
:api_version => "0.2.2"
|
146
|
+
}
|
147
|
+
```
|
148
|
+
|
149
|
+
Update monitor script:
|
150
|
+
|
151
|
+
```ruby
|
152
|
+
> synthetics.monitor(uuid).update_script('var test = function() {};')
|
153
|
+
nil
|
154
|
+
```
|
155
|
+
|
156
|
+
Destroy monitor:
|
157
|
+
|
158
|
+
```ruby
|
159
|
+
> synthetics.monitor(uuid).destroy
|
160
|
+
nil
|
161
|
+
```
|
162
|
+
|
163
|
+
### Labels
|
164
|
+
|
165
|
+
|
166
|
+
List labels:
|
167
|
+
|
168
|
+
```ruby
|
169
|
+
> synthetics.labels.list
|
170
|
+
{
|
171
|
+
:labels => [
|
172
|
+
{
|
173
|
+
:type => 'sha',
|
174
|
+
:value => '8ace32a'
|
175
|
+
}
|
176
|
+
],
|
177
|
+
:count => 1
|
178
|
+
}
|
179
|
+
```
|
180
|
+
|
181
|
+
### Label
|
182
|
+
|
183
|
+
These examples assume you have a valid label, such as:
|
184
|
+
|
185
|
+
```ruby
|
186
|
+
> label = 'sample:label'
|
187
|
+
```
|
188
|
+
|
189
|
+
Show monitors for a label:
|
190
|
+
|
191
|
+
```ruby
|
192
|
+
> synthetics.label(label).monitors
|
193
|
+
{
|
194
|
+
:monitors => [
|
195
|
+
{
|
196
|
+
:id => "SOME-VALID-UUID",
|
197
|
+
:name => "Ping Google",
|
198
|
+
:type => "SIMPLE",
|
199
|
+
:frequency => 1440,
|
200
|
+
:uri => "https://google.com",
|
201
|
+
:locations => ["AWS_US_EAST_1", "AWS_EU_WEST_1"],
|
202
|
+
:status => "ENABLED",
|
203
|
+
:sla_threshold => 7.0,
|
204
|
+
:modified_at => "2016-02-26T15:10:58.515+0000",
|
205
|
+
:created_at => "2016-02-26T15:10:58.515+0000",
|
206
|
+
:user_id => 123,
|
207
|
+
:api_version => "0.2.2"
|
208
|
+
}
|
209
|
+
],
|
210
|
+
:count => 1
|
211
|
+
}
|
212
|
+
```
|
213
|
+
|
214
|
+
Attach a label to a monitor:
|
215
|
+
|
216
|
+
```ruby
|
217
|
+
> synthetics.label(label).attach(uuid)
|
218
|
+
nil
|
219
|
+
```
|
220
|
+
|
221
|
+
Remove a label from a monitor:
|
222
|
+
|
223
|
+
```ruby
|
224
|
+
> synthetics.label(label).remove(uuid)
|
225
|
+
nil
|
226
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require 'pry'
|
4
|
+
|
5
|
+
desc 'Run the gem specs'
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
7
|
+
|
8
|
+
desc 'Load the gem'
|
9
|
+
task :environment do
|
10
|
+
$LOAD_PATH << File.expand_path('../lib', __FILE__)
|
11
|
+
require 'synthetics'
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'Start a console in the context of the Synthetics module'
|
15
|
+
task shell: :environment do
|
16
|
+
Pry.start(Synthetics)
|
17
|
+
end
|
18
|
+
|
19
|
+
task default: :spec
|
data/lib/synthetics.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'base64'
|
2
|
+
require 'excon'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
require 'synthetics/version'
|
6
|
+
require 'synthetics/constants'
|
7
|
+
require 'synthetics/errors'
|
8
|
+
require 'synthetics/util'
|
9
|
+
require 'synthetics/client'
|
10
|
+
require 'synthetics/api'
|
11
|
+
|
12
|
+
# Top level gem namespace.
|
13
|
+
module Synthetics
|
14
|
+
def self.new(api_key = ENV[API_KEY_ENVIRONMENT_VARIABLE])
|
15
|
+
if api_key.nil?
|
16
|
+
fail NoAPIKeyError,
|
17
|
+
"No API key given, please set $#{API_KEY_ENVIRONMENT_VARIABLE}"
|
18
|
+
end
|
19
|
+
API.new(Client.new(api_key))
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'synthetics/api/base'
|
2
|
+
require 'synthetics/api/label'
|
3
|
+
require 'synthetics/api/labels'
|
4
|
+
require 'synthetics/api/locations'
|
5
|
+
require 'synthetics/api/monitor'
|
6
|
+
require 'synthetics/api/monitors'
|
7
|
+
|
8
|
+
module Synthetics
|
9
|
+
# This class holds the sub APIs used to communicate with synthetics.
|
10
|
+
class API
|
11
|
+
attr_reader :client
|
12
|
+
|
13
|
+
def initialize(client)
|
14
|
+
@client = client
|
15
|
+
end
|
16
|
+
|
17
|
+
def label(label)
|
18
|
+
Label.new(client, label)
|
19
|
+
end
|
20
|
+
|
21
|
+
def labels
|
22
|
+
Labels.new(client)
|
23
|
+
end
|
24
|
+
|
25
|
+
def locations
|
26
|
+
Locations.new(client)
|
27
|
+
end
|
28
|
+
|
29
|
+
def monitor(monitor_uuid)
|
30
|
+
Monitor.new(client, monitor_uuid)
|
31
|
+
end
|
32
|
+
|
33
|
+
def monitors
|
34
|
+
Monitors.new(client)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Synthetics
|
2
|
+
class API
|
3
|
+
# This class defines common methods for all APIs.
|
4
|
+
class Base
|
5
|
+
extend Forwardable
|
6
|
+
|
7
|
+
attr_reader :client
|
8
|
+
def_delegators :@client, :request
|
9
|
+
|
10
|
+
def initialize(client)
|
11
|
+
@client = client
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Synthetics
|
2
|
+
class API
|
3
|
+
# This class makes requests to the labels section of the Synthetics API.
|
4
|
+
class Label < Base
|
5
|
+
attr_reader :label
|
6
|
+
|
7
|
+
def initialize(client, label)
|
8
|
+
super(client)
|
9
|
+
@label = label
|
10
|
+
end
|
11
|
+
|
12
|
+
def monitors
|
13
|
+
request(method: 'GET', path: "/monitors/labels/#{label}")
|
14
|
+
end
|
15
|
+
|
16
|
+
def attach(monitor_uuid)
|
17
|
+
request(
|
18
|
+
method: 'POST',
|
19
|
+
path: "/monitors/#{monitor_uuid}/labels",
|
20
|
+
body: label
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def remove(monitor_uuid)
|
25
|
+
request(
|
26
|
+
method: 'DELETE',
|
27
|
+
path: "/monitors/#{monitor_uuid}/labels/#{label}"
|
28
|
+
)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Synthetics
|
2
|
+
class API
|
3
|
+
# This class makes requests to the monitors section of the Synthetics API.
|
4
|
+
class Monitor < Base
|
5
|
+
attr_reader :monitor_uuid
|
6
|
+
|
7
|
+
def initialize(client, monitor_uuid)
|
8
|
+
super(client)
|
9
|
+
@monitor_uuid = monitor_uuid
|
10
|
+
end
|
11
|
+
|
12
|
+
def show
|
13
|
+
request(path: "/monitors/#{monitor_uuid}", method: 'GET')
|
14
|
+
end
|
15
|
+
|
16
|
+
def update(options)
|
17
|
+
request(path: "/monitors/#{monitor_uuid}", method: 'PUT', body: options)
|
18
|
+
end
|
19
|
+
|
20
|
+
def update_script(str)
|
21
|
+
request(
|
22
|
+
path: "/monitors/#{monitor_uuid}/script",
|
23
|
+
method: 'PUT',
|
24
|
+
body: { script_text: Base64.strict_encode64(str) }
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def destroy
|
29
|
+
request(path: "/monitors/#{monitor_uuid}", method: 'DELETE')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Synthetics
|
2
|
+
class API
|
3
|
+
# This class makes requests to the collection methods in the monitors
|
4
|
+
# section of the Synthetics API.
|
5
|
+
class Monitors < Base
|
6
|
+
def list
|
7
|
+
request(path: '/monitors', method: 'GET')
|
8
|
+
end
|
9
|
+
|
10
|
+
def create(options)
|
11
|
+
request(path: '/monitors', method: 'POST', body: options)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Synthetics
|
2
|
+
# This class wraps Excon to make requests to the Synthetics API.
|
3
|
+
class Client
|
4
|
+
include Util
|
5
|
+
|
6
|
+
def initialize(api_key)
|
7
|
+
@api_key = api_key.freeze
|
8
|
+
end
|
9
|
+
|
10
|
+
def request(options)
|
11
|
+
wrap_errors do
|
12
|
+
normailze_request_options!(options)
|
13
|
+
response = excon.request(options)
|
14
|
+
return nil if response.body.empty?
|
15
|
+
deep_snakeify_keys(JSON.parse(response.body))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def wrap_errors
|
22
|
+
yield
|
23
|
+
rescue JSON::JSONError => ex
|
24
|
+
raise ParseError, ex
|
25
|
+
rescue Excon::Errors::ClientError => ex
|
26
|
+
raise ClientError, ex
|
27
|
+
rescue Excon::Errors::ServerError => ex
|
28
|
+
raise ServerError, ex
|
29
|
+
end
|
30
|
+
|
31
|
+
def normailze_request_options!(opts)
|
32
|
+
opts[:path] = API_PATH_PREFIX + opts[:path]
|
33
|
+
opts[:headers] ||= {}
|
34
|
+
opts[:headers].merge!(
|
35
|
+
'Content-Type' => 'application/json',
|
36
|
+
'X-API-Key' => @api_key
|
37
|
+
)
|
38
|
+
if opts.key?(:body) && !opts[:body].is_a?(String)
|
39
|
+
opts[:body] = deep_camelize_keys(opts[:body]).to_json
|
40
|
+
end
|
41
|
+
opts[:expects] = 200..204
|
42
|
+
end
|
43
|
+
|
44
|
+
def excon
|
45
|
+
@excon ||= Excon.new(API_HOST)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Synthetics
|
2
|
+
# Catch-all error class.
|
3
|
+
Error = Class.new(StandardError)
|
4
|
+
# Raised when parsing JSON fails.
|
5
|
+
ParseError = Class.new(Error)
|
6
|
+
# Raised when there is a 400 level error returned from the Synthetics API.
|
7
|
+
ClientError = Class.new(Error)
|
8
|
+
# Raised when there is a 500 level error returned from the Synthetics API.
|
9
|
+
ServerError = Class.new(Error)
|
10
|
+
# Raised when no API is given to a Synthetics client.
|
11
|
+
NoAPIKeyError = Class.new(Error)
|
12
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Synthetics
|
2
|
+
# This module holds general purpose utilities for the gem.
|
3
|
+
module Util
|
4
|
+
module_function
|
5
|
+
|
6
|
+
def deep_snakeify_keys(object)
|
7
|
+
deep_transform_keys(object) { |key| snakeify(key).to_sym }
|
8
|
+
end
|
9
|
+
|
10
|
+
def deep_camelize_keys(object)
|
11
|
+
deep_transform_keys(object) { |key| camelize(key.to_s) }
|
12
|
+
end
|
13
|
+
|
14
|
+
def deep_transform_keys(object, &block)
|
15
|
+
case object
|
16
|
+
when Hash
|
17
|
+
object.each_with_object({}) do |(key, value), hash|
|
18
|
+
hash[yield key] = deep_transform_keys(value, &block)
|
19
|
+
end
|
20
|
+
when Array
|
21
|
+
object.map { |elem| deep_transform_keys(elem, &block) }
|
22
|
+
else
|
23
|
+
object
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def camelize(str)
|
28
|
+
first, *rest = str.split('_')
|
29
|
+
rest.each_with_object(first) { |word, memo| memo << word.capitalize }
|
30
|
+
end
|
31
|
+
|
32
|
+
def snakeify(str)
|
33
|
+
str.gsub(/[A-Z]/) { |letter| "_#{letter.downcase}" }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/synthetics.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'synthetics/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'synthetics'
|
8
|
+
spec.version = Synthetics::VERSION
|
9
|
+
spec.authors = ['Tom Hulihan']
|
10
|
+
spec.email = ['hulihan.tom159@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = 'Ruby client for the New Relic Synthetics'
|
13
|
+
spec.description = <<-EOS
|
14
|
+
synthetics interfaces with New Relic Synthetics' HTTP API:
|
15
|
+
https://docs.newrelic.com/docs/apis/synthetics-rest-api/. The gem can be used to
|
16
|
+
read, create, update, and destroy monitors.
|
17
|
+
EOS
|
18
|
+
spec.homepage = 'https://github.com/swipely/synthetics'
|
19
|
+
spec.license = 'MIT'
|
20
|
+
|
21
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
22
|
+
f.start_with?('spec')
|
23
|
+
end
|
24
|
+
spec.require_paths = %w(lib)
|
25
|
+
|
26
|
+
spec.add_dependency 'excon'
|
27
|
+
spec.add_development_dependency 'bundler', '~> 1.11'
|
28
|
+
spec.add_development_dependency 'pry', '~> 0.10'
|
29
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
30
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
31
|
+
spec.add_development_dependency 'vcr', '~> 3.0'
|
32
|
+
spec.add_development_dependency 'webmock', '~> 1.22'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: synthetics
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tom Hulihan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: excon
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.11'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.11'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.10'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.10'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: vcr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webmock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.22'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.22'
|
111
|
+
description: |
|
112
|
+
synthetics interfaces with New Relic Synthetics' HTTP API:
|
113
|
+
https://docs.newrelic.com/docs/apis/synthetics-rest-api/. The gem can be used to
|
114
|
+
read, create, update, and destroy monitors.
|
115
|
+
email:
|
116
|
+
- hulihan.tom159@gmail.com
|
117
|
+
executables: []
|
118
|
+
extensions: []
|
119
|
+
extra_rdoc_files: []
|
120
|
+
files:
|
121
|
+
- ".gitignore"
|
122
|
+
- ".rspec"
|
123
|
+
- ".ruby-version"
|
124
|
+
- ".travis.yml"
|
125
|
+
- CHANGELOG.md
|
126
|
+
- Gemfile
|
127
|
+
- LICENSE.txt
|
128
|
+
- README.md
|
129
|
+
- Rakefile
|
130
|
+
- lib/synthetics.rb
|
131
|
+
- lib/synthetics/api.rb
|
132
|
+
- lib/synthetics/api/base.rb
|
133
|
+
- lib/synthetics/api/label.rb
|
134
|
+
- lib/synthetics/api/labels.rb
|
135
|
+
- lib/synthetics/api/locations.rb
|
136
|
+
- lib/synthetics/api/monitor.rb
|
137
|
+
- lib/synthetics/api/monitors.rb
|
138
|
+
- lib/synthetics/client.rb
|
139
|
+
- lib/synthetics/constants.rb
|
140
|
+
- lib/synthetics/errors.rb
|
141
|
+
- lib/synthetics/util.rb
|
142
|
+
- lib/synthetics/version.rb
|
143
|
+
- synthetics.gemspec
|
144
|
+
homepage: https://github.com/swipely/synthetics
|
145
|
+
licenses:
|
146
|
+
- MIT
|
147
|
+
metadata: {}
|
148
|
+
post_install_message:
|
149
|
+
rdoc_options: []
|
150
|
+
require_paths:
|
151
|
+
- lib
|
152
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
requirements: []
|
163
|
+
rubyforge_project:
|
164
|
+
rubygems_version: 2.4.5
|
165
|
+
signing_key:
|
166
|
+
specification_version: 4
|
167
|
+
summary: Ruby client for the New Relic Synthetics
|
168
|
+
test_files: []
|