seiso-connector 0.1.5 → 0.1.6
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 +8 -8
- data/lib/seiso/connector/rest_connector.rb +16 -11
- data/lib/seiso/connector/uri_factory_v2.rb +8 -2
- data/seiso-connector.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmQzNTdjNWYxYTZjZWFmZWQ4NTc5NjQ0OWE2ZWUyMmQ0NzAzNGQ2Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YWI1ZjFiMWFiN2I3MDIyYjM5MzEwMTE4YTBjODNiMmM2MWRiZGRmZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDQyNGQzYTRhNzI2MDkyNmFkNzdmOTYwYTRiYmZjNzhmMzU0ZTMwMDlhMWUx
|
10
|
+
MjlhYTUyNGY4NTIwNjhkNmQ0YjQ5ZDAzYTAwMTc3NGNjNDRmNzhjZWMyNzJh
|
11
|
+
NjkxM2U4MTk4MjEyZTVlNmE4YWZkYzgzY2EwZjJjYTc3ODQyNzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NWJjYjAzMzdkMzRkNGUwZDUxMTAwZDRiZjAxNTFlOTAxMDc4Nzg4NGI1ZWNi
|
14
|
+
MTAzNDFjNzQyMmM0MjM1ZWM4ZTk0MzRlOTQ1OGE2NzEzNTNiMTQxYjkwNDg3
|
15
|
+
MGYyYjA2Y2RlZDVhY2M0M2FmYjk2M2E2NjJlMzRhOTY3OTQwYWE=
|
@@ -12,7 +12,7 @@ module Seiso
|
|
12
12
|
HN_ACCEPT = "Accept"
|
13
13
|
HN_CONTENT_TYPE = "Content-Type"
|
14
14
|
|
15
|
-
|
15
|
+
MT_TEXT_URI_LIST = "text/uri-list"
|
16
16
|
|
17
17
|
def initialize(host, port, use_ssl, ignore_cert, username, password, media_type)
|
18
18
|
@host = host
|
@@ -42,6 +42,21 @@ module Seiso
|
|
42
42
|
do_request(http, request)
|
43
43
|
end
|
44
44
|
|
45
|
+
# - uri: collection resource we're posting the URI list to
|
46
|
+
# - uri_list: list of strings, not URI objects
|
47
|
+
def post_uri_list(uri, uri_list)
|
48
|
+
request_body = ""
|
49
|
+
uri_list.each do |uri|
|
50
|
+
request_body << "#{uri}\n"
|
51
|
+
end
|
52
|
+
|
53
|
+
request = Net::HTTP::Post.new uri.request_uri
|
54
|
+
request[HN_CONTENT_TYPE] = MT_TEXT_URI_LIST
|
55
|
+
request.basic_auth(@username, @password)
|
56
|
+
request.body = request_body
|
57
|
+
do_request(http, request)
|
58
|
+
end
|
59
|
+
|
45
60
|
# Puts all resources using a keepalive connection
|
46
61
|
def put_all(uri_resource_pairs)
|
47
62
|
Net::HTTP.start(
|
@@ -70,16 +85,6 @@ module Seiso
|
|
70
85
|
do_request(http, request)
|
71
86
|
end
|
72
87
|
|
73
|
-
# - uri: main resource URI
|
74
|
-
# - linked_uri: specifies resource we're linking to the main resource
|
75
|
-
def put_link(uri, linked_uri)
|
76
|
-
request = Net::HTTP::Put.new uri.request_uri
|
77
|
-
request[HN_CONTENT_TYPE] = MT_TEXT_URI
|
78
|
-
request.basic_auth(@username, @password)
|
79
|
-
request.body = linked_uri.request_uri
|
80
|
-
do_request(http, request)
|
81
|
-
end
|
82
|
-
|
83
88
|
def delete(uri)
|
84
89
|
puts "DELETE #{uri}"
|
85
90
|
request = Net::HTTP::Delete.new uri.request_uri
|
@@ -25,6 +25,14 @@ module Seiso
|
|
25
25
|
uri "/service-instances/#{key}"
|
26
26
|
end
|
27
27
|
|
28
|
+
def service_instance_seyren_checks_uri(key)
|
29
|
+
uri "/service-instances/#{key}/seyren-checks"
|
30
|
+
end
|
31
|
+
|
32
|
+
def service_instance_seyren_check_uri(service_instance_key, check_id)
|
33
|
+
uri "/service-instances/#{key}/seyren-checks/#{check_id}"
|
34
|
+
end
|
35
|
+
|
28
36
|
def seyren_checks_uri()
|
29
37
|
uri "/seyren-checks"
|
30
38
|
end
|
@@ -33,8 +41,6 @@ module Seiso
|
|
33
41
|
uri "/seyren-checks/search/find-by-base-url-and-id?url=#{seyren_base_url}&id=#{seyren_id}"
|
34
42
|
end
|
35
43
|
|
36
|
-
private
|
37
|
-
|
38
44
|
def uri(path)
|
39
45
|
URI.parse "#{@base_uri}#{path}"
|
40
46
|
end
|
data/seiso-connector.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "seiso-connector"
|
7
|
-
spec.version = "0.1.
|
7
|
+
spec.version = "0.1.6"
|
8
8
|
spec.authors = ["Willie Wheeler"]
|
9
9
|
spec.email = ["wwheeler@expedia.com"]
|
10
10
|
spec.summary = "Connector to make it easier for Ruby clients to talk to the Seiso REST API."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seiso-connector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willie Wheeler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|