havenondemand 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 125ae7854ef9fda55dc410583ff13202ad75a39a
4
- data.tar.gz: b7a8b4c3e57a441a83efd8dbf3b57ec20fef2f0f
3
+ metadata.gz: 1d2b9f51210a8cd4468a49c84d80fda9c9a0a52d
4
+ data.tar.gz: d17470b777f645b3dbe2e4dbdc3489e67a31ae0d
5
5
  SHA512:
6
- metadata.gz: a59d5357025e6fa147c143f2ed1bc9d4f65c195580c521f9e9e1c3e9464a5e835a3ce3be23bd658077561664b8beb6d5dc485e5000a64e9e39bc51775e920112
7
- data.tar.gz: 2d18103c08f4e87a64e635fcfc418ae6e454373fb3eacb03a2a2b50118fd843e78458ca26dc18a0c516240e5b7ac7886835307523e0791f2caf45e7aac6b0269
6
+ metadata.gz: b643922f3fdd20a7f206fb56640f3a35a30d6671a482bb952f3042829c62a8e13a792c2e45928488b81dd9aa08217fb28cf2296c4d1bfae88194b2b741232161
7
+ data.tar.gz: 168e597e6d84957f877e16d8c8625c537667613b6a592a9c508482328932e9e8f6af93a197c47df885ebb13a0644055c821d448415181b4fffda0e3d8b4b21bc
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  *.gem
2
+ **/.DS_Store
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 TODO: Write your name
1
+ Copyright (c) 2014 TODO: Tyler Nappy
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -88,6 +88,20 @@ docs = myjson["documents"]
88
88
  array.each {|doc| puts doc["title"] }
89
89
  ```
90
90
 
91
+ ### Combinations
92
+
93
+ Haven OnDemand allows to chain two ore more APIs together to create customizable, reusable services. These combinations enable one data input to have unlimited transformations and processing all from a single API call.
94
+
95
+ ```ruby
96
+ data = { :parameters => { :name => "name_of_input", :value => "value_of_input"} }
97
+ r = client.post_combination('name_of_combination', data)
98
+ puts r.json()
99
+ ```
100
+
101
+ **Note: using local files and publicly accessible URLs is not supported by this wrapper**
102
+
103
+ To find out more about combinations and how to create one, see [here](https://dev.havenondemand.com/combination/home).
104
+
91
105
  ###Indexing
92
106
 
93
107
  **Creating an index**
@@ -153,9 +167,9 @@ It makes it easy to batch together groups of documents.
153
167
  ####Indexing - Connectors
154
168
 
155
169
  ```ruby
156
- client = HODClient.new("http://api.idolondemand.com", $apikey)
170
+ client = HODClient.new(apikey, version)
157
171
  conn = HODConnector.new("mytestconnector", client)
158
- conn.create(type="web", config = { "url" => "http://www.idolondemand.com" })
172
+ conn.create(type="web", config = { "url" => "http://www.havenondemand.com" })
159
173
  conn.delete()
160
174
  ```
161
175
 
@@ -183,8 +197,9 @@ r = index.commit(async = true)
183
197
 
184
198
 
185
199
  ## Contributing
200
+ We encourage you to contribute to this repo! Please send pull requests with modified and updated code.
186
201
 
187
- 1. Fork it ( https://github.com/HP-Haven-OnDemand/havenondemand-ruby/fork )
202
+ 1. Fork it ( https://github.com/HPE-Haven-OnDemand/havenondemand-ruby/fork )
188
203
  2. Create your feature branch (`git checkout -b my-new-feature`)
189
204
  3. Commit your changes (`git commit -am 'Add some feature'`)
190
205
  4. Push to the branch (`git push origin my-new-feature`)
data/lib/havenondemand.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'Unirest'
4
4
  require 'json'
5
5
  #require 'httpclient'
6
+ require 'byebug'
6
7
 
7
8
 
8
9
 
@@ -133,6 +134,32 @@ class HODClient
133
134
  return post("connectorstatus",data)
134
135
  end
135
136
 
137
+ def post_combination(combination, data=Hash.new, async=false)
138
+ handler="executecombination"
139
+ data[:apikey]=@apikey
140
+ syncpath="sync"
141
+ syncpath="async" if async
142
+ data[:combination] = combination
143
+ data[:parameters] = data[:parameters].to_json
144
+ Unirest.timeout(30)
145
+
146
+ response=Unirest.post "#{@url}/#{@@version}/api/#{syncpath}/#{handler}/#{@@apidefault}",
147
+ headers:{ "Accept" => "application/json", "Content-Type" => "application/json"},
148
+ parameters:data
149
+ if response.code == 200
150
+
151
+ if async
152
+ return HODAsyncResponse.new(response,self)
153
+ end
154
+ return HODResponse.new(response)
155
+ else
156
+ puts response.body
157
+ #puts data[:json].encoding.name
158
+ raise HODError.new "Error #{response.body["error"]} -- #{response.body["reason"]}"
159
+ end
160
+
161
+ end
162
+
136
163
  def post(handler, data=Hash.new, async=false)
137
164
  data[:apikey]=@apikey
138
165
  syncpath="sync"
@@ -1,3 +1,3 @@
1
1
  module Havenondemand
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,56 +1,56 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: havenondemand
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Nappy
8
- - " Martin Zerbib"
8
+ - ' Martin Zerbib'
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-09 00:00:00.000000000 Z
12
+ date: 2016-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: unirest
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ~>
33
33
  - !ruby/object:Gem::Version
34
34
  version: '1.7'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ~>
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.7'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ~>
47
47
  - !ruby/object:Gem::Version
48
48
  version: '10.0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ~>
54
54
  - !ruby/object:Gem::Version
55
55
  version: '10.0'
56
56
  description: ''
@@ -60,19 +60,15 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - ".DS_Store"
64
- - ".gitignore"
63
+ - .gitignore
65
64
  - Gemfile
66
65
  - LICENSE.txt
67
66
  - README.md
68
67
  - Rakefile
69
- - examples/.DS_Store
70
68
  - examples/examples.rb
71
69
  - examples/testhelper.rb
72
70
  - havenondemand.gemspec
73
- - lib/.DS_Store
74
71
  - lib/havenondemand.rb
75
- - lib/havenondemand/.DS_Store
76
72
  - lib/havenondemand/version.rb
77
73
  homepage: https://github.com/HP-Haven-OnDemand/havenondemand-ruby
78
74
  licenses:
@@ -84,17 +80,17 @@ require_paths:
84
80
  - lib
85
81
  required_ruby_version: !ruby/object:Gem::Requirement
86
82
  requirements:
87
- - - ">="
83
+ - - '>='
88
84
  - !ruby/object:Gem::Version
89
85
  version: '0'
90
86
  required_rubygems_version: !ruby/object:Gem::Requirement
91
87
  requirements:
92
- - - ">="
88
+ - - '>='
93
89
  - !ruby/object:Gem::Version
94
90
  version: '0'
95
91
  requirements: []
96
92
  rubyforge_project:
97
- rubygems_version: 2.4.6
93
+ rubygems_version: 2.0.14.1
98
94
  signing_key:
99
95
  specification_version: 4
100
96
  summary: Haven OnDemand Ruby Client
data/.DS_Store DELETED
Binary file
data/examples/.DS_Store DELETED
Binary file
data/lib/.DS_Store DELETED
Binary file
Binary file