kinetic_sdk 5.0.3 → 5.0.8

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
  SHA256:
3
- metadata.gz: ad0e7ab692dcbe3b8490670c9b287728fefd5f55efae43dc8c300dfe18712889
4
- data.tar.gz: 6769c8d4ff7571c3ac162b7b513e6fb1022a3515cee75c70e9e116f0e35dad6e
3
+ metadata.gz: 8609e20b77b0b2e67c56e49dcf6663460e8bb48a96efac596ba7f5ef0059af29
4
+ data.tar.gz: 8f739a18f3628432f830847c41e0960cacfccb90f9a00cf464f248e17761cb7c
5
5
  SHA512:
6
- metadata.gz: 7af711dd0ecdff0aa958b9716a2c98f05038d813a36b76fad15ffb12b3bd2a85abc5c5a970516f2a42b522ed706edb700383d1fb95e8b81cc42b3edfb4102f82
7
- data.tar.gz: 373e02aa81064b9ce26a547dca6bcc66827f2c3719b1052344ef2511d0ff436e049f3604d485482310fa7504ccb082daa6147142133bea21d854b4a54ed040b2
6
+ metadata.gz: f1cc775a113d0af41d243f234fdf35dace6a54e5696774b97e8e68477a6bc53c13da510faa9cf0e73c9fb0e664d3351067adfa7e656feae39367284203ab48e2
7
+ data.tar.gz: 5cc32a2d2ba49cc09119adf8fedffaa27e318714446111ab3c1c559f30ee5633217e9dbf80b7e3f26e74c809f3c05f1ad04a1edbe8f487257a265a5b17d4978e
@@ -39,3 +39,34 @@ sdk.logger.info("foo")
39
39
  - Gateway errors (HTTP codes [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502), [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503), and [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504)) will automatically be retried, and may be controlled by the following options:
40
40
  - :gateway_retry_limit (default 5), set to -1 to disable retrying gateway errors
41
41
  - :gateway_retry_delay (default 1.0)
42
+
43
+ ## [5.0.0](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.0) (2019-12-19)
44
+
45
+ ** 1.x to 5.x Upgrade Warning **
46
+ All platform components (Core, Task, Agent, Discussions...etc) should be running a 5.x release or greater.
47
+ Unintended behavior is possible if running 5.x of the SDK against any platform component < 5.x.
48
+
49
+ ## [5.0.1](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.1) (2020-01-10)
50
+
51
+ **Implemented enhancements:**
52
+
53
+ - Implemented Task System error API
54
+ - Fixed typo in Discussions component
55
+
56
+ ## [5.0.2](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.2) (2020-01-10)
57
+
58
+ **Implemented enhancements:**
59
+
60
+ - Fixed bug with jetching JWT regarding redirects
61
+
62
+ ## [5.0.3](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.3) (2020-01-17)
63
+
64
+ **Implemented enhancements:**
65
+
66
+ - Implmented task engine configuration APIs
67
+
68
+ ## [5.0.4](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.4) (2020-02-12)
69
+
70
+ **Implemented enhancements:**
71
+
72
+ - Implmented platform components APIs
data/README.md CHANGED
@@ -75,20 +75,21 @@ the SDK with the following code.
75
75
  require File.join(File.expand_path(File.dirname(__FILE__)), 'vendor', 'kinetic-sdk-rb', 'kinetic-sdk')
76
76
  ```
77
77
 
78
- ### Kinetic Agent SDK example
78
+ ### Kinetic Core SDK example of a Space User
79
79
 
80
80
  ```ruby
