kinetic_sdk 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.yardoc-includes/yard-helpers.rb +14 -0
- data/.yardopts +7 -0
- data/CHANGELOG.md +41 -0
- data/GettingStarted.md +6 -12
- data/README.md +85 -37
- data/Rakefile +13 -0
- data/kinetic_sdk.gemspec +33 -0
- data/lib/kinetic_sdk/agent/agent-sdk.rb +90 -0
- data/lib/kinetic_sdk/agent/lib/bridges.rb +92 -0
- data/lib/kinetic_sdk/agent/lib/filestores.rb +91 -0
- data/lib/kinetic_sdk/agent/lib/handler.rb +91 -0
- data/lib/kinetic_sdk/bridgehub/bridgehub-sdk.rb +11 -3
- data/lib/kinetic_sdk/bridgehub/lib/access_keys.rb +5 -5
- data/lib/kinetic_sdk/bridgehub/lib/bridge.rb +5 -5
- data/lib/kinetic_sdk/{request_ce/request-ce-sdk.rb → core/core-sdk.rb} +30 -16
- data/lib/kinetic_sdk/core/lib/attribute_definitions.rb +500 -0
- data/lib/kinetic_sdk/core/lib/bridges.rb +141 -0
- data/lib/kinetic_sdk/{request_ce → core}/lib/categories.rb +3 -3
- data/lib/kinetic_sdk/{request_ce → core}/lib/datastore_form.rb +8 -8
- data/lib/kinetic_sdk/{request_ce → core}/lib/datastore_submissions.rb +20 -9
- data/lib/kinetic_sdk/{request_ce → core}/lib/form.rb +7 -7
- data/lib/kinetic_sdk/{request_ce → core}/lib/form_types.rb +4 -4
- data/lib/kinetic_sdk/{request_ce → core}/lib/jwt.rb +4 -4
- data/lib/kinetic_sdk/{request_ce → core}/lib/kapp.rb +7 -7
- data/lib/kinetic_sdk/{request_ce → core}/lib/meta.rb +3 -3
- data/lib/kinetic_sdk/{request_ce → core}/lib/oauth.rb +4 -4
- data/lib/kinetic_sdk/{request_ce → core}/lib/security_policy_definitions.rb +11 -11
- data/lib/kinetic_sdk/core/lib/space.rb +156 -0
- data/lib/kinetic_sdk/{request_ce → core}/lib/submissions.rb +11 -11
- data/lib/kinetic_sdk/{request_ce → core}/lib/system_api.rb +19 -7
- data/lib/kinetic_sdk/{request_ce → core}/lib/teams.rb +9 -9
- data/lib/kinetic_sdk/{request_ce → core}/lib/users.rb +15 -15
- data/lib/kinetic_sdk/{request_ce → core}/lib/webhook_jobs.rb +5 -5
- data/lib/kinetic_sdk/{request_ce → core}/lib/webhooks.rb +9 -9
- data/lib/kinetic_sdk/discussions/discussions-sdk.rb +12 -4
- data/lib/kinetic_sdk/discussions/lib/discussions.rb +8 -8
- data/lib/kinetic_sdk/discussions/lib/invitations.rb +9 -9
- data/lib/kinetic_sdk/discussions/lib/messages.rb +8 -8
- data/lib/kinetic_sdk/discussions/lib/meta.rb +1 -1
- data/lib/kinetic_sdk/discussions/lib/participants.rb +5 -5
- data/lib/kinetic_sdk/discussions/lib/related_items.rb +4 -4
- data/lib/kinetic_sdk/discussions/lib/websockets.rb +9 -9
- data/lib/kinetic_sdk/filehub/filehub-sdk.rb +11 -3
- data/lib/kinetic_sdk/filehub/lib/access_keys.rb +5 -5
- data/lib/kinetic_sdk/filehub/lib/filestores.rb +5 -5
- data/lib/kinetic_sdk/task/lib/access_keys.rb +35 -7
- data/lib/kinetic_sdk/task/lib/categories.rb +30 -17
- data/lib/kinetic_sdk/task/lib/config.rb +14 -14
- data/lib/kinetic_sdk/task/lib/engine.rb +1 -1
- data/lib/kinetic_sdk/task/lib/errors.rb +10 -10
- data/lib/kinetic_sdk/task/lib/export.rb +32 -0
- data/lib/kinetic_sdk/task/lib/groups.rb +23 -10
- data/lib/kinetic_sdk/task/lib/handlers.rb +27 -11
- data/lib/kinetic_sdk/task/lib/health.rb +11 -3
- data/lib/kinetic_sdk/task/lib/license.rb +4 -4
- data/lib/kinetic_sdk/task/lib/policy_rules.rb +25 -12
- data/lib/kinetic_sdk/task/lib/runs.rb +43 -0
- data/lib/kinetic_sdk/task/lib/setup.rb +2 -2
- data/lib/kinetic_sdk/task/lib/sources.rb +39 -8
- data/lib/kinetic_sdk/task/lib/tasks.rb +1 -1
- data/lib/kinetic_sdk/task/lib/trees.rb +84 -28
- data/lib/kinetic_sdk/task/lib/users.rb +6 -6
- data/lib/kinetic_sdk/task/task-sdk.rb +16 -4
- data/lib/kinetic_sdk/utils/kinetic-export-utils.rb +157 -0
- data/lib/kinetic_sdk/utils/kinetic-http.rb +388 -98
- data/lib/kinetic_sdk/utils/logger.rb +82 -46
- data/lib/kinetic_sdk/utils/prettier-xml-formatter.rb +60 -0
- data/lib/kinetic_sdk/version.rb +1 -1
- data/lib/kinetic_sdk.rb +5 -2
- metadata +41 -27
- data/lib/kinetic_sdk/request_ce/lib/attribute_definitions.rb +0 -153
- data/lib/kinetic_sdk/request_ce/lib/bridges.rb +0 -66
- data/lib/kinetic_sdk/request_ce/lib/space.rb +0 -89
@@ -1,89 +0,0 @@
|
|
1
|
-
module KineticSdk
|
2
|
-
class RequestCe
|
3
|
-
|
4
|
-
# Add an attribute value to the space, or update an attribute if it already exists
|
5
|
-
#
|
6
|
-
# @param attribute_name [String] name of the attribute
|
7
|
-
# @param attribute_value [String] value of the attribute
|
8
|
-
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
9
|
-
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
10
|
-
def add_space_attribute(attribute_name, attribute_value, headers=default_headers)
|
11
|
-
# first find the space
|
12
|
-
response = find_space({ "include" => "attributes"}, headers)
|
13
|
-
# hack to try a second time if space isn't found
|
14
|
-
if response.status == 404
|
15
|
-
sleep 2
|
16
|
-
response = find_space({ "include" => "attributes"}, headers)
|
17
|
-
end
|
18
|
-
space = response.content["space"]
|
19
|
-
attributes = space["attributes"]
|
20
|
-
# either add or update the attribute value
|
21
|
-
exists = false
|
22
|
-
attributes.each do |attribute|
|
23
|
-
info("Attribute: #{attribute.inspect}")
|
24
|
-
# if the attribute already exists, update it
|
25
|
-
if attribute["name"] == attribute_name
|
26
|
-
attribute["values"] = [ attribute_value ]
|
27
|
-
exists = true
|
28
|
-
end
|
29
|
-
end
|
30
|
-
# add the attribute if it didn't exist
|
31
|
-
attributes.push({
|
32
|
-
"name" => attribute_name,
|
33
|
-
"values" => [ attribute_value ]
|
34
|
-
}) unless exists
|
35
|
-
|
36
|
-
# set the updated attributes list
|
37
|
-
body = { "attributes" => attributes }
|
38
|
-
if exists
|
39
|
-
info("Updating attribute \"#{attribute_name}\" = \"#{attribute_value}\" in the \"#{space_slug}\" space.")
|
40
|
-
else
|
41
|
-
info("Adding attribute \"#{attribute_name}\" = \"#{attribute_value}\" to the \"#{space_slug}\" space.")
|
42
|
-
end
|
43
|
-
# Update the space
|
44
|
-
put("#{@api_url}/space", body, headers)
|
45
|
-
end
|
46
|
-
|
47
|
-
# Update a space
|
48
|
-
#
|
49
|
-
# @param body [Hash] properties for the Space
|
50
|
-
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
51
|
-
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
52
|
-
def update_space(body={}, headers=default_headers)
|
53
|
-
info("Updating Space \"#{@space_slug}\"")
|
54
|
-
put("#{@api_url}/space", body, headers)
|
55
|
-
end
|
56
|
-
|
57
|
-
# Export a space
|
58
|
-
#
|
59
|
-
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
60
|
-
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
61
|
-
def export_space(headers=default_headers)
|
62
|
-
info("Exporting Space \"#{@space_slug}\"")
|
63
|
-
get("#{@api_url}/space", { 'export' => true}, headers)
|
64
|
-
end
|
65
|
-
|
66
|
-
# Find the space
|
67
|
-
#
|
68
|
-
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
69
|
-
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
70
|
-
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
71
|
-
def find_space(params={}, headers=default_headers)
|
72
|
-
info("Finding Space \"#{@space_slug}\"")
|
73
|
-
get("#{@api_url}/space", params, headers)
|
74
|
-
end
|
75
|
-
|
76
|
-
# Checks if the space exists
|
77
|
-
#
|
78
|
-
# @param slug [String] slug of the space
|
79
|
-
# @param params [Hash] Query parameters that are added to the URL, such as +include+
|
80
|
-
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
81
|
-
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
82
|
-
def space_exists?(slug, params={}, headers=default_headers)
|
83
|
-
info("Checking if the \"#{slug}\" space exists")
|
84
|
-
response = get("#{@api_url}/spaces/#{slug}", params, headers)
|
85
|
-
response.status == 200
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
89
|
-
end
|