kinetic_sdk 0.1.1
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 +7 -0
- data/GettingStarted.md +64 -0
- data/README.md +383 -0
- data/bin/console +12 -0
- data/bin/setup +8 -0
- data/gems/kontena-websocket-client-0.1.1/Gemfile +4 -0
- data/gems/kontena-websocket-client-0.1.1/LICENSE +190 -0
- data/gems/kontena-websocket-client-0.1.1/README.md +138 -0
- data/gems/kontena-websocket-client-0.1.1/Rakefile +6 -0
- data/gems/kontena-websocket-client-0.1.1/benchmark/benchmark-client.rb +45 -0
- data/gems/kontena-websocket-client-0.1.1/benchmark/benchmark-em.rb +66 -0
- data/gems/kontena-websocket-client-0.1.1/benchmark/benchmark.rb +161 -0
- data/gems/kontena-websocket-client-0.1.1/benchmark/benchmark.sh +17 -0
- data/gems/kontena-websocket-client-0.1.1/benchmark/websocket-echo-server.go +207 -0
- data/gems/kontena-websocket-client-0.1.1/examples/websocket-echo-client.rb +80 -0
- data/gems/kontena-websocket-client-0.1.1/kontena-websocket-client.gemspec +24 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/client/connection.rb +119 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/client/version.rb +13 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/client.rb +848 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/error.rb +81 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/logging.rb +55 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena/websocket/openssl_patch.rb +10 -0
- data/gems/kontena-websocket-client-0.1.1/lib/kontena-websocket-client.rb +15 -0
- data/gems/mime-types-3.1/Code-of-Conduct.rdoc +74 -0
- data/gems/mime-types-3.1/Contributing.rdoc +130 -0
- data/gems/mime-types-3.1/History.rdoc +658 -0
- data/gems/mime-types-3.1/Licence.rdoc +25 -0
- data/gems/mime-types-3.1/Manifest.txt +31 -0
- data/gems/mime-types-3.1/README.rdoc +202 -0
- data/gems/mime-types-3.1/Rakefile +254 -0
- data/gems/mime-types-3.1/lib/mime/type/columnar.rb +55 -0
- data/gems/mime-types-3.1/lib/mime/type.rb +573 -0
- data/gems/mime-types-3.1/lib/mime/types/_columnar.rb +135 -0
- data/gems/mime-types-3.1/lib/mime/types/cache.rb +56 -0
- data/gems/mime-types-3.1/lib/mime/types/columnar.rb +1 -0
- data/gems/mime-types-3.1/lib/mime/types/container.rb +30 -0
- data/gems/mime-types-3.1/lib/mime/types/deprecations.rb +32 -0
- data/gems/mime-types-3.1/lib/mime/types/full.rb +17 -0
- data/gems/mime-types-3.1/lib/mime/types/loader.rb +148 -0
- data/gems/mime-types-3.1/lib/mime/types/logger.rb +37 -0
- data/gems/mime-types-3.1/lib/mime/types/registry.rb +81 -0
- data/gems/mime-types-3.1/lib/mime/types.rb +228 -0
- data/gems/mime-types-3.1/lib/mime-types.rb +1 -0
- data/gems/mime-types-3.1/test/bad-fixtures/malformed +9 -0
- data/gems/mime-types-3.1/test/fixture/json.json +1 -0
- data/gems/mime-types-3.1/test/fixture/old-data +9 -0
- data/gems/mime-types-3.1/test/fixture/yaml.yaml +55 -0
- data/gems/mime-types-3.1/test/minitest_helper.rb +13 -0
- data/gems/mime-types-3.1/test/test_mime_type.rb +603 -0
- data/gems/mime-types-3.1/test/test_mime_types.rb +161 -0
- data/gems/mime-types-3.1/test/test_mime_types_cache.rb +109 -0
- data/gems/mime-types-3.1/test/test_mime_types_class.rb +155 -0
- data/gems/mime-types-3.1/test/test_mime_types_lazy.rb +43 -0
- data/gems/mime-types-3.1/test/test_mime_types_loader.rb +32 -0
- data/gems/mime-types-data-3.2016.0521/Code-of-Conduct.md +75 -0
- data/gems/mime-types-data-3.2016.0521/Contributing.md +157 -0
- data/gems/mime-types-data-3.2016.0521/History.md +351 -0
- data/gems/mime-types-data-3.2016.0521/Licence.md +25 -0
- data/gems/mime-types-data-3.2016.0521/Manifest.txt +18 -0
- data/gems/mime-types-data-3.2016.0521/README.md +61 -0
- data/gems/mime-types-data-3.2016.0521/Rakefile +80 -0
- data/gems/mime-types-data-3.2016.0521/data/mime-types.json +1 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.content_type.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.docs.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.encoding.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.flags.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.friendly.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.pext.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.use_instead.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/data/mime.xrefs.column +1964 -0
- data/gems/mime-types-data-3.2016.0521/lib/mime/types/data.rb +21 -0
- data/gems/mime-types-data-3.2016.0521/lib/mime-types-data.rb +3 -0
- data/gems/multipart-post-2.0.0/Gemfile +14 -0
- data/gems/multipart-post-2.0.0/History.txt +60 -0
- data/gems/multipart-post-2.0.0/Manifest.txt +9 -0
- data/gems/multipart-post-2.0.0/README.md +77 -0
- data/gems/multipart-post-2.0.0/Rakefile +9 -0
- data/gems/multipart-post-2.0.0/lib/composite_io.rb +108 -0
- data/gems/multipart-post-2.0.0/lib/multipart_post.rb +9 -0
- data/gems/multipart-post-2.0.0/lib/multipartable.rb +29 -0
- data/gems/multipart-post-2.0.0/lib/net/http/post/multipart.rb +27 -0
- data/gems/multipart-post-2.0.0/lib/parts.rb +96 -0
- data/gems/multipart-post-2.0.0/multipart-post.gemspec +22 -0
- data/gems/multipart-post-2.0.0/test/multibyte.txt +1 -0
- data/gems/multipart-post-2.0.0/test/net/http/post/test_multipart.rb +110 -0
- data/gems/multipart-post-2.0.0/test/test_composite_io.rb +115 -0
- data/gems/multipart-post-2.0.0/test/test_parts.rb +86 -0
- data/gems/parallel-1.12.1/MIT-LICENSE.txt +20 -0
- data/gems/parallel-1.12.1/lib/parallel/processor_count.rb +93 -0
- data/gems/parallel-1.12.1/lib/parallel/version.rb +3 -0
- data/gems/parallel-1.12.1/lib/parallel.rb +500 -0
- data/gems/ruby-progressbar-1.9.0/LICENSE.txt +19 -0
- data/gems/ruby-progressbar-1.9.0/README.md +38 -0
- data/gems/ruby-progressbar-1.9.0/Rakefile +2 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/base.rb +183 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/calculators/length.rb +99 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/calculators/running_average.rb +9 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components/bar.rb +96 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components/percentage.rb +29 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components/rate.rb +43 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components/time.rb +107 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components/title.rb +13 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/components.rb +5 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/errors/invalid_progress_error.rb +4 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/format/formatter.rb +27 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/format/molecule.rb +59 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/format/string.rb +36 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/format.rb +3 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/output.rb +68 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/outputs/non_tty.rb +47 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/outputs/null.rb +33 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/outputs/tty.rb +32 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/progress.rb +118 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/refinements/enumerator.rb +25 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/refinements.rb +1 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/throttle.rb +25 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/time.rb +30 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/timer.rb +72 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar/version.rb +3 -0
- data/gems/ruby-progressbar-1.9.0/lib/ruby-progressbar.rb +18 -0
- data/gems/slugify-1.0.7/README +18 -0
- data/gems/slugify-1.0.7/lib/slugify.rb +1012 -0
- data/gems/slugify-1.0.7/lib/slugify_string.rb +11 -0
- data/gems/slugify-1.0.7/tests/slugify_test.rb +116 -0
- data/gems/slugify-1.0.7/tests/string_slugify_test.rb +23 -0
- data/gems/websocket-driver-0.6.5/CHANGELOG.md +123 -0
- data/gems/websocket-driver-0.6.5/LICENSE.md +22 -0
- data/gems/websocket-driver-0.6.5/README.md +369 -0
- data/gems/websocket-driver-0.6.5/examples/tcp_server.rb +28 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/Makefile +264 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/WebsocketMaskService.java +55 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/extconf.rb +4 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/websocket_mask.bundle +0 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/websocket_mask.c +41 -0
- data/gems/websocket-driver-0.6.5/ext/websocket-driver/websocket_mask.o +0 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/client.rb +140 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/draft75.rb +102 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/draft76.rb +96 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/event_emitter.rb +54 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/headers.rb +45 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/hybi/frame.rb +20 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/hybi/message.rb +31 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/hybi.rb +406 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/proxy.rb +68 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/server.rb +80 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver/stream_reader.rb +55 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/driver.rb +199 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/http/headers.rb +112 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/http/request.rb +45 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/http/response.rb +29 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/http.rb +15 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/mask.rb +14 -0
- data/gems/websocket-driver-0.6.5/lib/websocket/websocket_mask.rb +2 -0
- data/gems/websocket-driver-0.6.5/lib/websocket_mask.bundle +0 -0
- data/gems/websocket-driver-0.6.5-java/CHANGELOG.md +123 -0
- data/gems/websocket-driver-0.6.5-java/LICENSE.md +22 -0
- data/gems/websocket-driver-0.6.5-java/README.md +369 -0
- data/gems/websocket-driver-0.6.5-java/examples/tcp_server.rb +28 -0
- data/gems/websocket-driver-0.6.5-java/ext/websocket-driver/WebsocketMaskService.java +55 -0
- data/gems/websocket-driver-0.6.5-java/ext/websocket-driver/extconf.rb +4 -0
- data/gems/websocket-driver-0.6.5-java/ext/websocket-driver/websocket_mask.c +41 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/client.rb +140 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/draft75.rb +102 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/draft76.rb +96 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/event_emitter.rb +54 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/headers.rb +45 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/hybi/frame.rb +20 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/hybi/message.rb +31 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/hybi.rb +406 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/proxy.rb +68 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/server.rb +80 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver/stream_reader.rb +55 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/driver.rb +199 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/http/headers.rb +112 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/http/request.rb +45 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb +29 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/http.rb +15 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/mask.rb +14 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket/websocket_mask.rb +2 -0
- data/gems/websocket-driver-0.6.5-java/lib/websocket_mask.jar +0 -0
- data/gems/websocket-extensions-0.1.3/CHANGELOG.md +15 -0
- data/gems/websocket-extensions-0.1.3/LICENSE.md +20 -0
- data/gems/websocket-extensions-0.1.3/README.md +313 -0
- data/gems/websocket-extensions-0.1.3/lib/websocket/extensions/parser.rb +111 -0
- data/gems/websocket-extensions-0.1.3/lib/websocket/extensions.rb +181 -0
- data/lib/kinetic-sdk.rb +1 -0
- data/lib/kinetic_sdk/bridgehub/bridgehub-sdk.rb +80 -0
- data/lib/kinetic_sdk/bridgehub/lib/access_keys.rb +67 -0
- data/lib/kinetic_sdk/bridgehub/lib/bridge.rb +69 -0
- data/lib/kinetic_sdk/discussions/discussions-sdk.rb +165 -0
- data/lib/kinetic_sdk/discussions/lib/discussions.rb +107 -0
- data/lib/kinetic_sdk/discussions/lib/invitations.rb +120 -0
- data/lib/kinetic_sdk/discussions/lib/messages.rb +190 -0
- data/lib/kinetic_sdk/discussions/lib/meta.rb +14 -0
- data/lib/kinetic_sdk/discussions/lib/participants.rb +64 -0
- data/lib/kinetic_sdk/discussions/lib/related_items.rb +54 -0
- data/lib/kinetic_sdk/discussions/lib/websockets.rb +96 -0
- data/lib/kinetic_sdk/filehub/filehub-sdk.rb +80 -0
- data/lib/kinetic_sdk/filehub/lib/access_keys.rb +67 -0
- data/lib/kinetic_sdk/filehub/lib/filestores.rb +67 -0
- data/lib/kinetic_sdk/request_ce/lib/attribute_definitions.rb +153 -0
- data/lib/kinetic_sdk/request_ce/lib/bridges.rb +66 -0
- data/lib/kinetic_sdk/request_ce/lib/categories.rb +34 -0
- data/lib/kinetic_sdk/request_ce/lib/datastore_form.rb +110 -0
- data/lib/kinetic_sdk/request_ce/lib/datastore_submissions.rb +157 -0
- data/lib/kinetic_sdk/request_ce/lib/form.rb +99 -0
- data/lib/kinetic_sdk/request_ce/lib/form_types.rb +51 -0
- data/lib/kinetic_sdk/request_ce/lib/jwt.rb +55 -0
- data/lib/kinetic_sdk/request_ce/lib/kapp.rb +93 -0
- data/lib/kinetic_sdk/request_ce/lib/meta.rb +14 -0
- data/lib/kinetic_sdk/request_ce/lib/oauth.rb +37 -0
- data/lib/kinetic_sdk/request_ce/lib/security_policy_definitions.rb +157 -0
- data/lib/kinetic_sdk/request_ce/lib/space.rb +89 -0
- data/lib/kinetic_sdk/request_ce/lib/submissions.rb +215 -0
- data/lib/kinetic_sdk/request_ce/lib/system_api.rb +69 -0
- data/lib/kinetic_sdk/request_ce/lib/teams.rb +113 -0
- data/lib/kinetic_sdk/request_ce/lib/users.rb +245 -0
- data/lib/kinetic_sdk/request_ce/lib/webhook_jobs.rb +142 -0
- data/lib/kinetic_sdk/request_ce/lib/webhooks.rb +192 -0
- data/lib/kinetic_sdk/request_ce/request-ce-sdk.rb +153 -0
- data/lib/kinetic_sdk/task/lib/access_keys.rb +94 -0
- data/lib/kinetic_sdk/task/lib/categories.rb +190 -0
- data/lib/kinetic_sdk/task/lib/config.rb +202 -0
- data/lib/kinetic_sdk/task/lib/engine.rb +42 -0
- data/lib/kinetic_sdk/task/lib/environment.rb +14 -0
- data/lib/kinetic_sdk/task/lib/errors.rb +165 -0
- data/lib/kinetic_sdk/task/lib/groups.rb +112 -0
- data/lib/kinetic_sdk/task/lib/handlers.rb +105 -0
- data/lib/kinetic_sdk/task/lib/health.rb +28 -0
- data/lib/kinetic_sdk/task/lib/license.rb +52 -0
- data/lib/kinetic_sdk/task/lib/policy_rules.rb +166 -0
- data/lib/kinetic_sdk/task/lib/setup.rb +56 -0
- data/lib/kinetic_sdk/task/lib/sources.rb +134 -0
- data/lib/kinetic_sdk/task/lib/tasks.rb +17 -0
- data/lib/kinetic_sdk/task/lib/trees.rb +274 -0
- data/lib/kinetic_sdk/task/lib/users.rb +75 -0
- data/lib/kinetic_sdk/task/task-sdk.rb +92 -0
- data/lib/kinetic_sdk/utils/kinetic-http-headers.rb +150 -0
- data/lib/kinetic_sdk/utils/kinetic-http-response.rb +75 -0
- data/lib/kinetic_sdk/utils/kinetic-http.rb +552 -0
- data/lib/kinetic_sdk/utils/logger.rb +70 -0
- data/lib/kinetic_sdk/utils/random.rb +30 -0
- data/lib/kinetic_sdk/version.rb +7 -0
- data/lib/kinetic_sdk.rb +57 -0
- metadata +414 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
module KineticSdk
|
|
2
|
+
class Task
|
|
3
|
+
|
|
4
|
+
# Add a category
|
|
5
|
+
#
|
|
6
|
+
# @param category [Hash] Category properties
|
|
7
|
+
# - +name+ - name of the category
|
|
8
|
+
# - +handlers+ - array of handler definitionIds associated to the category
|
|
9
|
+
# - +policyRules+ - array of policy rule names associated to the category
|
|
10
|
+
# - +trees+ - array of tree (routine) definitionIds associated to the category
|
|
11
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
12
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
13
|
+
def add_category(category, headers=default_headers)
|
|
14
|
+
info("Add category \"#{category['name']}\"")
|
|
15
|
+
post("#{@api_url}/categories", category, headers)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Delete a Category
|
|
19
|
+
#
|
|
20
|
+
# @param name [String] Category name
|
|
21
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
22
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
23
|
+
def delete_category(name, headers=header_basic_auth)
|
|
24
|
+
info("Deleting Category \"#{name}\"")
|
|
25
|
+
delete("#{@api_url}/categories/#{encode(name)}", headers)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Delete all Categories
|
|
29
|
+
#
|
|
30
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
31
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
32
|
+
def delete_categories(headers=header_basic_auth)
|
|
33
|
+
info("Deleting all categories")
|
|
34
|
+
(find_categories(headers).content["categories"] || []).each do |category|
|
|
35
|
+
delete_category(category['name'], headers)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Export a Category
|
|
40
|
+
#
|
|
41
|
+
# @param category [String|Hash] Category name, or hash of category properties
|
|
42
|
+
# - +name+ - name of the category
|
|
43
|
+
# - +handlers+ - array of handler definitionIds associated to the category
|
|
44
|
+
# - +policyRules+ - array of policy rule names associated to the category
|
|
45
|
+
# - +trees+ - array of tree (routine) definitionIds associated to the category
|
|
46
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
47
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
48
|
+
def export_category(category, headers=header_basic_auth)
|
|
49
|
+
raise StandardError.new "An export directory must be defined to export a category." if @options[:export_directory].nil?
|
|
50
|
+
if category.is_a? String
|
|
51
|
+
response = find_category(category, { "include" => "handlers,trees,policyRules" }, headers)
|
|
52
|
+
category = response.content
|
|
53
|
+
end
|
|
54
|
+
info("Exporting category \"#{category['name']}\" to #{@options[:export_directory]}.")
|
|
55
|
+
# Create the category directory if it doesn't yet exist
|
|
56
|
+
category_dir = FileUtils::mkdir_p(File.join(@options[:export_directory], "categories"))
|
|
57
|
+
category_file = File.join(category_dir, "#{category['name'].slugify}.json")
|
|
58
|
+
|
|
59
|
+
# Just export the associated key values
|
|
60
|
+
category['handlers'].collect! { |h| h['definitionId'] }.sort!
|
|
61
|
+
category['trees'].collect! { |t| t['definitionId'] }.sort!
|
|
62
|
+
category['policyRules'].collect! { |pr| pr['name'] }.sort!
|
|
63
|
+
|
|
64
|
+
# write the file
|
|
65
|
+
File.write(category_file, JSON.pretty_generate(category))
|
|
66
|
+
info("Exported category: #{category['name']} to #{category_file}")
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Export Categories
|
|
70
|
+
#
|
|
71
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
72
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
73
|
+
def export_categories(headers=header_basic_auth)
|
|
74
|
+
raise StandardError.new "An export directory must be defined to export categories." if @options[:export_directory].nil?
|
|
75
|
+
(find_categories({ "include" => "handlers,trees,policyRules" }).content["categories"] || []).each do |category|
|
|
76
|
+
export_category(category)
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Find all categories
|
|
81
|
+
#
|
|
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
|
|
84
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
85
|
+
def find_categories(params={}, headers=header_basic_auth)
|
|
86
|
+
info("Finding all categories")
|
|
87
|
+
get("#{@api_url}/categories", params, headers)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Find a category
|
|
91
|
+
#
|
|
92
|
+
# @param name [String] name of the category
|
|
93
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
94
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
95
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
96
|
+
def find_category(name, params={}, headers=header_basic_auth)
|
|
97
|
+
info("Finding Category \"#{name}\"")
|
|
98
|
+
get("#{@api_url}/categories/#{encode(name)}", params, headers)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Update a category
|
|
102
|
+
#
|
|
103
|
+
# @param original_name [String] name of the category before updating
|
|
104
|
+
# @param body [Hash] the updated property values
|
|
105
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
106
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
107
|
+
#
|
|
108
|
+
# Example
|
|
109
|
+
#
|
|
110
|
+
# update_category("Foo", { "name" => "Bar" })
|
|
111
|
+
#
|
|
112
|
+
def update_category(original_name, body={}, headers=default_headers)
|
|
113
|
+
info("Updating Category \"#{original_name}\"")
|
|
114
|
+
put("#{@api_url}/categories/#{encode(original_name)}", body, headers)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
# Add a handler to a category
|
|
119
|
+
#
|
|
120
|
+
# @param handler_id [String] the handler id to add
|
|
121
|
+
# @param category_name [String] name of the category to associate the handler
|
|
122
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
123
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
124
|
+
def add_handler_to_category(handler_id, category_name, headers=default_headers)
|
|
125
|
+
body = { "definitionId" => handler_id }
|
|
126
|
+
info("Adding handler \"#{handler_id}\" to category \"#{category_name}\"")
|
|
127
|
+
post("#{@api_url}/categories/#{encode(category_name)}/handlers", body, headers)
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Remove a handler from a category
|
|
131
|
+
#
|
|
132
|
+
# @param handler_id [String] the handler id to remove
|
|
133
|
+
# @param category_name [String] name of the category to remove the handler from
|
|
134
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
135
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
136
|
+
def remove_handler_from_category(handler_id, category_name, headers=default_headers)
|
|
137
|
+
info("Removing handler \"#{handler_id}\" from category \"#{category_name}\"")
|
|
138
|
+
delete("#{@api_url}/categories/#{encode(category_name)}/handlers/#{encode(handler_id)}", headers)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Add a global routine to a category
|
|
142
|
+
#
|
|
143
|
+
# @param routine_id [String] the global routine id to add
|
|
144
|
+
# @param category_name [String] name of the category to associate the global routine
|
|
145
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
146
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
147
|
+
def add_routine_to_category(routine_id, category_name, headers=default_headers)
|
|
148
|
+
body = { "definitionId" => routine_id }
|
|
149
|
+
info("Adding routine \"#{routine_id}\" to category \"#{category_name}\"")
|
|
150
|
+
post("#{@api_url}/categories/#{encode(category_name)}/routines", body, headers)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Remove a global routine from a category
|
|
154
|
+
#
|
|
155
|
+
# @param routine_id [String] the global routine id to remove
|
|
156
|
+
# @param category_name [String] name of the category to remove the global routine from
|
|
157
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
158
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
159
|
+
def remove_routine_from_category(routine_id, category_name, headers=default_headers)
|
|
160
|
+
info("Removing routine \"#{routine_id}\" from category \"#{category_name}\"")
|
|
161
|
+
delete("#{@api_url}/categories/#{encode(category_name)}/routines/#{encode(routine_id)}", headers)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Add a policy rule to a category
|
|
165
|
+
#
|
|
166
|
+
# @param policy_rule_type [String] the type of policy rule
|
|
167
|
+
# @param policy_rule_name [String] the name of policy rule
|
|
168
|
+
# @param category_name [String] name of the category to associate the policy rule
|
|
169
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
170
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
171
|
+
def add_policy_rule_to_category(policy_rule_type, policy_rule_name, category_name, headers=default_headers)
|
|
172
|
+
body = { "type" => policy_rule_type, "name" => policy_rule_name }
|
|
173
|
+
info("Adding policy rule \"#{policy_rule_type} - #{policy_rule_name}\" to category \"#{category_name}\"")
|
|
174
|
+
post("#{@api_url}/categories/#{encode(category_name)}/policyRules", body, headers)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Remove a policy rule from a category
|
|
178
|
+
#
|
|
179
|
+
# @param policy_rule_type [String] the type of policy rule
|
|
180
|
+
# @param policy_rule_name [String] the name of policy rule
|
|
181
|
+
# @param category_name [String] name of the category to remove the policy rule from
|
|
182
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
183
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
184
|
+
def remove_policy_rule_from_category(policy_rule_type, policy_rule_name, category_name, headers=default_headers)
|
|
185
|
+
info("Removing policy rule \"#{policy_rule_type} - #{policy_rule_name}\" from category \"#{category_name}\"")
|
|
186
|
+
delete("#{@api_url}/categories/#{encode(category_name)}/policyRules/#{encode(policy_rule_type)}/#{encode(policy_rule_name)}", headers)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
end
|
|
190
|
+
end
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
module KineticSdk
|
|
2
|
+
class Task
|
|
3
|
+
|
|
4
|
+
# Find the database configuration
|
|
5
|
+
#
|
|
6
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
7
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
8
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
9
|
+
def find_db(params={}, headers=header_basic_auth)
|
|
10
|
+
info("Finding the database configuration")
|
|
11
|
+
get("#{@api_url}/config/db", params, headers)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Find the session configuration properties
|
|
16
|
+
#
|
|
17
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
18
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
19
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
20
|
+
def find_session_configuration(params={}, headers=header_basic_auth)
|
|
21
|
+
info("Finding the session timeout")
|
|
22
|
+
get("#{@api_url}/config/session", params, headers)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Update the authentication settings
|
|
27
|
+
#
|
|
28
|
+
# @param settings [Hash] Settings for the authenticator
|
|
29
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
30
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
31
|
+
#
|
|
32
|
+
# Example
|
|
33
|
+
#
|
|
34
|
+
# update_authentication({
|
|
35
|
+
# "authenticator" => "com.kineticdata.core.v1.authenticators.ProxyAuthenticator",
|
|
36
|
+
# "authenticationJsp" => "/WEB-INF/app/login.jsp",
|
|
37
|
+
# "properties" => {
|
|
38
|
+
# "Authenticator[Authentication Strategy]" => "Http Header",
|
|
39
|
+
# "Authenticator[Header Name]" => "X-Login",
|
|
40
|
+
# "Authenticator[Guest Access Enabled]" => "No"
|
|
41
|
+
# }
|
|
42
|
+
# })
|
|
43
|
+
#
|
|
44
|
+
def update_authentication(settings, headers=default_headers)
|
|
45
|
+
info("Updating the authentication properties")
|
|
46
|
+
put("#{@api_url}/config/auth", settings, headers)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# Update the database configuration
|
|
51
|
+
#
|
|
52
|
+
# This assumes the database has already been created on the dbms.
|
|
53
|
+
#
|
|
54
|
+
# @param settings [Hash] Setting sfor the selected type of dbms
|
|
55
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
56
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
57
|
+
#
|
|
58
|
+
# Example
|
|
59
|
+
#
|
|
60
|
+
# update_db({
|
|
61
|
+
# "hibernate.connection.driver_class" => "org.postgresql.Driver",
|
|
62
|
+
# "hibernate.connection.url" => "jdbc:postgresql://192.168.0.1:5432",
|
|
63
|
+
# "hibernate.connection.username" => "my-db-user",
|
|
64
|
+
# "hibernate.connection.password" => "my-db-password",
|
|
65
|
+
# "hibernate.dialect" => "com.kineticdata.task.adapters.dbms.KineticPostgreSQLDialect"
|
|
66
|
+
# })
|
|
67
|
+
#
|
|
68
|
+
def update_db(settings, headers=default_headers)
|
|
69
|
+
info("Updating the database properties")
|
|
70
|
+
put("#{@api_url}/config/db", settings, headers)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# Update the engine settings
|
|
75
|
+
#
|
|
76
|
+
# @param settings [Hash] Settings for the selected type of dbms
|
|
77
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
78
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
79
|
+
#
|
|
80
|
+
# Example
|
|
81
|
+
#
|
|
82
|
+
# update_engine({
|
|
83
|
+
# "Max Threads" => "1",
|
|
84
|
+
# "Sleep Delay" => "10",
|
|
85
|
+
# "Trigger Query" => "'Selection Criterion'=null"
|
|
86
|
+
# })
|
|
87
|
+
#
|
|
88
|
+
def update_engine(settings, headers=default_headers)
|
|
89
|
+
info("Updating the engine properties")
|
|
90
|
+
put("#{@api_url}/config/engine", settings, headers)
|
|
91
|
+
|
|
92
|
+
# start the task engine?
|
|
93
|
+
if !settings['Sleep Delay'].nil? && settings['Sleep Delay'].to_i > 0
|
|
94
|
+
info("Starting the engine")
|
|
95
|
+
start_engine
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# Update the identity store settings
|
|
101
|
+
#
|
|
102
|
+
# @param settings [Hash] Settings for the identity store
|
|
103
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
104
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
105
|
+
#
|
|
106
|
+
# Example
|
|
107
|
+
#
|
|
108
|
+
# update_identity_store({
|
|
109
|
+
# "Identity Store" => "com.kineticdata.authentication.kineticcore.KineticCoreIdentityStore",
|
|
110
|
+
# "properties" => {
|
|
111
|
+
# "Kinetic Core Space Url" => "http://server:port/kinetic/space",
|
|
112
|
+
# "Group Attribute Name" => "Group",
|
|
113
|
+
# "Proxy Username" => "admin",
|
|
114
|
+
# "Proxy Password" => "admin"
|
|
115
|
+
# }
|
|
116
|
+
# })
|
|
117
|
+
#
|
|
118
|
+
def update_identity_store(settings, headers=default_headers)
|
|
119
|
+
info("Updating the identity store properties")
|
|
120
|
+
put("#{@api_url}/config/identityStore", settings, headers)
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
# Update the web server and default configuration user settings
|
|
125
|
+
#
|
|
126
|
+
# @param settings [Hash] Settings for the web server and configurator user
|
|
127
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
128
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
129
|
+
#
|
|
130
|
+
# Example
|
|
131
|
+
#
|
|
132
|
+
# update_properties({
|
|
133
|
+
# "Configurator Username" => "my-admin-user",
|
|
134
|
+
# "Configurator Password" => "my-admin-pass",
|
|
135
|
+
# "Log Level" => "DEBUG",
|
|
136
|
+
# "Log Size (MB)" => "20"
|
|
137
|
+
# })
|
|
138
|
+
#
|
|
139
|
+
# Example
|
|
140
|
+
#
|
|
141
|
+
# update_properties({
|
|
142
|
+
# "Configurator Username" => "my-admin-user",
|
|
143
|
+
# "Configurator Password" => "my-admin-pass"
|
|
144
|
+
# })
|
|
145
|
+
#
|
|
146
|
+
def update_properties(settings, headers=default_headers)
|
|
147
|
+
info("Updating the web server properties")
|
|
148
|
+
put("#{@api_url}/config/server", settings, headers)
|
|
149
|
+
|
|
150
|
+
# reset the configuration user
|
|
151
|
+
@config_user = {
|
|
152
|
+
username: settings["Configurator Username"],
|
|
153
|
+
password: settings["Configurator Password"]
|
|
154
|
+
}
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
# Update the session configuration settings
|
|
159
|
+
#
|
|
160
|
+
# @param settings [Hash] Settings for the session configuration
|
|
161
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
162
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
163
|
+
#
|
|
164
|
+
# Example
|
|
165
|
+
#
|
|
166
|
+
# update_session_configuration({
|
|
167
|
+
# "timeout" => "30"
|
|
168
|
+
# })
|
|
169
|
+
#
|
|
170
|
+
def update_session_configuration(settings, headers=default_headers)
|
|
171
|
+
info("Updating the session configuration settings")
|
|
172
|
+
put("#{@api_url}/config/session", settings, headers)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Find the system policy rule
|
|
176
|
+
#
|
|
177
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
178
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
179
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
180
|
+
def find_system_policy_rule(params={}, headers=header_basic_auth)
|
|
181
|
+
info("Finding the system policy rule")
|
|
182
|
+
get("#{@api_url}/config/systemPolicyRule", params, headers)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Update the system policy rule
|
|
186
|
+
#
|
|
187
|
+
# @param policy_rule_name [String] name of the policy rule to use
|
|
188
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
189
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
190
|
+
#
|
|
191
|
+
# Example
|
|
192
|
+
#
|
|
193
|
+
# update_system_policy_rule("Allow All")
|
|
194
|
+
#
|
|
195
|
+
def update_system_policy_rule(policy_rule_name, headers=default_headers)
|
|
196
|
+
info("Updating the system policy rule")
|
|
197
|
+
payload = { "name" => policy_rule_name }
|
|
198
|
+
put("#{@api_url}/config/systemPolicyRule", payload, headers)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
end
|
|
202
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module KineticSdk
|
|
2
|
+
class Task
|
|
3
|
+
|
|
4
|
+
# Start the task engine
|
|
5
|
+
#
|
|
6
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
7
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
8
|
+
def start_engine(headers=default_headers)
|
|
9
|
+
body = { "action" => "start" }
|
|
10
|
+
post("#{@api_url}/engine", body, headers)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Stop the task engine
|
|
14
|
+
#
|
|
15
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
16
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
17
|
+
def stop_engine(headers=default_headers)
|
|
18
|
+
body = { "action" => "stop" }
|
|
19
|
+
post("#{@api_url}/engine", body, headers)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Get the engine info
|
|
23
|
+
#
|
|
24
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
25
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
26
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
27
|
+
def engine_info(params={}, headers=header_basic_auth)
|
|
28
|
+
get("#{@api_url}/engine", params, headers)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Get the engine status
|
|
32
|
+
#
|
|
33
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
34
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
35
|
+
def engine_status(headers=header_basic_auth)
|
|
36
|
+
response = engine_info({}, headers)
|
|
37
|
+
data = response.content
|
|
38
|
+
data.nil? ? "Unknown" : data['status']
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module KineticSdk
|
|
2
|
+
class Task
|
|
3
|
+
|
|
4
|
+
# Get the web server environment
|
|
5
|
+
#
|
|
6
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
7
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
8
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
9
|
+
def environment(params={}, headers=header_basic_auth)
|
|
10
|
+
get("#{@api_url}/environment", params, headers)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
module KineticSdk
|
|
2
|
+
class Task
|
|
3
|
+
|
|
4
|
+
# Delete an Error
|
|
5
|
+
#
|
|
6
|
+
# @param id [Integer] id of the error
|
|
7
|
+
# @param headers [Hash] headers to send with the request, default is basic authentication
|
|
8
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
9
|
+
# @since Task v4.3.0
|
|
10
|
+
def delete_error(id, headers=header_basic_auth)
|
|
11
|
+
info("Deleting Error \"#{id}\"")
|
|
12
|
+
delete("#{@api_url}/errors/#{id}", headers)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Resolve multiple errors with the same action and resolution notes.
|
|
16
|
+
#
|
|
17
|
+
# @param ids [Array<Integer>] Array of error ids to resolve
|
|
18
|
+
# @param action [String] type of action to perform
|
|
19
|
+
# - +Cancel Branch+ - resolve the error and cancel the branch (connector error)
|
|
20
|
+
# - +Continue Branch+ - resolve the error and continue the branch (connector error)
|
|
21
|
+
# - +Do Nothing+ - resolve the error and do nothing more
|
|
22
|
+
# - +Retry+ - resolve the error and retry the connector that caused the error (connector error)
|
|
23
|
+
# - +Retry Task+ - resolve the error and retry the task that caused the error (node error)
|
|
24
|
+
# - +Skip Task+ - resolve the error and continue after the task that caused the error (node error)
|
|
25
|
+
# @param resolution [String] resolution notes
|
|
26
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
|
27
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
28
|
+
def resolve_errors(ids, action, resolution, headers=default_headers)
|
|
29
|
+
info("Resolving errors #{ids}")
|
|
30
|
+
body = { "ids" => ids, "action" => action, "resolution" => resolution }
|
|
31
|
+
post("#{@api_url}/errors/resolve", body, headers)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Find a list of errors.
|
|
35
|
+
#
|
|
36
|
+
# @param params [Hash] Query parameters that are added to the URL
|
|
37
|
+
# - +timeline+ - either "createdAt" or "updatedAt". Default: createdAt
|
|
38
|
+
# - +direction+ - DESC or ASC (default: DESC)
|
|
39
|
+
# - +start+ - 2017-07-27 or 2017-07-27T15:00:00.000Z
|
|
40
|
+
# - +end+ - 2017-07-27 or 2017-07-27T15:00:00.000Z
|
|
41
|
+
# - +source+ - name of the source
|
|
42
|
+
# - +sourceId+ - only if *source* is provided
|
|
43
|
+
# - +group+ - only if *source* is provided
|
|
44
|
+
# - +tree+ - only if *source* and *group* are provided
|
|
45
|
+
# - +nodeId+ - only if *source*, *group*, and *tree* are provided
|
|
46
|
+
# - +handlerId+
|
|
47
|
+
# - +runId+
|
|
48
|
+
# - +type+
|
|
49
|
+
# - +status+
|
|
50
|
+
# - +relatedItem1Id+
|
|
51
|
+
# - +relatedItem1Type+
|
|
52
|
+
# - +relatedItem2Id+
|
|
53
|
+
# - +relatedItem2Type+
|
|
54
|
+
# - +limit+
|
|
55
|
+
# - +offset+
|
|
56
|
+
# - +include+
|
|
57
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
58
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
59
|
+
def find_errors(params={}, headers=header_basic_auth)
|
|
60
|
+
info("Finding errors")
|
|
61
|
+
get("#{@api_url}/errors", params, headers)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Find an Error
|
|
65
|
+
#
|
|
66
|
+
# @param id [Integer] id of the error
|
|
67
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
68
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
69
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
70
|
+
def find_error(id, params={}, headers=header_basic_auth)
|
|
71
|
+
info("Finding error #{id}")
|
|
72
|
+
get("#{@api_url}/errors/#{id}", params, headers)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Find Active Errors by Handler Id
|
|
76
|
+
#
|
|
77
|
+
# @param handler_id [String] handler identifier
|
|
78
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
79
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
80
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
81
|
+
def find_active_errors_by_handler(handler_id, params={}, headers=header_basic_auth)
|
|
82
|
+
info("Finding active errors for handler #{handler_id}")
|
|
83
|
+
params['handlerId'] = handler_id
|
|
84
|
+
params['status'] = 'Active'
|
|
85
|
+
find_errors(params, headers)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Find Active Errors by Source
|
|
89
|
+
#
|
|
90
|
+
# @param source_name [String] Source name
|
|
91
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
92
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
93
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
94
|
+
def find_active_errors_by_source(source_name, params={}, headers=header_basic_auth)
|
|
95
|
+
info("Finding active errors for source \"#{source_name}\"")
|
|
96
|
+
params['source'] = source_name
|
|
97
|
+
params['status'] = 'Active'
|
|
98
|
+
find_errors(params, headers)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Finding Active Errors by Source Group
|
|
102
|
+
#
|
|
103
|
+
# @param source_name [String] Source name
|
|
104
|
+
# @param group [String] Source group
|
|
105
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
106
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
107
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
108
|
+
def find_active_errors_by_source_group(source_name, group, params={}, headers=header_basic_auth)
|
|
109
|
+
info("Finding active errors for source group \"#{source_name} :: #{group}\"")
|
|
110
|
+
params['group'] = group
|
|
111
|
+
params['source'] = source_name
|
|
112
|
+
params['status'] = 'Active'
|
|
113
|
+
find_errors(params, headers)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Find Active Errors by Tree Name
|
|
117
|
+
#
|
|
118
|
+
# @param source_name [String] Source name
|
|
119
|
+
# @param group [String] Source group
|
|
120
|
+
# @param tree_name [String] Tree name
|
|
121
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
122
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
123
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
124
|
+
def find_active_errors_by_tree(source_name, group, tree_name, params={}, headers=header_basic_auth)
|
|
125
|
+
info("Finding active errors for tree \"#{source_name} :: #{group} :: #{tree_name}\"")
|
|
126
|
+
params['tree'] = tree_name
|
|
127
|
+
params['group'] = group
|
|
128
|
+
params['source'] = source_name
|
|
129
|
+
params['status'] = 'Active'
|
|
130
|
+
find_errors(params, headers)
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Find Active Errors by Node
|
|
134
|
+
#
|
|
135
|
+
# @param source_name [String] Source name
|
|
136
|
+
# @param group [String] Source group
|
|
137
|
+
# @param tree_name [String] Tree name
|
|
138
|
+
# @param node_id [String] Node id in the tree
|
|
139
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
140
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
141
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
142
|
+
def find_active_errors_by_node(source_name, group, tree_name, node_id, params={}, headers=header_basic_auth)
|
|
143
|
+
info("Finding active errors for node \"#{source_name} :: #{group} :: #{tree_name} :: #{node_id}\"")
|
|
144
|
+
params['nodeId'] = node_id
|
|
145
|
+
params['tree'] = tree_name
|
|
146
|
+
params['group'] = group
|
|
147
|
+
params['source'] = source_name
|
|
148
|
+
params['status'] = 'Active'
|
|
149
|
+
find_errors(params, headers)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Find Errors by Run Id
|
|
153
|
+
#
|
|
154
|
+
# @param run_id [Integer] Run id
|
|
155
|
+
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
|
156
|
+
# @param headers [Hash] hash of headers to send, default is basic authentication
|
|
157
|
+
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
|
158
|
+
def find_errors_by_run(run_id, params={}, headers=header_basic_auth)
|
|
159
|
+
info("Finding active errors for run #{run_id}")
|
|
160
|
+
params['runId'] = run_id
|
|
161
|
+
find_errors(params, headers)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|
|
165
|
+
end
|