81
- agent_sdk = KineticSdk::Agent.new({
82
- app_server_url: "http://localhost:8080/kinetic-agent",
83
- username: "configuration-user",
81
+ space_sdk = KineticSdk::Core.new({
82
+ app_server_url: "http://localhost:8080/kinetic",
83
+ space_slug: "foo",
84
+ username: "space-user-1",
84
85
  password: "password",
85
86
  options: {
86
87
  log_level: "info",
87
88
  max_redirects: 3
88
89
  }
89
90
  })
90
- response = agent_sdk.find_all_bridges()
91
- bridges = response.content['bridges']
91
+ response = space_sdk.find_kapps()
92
+ kapps = response.content['kapps']
92
93
 
93
94
  puts response.code # String value of HTTP response code ("200", "400", "500", etc...)
94
95
  puts response.status # Ruby Fixnum value of response.code (200, 400, 500, etc...)
@@ -96,11 +97,11 @@ puts response.content # Ruby Hash
96
97
  puts response.content_string # JSON formatted response body
97
98
  ```
98
99
 
99
- ### Kinetic BridgeHub SDK example
100
+ ### Kinetic Core SDK example of a System User
100
101
 
101
102
  ```ruby
102
- bridgehub_sdk = KineticSdk::Bridgehub.new({
103
- app_server_url: "http://localhost:8080/kinetic-bridgehub",
103
+ system_sdk = KineticSdk::Core.new({
104
+ app_server_url: "http://localhost:8080/kinetic",
104
105
  username: "configuration-user",
105
106
  password: "password",
106
107
  options: {
@@ -108,8 +109,7 @@ bridgehub_sdk = KineticSdk::Bridgehub.new({
108
109
  max_redirects: 3
109
110
  }
110
111
  })
111
- response = bridgehub_sdk.find_bridges()
112
- bridges = response.content['bridges']
112
+ response = system_sdk.add_space('My Company Space', 'my-company')
113
113
 
114
114
  puts response.code # String value of HTTP response code ("200", "400", "500", etc...)
115
115
  puts response.status # Ruby Fixnum value of response.code (200, 400, 500, etc...)
@@ -117,20 +117,23 @@ puts response.content # Ruby Hash
117
117
  puts response.content_string # JSON formatted response body
118
118
  ```
119
119
 
120
- ### Kinetic FileHub SDK example
120
+ ### Kinetic Core SDK example of a Subdomain
121
+
122
+ This example requires a proxy server configured to rewrite the space slug subdomain to the expected Core API route.
121
123
 
122
124
  ```ruby
123
- filehub_sdk = KineticSdk::Filehub.new({
124
- app_server_url: "http://localhost:8080/kinetic-filehub",
125
- username: "configuration-user",
125
+ space_sdk = KineticSdk::Core.new({
126
+ space_server_url: "https://foo.myapp.io",
127
+ space_slug: "foo",
128
+ username: "space-user-1",
126
129
  password: "password",
127
130
  options: {
128
131
  log_level: "info",
129
132
  max_redirects: 3
130
133
  }
131
134
  })
132
- response = filehub_sdk.find_filestores()
133
- filestores = response.content['filestores']
135
+ response = space_sdk.find_kapps()
136
+ kapps = response.content['kapps']
134
137
 
135
138
  puts response.code # String value of HTTP response code ("200", "400", "500", etc...)
136
139
  puts response.status # Ruby Fixnum value of response.code (200, 400, 500, etc...)
@@ -138,21 +141,20 @@ puts response.content # Ruby Hash
138
141
  puts response.content_string # JSON formatted response body
139
142
  ```
140
143
 
141
- ### Kinetic Core SDK example of a Space User
144
+ ### Kinetic Task SDK example
142
145
 
143
146
  ```ruby
144
- space_sdk = KineticSdk::Core.new({
145
- app_server_url: "http://localhost:8080/kinetic",
146
- space_slug: "foo",
147
- username: "space-user-1",
147
+ task_sdk = KineticSdk::Task.new({
148
+ app_server_url: "http://localhost:8080/kinetic-task",
149
+ username: "user-1",
148
150
  password: "password",
149
151
  options: {
152
+ export_directory: "/opt/exports/task-server-a",
150
153
  log_level: "info",
151
154
  max_redirects: 3
152
155
  }
153
156
  })
154
- response = space_sdk.find_kapps()
155
- kapps = response.content['kapps']
157
+ response = task_sdk.environment()
156
158
 
157
159
  puts response.code # String value of HTTP response code ("200", "400", "500", etc...)
158
160
  puts response.status # Ruby Fixnum value of response.code (200, 400, 500, etc...)
@@ -160,11 +162,11 @@ puts response.content # Ruby Hash
160
162
  puts response.content_string # JSON formatted response body
161
163
  ```
162
164
 
163
- ### Kinetic Core SDK example of a System User
165
+ ### Kinetic Agent SDK example
164
166
 
165
167
  ```ruby
166
- system_sdk = KineticSdk::Core.new({
167
- app_server_url: "http://localhost:8080/kinetic",
168
+ agent_sdk = KineticSdk::Agent.new({
169
+ app_server_url: "http://localhost:8080/kinetic-agent",
168
170
  username: "configuration-user",
169
171
  password: "password",
170
172
  options: {
@@ -172,7 +174,8 @@ system_sdk = KineticSdk::Core.new({
172
174
  max_redirects: 3
173
175
  }
174
176
  })
175
- response = system_sdk.add_space('My Company Space', 'my-company')
177
+ response = agent_sdk.find_all_bridges()
178
+ bridges = response.content['bridges']
176
179
 
177
180
  puts response.code # String value of HTTP response code ("200", "400", "500", etc...)
178
181
  puts response.status # Ruby Fixnum value of response.code (200, 400, 500, etc...)
@@ -180,23 +183,20 @@ puts response.content # Ruby Hash
180
183
  puts response.content_string # JSON formatted response body
181
184
  ```
182
185
 
183
- ### Kinetic Core SDK example of a Subdomain
184
-
185
- This example requires a proxy server configured to rewrite the space slug subdomain to the expected Core API route.
186
+ ### Kinetic BridgeHub SDK example
186
187
 
187
188
  ```ruby
188
- space_sdk = KineticSdk::Core.new({
189
- space_server_url: "https://foo.myapp.io",
190
- space_slug: "foo",
191
- username: "space-user-1",
189
+ bridgehub_sdk = KineticSdk::Bridgehub.new({
190
+ app_server_url: "http://localhost:8080/kinetic-bridgehub",
191
+ username: "configuration-user",
192
192
  password: "password",
193
193
  options: {
194
194
  log_level: "info",
195
195
  max_redirects: 3
196
196
  }
197
197
  })
198
- response = space_sdk.find_kapps()
199
- kapps = response.content['kapps']
198
+ response = bridgehub_sdk.find_bridges()
199
+ bridges = response.content['bridges']
200
200
 
201
201
  puts response.code # String value of HTTP response code ("200", "400", "500", etc...)
202
202
  puts response.status # Ruby Fixnum value of response.code (200, 400, 500, etc...)
@@ -204,20 +204,20 @@ puts response.content # Ruby Hash
204
204
  puts response.content_string # JSON formatted response body
205
205
  ```
206
206
 
207
- ### Kinetic Task SDK example
207
+ ### Kinetic FileHub SDK example
208
208
 
209
209
  ```ruby
210
- task_sdk = KineticSdk::Task.new({
211
- app_server_url: "http://localhost:8080/kinetic-task",
212
- username: "user-1",
210
+ filehub_sdk = KineticSdk::Filehub.new({
211
+ app_server_url: "http://localhost:8080/kinetic-filehub",
212
+ username: "configuration-user",
213
213
  password: "password",
214
214
  options: {
215
- export_directory: "/opt/exports/task-server-a",
216
215
  log_level: "info",
217
216
  max_redirects: 3
218
217
  }
219
218
  })
220
- response = task_sdk.environment()
219
+ response = filehub_sdk.find_filestores()
220
+ filestores = response.content['filestores']
221
221
 
222
222
  puts response.code # String value of HTTP response code ("200", "400", "500", etc...)
223
223
  puts response.status # Ruby Fixnum value of response.code (200, 400, 500, etc...)
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "kontena-websocket-client", "0.1.1"
27
27
 
28
28
  spec.add_development_dependency "bundler", "~> 1.16"
29
- spec.add_development_dependency "rake", "~> 12.3.0"
29
+ spec.add_development_dependency "rake", "~> 13.0.1"
30
30
  spec.add_development_dependency "yard", "~> 0.9.20"
31
31
 
32
32
  spec.metadata["yard.run"] = "yri"
@@ -3,26 +3,26 @@ module KineticSdk
3
3
 
4
4
  # Add a Bridge
5
5
  #
6
- # @param body [Hash] properties associated to the Bridge
7
- # - +adapterClass+
6
+ # @param body [Hash] optional properties associated to the Bridge
8
7
  # - +name+
9
- # - +slug+
10
- # - +properties+
8
+ # - +status+
9
+ # - +url+
11
10
  # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
12
11
  # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
13
- def add_bridge(body, headers=default_headers)
14
- @logger.info("Adding the \"#{body['name']}\" bridge through proxy to the agent platform component.")
15
- post("#{@proxy_url}/agent/app/api/v1/bridges", body, headers)
12
+ def add_bridge(body={}, headers=default_headers)
13
+ @logger.info("Adding the \"#{body['name']}\" Bridge.")
14
+ post("#{@api_url}/bridges", body, headers)
16
15
  end
17
16
 
18
17
  # Delete a Bridge
19
18
  #
20
- # @param slug [String] slug of the Bridge
19
+ # @param name [String] name of the bridge
20
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
21
21
  # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
22
22
  # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
23
- def delete_bridge(slug, headers=default_headers)
24
- @logger.info("Deleting the \"#{slug}\" bridge through proxy to the agent platform component.")
25
- delete("#{@proxy_url}/agent/app/api/v1/bridges/#{slug}", headers)
23
+ def delete_bridge(name, params={}, headers=default_headers)
24
+ @logger.info("Deleting the \"#{name}\" bridge.")
25
+ delete("#{@api_url}/bridges/#{encode(name)}", headers)
26
26
  end
27
27
 
28
28
  # Find a list of bridges
@@ -31,30 +31,30 @@ module KineticSdk
31
31
  # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
32
32
  # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
33
33
  def find_bridges(params={}, headers=default_headers)
34
- @logger.info("Find bridges through proxy to the agent platform component.")
35
- get("#{@proxy_url}/agent/app/api/v1/bridges", params, headers)
34
+ @logger.info("Find Bridges.")
35
+ get("#{@api_url}/bridges", params, headers)
36
36
  end
37
37
 
38
38
  # Find a bridge
39
39
  #
40
- # @param slug [String] slug of the bridge
40
+ # @param name [String] name of the bridge
41
41
  # @param params [Hash] Query parameters that are added to the URL, such as +include+
42
42
  # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
43
43
  # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
44
- def find_bridge(slug, params={}, headers=default_headers)
45
- @logger.info("Finding the \"#{slug}\" bridge through proxy to the agent platform component.")
46
- get("#{@proxy_url}/agent/app/api/v1/bridges/#{slug}", params, headers)
44
+ def find_bridge(name, params={}, headers=default_headers)
45
+ @logger.info("Finding the \"#{name}\" Bridge.")
46
+ get("#{@api_url}/bridges/#{encode(name)}", params, headers)
47
47
  end
48
48
 
49
49
  # Update a bridge
50
50
  #
51
- # @param slug [String] slug of the bridge
51
+ # @param name [String] name of the bridge
52
52
  # @param body [Hash] properties of the bridge to update
53
53
  # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
54
54
  # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
55
- def update_bridge(slug, body={}, headers=default_headers)
56
- @logger.info("Updating the \"#{slug}\" bridge through proxy to the agent platform component.")
57
- put("#{@proxy_url}/agent/app/api/v1/bridges/#{slug}", body, headers)
55
+ def update_bridge(name, body={}, headers=default_headers)
56
+ @logger.info("Updating the \"#{name}\" Bridge.")
57
+ put("#{@api_url}/bridges/#{encode(name)}", body, headers)
58
58
  end
59
59
 
60
60
  # Add a Bridge Model
@@ -1,6 +1,29 @@
1
1
  module KineticSdk
2
2
  class Core
3
3
 
4
+ # Retrieve a Category on a Kapp
5
+ #
6
+ # @param kapp_slug [String] slug of the Kapp the category belongs to
7
+ # @param category_slug [String] slug of the the category to find
8
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
9
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
10
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
11
+ def find_category_on_kapp(kapp_slug, category_slug, params={}, headers=default_headers)
12
+ @logger.info("Finding #{category_slug} Category on the #{kapp_slug} kapp.")
13
+ get("#{@api_url}/kapps/#{kapp_slug}/categories/#{category_slug}", params, headers)
14
+ end
15
+
16
+ # Find Categories on a Kapp
17
+ #
18
+ # @param kapp_slug [String] slug of the Kapp the category belongs to
19
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
20
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
21
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
22
+ def find_categories(kapp_slug, params={}, headers=default_headers)
23
+ @logger.info("Finding Categories on the #{kapp_slug} kapp.")
24
+ get("#{@api_url}/kapps/#{kapp_slug}/categories", params, headers)
25
+ end
26
+
4
27
  # Add a category on a Kapp
5
28
  #
6
29
  # @param kapp_slug [String] slug of the Kapp the category belongs to
@@ -29,6 +52,32 @@ module KineticSdk
29
52
  @logger.info("Adding Categorization for \"#{kapp_slug}\" kapp")
30
53
  post("#{@api_url}/kapps/#{kapp_slug}/categorizations", body, headers)
31
54
  end
55
+
56
+ # Update a category on a Kapp
57
+ #
58
+ # @param kapp_slug [String] slug of the Kapp the category belongs to
59
+ # @param category_slug [String] slug of the the category to find
60
+ # @param body [Hash] category properties
61
+ # - +name+ - A descriptive name for the category
62
+ # - +other details + -
63
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
64
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
65
+ def update_category_on_kapp(kapp_slug, category_slug, body, headers=default_headers)
66
+ raise StandardError.new "Category properties is not valid, must be a Hash." unless body.is_a? Hash
67
+ @logger.info("Updating Category \"#{body['name']}\" for \"#{kapp_slug}\" kapp")
68
+ put("#{@api_url}/kapps/#{kapp_slug}/categories/#{category_slug}", body, headers)
69
+ end
70
+
71
+ # Delete a Category
72
+ #
73
+ # @param kapp_slug [String] slug of the Kapp the category belongs to
74
+ # @param category_slug [String] slug of the the category to delete
75
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
76
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
77
+ def delete_category_on_kapp(kapp_slug, category_slug, headers=default_headers)
78
+ @logger.info("Deleting the #{category_slug} Category on the #{kapp_slug}\ kapp.")
79
+ delete("#{@api_url}/kapps/#{kapp_slug}/categories/#{category_slug}", headers)
80
+ end
32
81
 
33
82
  end
34
83
  end
@@ -0,0 +1,90 @@
1
+ require "digest/md5"
2
+
3
+ module KineticSdk
4
+ class Core
5
+
6
+ # Find Task Component
7
+ #
8
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
9
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
10
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
11
+ def find_task_component(params = {}, headers = default_headers)
12
+ @logger.info("Finding Task Component.")
13
+ get("#{@api_url}/platformComponents/task", params, headers)
14
+ end
15
+
16
+ # Update Task Component
17
+ #
18
+ # @param component_properties [Hash] the property values for the platform component
19
+ # - +url+ - Url to the task component
20
+ # - +secret+ - Shared secret used to encrypt traffic between core component and task component
21
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
22
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
23
+ def update_task_component(component_properties, headers = default_headers)
24
+ raise StandardError.new "Task Component properties is not valid, must be a Hash." unless component_properties.is_a? Hash
25
+ @logger.info("Updating Task Platform Component")
26
+ put("#{@api_url}/platformComponents/task", component_properties, headers)
27
+ end
28
+
29
+ # Find Agent Component
30
+ #
31
+ # @param agent_slug [String] the slug of the agent to retrieve
32
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
33
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
34
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
35
+ def find_agent_component(agent_slug, params = {}, headers = default_headers)
36
+ @logger.info("Finding Agent Component with slug: \"#{agent_slug}\".")
37
+ get("#{@api_url}/platformComponents/agents/#{agent_slug}", params, headers)
38
+ end
39
+
40
+ # Find Agent Components
41
+ #
42
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
43
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
44
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
45
+ def find_agent_components(params = {}, headers = default_headers)
46
+ @logger.info("Finding Agent Components.")
47
+ get("#{@api_url}/platformComponents/agents", params, headers)
48
+ end
49
+
50
+ # Add Agent Component
51
+ #
52
+ # @param component_properties [Hash] the property values for the team
53
+ # - +slug+ - Slug of the agent to be added
54
+ # - +url+ - URL for the agent being added
55
+ # - +secret+ - Secret for the agent being added
56
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
57
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
58
+ def add_agent_component(component_properties, headers = default_headers)
59
+ raise StandardError.new "Agent Component properties is not valid, must be a Hash." unless component_properties.is_a? Hash
60
+ @logger.info("Creating Agent Component \"#{component_properties["slug"]}\".")
61
+ post("#{@api_url}/platformComponents/agents", component_properties, headers)
62
+ end
63
+
64
+ # Update Agent Component
65
+ #
66
+ # @param agent_slug [String] the slug of the agent to update
67
+ # @param component_properties [Hash] the property values for the team
68
+ # - +slug+ - Slug of the agent to be added
69
+ # - +url+ - URL for the agent being added
70
+ # - +secret+ - Secret for the agent being added
71
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
72
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
73
+ def update_agent_component(agent_slug, component_properties, headers = default_headers)
74
+ raise StandardError.new "Agent Component properties is not valid, must be a Hash." unless component_properties.is_a? Hash
75
+ @logger.info("Updating Agent Component \"#{agent_slug}\".")
76
+ put("#{@api_url}/platformComponents/agents/#{agent_slug}", component_properties, headers)
77
+ end
78
+
79
+ # Delete Agent Component
80
+ #
81
+ # @param agent_slug [String] the slug of the agent to retrieve
82
+ # @param params [Hash] Query parameters that are added to the URL, such as +include+
83
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
84
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
85
+ def delete_agent_component(agent_slug, headers = default_headers)
86
+ @logger.info("Deleting Agent Component with slug: \"#{agent_slug}\".")
87
+ delete("#{@api_url}/platformComponents/agents/#{agent_slug}", headers)
88
+ end
89
+ end
90
+ end
@@ -69,10 +69,11 @@ module KineticSdk
69
69
  "space.kapps.{slug}.categoryAttributeDefinitions",
70
70
  "space.kapps.{slug}.forms.{slug}",
71
71
  "space.kapps.{slug}.formAttributeDefinitions",
72
- "space.kapps.{slug}.formsTypes",
72
+ "space.kapps.{slug}.formTypes",
73
73
  "space.kapps.{slug}.kappAttributeDefinitions",
74
74
  "space.kapps.{slug}.securityPolicyDefinitions",
75
75
  "space.kapps.{slug}.webhooks.{name}",
76
+ "space.kapps.{slug}.webApis.{slug}",
76
77
  "space.models.{name}",
77
78
  "space.teams.{name}",
78
79
  "space.datastoreFormAttributeDefinitions",
@@ -81,6 +82,7 @@ module KineticSdk
81
82
  "space.teamAttributeDefinitions",
82
83
  "space.userAttributeDefinitions",
83
84
  "space.userProfileAttributeDefinitions",
85
+ "space.webApis.{slug}",
84
86
  "space.webhooks.{name}",
85
87
  )
86
88
  core_data = get("#{@api_url}/space", { 'export' => true}, headers).content
@@ -134,6 +136,7 @@ module KineticSdk
134
136
  if api_path == "/kapps"
135
137
  kapp_slug = resp.content["kapp"]["slug"]
136
138
  delete_security_policy_definitions(kapp_slug)
139
+ delete_form_types_on_kapp(kapp_slug)
137
140
  end
138
141
  end
139
142
  end
@@ -7,7 +7,7 @@ module KineticSdk
7
7
  #
8
8
  # @param team_name [String] the team name
9
9
  # @param attribute_name [String] the attribute name
10
- # @param attribute_value [String] the attribute value
10
+ # @param attribute_value [String|Array] the attribute value(s)
11
11
  # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
12
12
  # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
13
13
  def add_team_attribute(team_name, attribute_name, attribute_value, headers=default_headers)
@@ -21,14 +21,14 @@ module KineticSdk
21
21
  @logger.info("Attribute: #{attribute.inspect}")
22
22
  # if the attribute already exists, update it
23
23
  if attribute["name"] == attribute_name
24
- attribute["values"] = [ attribute_value ]
24
+ attribute["values"] = attribute_value.is_a?(Array) ? attribute_value : [ attribute_value ]
25
25
  exists = true
26
26
  end
27
27
  end
28
28
  # add the attribute if it didn't exist
29
29
  attributes.push({
30
30
  "name" => attribute_name,
31
- "values" => [ attribute_value ]
31
+ "values" => attribute_value.is_a?(Array) ? attribute_value : [ attribute_value ]
32
32
  }) unless exists
33
33
 
34
34
  # set the updated attributes list
@@ -108,6 +108,29 @@ module KineticSdk
108
108
  @logger.info("Finding the \"#{team_name}\" (#{team_slug}) Team.")
109
109
  get("#{@api_url}/teams/#{team_slug}", params, headers)
110
110
  end
111
-
111
+
112
+ # Update a Team
113
+ #
114
+ # @param team_slug [String] slug of the Team to update
115
+ # @param body [Hash] category properties
116
+ # - +name+ - Name of the team to be added
117
+ # - +description+ - Description of the Team to be added
118
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
119
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
120
+ def update_team(team_slug, body, headers=default_headers)
121
+ raise StandardError.new "Team properties is not valid, must be a Hash." unless body.is_a? Hash
122
+ @logger.info("Updating Team #{team_slug}")
123
+ put("#{@api_url}/teams/#{team_slug}", body, headers)
124
+ end
125
+
126
+ # Delete a Team
127
+ #
128
+ # @param team_slug [String] slug of the the team to delete
129
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
130
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
131
+ def delete_team(team_slug, headers=default_headers)
132
+ @logger.info("Deleting the #{team_slug} Team.")
133
+ delete("#{@api_url}/teams/#{team_slug}", headers)
134
+ end
112
135
  end
113
136
  end
@@ -187,6 +187,26 @@ module KineticSdk
187
187
  @logger.info("Updating the \"#{name}\" webhook on the Space")
188
188
  put("#{@api_url}/webhooks/#{encode(name)}", webhook_properties, headers)
189
189
  end
190
+
191
+ # Delete a webhook on a kapp
192
+ #
193
+ # @param kapp_slug [String] slug of the Kapp the webhook belongs to
194
+ # @param name [String] the webhook name
195
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
196
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
197
+ def delete_webhook_on_kapp(kapp_slug, name, headers=default_headers)
198
+ @logger.info("Deleting the #{name} webhook on the #{kapp_slug}\ kapp.")
199
+ delete(URI.encode("#{@api_url}/kapps/#{kapp_slug}/webhooks/#{encode(name)}"), headers)
200
+ end
201
+
202
+ # Delete a webhook on space
203
+ # @param name [String] the webhook name
204
+ # @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
205
+ # @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
206
+ def delete_webhook_on_space(name, headers=default_headers)
207
+ @logger.info("Deleting the #{name} webhook on the space.")
208
+ delete("#{@api_url}/webhooks/#{encode(name)}", headers)
209
+ end
190
210
 
191
211
  end
192
212
  end
@@ -3,5 +3,5 @@ module KineticSdk
3
3
  # Version of Kinetic SDK
4
4
  #
5
5
  # @return [String] Version of the SDK
6
- VERSION = "5.0.3"
6
+ VERSION = "5.0.8"
7
7
  end
metadata CHANGED
@@ -1,142 +1,142 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kinetic_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.3
4
+ version: 5.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kinetic Data
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-17 00:00:00.000000000 Z
11
+ date: 2020-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: slugify
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - '='
17
18
  - !ruby/object:Gem::Version
18
19
  version: 1.0.7
19
- name: slugify
20
- prerelease: false
21
20
  type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.0.7
27
27
  - !ruby/object:Gem::Dependency
28
+ name: multipart-post
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - '='
31
32
  - !ruby/object:Gem::Version
32
33
  version: 2.0.0
33
- name: multipart-post
34
- prerelease: false
35
34
  type: :runtime
35
+ prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.0.0
41
41
  - !ruby/object:Gem::Dependency
42
+ name: mime-types
42
43
  requirement: !ruby/object:Gem::Requirement
43
44
  requirements:
44
45
  - - '='
45
46
  - !ruby/object:Gem::Version
46
47
  version: '3.1'
47
- name: mime-types
48
- prerelease: false
49
48
  type: :runtime
49
+ prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.1'
55
55
  - !ruby/object:Gem::Dependency
56
+ name: parallel
56
57
  requirement: !ruby/object:Gem::Requirement
57
58
  requirements:
58
59
  - - '='
59
60
  - !ruby/object:Gem::Version
60
61
  version: 1.12.1
61
- name: parallel
62
- prerelease: false
63
62
  type: :runtime
63
+ prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.12.1
69
69
  - !ruby/object:Gem::Dependency
70
+ name: ruby-progressbar
70
71
  requirement: !ruby/object:Gem::Requirement
71
72
  requirements:
72
73
  - - '='
73
74
  - !ruby/object:Gem::Version
74
75
  version: 1.9.0
75
- name: ruby-progressbar
76
- prerelease: false
77
76
  type: :runtime
77
+ prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.9.0
83
83
  - !ruby/object:Gem::Dependency
84
+ name: kontena-websocket-client
84
85
  requirement: !ruby/object:Gem::Requirement
85
86
  requirements:
86
87
  - - '='
87
88
  - !ruby/object:Gem::Version
88
89
  version: 0.1.1
89
- name: kontena-websocket-client
90
- prerelease: false
91
90
  type: :development
91
+ prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.1.1
97
97
  - !ruby/object:Gem::Dependency
98
+ name: bundler
98
99
  requirement: !ruby/object:Gem::Requirement
99
100
  requirements:
100
101
  - - "~>"
101
102
  - !ruby/object:Gem::Version
102
103
  version: '1.16'
103
- name: bundler
104
- prerelease: false
105
104
  type: :development
105
+ prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.16'
111
111
  - !ruby/object:Gem::Dependency
112
+ name: rake
112
113
  requirement: !ruby/object:Gem::Requirement
113
114
  requirements:
114
115
  - - "~>"
115
116
  - !ruby/object:Gem::Version
116
- version: 12.3.0
117
- name: rake
118
- prerelease: false
117
+ version: 13.0.1
119
118
  type: :development
119
+ prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 12.3.0
124
+ version: 13.0.1
125
125
  - !ruby/object:Gem::Dependency
126
+ name: yard
126
127
  requirement: !ruby/object:Gem::Requirement
127
128
  requirements:
128
129
  - - "~>"
129
130
  - !ruby/object:Gem::Version
130
131
  version: 0.9.20
131
- name: yard
132
- prerelease: false
133
132
  type: :development
133
+ prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 0.9.20
139
- description:
139
+ description:
140
140
  email:
141
141
  - support@kineticdata.com
142
142
  executables:
@@ -355,6 +355,7 @@ files:
355
355
  - lib/kinetic_sdk/core/lib/kapp.rb
356
356
  - lib/kinetic_sdk/core/lib/meta.rb
357
357
  - lib/kinetic_sdk/core/lib/oauth.rb
358
+ - lib/kinetic_sdk/core/lib/platform_components.rb
358
359
  - lib/kinetic_sdk/core/lib/security_policy_definitions.rb
359
360
  - lib/kinetic_sdk/core/lib/space.rb
360
361
  - lib/kinetic_sdk/core/lib/submissions.rb
@@ -406,7 +407,7 @@ homepage: https://github.com/kineticdata/kinetic-sdk-rb
406
407
  licenses: []
407
408
  metadata:
408
409
  yard.run: yri
409
- post_install_message:
410
+ post_install_message:
410
411
  rdoc_options: []
411
412
  require_paths:
412
413
  - lib
@@ -421,9 +422,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
421
422
  - !ruby/object:Gem::Version
422
423
  version: '0'
423
424
  requirements: []
424
- rubyforge_project:
425
- rubygems_version: 2.6.11
426
- signing_key:
425
+ rubygems_version: 3.0.8
426
+ signing_key:
427
427
  specification_version: 4
428
428
  summary: Ruby SDK for Kinetic Data application APIs
429
429
  test_files: []