kinetic_sdk 5.0.8 → 5.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +102 -32
- data/kinetic_sdk.gemspec +2 -2
- data/lib/kinetic_sdk/core/lib/form_types.rb +59 -2
- data/lib/kinetic_sdk/core/lib/teams.rb +0 -1
- data/lib/kinetic_sdk/core/lib/webapis.rb +144 -0
- data/lib/kinetic_sdk/core/lib/webhooks.rb +1 -1
- data/lib/kinetic_sdk/task/lib/handlers.rb +1 -1
- data/lib/kinetic_sdk/task/lib/sources.rb +1 -1
- data/lib/kinetic_sdk/utils/kinetic-export-utils.rb +6 -1
- data/lib/kinetic_sdk/version.rb +1 -1
- metadata +31 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bd5047435e78a51884c4b0b9a9766e273637fe9e31134fda839ebd4b5c9f939
|
4
|
+
data.tar.gz: a22fb82511b3670bb86931fd0a57cea9ef91adc7ec4d0780f6f3c5f151a84eb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea4237e58c4e40ee2b6c154efbec23d467a93d9ea83c0d0a798a53d987336c1fc9832ada3ea75527a74605ed36985f4e644876a345b4610cb74dd69d5574c971
|
7
|
+
data.tar.gz: b0901ed2b02c428e70eebaa6a260b16ca7f2f47aca26d020bdb79ab87de0f7e73205279a01bf9caba85b8b3f65e64662745247ae461ab29f2abddf2a91043e3d
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,109 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [5.0.13](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/5.0.13) (2020-09-03)
|
4
|
+
|
5
|
+
**Implemented enhancements:**
|
6
|
+
|
7
|
+
- Added missing Form Type methods.
|
8
|
+
- Deprecated some Form Type methods and replaced with simpler names.
|
9
|
+
- Removed an unnecessary logging statement when adding a team attribute.
|
10
|
+
- Removed double URL encoding when deleting a webhook from a Kapp.
|
11
|
+
|
12
|
+
## [5.0.12](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/5.0.12) (2020-08-27)
|
13
|
+
|
14
|
+
**Implemented enhancements:**
|
15
|
+
|
16
|
+
- Implemented webapi APIs
|
17
|
+
|
18
|
+
## [5.0.11](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/5.0.11) (2020-08-24)
|
19
|
+
|
20
|
+
**Implemented enhancements:**
|
21
|
+
|
22
|
+
- Allow spaces in filenames when exporting items. Spaces were removed in 5.0.10, but they are valid in Windows so allowing them if they exist.
|
23
|
+
|
24
|
+
## [5.0.10](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/5.0.10) (2020-08-24)
|
25
|
+
|
26
|
+
**Implemented enhancements:**
|
27
|
+
|
28
|
+
- Changed how filenames are stored when items are exported to be compatible with Windows.
|
29
|
+
|
30
|
+
## [5.0.9](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/5.0.9) (2020-06-29)
|
31
|
+
|
32
|
+
**Implemented enhancements:**
|
33
|
+
|
34
|
+
- Bug fixes
|
35
|
+
|
36
|
+
## [5.0.8](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/5.0.8) (2020-06-11)
|
37
|
+
|
38
|
+
**Implemented enhancements:**
|
39
|
+
|
40
|
+
- Bug fixes
|
41
|
+
|
42
|
+
## [5.0.7](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/5.0.7) (2020-05-15)
|
43
|
+
|
44
|
+
**Implemented enhancements:**
|
45
|
+
|
46
|
+
- Bug fixes
|
47
|
+
|
48
|
+
## [5.0.6](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/5.0.6) (2020-04-24)
|
49
|
+
|
50
|
+
**Implemented enhancements:**
|
51
|
+
|
52
|
+
- Bug fixes
|
53
|
+
|
54
|
+
## [5.0.5](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/5.0.5) (2020-04-24)
|
55
|
+
|
56
|
+
**Implemented enhancements:**
|
57
|
+
|
58
|
+
- Bug fixes
|
59
|
+
|
60
|
+
## [5.0.4](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.4) (2020-02-12)
|
61
|
+
|
62
|
+
**Implemented enhancements:**
|
63
|
+
|
64
|
+
- Implemented platform components APIs
|
65
|
+
|
66
|
+
## [5.0.3](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.3) (2020-01-17)
|
67
|
+
|
68
|
+
**Implemented enhancements:**
|
69
|
+
|
70
|
+
- Implemented task engine configuration APIs
|
71
|
+
|
72
|
+
## [5.0.2](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.2) (2020-01-10)
|
73
|
+
|
74
|
+
**Implemented enhancements:**
|
75
|
+
|
76
|
+
- Fixed bug with jetching JWT regarding redirects
|
77
|
+
|
78
|
+
## [5.0.1](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.1) (2020-01-10)
|
79
|
+
|
80
|
+
**Implemented enhancements:**
|
81
|
+
|
82
|
+
- Implemented Task System error API
|
83
|
+
- Fixed typo in Discussions component
|
84
|
+
|
85
|
+
## [5.0.0](https://github.com/kineticdata/kinetic-sdk-rb/tree/5.0.0) (2019-12-19)
|
86
|
+
|
87
|
+
### **1.x to 5.x Upgrade Warning**
|
88
|
+
|
89
|
+
All platform components (Core, Task, Agent, Discussions...etc) should be running a 5.x release or greater.
|
90
|
+
Unintended behavior is possible if running 5.x of the SDK against any platform component < 5.x.
|
91
|
+
|
92
|
+
## [1.0.2](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/1.0.2) (2019-12-18)
|
93
|
+
|
94
|
+
**Implemented enhancements:**
|
95
|
+
|
96
|
+
- Bug fixes
|
97
|
+
|
98
|
+
## [1.0.1](https://github.com/kineticdata/kinetic-sdk-rb/releases/tag/1.0.1) (2019-12-17)
|
99
|
+
|
100
|
+
**Implemented enhancements:**
|
101
|
+
|
102
|
+
- Bug fixes
|
103
|
+
|
3
104
|
## [1.0.0](https://github.com/kineticdata/kinetic-sdk-rb/tree/1.0.0) (2019-06-13)
|
4
105
|
|
5
|
-
**
|
106
|
+
### **0.x to 1.x Upgrade Warning**
|
6
107
|
|
7
108
|
Export methods have been updated to reflect the folder structure
|
8
109
|
of their respective API routes.
|
@@ -39,34 +140,3 @@ sdk.logger.info("foo")
|
|
39
140
|
- 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
141
|
- :gateway_retry_limit (default 5), set to -1 to disable retrying gateway errors
|
41
142
|
- :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/kinetic_sdk.gemspec
CHANGED
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_development_dependency "kontena-websocket-client", "0.1.1"
|
27
27
|
|
28
|
-
spec.add_development_dependency "bundler", "~> 1.
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
29
29
|
spec.add_development_dependency "rake", "~> 13.0.1"
|
30
|
-
spec.add_development_dependency "yard", "~> 0.9.
|
30
|
+
spec.add_development_dependency "yard", "~> 0.9.25"
|
31
31
|
|
32
32
|
spec.metadata["yard.run"] = "yri"
|
33
33
|
end
|
@@ -2,6 +2,7 @@ module KineticSdk
|
|
2
2
|
class Core
|
3
3
|
|
4
4
|
# Add a form type on a Kapp
|
5
|
+
# The method is being depreciated and replaced with add_formtype
|
5
6
|
#
|
6
7
|
# @param kapp_slug [String] slug of the Kapp the form type belongs to
|
7
8
|
# @param body [Hash] form type properties
|
@@ -14,7 +15,30 @@ module KineticSdk
|
|
14
15
|
post("#{@api_url}/kapps/#{kapp_slug}/formTypes", body, headers)
|
15
16
|
end
|
16
17
|
|
18
|
+
alias :add_formtype :add_form_type_on_kapp
|
19
|
+
|
20
|
+
def add_form_type_on_kapp(kapp_slug, body, headers=default_headers)
|
21
|
+
logger.info "Deprecation Warning: add_form_type_on_kapp method will be removed in a future version. Please use #add_formtype"
|
22
|
+
add_formtype(kapp_slug, body, headers=default_headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
# Update a form type on a Kapp
|
27
|
+
#
|
28
|
+
# @param kapp_slug [String] slug of the Kapp the form type belongs to
|
29
|
+
# @param name [String] name of the form type
|
30
|
+
# @param body [Hash] form type properties
|
31
|
+
# - +name+ - A descriptive name for the form type
|
32
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
33
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
34
|
+
def update_formtype(kapp_slug, name, body, headers=default_headers)
|
35
|
+
raise StandardError.new "Form Type properties is not valid, must be a Hash." unless body.is_a? Hash
|
36
|
+
@logger.info("Updating Form Type \"#{body['name']}\" for \"#{kapp_slug}\" kapp")
|
37
|
+
put("#{@api_url}/kapps/#{kapp_slug}/formTypes/#{encode(name)}", body, headers)
|
38
|
+
end
|
39
|
+
|
17
40
|
# Delete a form type on a Kapp
|
41
|
+
# The method is being depreciated and replaced with delete_formtype
|
18
42
|
#
|
19
43
|
# @param kapp_slug [String] slug of the Kapp the form type belongs to
|
20
44
|
# @param name [String] name of the form type
|
@@ -24,19 +48,46 @@ module KineticSdk
|
|
24
48
|
@logger.info("Deleting form type \"#{name}\" from \"#{kapp_slug}\" kapp")
|
25
49
|
delete("#{@api_url}/kapps/#{kapp_slug}/formTypes/#{encode(name)}", headers)
|
26
50
|
end
|
51
|
+
|
52
|
+
alias :delete_formtype :delete_form_type
|
53
|
+
|
54
|
+
def delete_form_type(kapp_slug, name, headers=default_headers)
|
55
|
+
logger.info "Deprecation Warning: delete_form_type method will be removed in a future version. Please use #delete_formtype"
|
56
|
+
delete_formtype(kapp_slug, name, headers=default_headers)
|
57
|
+
end
|
27
58
|
|
28
59
|
# Delete all form types on a Kapp
|
60
|
+
# The method is being depreciated and replaced with delete_formtypes
|
29
61
|
#
|
30
62
|
# @param kapp_slug [String] slug of the Kapp the form types belongs to
|
31
63
|
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
32
64
|
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
33
65
|
def delete_form_types_on_kapp(kapp_slug, headers=default_headers)
|
34
|
-
(
|
35
|
-
|
66
|
+
(find_formtypes(kapp_slug, {}, headers).content["formTypes"] || []).each do |form_type|
|
67
|
+
delete_formtype(kapp_slug, form_type['name'], headers)
|
36
68
|
end
|
37
69
|
end
|
70
|
+
|
71
|
+
alias :delete_formtypes :delete_form_types_on_kapp
|
72
|
+
|
73
|
+
def delete_form_types_on_kapp(kapp_slug, headers=default_headers)
|
74
|
+
logger.info "Deprecation Warning: delete_form_types_on_kapp method will be removed in a future version. Please use #delete_formtypes"
|
75
|
+
delete_formtypes(kapp_slug, headers=default_headers)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Retrieve a single form types for a Kapp
|
79
|
+
#
|
80
|
+
# @param kapp_slug [String] slug of the Kapp the form types belongs to
|
81
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
82
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
83
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
84
|
+
def find_formtype(kapp_slug, name, params={}, headers=default_headers)
|
85
|
+
@logger.info("Finding the #{name}Form Type for \"#{kapp_slug}\" kapp")
|
86
|
+
get("#{@api_url}/kapps/#{kapp_slug}/formTypes/#{encode(name)}", params, headers)
|
87
|
+
end
|
38
88
|
|
39
89
|
# Retrieve a list of all form types for a Kapp
|
90
|
+
# The method is being depreciated and replaced with find_formtypes
|
40
91
|
#
|
41
92
|
# @param kapp_slug [String] slug of the Kapp the form types belongs to
|
42
93
|
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
@@ -46,6 +97,12 @@ module KineticSdk
|
|
46
97
|
@logger.info("Finding Form Types for \"#{kapp_slug}\" kapp")
|
47
98
|
get("#{@api_url}/kapps/#{kapp_slug}/formTypes", params, headers)
|
48
99
|
end
|
100
|
+
|
101
|
+
alias :find_formtypes :find_form_types_on_kapp
|
49
102
|
|
103
|
+
def find_form_types_on_kapp(kapp_slug, params={}, headers=default_headers)
|
104
|
+
logger.info "Deprecation Warning: find_form_types_on_kapp method will be removed in a future version. Please use #find_formtypes"
|
105
|
+
find_formtypes(kapp_slug, params={}, headers=default_headers)
|
106
|
+
end
|
50
107
|
end
|
51
108
|
end
|
@@ -18,7 +18,6 @@ module KineticSdk
|
|
18
18
|
# either add or update the attribute value
|
19
19
|
exists = false
|
20
20
|
attributes.each do |attribute|
|
21
|
-
@logger.info("Attribute: #{attribute.inspect}")
|
22
21
|
# if the attribute already exists, update it
|
23
22
|
if attribute["name"] == attribute_name
|
24
23
|
attribute["values"] = attribute_value.is_a?(Array) ? attribute_value : [ attribute_value ]
|
@@ -0,0 +1,144 @@
|
|
1
|
+
module KineticSdk
|
2
|
+
class Core
|
3
|
+
|
4
|
+
# Add a Web API on the Space
|
5
|
+
#
|
6
|
+
# @param body [Hash] hash of Web API properties
|
7
|
+
# - +method+ - The method of the Web API - "GET", "POST", "PUT", or "DELETE"
|
8
|
+
# - +slug+ - The slug of the Web API
|
9
|
+
# - +securityPolicies+ - [Array] Array of hashes
|
10
|
+
# - - +endpoint+ - "Execution"
|
11
|
+
# - - +name+ - Name of an existing Space Security Definition
|
12
|
+
|
13
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
14
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
15
|
+
def add_space_webapi(body, headers=default_headers)
|
16
|
+
raise StandardError.new "Web API properties is not valid, must be a Hash." unless body.is_a? Hash
|
17
|
+
@logger.info("Adding the \"#{body['slug']}\" to the Space.")
|
18
|
+
post("#{@api_url}/webApis", body, headers)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Add a Web API on a Kapp
|
22
|
+
#
|
23
|
+
# @param kapp_slug [String] the Kapp slug
|
24
|
+
# @param body [Hash] hash of Web API properties
|
25
|
+
# - +method+ - The method of the Web API - "GET", "POST", "PUT", or "DELETE"
|
26
|
+
# - +slug+ - The slug of the Web API
|
27
|
+
# - +securityPolicies+ - [Array] Array of hashes
|
28
|
+
# - - +endpoint+ - "Execution"
|
29
|
+
# - - +name+ - Name of an existing Space Security Definition
|
30
|
+
|
31
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
32
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
33
|
+
def add_kapp_webapi(kapp_slug, body, headers=default_headers)
|
34
|
+
raise StandardError.new "Web API properties is not valid, must be a Hash." unless body.is_a? Hash
|
35
|
+
@logger.info("Adding the \"#{body['slug']}\" to the \"#{kapp_slug}\" Kapp.")
|
36
|
+
post("#{@api_url}/kapps/#{kapp_slug}/webApis", body, headers)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Find all Web APIs for the Space
|
40
|
+
#
|
41
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
42
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
43
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
44
|
+
def find_space_webapis(params={}, headers=default_headers)
|
45
|
+
@logger.info("Finding all Web APIs on the Space")
|
46
|
+
get("#{@api_url}/webApis", params, headers)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Find a single Web API on the Space
|
50
|
+
#
|
51
|
+
# @param slug [String] slug of the Web API
|
52
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
53
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
54
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
55
|
+
def find_space_webapi(slug, params={}, headers=default_headers)
|
56
|
+
@logger.info("Finding the \"#{slug}\" Web API on the Space")
|
57
|
+
get("#{@api_url}/webApis/#{slug}", params, headers)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Find all Web APIs for a Kapp
|
61
|
+
#
|
62
|
+
# @param kapp_slug [String] the Kapp slug
|
63
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
64
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
65
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
66
|
+
def find_kapp_webapis(kapp_slug, params={}, headers=default_headers)
|
67
|
+
@logger.info("Finding all Web APIs on the \"#{kapp_slug}\" Kapp.")
|
68
|
+
get("#{@api_url}/kapps/#{kapp_slug}/webApis", params, headers)
|
69
|
+
end
|
70
|
+
|
71
|
+
# Find a single Web API on the Kapp
|
72
|
+
#
|
73
|
+
# @param kapp_slug [String] the Kapp slug
|
74
|
+
# @param slug [String] slug of the Web API
|
75
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
76
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
77
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
78
|
+
def find_kapp_webapi(kapp_slug, slug, params={}, headers=default_headers)
|
79
|
+
@logger.info("Finding the \"#{slug}\" Web API on the \"#{kapp_slug}\" Kapp.")
|
80
|
+
get("#{@api_url}/kapps/#{kapp_slug}/webApis/#{slug}", params, headers)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Update a Web API on the Space
|
84
|
+
#
|
85
|
+
# All of the Web API properties are optional. Only the properties provided
|
86
|
+
# in the Hash will be updated, the other properties will retain their
|
87
|
+
# current values.
|
88
|
+
#
|
89
|
+
# @param slug [String] the slug of the Web API
|
90
|
+
# @param body [Hash] hash of Web API properties
|
91
|
+
# - +method+ - The method of the Web API - "GET", "POST", "PUT", or "DELETE"
|
92
|
+
# - +slug+ - The slug of the Web API
|
93
|
+
# - +securityPolicies+ - [Array] Array of hashes
|
94
|
+
# - - +endpoint+ - "Execution"
|
95
|
+
# - - +name+ - Name of an existing Space Security Definition
|
96
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
97
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
98
|
+
def update_space_webapi(slug, body, headers=default_headers)
|
99
|
+
@logger.info("Updating the \"#{slug}\" Web API on the Space.")
|
100
|
+
put("#{@api_url}/webApis/#{slug}", body, headers)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Update a Web API on a Kapp
|
104
|
+
#
|
105
|
+
# All of the Web API properties are optional. Only the properties provided
|
106
|
+
# in the Hash will be updated, the other properties will retain their
|
107
|
+
# current values.
|
108
|
+
#
|
109
|
+
# @param kapp_slug [String] the Kapp slug
|
110
|
+
# @param slug [String] the slug of the Web API
|
111
|
+
# @param body [Hash] hash of Web API properties
|
112
|
+
# - +method+ - The method of the Web API - "GET", "POST", "PUT", or "DELETE"
|
113
|
+
# - +slug+ - The slug of the Web API
|
114
|
+
# - +securityPolicies+ - [Array] Array of hashes
|
115
|
+
# - - +endpoint+ - "Execution"
|
116
|
+
# - - +name+ - Name of an existing Space Security Definition
|
117
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
118
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
119
|
+
def update_kapp_webapi(kapp_slug, slug, body, headers=default_headers)
|
120
|
+
@logger.info("Updating the \"#{slug}\" Web API on the \"#{kapp_slug}\" Kapp.")
|
121
|
+
put("#{@api_url}/kapps/#{kapp_slug}/webApis/#{slug}", body, headers)
|
122
|
+
end
|
123
|
+
|
124
|
+
# Delete a Web API on the Space
|
125
|
+
# @param slug [String] the slug of the Web API
|
126
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
127
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
128
|
+
def delete_space_webapi(slug, headers=default_headers)
|
129
|
+
@logger.info("Deleting the \"#{slug}\" Web API on the Space.")
|
130
|
+
delete("#{@api_url}/webApis/#{slug}", headers)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Delete a Web API on a Kapp
|
134
|
+
# @param kapp_slug [String] the Kapp slug
|
135
|
+
# @param slug [String] the slug of the Web API
|
136
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
137
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
138
|
+
def delete_kapp_webapi(kapp_slug, slug, headers=default_headers)
|
139
|
+
@logger.info("Deleting the \"#{slug}\" Web API on the \"#{kapp_slug}\" Kapp.")
|
140
|
+
delete("#{@api_url}/kapps/#{kapp_slug}/webApis/#{slug}", headers)
|
141
|
+
end
|
142
|
+
|
143
|
+
end
|
144
|
+
end
|
@@ -196,7 +196,7 @@ module KineticSdk
|
|
196
196
|
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
197
197
|
def delete_webhook_on_kapp(kapp_slug, name, headers=default_headers)
|
198
198
|
@logger.info("Deleting the #{name} webhook on the #{kapp_slug}\ kapp.")
|
199
|
-
delete(
|
199
|
+
delete("#{@api_url}/kapps/#{kapp_slug}/webhooks/#{encode(name)}", headers)
|
200
200
|
end
|
201
201
|
|
202
202
|
# Delete a webhook on space
|
@@ -18,7 +18,7 @@ module KineticSdk
|
|
18
18
|
def delete_handlers(headers=header_basic_auth)
|
19
19
|
@logger.info("Deleting all handlers")
|
20
20
|
(find_handlers(headers).content['handlers'] || []).each do |handler|
|
21
|
-
delete("#{@api_url}/handlers/#{handler['
|
21
|
+
delete("#{@api_url}/handlers/#{handler['definitionId']}", headers)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -60,7 +60,7 @@ module KineticSdk
|
|
60
60
|
# @return nil
|
61
61
|
def export_sources(headers=header_basic_auth)
|
62
62
|
raise StandardError.new "An export directory must be defined to export sources." if @options[:export_directory].nil?
|
63
|
-
response = find_sources({"include" => "policyRules"})
|
63
|
+
response = find_sources({"include" => "policyRules, properties"})
|
64
64
|
(response.content["sourceRoots"] || []).each do |source|
|
65
65
|
# determine which directory to write the file to
|
66
66
|
if source['name'] != "-"
|
@@ -140,11 +140,16 @@ module KineticSdk
|
|
140
140
|
|
141
141
|
# If this is not the "root" object
|
142
142
|
if object_path != '' && !file_contents.empty?
|
143
|
+
# Remove all `/` and `\` characters with ``
|
144
|
+
# Replace all `.` with `/`
|
145
|
+
# Replace all `::` with `-` (this ensures nested Teams/Categories maintain a separator)
|
146
|
+
# Replace all non-slug characters with ``
|
147
|
+
filename = "#{core_path}/#{object_path.gsub('/\\', '').gsub('.', '/').gsub(/::/, '-').gsub(/[^ a-zA-Z0-9_\-\/]/, '')}.json"
|
143
148
|
# Write the file_contents based upon the
|
144
|
-
filename = "#{core_path}/#{object_path.gsub('.', '/')}.json"
|
145
149
|
write_object_to_file(filename, file_contents)
|
146
150
|
end
|
147
151
|
|
152
|
+
|
148
153
|
# For each of the child objects
|
149
154
|
child_objects.each do |key, child_object|
|
150
155
|
# Process the export for that object (recursively)
|
data/lib/kinetic_sdk/version.rb
CHANGED
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.
|
4
|
+
version: 5.0.13
|
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-
|
11
|
+
date: 2020-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: slugify
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - '='
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: 1.0.7
|
20
|
-
|
19
|
+
name: slugify
|
21
20
|
prerelease: false
|
21
|
+
type: :runtime
|
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
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - '='
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: 2.0.0
|
34
|
-
|
33
|
+
name: multipart-post
|
35
34
|
prerelease: false
|
35
|
+
type: :runtime
|
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
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - '='
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: '3.1'
|
48
|
-
|
47
|
+
name: mime-types
|
49
48
|
prerelease: false
|
49
|
+
type: :runtime
|
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
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - '='
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: 1.12.1
|
62
|
-
|
61
|
+
name: parallel
|
63
62
|
prerelease: false
|
63
|
+
type: :runtime
|
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
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
72
71
|
requirements:
|
73
72
|
- - '='
|
74
73
|
- !ruby/object:Gem::Version
|
75
74
|
version: 1.9.0
|
76
|
-
|
75
|
+
name: ruby-progressbar
|
77
76
|
prerelease: false
|
77
|
+
type: :runtime
|
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
|
85
84
|
requirement: !ruby/object:Gem::Requirement
|
86
85
|
requirements:
|
87
86
|
- - '='
|
88
87
|
- !ruby/object:Gem::Version
|
89
88
|
version: 0.1.1
|
90
|
-
|
89
|
+
name: kontena-websocket-client
|
91
90
|
prerelease: false
|
91
|
+
type: :development
|
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
|
99
98
|
requirement: !ruby/object:Gem::Requirement
|
100
99
|
requirements:
|
101
100
|
- - "~>"
|
102
101
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
104
|
-
|
102
|
+
version: '1.17'
|
103
|
+
name: bundler
|
105
104
|
prerelease: false
|
105
|
+
type: :development
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
110
|
+
version: '1.17'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: rake
|
113
112
|
requirement: !ruby/object:Gem::Requirement
|
114
113
|
requirements:
|
115
114
|
- - "~>"
|
116
115
|
- !ruby/object:Gem::Version
|
117
116
|
version: 13.0.1
|
118
|
-
|
117
|
+
name: rake
|
119
118
|
prerelease: false
|
119
|
+
type: :development
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 13.0.1
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name: yard
|
127
126
|
requirement: !ruby/object:Gem::Requirement
|
128
127
|
requirements:
|
129
128
|
- - "~>"
|
130
129
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.9.
|
132
|
-
|
130
|
+
version: 0.9.25
|
131
|
+
name: yard
|
133
132
|
prerelease: false
|
133
|
+
type: :development
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.9.
|
139
|
-
description:
|
138
|
+
version: 0.9.25
|
139
|
+
description:
|
140
140
|
email:
|
141
141
|
- support@kineticdata.com
|
142
142
|
executables:
|
@@ -362,6 +362,7 @@ files:
|
|
362
362
|
- lib/kinetic_sdk/core/lib/system_api.rb
|
363
363
|
- lib/kinetic_sdk/core/lib/teams.rb
|
364
364
|
- lib/kinetic_sdk/core/lib/users.rb
|
365
|
+
- lib/kinetic_sdk/core/lib/webapis.rb
|
365
366
|
- lib/kinetic_sdk/core/lib/webhook_jobs.rb
|
366
367
|
- lib/kinetic_sdk/core/lib/webhooks.rb
|
367
368
|
- lib/kinetic_sdk/discussions/discussions-sdk.rb
|
@@ -407,7 +408,7 @@ homepage: https://github.com/kineticdata/kinetic-sdk-rb
|
|
407
408
|
licenses: []
|
408
409
|
metadata:
|
409
410
|
yard.run: yri
|
410
|
-
post_install_message:
|
411
|
+
post_install_message:
|
411
412
|
rdoc_options: []
|
412
413
|
require_paths:
|
413
414
|
- lib
|
@@ -422,8 +423,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
422
423
|
- !ruby/object:Gem::Version
|
423
424
|
version: '0'
|
424
425
|
requirements: []
|
425
|
-
|
426
|
-
|
426
|
+
rubyforge_project:
|
427
|
+
rubygems_version: 2.6.11
|
428
|
+
signing_key:
|
427
429
|
specification_version: 4
|
428
430
|
summary: Ruby SDK for Kinetic Data application APIs
|
429
431
|
test_files: []
|