seiso-connector 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Mzg1ZTBjNTVkOWVmZDc4Nzg3OGY4YjMxNTM3ZDAwNGJjNWUyMDY1NA==
4
+ YmQzNTdjNWYxYTZjZWFmZWQ4NTc5NjQ0OWE2ZWUyMmQ0NzAzNGQ2Ng==
5
5
  data.tar.gz: !binary |-
6
- YTM0ODBjNjc5ODhjYjhkNWIyN2MwYzA2ZTRkMTQ2MzM5N2FlYzdkMA==
6
+ YWI1ZjFiMWFiN2I3MDIyYjM5MzEwMTE4YTBjODNiMmM2MWRiZGRmZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzhlMzMxMjdmYzIzMTc0MGMwYTQwNDY3YjRlNzA5ZDM2NjIyYWUzYWQ3MGI4
10
- N2NjMWEzYTliOGFiMmVhMzBhNjY4ZTEwN2Q0Nzc2MGI3MjQwMmY2M2RmNTY1
11
- OWI2ZTBiY2QzYWZiZjczZjg0NDNkYjY5OWQxMzQwNjRmMmNlY2Y=
9
+ NDQyNGQzYTRhNzI2MDkyNmFkNzdmOTYwYTRiYmZjNzhmMzU0ZTMwMDlhMWUx
10
+ MjlhYTUyNGY4NTIwNjhkNmQ0YjQ5ZDAzYTAwMTc3NGNjNDRmNzhjZWMyNzJh
11
+ NjkxM2U4MTk4MjEyZTVlNmE4YWZkYzgzY2EwZjJjYTc3ODQyNzY=
12
12
  data.tar.gz: !binary |-
13
- Njk4OGFlODBiM2UwNTI5YjM0ZmY0MDM5OTNhODI5OTI1MzYyMzY3Y2U4ZTM2
14
- N2NmOTQ2YTQzZjFjY2FhNGRjYTExMzM2MjhmYmJiN2EzZjg3MDdmM2Y2ZDk0
15
- ZWU4NjZlODQ4M2ZkMDY4ZDUwMjY4MzFhYjVjYTNiMGJhMmM2ZTY=
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
- MT_TEXT_URI = "text/uri"
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
@@ -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.5"
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.5
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-20 00:00:00.000000000 Z
11
+ date: 2015-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler