Class: KineticSdk::Core
- Inherits:
-
Object
- Object
- KineticSdk::Core
- Includes:
- Utils::KineticExportUtils, Utils::KineticHttpUtils
- Defined in:
- lib/kinetic_sdk/core/core-sdk.rb,
lib/kinetic_sdk/core/lib/jwt.rb,
lib/kinetic_sdk/core/lib/form.rb,
lib/kinetic_sdk/core/lib/kapp.rb,
lib/kinetic_sdk/core/lib/meta.rb,
lib/kinetic_sdk/core/lib/oauth.rb,
lib/kinetic_sdk/core/lib/space.rb,
lib/kinetic_sdk/core/lib/teams.rb,
lib/kinetic_sdk/core/lib/users.rb,
lib/kinetic_sdk/core/lib/bridges.rb,
lib/kinetic_sdk/core/lib/webapis.rb,
lib/kinetic_sdk/core/lib/webhooks.rb,
lib/kinetic_sdk/core/lib/categories.rb,
lib/kinetic_sdk/core/lib/form_types.rb,
lib/kinetic_sdk/core/lib/system_api.rb,
lib/kinetic_sdk/core/lib/submissions.rb,
lib/kinetic_sdk/core/lib/webhook_jobs.rb,
lib/kinetic_sdk/core/lib/datastore_form.rb,
lib/kinetic_sdk/core/lib/platform_components.rb,
lib/kinetic_sdk/core/lib/attribute_definitions.rb,
lib/kinetic_sdk/core/lib/datastore_submissions.rb,
lib/kinetic_sdk/core/lib/security_policy_definitions.rb
Overview
Core is a Ruby class that acts as a wrapper for the Core REST API without having to make explicit HTTP requests.
Instance Attribute Summary collapse
-
#api_url ⇒ Object
readonly
Returns the value of attribute api_url.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#proxy_url ⇒ Object
readonly
Returns the value of attribute proxy_url.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#space_slug ⇒ Object
readonly
Returns the value of attribute space_slug.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#add_agent_component(component_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add Agent Component.
-
#add_bridge(body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Bridge.
-
#add_bridge_model(body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Bridge Model.
-
#add_categorization_on_form(kapp_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a categorization on a form.
-
#add_category_attribute_definition(kapp_slug, name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new category attribute definition.
-
#add_category_on_kapp(kapp_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a category on a Kapp.
-
#add_datastore_form(form_properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Datastore Form.
-
#add_datastore_form_attribute_definition(name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new datastore form attribute definition.
-
#add_datastore_submission(form_slug, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Datastore Submission.
-
#add_datastore_submission_page(form_slug, page_name, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Datastore Submission page.
-
#add_form(kapp_slug, form_properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Form.
-
#add_form_attribute_definition(kapp_slug, name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new form attribute definition.
-
#add_form_type_on_kapp(kapp_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a form type on a Kapp The method is being depreciated and replaced with add_formtype.
-
#add_form_webhook(kapp_slug, webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add form webhook.
-
#add_form_workflow(kapp_slug, form_slug, payload, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add Form workflow.
-
#add_formtype ⇒ KineticSdk::Utils::KineticHttpResponse
Add a form type on a Kapp The method is being depreciated and replaced with add_formtype.
-
#add_kapp(kapp_name, kapp_slug, properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Kapp.
-
#add_kapp_attribute_definition(kapp_slug, name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new kapp attribute definition.
-
#add_kapp_webapi(kapp_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Object, with +code+, +message+, +content_string+, and +content+ properties.
-
#add_kapp_workflow(kapp_slug, payload, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add Kapp workflow.
-
#add_oauth_client(options, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add an OAuth client.
-
#add_security_policy_definition(kapp_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Kapp security policy definition.
-
#add_space(name, slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new Space.
-
#add_space_attribute(attribute_name, attribute_value, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add an attribute value to the space, or update an attribute if it already exists.
-
#add_space_attribute_definition(name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new space attribute definition.
-
#add_space_security_policy_definition(body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Space security policy definition.
-
#add_space_webapi(body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Object, with +code+, +message+, +content_string+, and +content+ properties.
-
#add_space_webhook(webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add space webhook.
-
#add_space_workflow(payload, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add Space workflow.
-
#add_submission(kapp_slug, form_slug, payload = {}, parameters = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Submission.
-
#add_submission_page(kapp_slug, form_slug, page_name, payload = {}, parameters = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Submission page.
-
#add_submission_webhook(kapp_slug, webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add submission webhook.
-
#add_team(team_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Team.
-
#add_team_attribute(team_name, attribute_name, attribute_value, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add an attribute to a team.
-
#add_team_attribute_definition(name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new team attribute definition.
-
#add_team_membership(team_name, username, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a team membership.
-
#add_user(user, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a user in a space.
-
#add_user_attribute(username, attribute_name, attribute_value, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add an attribute value to the user, or update an attribute if it already exists.
-
#add_user_attribute_definition(name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new user attribute definition.
-
#add_user_attribute_value(username, attribute_name, attribute_value, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Adds an attribute value to an attribute.
-
#add_user_profile_attribute_definition(name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new user profile attribute definition.
-
#add_user_webhook(webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add user webhook.
-
#add_webhook_on_kapp(kapp_slug, webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a webhook on a Kapp (either a Form or Submission webhook).
-
#add_webhook_on_space(webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a webhook on a Space (either a Space or User webhook).
-
#app_version(headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Retrieve Core application version.
-
#build_datastore_form_indexes(form_slug, indexes, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Build Datastore Indexes.
-
#delete_agent_component(agent_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete Agent Component.
-
#delete_bridge(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Bridge.
-
#delete_bridge_model(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Bridge Model.
-
#delete_category_attribute_definition(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a category attribute definition.
-
#delete_category_on_kapp(kapp_slug, category_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Category.
-
#delete_datastore_form(form_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Datastore Form.
-
#delete_datastore_form_attribute_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a datastore form attribute definition.
-
#delete_datastore_submission(submission_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Datastore submission.
-
#delete_form(kapp_slug, form_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Form.
-
#delete_form_attribute_definition(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a form attribute definition.
-
#delete_form_type(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a form type on a Kapp The method is being depreciated and replaced with delete_formtype.
-
#delete_form_types_on_kapp(kapp_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete all form types on a Kapp The method is being depreciated and replaced with delete_formtypes.
-
#delete_form_workflow(kapp_slug, form_slug, workflow_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete Kapp workflow.
-
#delete_formtype ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a form type on a Kapp The method is being depreciated and replaced with delete_formtype.
-
#delete_formtypes ⇒ KineticSdk::Utils::KineticHttpResponse
Delete all form types on a Kapp The method is being depreciated and replaced with delete_formtypes.
-
#delete_kapp(kapp_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Kapp.
-
#delete_kapp_attribute_definition(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a kapp attribute definition.
-
#delete_kapp_webapi(kapp_slug, slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Web API on a Kapp.
-
#delete_kapp_workflow(kapp_slug, workflow_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete Kapp workflow.
-
#delete_security_policy_definition(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Kapp security policy definition.
-
#delete_security_policy_definitions(kapp_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete all Kapp security policy definitions.
-
#delete_space(slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Space.
-
#delete_space_attribute_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a space attribute definition.
-
#delete_space_security_policy_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Space security policy definition.
-
#delete_space_security_policy_definitions(headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete all Space security policy definitions.
-
#delete_space_webapi(slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Web API on the Space.
-
#delete_space_workflow(workflow_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete Space workflow.
-
#delete_submission(submission_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Submission.
-
#delete_team(team_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Team.
-
#delete_team_attribute_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a team attribute definition.
-
#delete_user(user, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a user in a space.
-
#delete_user_attribute_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a user attribute definition.
-
#delete_user_profile_attribute_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a user profile attribute definition.
-
#delete_webhook_on_kapp(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a webhook on a kapp.
-
#delete_webhook_on_space(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a webhook on space.
-
#export_datastore_form(form_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Export a Datastore Form.
-
#export_form(kapp_slug, form_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Export a Form.
-
#export_kapp(kapp_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Exports a Kapp.
-
#export_space(headers = default_headers) ⇒ Object
Export a space to the export_directory.
-
#export_team(team_name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Export a team.
-
#export_workflows(headers = default_headers) ⇒ Object
Exports linked workflows for the space, kapps, and forms.
-
#find_agent_component(agent_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Agent Component.
-
#find_agent_components(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Agent Components.
-
#find_all_form_datastore_submissions(form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Submissions for a Datastore Form.
-
#find_all_form_submissions(kapp_slug, form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Submissions for a form.
-
#find_all_kapp_webhook_jobs(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Webhook Jobs for a kapp.
-
#find_all_space_webhook_jobs(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Webhook Jobs for a space.
-
#find_bridge(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a bridge.
-
#find_bridge_model(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a bridge model.
-
#find_bridge_models(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a list of bridge models.
-
#find_bridges(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a list of bridges.
-
#find_categories(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Categories on a Kapp.
-
#find_category_attribute_definition(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a category attribute definition.
-
#find_category_attribute_definitions(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all category attribute definition.
-
#find_category_on_kapp(kapp_slug, category_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Retrieve a Category on a Kapp.
-
#find_datastore_form(form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a Datastore Form.
-
#find_datastore_form_attribute_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a datastore form attribute definition.
-
#find_datastore_form_attribute_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all datastore form attribute definitions.
-
#find_datastore_forms(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Datastore Forms.
-
#find_datastore_submission(submission_id, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a Datastore submission.
-
#find_form(kapp_slug, form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a Form.
-
#find_form_attribute_definition(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a form attribute definition.
-
#find_form_attribute_definitions(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all form attribute definition.
-
#find_form_datastore_submissions(form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a page of Submissions for a Datastore form.
-
#find_form_submissions(kapp_slug, form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a page of Submissions for a form.
-
#find_form_types_on_kapp(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Retrieve a list of all form types for a Kapp The method is being depreciated and replaced with find_formtypes.
-
#find_form_workflow(kapp_slug, form_slug, workflow_id, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a form workflow.
-
#find_form_workflows(kapp_slug, form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Form workflows.
-
#find_forms(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Forms.
-
#find_formtype(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Retrieve a single form types for a Kapp.
-
#find_formtypes ⇒ KineticSdk::Utils::KineticHttpResponse
Retrieve a list of all form types for a Kapp The method is being depreciated and replaced with find_formtypes.
-
#find_kapp(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a Kapp.
-
#find_kapp_attribute_definition(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a kapp attribute definition.
-
#find_kapp_attribute_definitions(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all kapp attribute definition.
-
#find_kapp_submissions(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a page of Submissions for a kapp.
-
#find_kapp_webapi(kapp_slug, slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a single Web API on the Kapp.
-
#find_kapp_webapis(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Web APIs for a Kapp.
-
#find_kapp_webhook_jobs(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find kapp webhook jobs.
-
#find_kapp_workflow(kapp_slug, workflow_id, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a kapp workflow.
-
#find_kapp_workflows(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Kapp workflows.
-
#find_kapps(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Kapps.
-
#find_oauth_client(client_id, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find OAuth client.
-
#find_security_policy_definition(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a single Kapp security policy definition.
-
#find_security_policy_definitions(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Kapp security policy definitions.
-
#find_space(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find the space.
-
#find_space_attribute_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a space attribute definition.
-
#find_space_attribute_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all space attribute definitions.
-
#find_space_in_system(slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find the space (System API).
-
#find_space_security_policy_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a single Space security policy definition.
-
#find_space_security_policy_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Space security policy definitions.
-
#find_space_webapi(slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a single Web API on the Space.
-
#find_space_webapis(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Web APIs for the Space.
-
#find_space_webhook_jobs(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find space webhook jobs.
-
#find_space_workflow(workflow_id, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a space workflow.
-
#find_space_workflows(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Space workflows.
-
#find_spaces(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all spaces.
-
#find_task_component(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Task Component.
-
#find_team(team_name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find the team.
-
#find_team_attribute_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a team attribute definition.
-
#find_team_attribute_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all team attribute definitions.
-
#find_teams(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find teams.
-
#find_user(username, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find the user.
-
#find_user_attribute_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a user attribute definition.
-
#find_user_attribute_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all user attribute definitions.
-
#find_user_in_system(space_slug, username, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a user in a space (System API).
-
#find_user_profile_attribute_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a user profile attribute definition.
-
#find_user_profile_attribute_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find user profile attribute definitions.
-
#find_users(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all users.
-
#find_users_in_system(space_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all users with the system api.
-
#find_webhook_on_kapp(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a webhook defined in a Kapp.
-
#find_webhooks_on_kapp(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all webhooks for a Kapp.
-
#find_webhooks_on_space(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all webhooks for a Space.
-
#finding_webhook_on_space(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a webhook defined in a Space.
-
#generate_password_token(username, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Generate Password Reset Token.
-
#import_space(slug, headers = default_headers) ⇒ Object
Imports a full space definition from the export_directory, except for workflows.
-
#import_workflows(slug, headers = default_headers) ⇒ Object
Imports the workflows for the space.
-
#initialize(opts = {}) ⇒ Core
constructor
Initalize the Core SDK with the web server URL, the space user username and password, along with any custom option values.
-
#jwt_code(client_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Gets an authentication code.
-
#jwt_token(client_id, client_secret, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Gets an authentication token.
-
#me(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find the current user.
-
#patch_datastore_submission(form_slug, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Patch a new Datastore Submission.
-
#patch_existing_datastore_submission(submission_id, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Patch an existing Datastore Submission.
-
#patch_existing_submission(submission_id, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Patch an existing Submission.
-
#patch_new_submission(kapp_slug, form_slug, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Patch a new Submission.
-
#remove_team_membership(team_name, username, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
remove a team membership.
-
#reset_license_count(headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Reset the license count (System API).
-
#space_exists?(slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Checks if the space exists.
-
#update_agent_component(agent_slug, component_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update Agent Component.
-
#update_bridge(name, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a bridge.
-
#update_bridge_model(name, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Bridge Model.
-
#update_bridge_model_mapping(model_name, mapping_name, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Bridge Model Mapping.
-
#update_category_attribute_definition(kapp_slug, name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a category attribute definition.
-
#update_category_on_kapp(kapp_slug, category_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a category on a Kapp.
-
#update_datastore_form(form_slug, properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Datastore Form.
-
#update_datastore_form_attribute_definition(name, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a datastore form attribute definition.
-
#update_datastore_submission(submission_id, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Datastore submission.
-
#update_form(kapp_slug, form_slug, properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Form.
-
#update_form_attribute_definition(kapp_slug, name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a form attribute definition.
-
#update_formtype(kapp_slug, name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a form type on a Kapp.
-
#update_kapp(kapp_slug, properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Kapp.
-
#update_kapp_attribute_definition(kapp_slug, name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a kapp attribute definition.
-
#update_kapp_webapi(kapp_slug, slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Web API on a Kapp.
-
#update_kapp_webhook_job(kapp_slug, job_id, job_properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update kapp webhook job.
-
#update_oauth_client(client_id, options, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update an OAuth client.
-
#update_security_policy_definition(kapp_slug, name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Kapp security policy definition.
-
#update_space(body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a space.
-
#update_space_attribute_definition(name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a space attribute definition.
-
#update_space_in_system(slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update the space (System API).
-
#update_space_security_policy_definition(name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Space security policy definition.
-
#update_space_webapi(slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Web API on the Space.
-
#update_space_webhook_job(job_id, job_properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update space webhook job.
-
#update_submission(submission_id, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a submission.
-
#update_task_component(component_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update Task Component.
-
#update_team(team_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Team.
-
#update_team_attribute_definition(name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a team attribute definition.
-
#update_user(username, user, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a user in a space.
-
#update_user_attribute_definition(name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a user attribute definition.
-
#update_user_profile_attribute_definition(name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a user profile attribute definition.
-
#update_webhook_on_kapp(kapp_slug, name, webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a webhook on a Kapp (either a Form or Submission webhook).
-
#update_webhook_on_space(name, webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a webhook on a Space (either a Space or User webhook).
Methods included from Utils::KineticExportUtils
#get_variable_property, #prepare_shape, #process_export, #should_extract, #write_object_to_file
Methods included from Utils::KineticHttpUtils
#default_headers, default_headers, #default_jwt_headers, default_jwt_headers, #delete, #encode, #gateway_retry_delay, #gateway_retry_limit, #get, #head, #header_accept_json, header_accept_json, #header_basic_auth, header_basic_auth, header_bearer_auth, #header_bearer_auth, #header_content_json, header_content_json, header_user_agent, #header_user_agent, #max_redirects, #mimetype, #patch, #post, #post_multipart, #put, #redirect_url, #stream_download_to_file
Constructor Details
#initialize(opts = {}) ⇒ Core
Initalize the Core SDK with the web server URL, the space user username and password, along with any custom option values.
Example: using a configuration file
KineticSdk::Core.new({
config_file: "/opt/config1.yaml"
})
Example: space user properties hash
KineticSdk::Core.new({
app_server_url: "http://localhost:8080/kinetic",
space_slug: "foo",
username: "space-user-1",
password: "password",
options: {
log_level: "debug",
ssl_verify_mode: "peer",
ssl_ca_file: "/usr/local/self_signing_ca.pem"
}
})
Example: system user properties hash
KineticSdk::Core.new({
app_server_url: "http://localhost:8080/kinetic",
username: "admin",
password: "password",
options: {
log_level: "debug",
ssl_verify_mode: "peer",
ssl_ca_file: "/usr/local/self_signing_ca.pem"
}
})
Example: space user properties hash with the space url
# Note: This example results in the same API endpoint as using:
#
# app_server_url: https://myapp.io
KineticSdk::Core.new({
space_server_url: "https://myapp.io/foo",
space_slug: "foo",
username: "space-user-1",
password: "password",
options: {
log_level: "info",
max_redirects: 3
}
})
Example: space user properties hash with the space url as a subdomain
# Note: This example requires a proxy server to rewrite the space slug
# as a request path parameter rather than a subdomain.
#
# Ex: https://myapp.io/foo
KineticSdk::Core.new({
space_server_url: "https://foo.myapp.io",
space_slug: "foo",
username: "space-user-1",
password: "password",
options: {
log_level: "info",
max_redirects: 3
}
})
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/kinetic_sdk/core/core-sdk.rb', line 127 def initialize(opts={}) = {} # process the configuration file if it was provided unless opts[:config_file].nil? .merge!(YAML::load_file opts[:config_file]) end # process the configuration hash if it was provided .merge!(opts) # allow either :app_server_url or :space_server_url, but not both if [:app_server_url] && [:space_server_url] raise StandardError.new "Expecting one of :app_server_url or :space_server_url, but not both." end # process any individual options @options = .delete(:options) || {} # setup logging log_level = @options[:log_level] || @options["log_level"] log_output = @options[:log_output] || @options["log_output"] @logger = KineticSdk::Utils::KLogger.new(log_level, log_output) @username = [:username] @password = [:password] @space_slug = [:space_slug] if [:app_server_url] @server = [:app_server_url].chomp('/') @api_url = @server + (@space_slug.nil? ? "/app/api/v1" : "/#{@space_slug}/app/api/v1") @proxy_url = @space_slug.nil? ? nil : "#{@server}/#{@space_slug}/app/components" else raise StandardError.new "The :space_slug option is required when using the :space_server_url option" if @space_slug.nil? @server = [:space_server_url].chomp('/') @api_url = "#{@server}/app/api/v1" @proxy_url = "#{@server}/app/components" end @version = 1 end |
Instance Attribute Details
#api_url ⇒ Object (readonly)
Returns the value of attribute api_url.
16 17 18 |
# File 'lib/kinetic_sdk/core/core-sdk.rb', line 16 def api_url @api_url end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
16 17 18 |
# File 'lib/kinetic_sdk/core/core-sdk.rb', line 16 def logger @logger end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
16 17 18 |
# File 'lib/kinetic_sdk/core/core-sdk.rb', line 16 def @options end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
16 17 18 |
# File 'lib/kinetic_sdk/core/core-sdk.rb', line 16 def password @password end |
#proxy_url ⇒ Object (readonly)
Returns the value of attribute proxy_url.
16 17 18 |
# File 'lib/kinetic_sdk/core/core-sdk.rb', line 16 def proxy_url @proxy_url end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
16 17 18 |
# File 'lib/kinetic_sdk/core/core-sdk.rb', line 16 def server @server end |
#space_slug ⇒ Object (readonly)
Returns the value of attribute space_slug.
16 17 18 |
# File 'lib/kinetic_sdk/core/core-sdk.rb', line 16 def space_slug @space_slug end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
16 17 18 |
# File 'lib/kinetic_sdk/core/core-sdk.rb', line 16 def username @username end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
16 17 18 |
# File 'lib/kinetic_sdk/core/core-sdk.rb', line 16 def version @version end |
Instance Method Details
#add_agent_component(component_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add Agent Component
58 59 60 61 62 |
# File 'lib/kinetic_sdk/core/lib/platform_components.rb', line 58 def add_agent_component(component_properties, headers = default_headers) raise StandardError.new "Agent Component properties is not valid, must be a Hash." unless component_properties.is_a? Hash @logger.info("Creating Agent Component \"#{component_properties["slug"]}\".") post("#{@api_url}/platformComponents/agents", component_properties, headers) end |
#add_bridge(body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Bridge
12 13 14 15 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 12 def add_bridge(body={}, headers=default_headers) @logger.info("Adding the \"#{body['name']}\" Bridge.") post("#{@api_url}/bridges", body, headers) end |
#add_bridge_model(body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Bridge Model
71 72 73 74 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 71 def add_bridge_model(body={}, headers=default_headers) @logger.info("Adding the \"#{body['name']}\" Bridge Model and Mappings.") post("#{@api_url}/models", body, headers) end |
#add_categorization_on_form(kapp_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a categorization on a form
50 51 52 53 54 |
# File 'lib/kinetic_sdk/core/lib/categories.rb', line 50 def add_categorization_on_form(kapp_slug, body, headers=default_headers) raise StandardError.new "Category properties is not valid, must be a Hash." unless body.is_a? Hash @logger.info("Adding Categorization for \"#{kapp_slug}\" kapp") post("#{@api_url}/kapps/#{kapp_slug}/categorizations", body, headers) end |
#add_category_attribute_definition(kapp_slug, name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new category attribute definition.
312 313 314 315 316 317 318 319 320 321 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 312 def add_category_attribute_definition(kapp_slug, name, description, allows_multiple, headers=default_headers) body = { "allowsMultiple" => allows_multiple, "description" => description, "name" => name } @logger.info("Adding Category attribute definition \"#{name}\" to the \"#{kapp_slug}\" kapp.") # Create the attribute definition post("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions", body, headers) end |
#add_category_on_kapp(kapp_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a category on a Kapp
34 35 36 37 38 |
# File 'lib/kinetic_sdk/core/lib/categories.rb', line 34 def add_category_on_kapp(kapp_slug, body, headers=default_headers) raise StandardError.new "Category properties is not valid, must be a Hash." unless body.is_a? Hash @logger.info("Adding Category \"#{body['name']}\" for \"#{kapp_slug}\" kapp") post("#{@api_url}/kapps/#{kapp_slug}/categories", body, headers) end |
#add_datastore_form(form_properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Datastore Form
22 23 24 25 |
# File 'lib/kinetic_sdk/core/lib/datastore_form.rb', line 22 def add_datastore_form(form_properties={}, headers=default_headers) @logger.info("Adding the \"#{form_properties['name']}\" Form.") post("#{@api_url}/datastore/forms", form_properties, headers) end |
#add_datastore_form_attribute_definition(name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new datastore form attribute definition.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 11 def add_datastore_form_attribute_definition(name, description, allows_multiple, headers=default_headers) body = { "allowsMultiple" => allows_multiple, "description" => description, "name" => name } @logger.info("Adding Datastore Form attribute definition \"#{name}\" to the \"#{space_slug}\" space.") # Create the attribute definition post("#{@api_url}/datastoreFormAttributeDefinitions", body, headers) end |
#add_datastore_submission(form_slug, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Datastore Submission
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/kinetic_sdk/core/lib/datastore_submissions.rb', line 14 def add_datastore_submission(form_slug, payload={}, headers=default_headers) # set origin hash if origin was passed as a string payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String # set parent hash if parent was passed as a string payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String # prepare any attachment values payload["values"] = prepare_new_datastore_submission_values(form_slug, payload["values"]) # Create the submission @logger.info("Adding a submission in the \"#{form_slug}\" Datastore Form.") post("#{@api_url}/datastore/forms/#{form_slug}/submissions", payload, headers) end |
#add_datastore_submission_page(form_slug, page_name, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Datastore Submission page
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/kinetic_sdk/core/lib/datastore_submissions.rb', line 37 def add_datastore_submission_page(form_slug, page_name, payload={}, headers=default_headers) # set origin hash if origin was passed as a string payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String # set parent hash if parent was passed as a string payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String # prepare any attachment values payload["values"] = prepare_new_datastore_submission_values(form_slug, payload["values"]) # Create the submission @logger.info("Adding a submission page in the \"#{form_slug}\" Datastore Form.") post("#{@api_url}/datastore/forms/#{form_slug}/submissions?page=#{encode(page_name)}", payload, headers) end |
#add_form(kapp_slug, form_properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Form
23 24 25 26 |
# File 'lib/kinetic_sdk/core/lib/form.rb', line 23 def add_form(kapp_slug, form_properties={}, headers=default_headers) @logger.info("Adding the \"#{form_properties['name']}\" Form.") post("#{@api_url}/kapps/#{kapp_slug}/forms", form_properties, headers) end |
#add_form_attribute_definition(kapp_slug, name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new form attribute definition.
377 378 379 380 381 382 383 384 385 386 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 377 def add_form_attribute_definition(kapp_slug, name, description, allows_multiple, headers=default_headers) body = { "allowsMultiple" => allows_multiple, "description" => description, "name" => name } @logger.info("Adding Form attribute definition \"#{name}\" to the \"#{kapp_slug}\" kapp.") # Create the attribute definition post("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions", body, headers) end |
#add_form_type_on_kapp(kapp_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a form type on a Kapp The method is being depreciated and replaced with add_formtype
12 13 14 15 16 |
# File 'lib/kinetic_sdk/core/lib/form_types.rb', line 12 def add_form_type_on_kapp(kapp_slug, body, headers=default_headers) raise StandardError.new "Form Type properties is not valid, must be a Hash." unless body.is_a? Hash @logger.info("Adding Form Type \"#{body['name']}\" for \"#{kapp_slug}\" kapp") post("#{@api_url}/kapps/#{kapp_slug}/formTypes", body, headers) end |
#add_form_webhook(kapp_slug, webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add form webhook
14 15 16 17 18 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 14 def add_form_webhook(kapp_slug, webhook_properties, headers=default_headers) raise StandardError.new "Webhook properties is not valid, must be a Hash." unless webhook_properties.is_a? Hash payload = { "type" => "Form" }.merge(webhook_properties) add_webhook_on_kapp(kapp_slug, payload, headers) end |
#add_form_workflow(kapp_slug, form_slug, payload, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add Form workflow
136 137 138 139 |
# File 'lib/kinetic_sdk/core/lib/form.rb', line 136 def add_form_workflow(kapp_slug, form_slug, payload, headers=default_headers) @logger.info("Add workflow to the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp.") post("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/workflows", payload, headers) end |
#add_formtype ⇒ KineticSdk::Utils::KineticHttpResponse
Add a form type on a Kapp The method is being depreciated and replaced with add_formtype
18 19 20 21 22 |
# File 'lib/kinetic_sdk/core/lib/form_types.rb', line 18 def add_form_type_on_kapp(kapp_slug, body, headers=default_headers) raise StandardError.new "Form Type properties is not valid, must be a Hash." unless body.is_a? Hash @logger.info("Adding Form Type \"#{body['name']}\" for \"#{kapp_slug}\" kapp") post("#{@api_url}/kapps/#{kapp_slug}/formTypes", body, headers) end |
#add_kapp(kapp_name, kapp_slug, properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Kapp
20 21 22 23 24 25 26 27 |
# File 'lib/kinetic_sdk/core/lib/kapp.rb', line 20 def add_kapp(kapp_name, kapp_slug, properties={}, headers=default_headers) properties.merge!({ "name" => kapp_name, "slug" => kapp_slug }) @logger.info("Adding the \"#{kapp_name}\" Kapp.") post("#{@api_url}/kapps", properties, headers) end |
#add_kapp_attribute_definition(kapp_slug, name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new kapp attribute definition.
442 443 444 445 446 447 448 449 450 451 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 442 def add_kapp_attribute_definition(kapp_slug, name, description, allows_multiple, headers=default_headers) body = { "allowsMultiple" => allows_multiple, "description" => description, "name" => name } @logger.info("Adding Kapp attribute definition \"#{name}\" to the \"#{kapp_slug}\" kapp.") # Create the attribute definition post("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions", body, headers) end |
#add_kapp_webapi(kapp_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Returns object, with +code+, +message+, +content_string+, and +content+ properties.
33 34 35 36 37 |
# File 'lib/kinetic_sdk/core/lib/webapis.rb', line 33 def add_kapp_webapi(kapp_slug, body, headers=default_headers) raise StandardError.new "Web API properties is not valid, must be a Hash." unless body.is_a? Hash @logger.info("Adding the \"#{body['slug']}\" to the \"#{kapp_slug}\" Kapp.") post("#{@api_url}/kapps/#{kapp_slug}/webApis", body, headers) end |
#add_kapp_workflow(kapp_slug, payload, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add Kapp workflow
127 128 129 130 |
# File 'lib/kinetic_sdk/core/lib/kapp.rb', line 127 def add_kapp_workflow(kapp_slug, payload, headers=default_headers) @logger.info("Add workflow to the \"#{kapp_slug}\" Kapp.") post("#{@api_url}/kapps/#{kapp_slug}/workflows", payload, headers) end |
#add_oauth_client(options, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add an OAuth client
9 10 11 12 |
# File 'lib/kinetic_sdk/core/lib/oauth.rb', line 9 def add_oauth_client(, headers=default_headers) @logger.info("Adding the \"#{['clientId']}\" OAuth client") post("#{@api_url}/oauthClients", , headers) end |
#add_security_policy_definition(kapp_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Kapp security policy definition
88 89 90 91 92 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 88 def add_security_policy_definition(kapp_slug, body, headers=default_headers) @logger.info("Adding Security Policy Definition \"#{body['name']}\" to the \"#{kapp_slug}\" kapp.") # Create the kapp security policy definition post("#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions", body, headers) end |
#add_space(name, slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new Space
10 11 12 13 14 |
# File 'lib/kinetic_sdk/core/lib/system_api.rb', line 10 def add_space(name, slug, headers=default_headers) payload = { "name" => name, "slug" => slug } @logger.info("Creating Space \"#{name}\" with slug \"#{slug}\"") post("#{@api_url}/spaces", payload, headers) end |
#add_space_attribute(attribute_name, attribute_value, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add an attribute value to the space, or update an attribute if it already exists
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 10 def add_space_attribute(attribute_name, attribute_value, headers=default_headers) # first find the space response = find_space({ "include" => "attributes"}, headers) # hack to try a second time if space isn't found if response.status == 404 sleep 2 response = find_space({ "include" => "attributes"}, headers) end space = response.content["space"] attributes = space["attributes"] # either add or update the attribute value exists = false attributes.each do |attribute| @logger.info("Attribute: #{attribute.inspect}") # if the attribute already exists, update it if attribute["name"] == attribute_name attribute["values"] = [ attribute_value ] exists = true end end # add the attribute if it didn't exist attributes.push({ "name" => attribute_name, "values" => [ attribute_value ] }) unless exists # set the updated attributes list body = { "attributes" => attributes } if exists @logger.info("Updating attribute \"#{attribute_name}\" = \"#{attribute_value}\" in the \"#{space_slug}\" space.") else @logger.info("Adding attribute \"#{attribute_name}\" = \"#{attribute_value}\" to the \"#{space_slug}\" space.") end # Update the space put("#{@api_url}/space", body, headers) end |
#add_space_attribute_definition(name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new space attribute definition.
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 71 def add_space_attribute_definition(name, description, allows_multiple, headers=default_headers) body = { "allowsMultiple" => allows_multiple, "description" => description, "name" => name } @logger.info("Adding Space attribute definition \"#{name}\" to the \"#{space_slug}\" space.") # Create the attribute definition post("#{@api_url}/spaceAttributeDefinitions", body, headers) end |
#add_space_security_policy_definition(body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Space security policy definition
13 14 15 16 17 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 13 def add_space_security_policy_definition(body, headers=default_headers) @logger.info("Adding Space Security Policy Definition \"#{body['name']}\".") # Create the space security policy definition post("#{@api_url}/securityPolicyDefinitions", body, headers) end |
#add_space_webapi(body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Returns object, with +code+, +message+, +content_string+, and +content+ properties.
15 16 17 18 19 |
# File 'lib/kinetic_sdk/core/lib/webapis.rb', line 15 def add_space_webapi(body, headers=default_headers) raise StandardError.new "Web API properties is not valid, must be a Hash." unless body.is_a? Hash @logger.info("Adding the \"#{body['slug']}\" to the Space.") post("#{@api_url}/webApis", body, headers) end |
#add_space_webhook(webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add space webhook
29 30 31 32 33 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 29 def add_space_webhook(webhook_properties, headers=default_headers) raise StandardError.new "Webhook properties is not valid, must be a Hash." unless webhook_properties.is_a? Hash payload = { "type" => "Space" }.merge(webhook_properties) add_webhook_on_space(payload, headers) end |
#add_space_workflow(payload, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add Space workflow
339 340 341 342 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 339 def add_space_workflow(payload, headers=default_headers) @logger.info("Add workflow to the space") post("#{@api_url}/workflows", payload, headers) end |
#add_submission(kapp_slug, form_slug, payload = {}, parameters = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Submission
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/kinetic_sdk/core/lib/submissions.rb', line 18 def add_submission(kapp_slug, form_slug, payload={}, parameters={}, headers=default_headers) # set origin hash if origin was passed as a string payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String # set parent hash if parent was passed as a string payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String # prepare any attachment values payload["values"] = prepare_new_submission_values(kapp_slug, form_slug, payload["values"]) # build the uri with the encoded parameters uri = URI.parse("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/submissions") uri.query = URI.encode_www_form(parameters) unless parameters.empty? # Create the submission @logger.info("Adding a submission in the \"#{form_slug}\" Form.") post(uri.to_s, payload, headers) end |
#add_submission_page(kapp_slug, form_slug, page_name, payload = {}, parameters = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Submission page
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/kinetic_sdk/core/lib/submissions.rb', line 49 def add_submission_page(kapp_slug, form_slug, page_name, payload={}, parameters={}, headers=default_headers) # set origin hash if origin was passed as a string payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String # set parent hash if parent was passed as a string payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String # prepare any attachment values payload["values"] = prepare_new_submission_values(kapp_slug, form_slug, payload["values"]) # add the page name to the parameters parameters["page"] = page_name # build the uri with the encoded parameters uri = URI.parse("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/submissions") uri.query = URI.encode_www_form(parameters) # Create the submission @logger.info("Adding a submission page in the \"#{form_slug}\" Form.") post(uri.to_s, payload, headers) end |
#add_submission_webhook(kapp_slug, webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add submission webhook
45 46 47 48 49 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 45 def add_submission_webhook(kapp_slug, webhook_properties, headers=default_headers) raise StandardError.new "Webhook properties is not valid, must be a Hash." unless webhook_properties.is_a? Hash payload = { "type" => "Submission" }.merge(webhook_properties) add_webhook_on_kapp(kapp_slug, payload, headers) end |
#add_team(team_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a Team
51 52 53 54 55 |
# File 'lib/kinetic_sdk/core/lib/teams.rb', line 51 def add_team(team_properties, headers=default_headers) raise StandardError.new "Team properties is not valid, must be a Hash." unless team_properties.is_a? Hash @logger.info("Adding Team \"#{team_properties['name']}\"") post("#{@api_url}/teams", team_properties, headers) end |
#add_team_attribute(team_name, attribute_name, attribute_value, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add an attribute to a team
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/kinetic_sdk/core/lib/teams.rb', line 13 def add_team_attribute(team_name, attribute_name, attribute_value, headers=default_headers) # first find the team response = find_team(team_name, { "include" => "attributes"}, headers) team = response.content["team"] attributes = team["attributes"] # either add or update the attribute value exists = false attributes.each do |attribute| # if the attribute already exists, update it if attribute["name"] == attribute_name attribute["values"] = attribute_value.is_a?(Array) ? attribute_value : [ attribute_value ] exists = true end end # add the attribute if it didn't exist attributes.push({ "name" => attribute_name, "values" => attribute_value.is_a?(Array) ? attribute_value : [ attribute_value ] }) unless exists # set the updated attributes list body = { "attributes" => attributes } if exists @logger.info("Updating attribute \"#{attribute_name}\" = \"#{attribute_value}\" in the \"#{team_name}\" team.") else @logger.info("Adding attribute \"#{attribute_name}\" = \"#{attribute_value}\" to the \"#{team_name}\" team.") end # Update the space put("#{@api_url}/teams/#{team['slug']}", body, headers) end |
#add_team_attribute_definition(name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new team attribute definition.
131 132 133 134 135 136 137 138 139 140 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 131 def add_team_attribute_definition(name, description, allows_multiple, headers=default_headers) body = { "allowsMultiple" => allows_multiple, "description" => description, "name" => name } @logger.info("Adding Team attribute definition \"#{name}\" to the \"#{space_slug}\" space.") # Create the team attribute definition post("#{@api_url}/teamAttributeDefinitions", body, headers) end |
#add_team_membership(team_name, username, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a team membership
63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/kinetic_sdk/core/lib/teams.rb', line 63 def add_team_membership(team_name, username, headers=default_headers) body = { "team" => { "name" => team_name }, "user" => { "username" => username } } @logger.info("Adding user: \"#{username}\" to \"#{team_name}\" team") post("#{@api_url}/memberships/", body, headers) end |
#add_user(user, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a user in a space.
If the SDK was initialized as a System user, the space_slug property must be provided in the user hash.
If the SDK was initialized as a Space user, the space_slug property is ignored.
Example
add_user({
"space_slug" => "bar",
"username" => "foo",
"password" => "bar",
"displayName" => "Foo",
"email" => "[email protected]",
"enabled" => true,
"preferredLocale" => "en_US",
"spaceAdmin" => false
})
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/kinetic_sdk/core/lib/users.rb', line 29 def add_user(user, headers=default_headers) if !@space_slug.nil? @logger.info("Adding user \"#{user['username']}\" for Space \"#{@space_slug}\" as system user.") post("#{@api_url}/users", user, headers) elsif !user['space_slug'].nil? space_slug = user.delete('space_slug') @logger.info("Adding user \"#{user['username']}\" for Space \"#{space_slug}\".") post("#{@api_url}/spaces/#{space_slug}/users", user, headers) else raise StandardError.new "The space slug must be supplied to add the user." end end |
#add_user_attribute(username, attribute_name, attribute_value, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add an attribute value to the user, or update an attribute if it already exists
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/kinetic_sdk/core/lib/users.rb', line 89 def add_user_attribute(username, attribute_name, attribute_value, headers=default_headers) # first find the user response = find_user(username, { "include" => "attributes"}, headers) user = response.content["user"] attributes = user["attributes"] # either add or update the attribute value exists = false attributes.each do |attribute| # if the attribute already exists, update it if attribute["name"] == attribute_name attribute["values"] = attribute_value.is_a?(Array) ? attribute_value : [ attribute_value ] exists = true end end # add the attribute if it didn't exist attributes.push({ "name" => attribute_name, "values" => attribute_value.is_a?(Array) ? attribute_value : [ attribute_value ] }) unless exists # set the updated attributes list body = { "attributes" => attributes } if exists @logger.info("Updating attribute \"#{attribute_name}\" on user \"#{username}\".") else @logger.info("Adding attribute \"#{attribute_name}\" to user \"#{username}\".") end # Update the user put("#{@api_url}/users/#{encode(username)}", body, headers) end |
#add_user_attribute_definition(name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new user attribute definition.
191 192 193 194 195 196 197 198 199 200 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 191 def add_user_attribute_definition(name, description, allows_multiple, headers=default_headers) body = { "allowsMultiple" => allows_multiple, "description" => description, "name" => name } @logger.info("Adding User attribute definition \"#{name}\" to the \"#{space_slug}\" space.") # Create the user attribute definition post("#{@api_url}/userAttributeDefinitions", body, headers) end |
#add_user_attribute_value(username, attribute_name, attribute_value, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Adds an attribute value to an attribute.
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/kinetic_sdk/core/lib/users.rb', line 127 def add_user_attribute_value(username, attribute_name, attribute_value, headers=default_headers) # first find the user response = find_user(username, { "include" => "attributes"}, headers) user = response.content["user"] attributes = user["attributes"] # either add or update the attribute value exists = false attributes.each do |attribute| # if the attribute already exists, update it if attribute["name"] == attribute_name if attribute_value.is_a?(Array) attribute["values"].concat(attribute_value) else attribute["values"] << attribute_value end attribute["values"].uniq! exists = true end end # add the attribute if it didn't exist attributes.push({ "name" => attribute_name, "values" => attribute_value.is_a?(Array) ? attribute_value : [ attribute_value ] }) unless exists # set the updated attributes list body = { "attributes" => attributes } if exists @logger.info("Updating attribute \"#{attribute_name}\" on user \"#{username}\".") else @logger.info("Adding attribute \"#{attribute_name}\" to user \"#{username}\".") end # Update the user put("#{@api_url}/users/#{encode(username)}", body, headers) end |
#add_user_profile_attribute_definition(name, description, allows_multiple, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a new user profile attribute definition.
251 252 253 254 255 256 257 258 259 260 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 251 def add_user_profile_attribute_definition(name, description, allows_multiple, headers=default_headers) body = { "allowsMultiple" => allows_multiple, "description" => description, "name" => name } @logger.info("Adding User attribute definition \"#{name}\" to the \"#{space_slug}\" space.") # Create the user attribute definition post("#{@api_url}/userProfileAttributeDefinitions", body, headers) end |
#add_user_webhook(webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add user webhook
60 61 62 63 64 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 60 def add_user_webhook(webhook_properties, headers=default_headers) raise StandardError.new "Webhook properties is not valid, must be a Hash." unless webhook_properties.is_a? Hash payload = { "type" => "User" }.merge(webhook_properties) add_webhook_on_space(payload, headers) end |
#add_webhook_on_kapp(kapp_slug, webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a webhook on a Kapp (either a Form or Submission webhook)
Ideally the shortcut methods (add_form_webhook, add_submission_webhook) would be used instead of this one.
80 81 82 83 84 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 80 def add_webhook_on_kapp(kapp_slug, webhook_properties, headers=default_headers) raise StandardError.new "Webhook properties is not valid, must be a Hash." unless webhook_properties.is_a? Hash @logger.info("Adding a \"#{webhook_properties['event']}\" \"#{webhook_properties['type']}\" webhook for #{kapp_slug}") post("#{@api_url}/kapps/#{kapp_slug}/webhooks", webhook_properties, headers) end |
#add_webhook_on_space(webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Add a webhook on a Space (either a Space or User webhook)
Ideally the shortcut methods (add_space_webhook, add_user_webhook) would be used instead of this one.
99 100 101 102 103 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 99 def add_webhook_on_space(webhook_properties, headers=default_headers) raise StandardError.new "Webhook properties is not valid, must be a Hash." unless webhook_properties.is_a? Hash @logger.info("Adding a \"#{webhook_properties['event']}\" \"#{webhook_properties['type']}\" webhook") post("#{@api_url}/webhooks", webhook_properties, headers) end |
#app_version(headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Retrieve Core application version
8 9 10 11 |
# File 'lib/kinetic_sdk/core/lib/meta.rb', line 8 def app_version(headers=default_headers) @logger.info("Retrieving Core application version.") get("#{@api_url}/version", {}, headers) end |
#build_datastore_form_indexes(form_slug, indexes, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Build Datastore Indexes
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/kinetic_sdk/core/lib/datastore_form.rb', line 98 def build_datastore_form_indexes(form_slug, indexes, headers=default_headers) payload = { "type" => "Datastore Indexing", "content" => { "indexes" => indexes } } @logger.info("Building indexes for the \"#{form_slug}\" Datastore Form.") post("#{@api_url}/datastore/forms/#{form_slug}/backgroundJobs", payload, headers) end |
#delete_agent_component(agent_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete Agent Component
84 85 86 87 |
# File 'lib/kinetic_sdk/core/lib/platform_components.rb', line 84 def delete_agent_component(agent_slug, headers = default_headers) @logger.info("Deleting Agent Component with slug: \"#{agent_slug}\".") delete("#{@api_url}/platformComponents/agents/#{agent_slug}", headers) end |
#delete_bridge(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Bridge
23 24 25 26 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 23 def delete_bridge(name, params={}, headers=default_headers) @logger.info("Deleting the \"#{name}\" bridge.") delete("#{@api_url}/bridges/#{encode(name)}", headers) end |
#delete_bridge_model(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Bridge Model
81 82 83 84 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 81 def delete_bridge_model(name, headers=default_headers) @logger.info("Deleting the \"#{name}\" Bridge Model.") delete("#{@api_url}/models/#{encode(name)}", headers) end |
#delete_category_attribute_definition(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a category attribute definition
329 330 331 332 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 329 def delete_category_attribute_definition(kapp_slug, name, headers=default_headers) @logger.info("Deleting the \"#{name}\" Category attribute definition from the \"#{kapp_slug}\" kapp.") delete("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions/#{encode(name)}", headers) end |
#delete_category_on_kapp(kapp_slug, category_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Category
77 78 79 80 |
# File 'lib/kinetic_sdk/core/lib/categories.rb', line 77 def delete_category_on_kapp(kapp_slug, category_slug, headers=default_headers) @logger.info("Deleting the #{category_slug} Category on the #{kapp_slug}\ kapp.") delete("#{@api_url}/kapps/#{kapp_slug}/categories/#{category_slug}", headers) end |
#delete_datastore_form(form_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Datastore Form
32 33 34 35 |
# File 'lib/kinetic_sdk/core/lib/datastore_form.rb', line 32 def delete_datastore_form(form_slug, headers=default_headers) @logger.info("Deleting the \"#{form_slug}\" Datastore Form") delete("#{@api_url}/datastore/forms/#{form_slug}", headers) end |
#delete_datastore_form_attribute_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a datastore form attribute definition
27 28 29 30 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 27 def delete_datastore_form_attribute_definition(name, headers=default_headers) @logger.info("Deleting the \"#{name}\" Datastore Form Attribute Definition") delete("#{@api_url}/datastoreFormAttributeDefinitions/#{encode(name)}", headers) end |
#delete_datastore_submission(submission_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Datastore submission
189 190 191 192 |
# File 'lib/kinetic_sdk/core/lib/datastore_submissions.rb', line 189 def delete_datastore_submission(submission_id, headers=default_headers) @logger.info("Deleting Datastore Submission \"#{submission_id}\"") delete("#{@api_url}/datastore/submissions/#{encode(submission_id)}", headers) end |
#delete_form(kapp_slug, form_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Form
34 35 36 37 |
# File 'lib/kinetic_sdk/core/lib/form.rb', line 34 def delete_form(kapp_slug, form_slug, headers=default_headers) @logger.info("Deleting the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp.") delete("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}", headers) end |
#delete_form_attribute_definition(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a form attribute definition
394 395 396 397 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 394 def delete_form_attribute_definition(kapp_slug, name, headers=default_headers) @logger.info("Deleting the \"#{name}\" Form attribute definition from the \"#{kapp_slug}\" kapp.") delete("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions/#{encode(name)}", headers) end |
#delete_form_type(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a form type on a Kapp The method is being depreciated and replaced with delete_formtype
47 48 49 50 |
# File 'lib/kinetic_sdk/core/lib/form_types.rb', line 47 def delete_form_type(kapp_slug, name, headers=default_headers) @logger.info("Deleting form type \"#{name}\" from \"#{kapp_slug}\" kapp") delete("#{@api_url}/kapps/#{kapp_slug}/formTypes/#{encode(name)}", headers) end |
#delete_form_types_on_kapp(kapp_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete all form types on a Kapp The method is being depreciated and replaced with delete_formtypes
65 66 67 68 69 |
# File 'lib/kinetic_sdk/core/lib/form_types.rb', line 65 def delete_form_types_on_kapp(kapp_slug, headers=default_headers) (find_formtypes(kapp_slug, {}, headers).content["formTypes"] || []).each do |form_type| delete_formtype(kapp_slug, form_type['name'], headers) end end |
#delete_form_workflow(kapp_slug, form_slug, workflow_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete Kapp workflow
148 149 150 151 |
# File 'lib/kinetic_sdk/core/lib/form.rb', line 148 def delete_form_workflow(kapp_slug, form_slug, workflow_id, headers=default_headers) @logger.info("Delete workflow from the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp.") delete("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/workflows/#{workflow_id}", headers) end |
#delete_formtype ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a form type on a Kapp The method is being depreciated and replaced with delete_formtype
52 53 54 55 |
# File 'lib/kinetic_sdk/core/lib/form_types.rb', line 52 def delete_form_type(kapp_slug, name, headers=default_headers) @logger.info("Deleting form type \"#{name}\" from \"#{kapp_slug}\" kapp") delete("#{@api_url}/kapps/#{kapp_slug}/formTypes/#{encode(name)}", headers) end |
#delete_formtypes ⇒ KineticSdk::Utils::KineticHttpResponse
Delete all form types on a Kapp The method is being depreciated and replaced with delete_formtypes
71 72 73 74 75 |
# File 'lib/kinetic_sdk/core/lib/form_types.rb', line 71 def delete_form_types_on_kapp(kapp_slug, headers=default_headers) (find_formtypes(kapp_slug, {}, headers).content["formTypes"] || []).each do |form_type| delete_formtype(kapp_slug, form_type['name'], headers) end end |
#delete_kapp(kapp_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Kapp
34 35 36 37 |
# File 'lib/kinetic_sdk/core/lib/kapp.rb', line 34 def delete_kapp(kapp_slug, headers=default_headers) @logger.info("Deleting the \"#{kapp_slug}\" Kapp.") delete("#{@api_url}/kapps/#{kapp_slug}", headers) end |
#delete_kapp_attribute_definition(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a kapp attribute definition
459 460 461 462 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 459 def delete_kapp_attribute_definition(kapp_slug, name, headers=default_headers) @logger.info("Deleting the \"#{name}\" Kapp attribute definition from the \"#{kapp_slug}\" kapp.") delete("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions/#{encode(name)}", headers) end |
#delete_kapp_webapi(kapp_slug, slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Web API on a Kapp
138 139 140 141 |
# File 'lib/kinetic_sdk/core/lib/webapis.rb', line 138 def delete_kapp_webapi(kapp_slug, slug, headers=default_headers) @logger.info("Deleting the \"#{slug}\" Web API on the \"#{kapp_slug}\" Kapp.") delete("#{@api_url}/kapps/#{kapp_slug}/webApis/#{slug}", headers) end |
#delete_kapp_workflow(kapp_slug, workflow_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete Kapp workflow
139 140 141 142 |
# File 'lib/kinetic_sdk/core/lib/kapp.rb', line 139 def delete_kapp_workflow(kapp_slug, workflow_id, headers=default_headers) @logger.info("Delete workflow from the \"#{kapp_slug}\" Kapp.") delete("#{@api_url}/kapps/#{kapp_slug}/workflows/#{workflow_id}", headers) end |
#delete_security_policy_definition(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Kapp security policy definition
100 101 102 103 104 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 100 def delete_security_policy_definition(kapp_slug, name, headers=default_headers) @logger.info("Deleting Security Policy Definition \"#{name}\" from the \"#{kapp_slug}\" kapp.") # Delete the kapp security policy definition delete("#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions/#{encode(name)}", headers) end |
#delete_security_policy_definitions(kapp_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete all Kapp security policy definitions
111 112 113 114 115 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 111 def delete_security_policy_definitions(kapp_slug, headers=default_headers) (find_security_policy_definitions(kapp_slug, {}, headers).content["securityPolicyDefinitions"] || []).each do |s| delete_security_policy_definition(kapp_slug, s['name'], headers) end end |
#delete_space(slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Space
22 23 24 25 |
# File 'lib/kinetic_sdk/core/lib/system_api.rb', line 22 def delete_space(slug, headers=default_headers) @logger.info("Deleting Space \"#{slug}\"") delete("#{@api_url}/spaces/#{slug}", headers) end |
#delete_space_attribute_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a space attribute definition
87 88 89 90 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 87 def delete_space_attribute_definition(name, headers=default_headers) @logger.info("Deleting the \"#{name}\" Space Attribute Definition") delete("#{@api_url}/spaceAttributeDefinitions/#{encode(name)}", headers) end |
#delete_space_security_policy_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Space security policy definition
24 25 26 27 28 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 24 def delete_space_security_policy_definition(name, headers=default_headers) @logger.info("Deleting Space Security Policy Definition \"#{name}\".") # Delete the space security policy definition delete("#{@api_url}/securityPolicyDefinitions/#{encode(name)}", headers) end |
#delete_space_security_policy_definitions(headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete all Space security policy definitions
34 35 36 37 38 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 34 def delete_space_security_policy_definitions(headers=default_headers) (find_space_security_policy_definitions({}, headers).content["securityPolicyDefinitions"] || []).each do |s| delete_space_security_policy_definition(s['name'], headers) end end |
#delete_space_webapi(slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Web API on the Space
128 129 130 131 |
# File 'lib/kinetic_sdk/core/lib/webapis.rb', line 128 def delete_space_webapi(slug, headers=default_headers) @logger.info("Deleting the \"#{slug}\" Web API on the Space.") delete("#{@api_url}/webApis/#{slug}", headers) end |
#delete_space_workflow(workflow_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete Space workflow
350 351 352 353 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 350 def delete_space_workflow(workflow_id, headers=default_headers) @logger.info("Delete workflow from the space") post("#{@api_url}/workflows/#{workflow_id}", payload, headers) end |
#delete_submission(submission_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Submission
71 72 73 74 |
# File 'lib/kinetic_sdk/core/lib/submissions.rb', line 71 def delete_submission(submission_id, headers=default_headers) @logger.info("Deleting a submission with id #{submission_id}.") delete("#{@api_url}/submissions/#{submission_id}", headers) end |
#delete_team(team_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a Team
142 143 144 145 |
# File 'lib/kinetic_sdk/core/lib/teams.rb', line 142 def delete_team(team_slug, headers=default_headers) @logger.info("Deleting the #{team_slug} Team.") delete("#{@api_url}/teams/#{team_slug}", headers) end |
#delete_team_attribute_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a team attribute definition
147 148 149 150 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 147 def delete_team_attribute_definition(name, headers=default_headers) @logger.info("Deleting the \"#{name}\" Team Attribute Definition") delete("#{@api_url}/teamAttributeDefinitions/#{encode(name)}", headers) end |
#delete_user(user, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a user in a space.
If the SDK was initialized as a System user, the space_slug property must be provided in the user hash.
If the SDK was initialized as a Space user, the space_slug property is ignored.
Example
delete_user({
"username" => "user1"
})
Example
delete_user({
"space_slug" => "foo",
"username" => "user1"
})
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/kinetic_sdk/core/lib/users.rb', line 69 def delete_user(user, headers=default_headers) if !@space_slug.nil? @logger.info("Deleting user \"#{user['username']}\" for Space \"#{@space_slug}\" as system user.") delete("#{@api_url}/users/#{encode(user['username'])}", headers) elsif !user['space_slug'].nil? space_slug = user.delete('space_slug') @logger.info("Deleting user \"#{user['username']}\" for Space \"#{space_slug}\".") delete("#{@api_url}/spaces/#{space_slug}/users/#{encode(user['username'])}", headers) else raise StandardError.new "The space slug must be supplied to add the user." end end |
#delete_user_attribute_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a user attribute definition
207 208 209 210 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 207 def delete_user_attribute_definition(name, headers=default_headers) @logger.info("Deleting the \"#{name}\" User Attribute Definition") delete("#{@api_url}/userAttributeDefinitions/#{encode(name)}", headers) end |
#delete_user_profile_attribute_definition(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a user profile attribute definition
267 268 269 270 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 267 def delete_user_profile_attribute_definition(name, headers=default_headers) @logger.info("Deleting the \"#{name}\" User Profile Attribute Definition") delete("#{@api_url}/userProfileAttributeDefinitions/#{encode(name)}", headers) end |
#delete_webhook_on_kapp(kapp_slug, name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a webhook on a kapp
197 198 199 200 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 197 def delete_webhook_on_kapp(kapp_slug, name, headers=default_headers) @logger.info("Deleting the #{name} webhook on the #{kapp_slug}\ kapp.") delete("#{@api_url}/kapps/#{kapp_slug}/webhooks/#{encode(name)}", headers) end |
#delete_webhook_on_space(name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Delete a webhook on space
206 207 208 209 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 206 def delete_webhook_on_space(name, headers=default_headers) @logger.info("Deleting the #{name} webhook on the space.") delete("#{@api_url}/webhooks/#{encode(name)}", headers) end |
#export_datastore_form(form_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Export a Datastore Form
42 43 44 45 |
# File 'lib/kinetic_sdk/core/lib/datastore_form.rb', line 42 def export_datastore_form(form_slug, headers=default_headers) @logger.info("Exporting the \"#{form_slug}\" Datastore Form.") get("#{@api_url}/datastore/forms/#{form_slug}", { 'export' => true }, headers) end |
#export_form(kapp_slug, form_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Export a Form
45 46 47 48 |
# File 'lib/kinetic_sdk/core/lib/form.rb', line 45 def export_form(kapp_slug, form_slug, headers=default_headers) @logger.info("Exporting the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp.") get("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}", { 'export' => true }, headers) end |
#export_kapp(kapp_slug, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Exports a Kapp
44 45 46 47 |
# File 'lib/kinetic_sdk/core/lib/kapp.rb', line 44 def export_kapp(kapp_slug, headers=default_headers) @logger.info("Exporting the \"#{kapp_slug}\" Kapp.") get("#{@api_url}/kapps/#{kapp_slug}", { 'export' => true }, headers) end |
#export_space(headers = default_headers) ⇒ Object
Export a space to the export_directory
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 61 def export_space(headers=default_headers) raise StandardError.new "An export directory must be defined to export space." if @options[:export_directory].nil? @logger.info("Exporting space definition to #{@options[:export_directory]}.") # Build up the tree of how files should be written export_shape = prepare_shape( "space.bridges.{name}", "space.datastore.forms.{slug}", "space.kapps.{slug}.categories", "space.kapps.{slug}.categoryAttributeDefinitions", "space.kapps.{slug}.forms.{slug}", "space.kapps.{slug}.formAttributeDefinitions", "space.kapps.{slug}.formTypes", "space.kapps.{slug}.kappAttributeDefinitions", "space.kapps.{slug}.securityPolicyDefinitions", "space.kapps.{slug}.webhooks.{name}", "space.kapps.{slug}.webApis.{slug}", "space.models.{name}", "space.teams.{name}", "space.datastoreFormAttributeDefinitions", "space.securityPolicyDefinitions", "space.spaceAttributeDefinitions", "space.teamAttributeDefinitions", "space.userAttributeDefinitions", "space.userProfileAttributeDefinitions", "space.webApis.{slug}", "space.webhooks.{name}", ) core_data = find_space({ 'export' => true }, headers).content process_export(@options[:export_directory], export_shape, core_data) export_workflows(headers) @logger.info("Finished exporting space definition to #{@options[:export_directory]}.") end |
#export_team(team_name, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Export a team
103 104 105 106 107 |
# File 'lib/kinetic_sdk/core/lib/teams.rb', line 103 def export_team(team_name, headers=default_headers) team_slug = Digest::MD5.hexdigest(team_name) @logger.info("Exporting the \"#{team_name}\" (#{team_slug}) Team.") get("#{@api_url}/teams/#{team_slug}", { 'export' => true}, headers) end |
#export_workflows(headers = default_headers) ⇒ Object
Exports linked workflows for the space, kapps, and forms. This method is automatically called from KineticSdk.Core.export_space()
.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 98 def export_workflows(headers=default_headers) # Workflows were introduced in core v6 version = app_version(headers).content["version"] if version && version["version"] < "6" @logger.info("Skip exporting workflows because the Core server version doesn't support workflows.") return end raise StandardError.new "An export directory must be defined to export workflows." if @options[:export_directory].nil? @logger.info("Exporting workflows to #{@options[:export_directory]}.") # space workflows space_workflows = find_space_workflows({ "include" => "details" }, headers).content["workflows"] || [] space_workflows.select { |wf| !wf["event"].nil? }.each do |workflow| @logger.info(workflow) unless workflow["name"] evt = workflow["event"].slugify name = workflow["name"].slugify filename = "#{File.join(@options[:export_directory], "space", "workflows", evt, name)}.json" workflow_json = find_space_workflow(workflow["id"], {}, headers).content["treeJson"] write_object_to_file(filename, workflow_json) end space_content = find_space({ 'include' => "kapps.details,kapps.forms.details" }).content["space"] # kapp workflows space_content["kapps"].each do |kapp| kapp_workflows = find_kapp_workflows(kapp["slug"], {}, headers).content["workflows"] || [] kapp_workflows.select { |wf| !wf["event"].nil? }.each do |workflow| evt = workflow["event"].slugify name = workflow["name"].slugify filename = "#{File.join(@options[:export_directory], "space", "kapps", kapp["slug"], "workflows", evt, name)}.json" workflow_json = find_kapp_workflow(kapp["slug"], workflow["id"], {}, headers).content["treeJson"] write_object_to_file(filename, workflow_json) end # form workflows kapp["forms"].each do |form| form_workflows = find_form_workflows(kapp["slug"], form["slug"], {}, headers).content["workflows"] || [] form_workflows.select { |wf| !wf["event"].nil? }.each do |workflow| evt = workflow["event"].slugify name = workflow["name"].slugify filename = "#{File.join(@options[:export_directory], "space", "kapps", kapp["slug"], "forms", form["slug"], "workflows", evt, name)}.json" workflow_json = find_form_workflow(kapp["slug"], form["slug"], workflow["id"], {}, headers).content["treeJson"] write_object_to_file(filename, workflow_json) end end end end |
#find_agent_component(agent_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Agent Component
35 36 37 38 |
# File 'lib/kinetic_sdk/core/lib/platform_components.rb', line 35 def find_agent_component(agent_slug, params = {}, headers = default_headers) @logger.info("Finding Agent Component with slug: \"#{agent_slug}\".") get("#{@api_url}/platformComponents/agents/#{agent_slug}", params, headers) end |
#find_agent_components(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Agent Components
45 46 47 48 |
# File 'lib/kinetic_sdk/core/lib/platform_components.rb', line 45 def find_agent_components(params = {}, headers = default_headers) @logger.info("Finding Agent Components.") get("#{@api_url}/platformComponents/agents", params, headers) end |
#find_all_form_datastore_submissions(form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Submissions for a Datastore Form.
This method will process pages of form submissions and internally concatenate the results into a single array.
Warning - using this method can cause out of memory errors on large result sets.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/kinetic_sdk/core/lib/datastore_submissions.rb', line 109 def find_all_form_datastore_submissions(form_slug, params={}, headers=default_headers) @logger.info("Finding submissions for the \"#{form_slug}\" Datastore Form.") # Make the initial request of pages submissions response = find_form_datastore_submissions(form_slug, params, headers) # Build the Messages Array = response.content["messages"] # Build Submissions Array submissions = response.content["submissions"] # if a next page token exists, keep retrieving submissions and add them to the results while (!response.content["nextPageToken"].nil?) params['pageToken'] = response.content["nextPageToken"] response = find_form_datastore_submissions(form_slug, params, headers) # concat the messages .concat(response.content["messages"] || []) # concat the submissions submissions.concat(response.content["submissions"] || []) end final_content = { "messages" => , "submissions" => submissions, "nextPageToken" => nil } # Return the results response.content=final_content response.content_string=final_content.to_json response end |
#find_all_form_submissions(kapp_slug, form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Submissions for a form.
This method will process pages of form submissions and internally concatenate the results into a single array.
Warning - using this method can cause out of memory errors on large result sets.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/kinetic_sdk/core/lib/submissions.rb', line 138 def find_all_form_submissions(kapp_slug, form_slug, params={}, headers=default_headers) @logger.info("Finding submissions for the \"#{form_slug}\" Form.") # Make the initial request of pages submissions response = find_form_submissions(kapp_slug, form_slug, params, headers) # Build the Messages Array = response.content["messages"] # Build Submissions Array submissions = response.content["submissions"] # if a next page token exists, keep retrieving submissions and add them to the results while (!response.content["nextPageToken"].nil?) params['pageToken'] = response.content["nextPageToken"] response = find_form_submissions(kapp_slug, form_slug, params, headers) # concat the messages .concat(response.content["messages"] || []) # concat the submissions submissions.concat(response.content["submissions"] || []) end final_content = { "messages" => , "submissions" => submissions, "nextPageToken" => nil } # Return the results response.content=final_content response.content_string=final_content.to_json response end |
#find_all_kapp_webhook_jobs(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Webhook Jobs for a kapp.
This method will process pages of jobs and internally concatenate the results into a single array.
Warning - using this method can cause out of memory errors on large result sets.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/kinetic_sdk/core/lib/webhook_jobs.rb', line 68 def find_all_kapp_webhook_jobs(kapp_slug, params={}, headers=default_headers) # Make the initial request of pages jobs response = find_kapp_webhook_jobs(kapp_slug, params, headers) # Build Submissions Array jobs = response.content["webhookJobs"] # if a next page token exists, keep retrieving jobs and add them to the results while (!response.content["nextPageToken"].nil?) params['pageToken'] = response.content["nextPageToken"] response = find_kapp_webhook_jobs(kapp_slug, params, headers) # concat the jobs jobs.concat(response.content["webhookJobs"] || []) end final_content = {"webhookJobs" => jobs, "nextPageToken" => nil } # Return the results response.content=final_content response.content_string=final_content.to_json response end |
#find_all_space_webhook_jobs(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Webhook Jobs for a space.
This method will process pages of jobs and internally concatenate the results into a single array.
Warning - using this method can cause out of memory errors on large result sets.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/kinetic_sdk/core/lib/webhook_jobs.rb', line 26 def find_all_space_webhook_jobs(params={}, headers=default_headers) # Make the initial request of pages jobs response = find_space_webhook_jobs(params, headers) # Build Submissions Array jobs = response.content["webhookJobs"] # if a next page token exists, keep retrieving jobs and add them to the results while (!response.content["nextPageToken"].nil?) params['pageToken'] = response.content["nextPageToken"] response = find_space_webhook_jobs(params, headers) # concat the jobs jobs.concat(response.content["webhookJobs"] || []) end final_content = {"webhookJobs" => jobs, "nextPageToken" => nil } # Return the results response.content=final_content response.content_string=final_content.to_json response end |
#find_bridge(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a bridge
44 45 46 47 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 44 def find_bridge(name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" Bridge.") get("#{@api_url}/bridges/#{encode(name)}", params, headers) end |
#find_bridge_model(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a bridge model
102 103 104 105 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 102 def find_bridge_model(name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" Bridge Model.") get("#{@api_url}/models/#{encode(name)}", params, headers) end |
#find_bridge_models(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a list of bridge models
91 92 93 94 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 91 def find_bridge_models(params={}, headers=default_headers) @logger.info("Find Bridge models.") get("#{@api_url}/models", params, headers) end |
#find_bridges(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a list of bridges
33 34 35 36 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 33 def find_bridges(params={}, headers=default_headers) @logger.info("Find Bridges.") get("#{@api_url}/bridges", params, headers) end |
#find_categories(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Categories on a Kapp
22 23 24 25 |
# File 'lib/kinetic_sdk/core/lib/categories.rb', line 22 def find_categories(kapp_slug, params={}, headers=default_headers) @logger.info("Finding Categories on the #{kapp_slug} kapp.") get("#{@api_url}/kapps/#{kapp_slug}/categories", params, headers) end |
#find_category_attribute_definition(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a category attribute definition
341 342 343 344 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 341 def find_category_attribute_definition(kapp_slug, name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" Category attribute definition in the \"#{kapp_slug}\" kapp.") get("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions/#{encode(name)}", params, headers) end |
#find_category_attribute_definitions(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all category attribute definition
352 353 354 355 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 352 def find_category_attribute_definitions(kapp_slug, params={}, headers=default_headers) @logger.info("Finding Category attribute definitions in the \"#{kapp_slug}\" kapp.") get("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions", params, headers) end |
#find_category_on_kapp(kapp_slug, category_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Retrieve a Category on a Kapp
11 12 13 14 |
# File 'lib/kinetic_sdk/core/lib/categories.rb', line 11 def find_category_on_kapp(kapp_slug, category_slug, params={}, headers=default_headers) @logger.info("Finding #{category_slug} Category on the #{kapp_slug} kapp.") get("#{@api_url}/kapps/#{kapp_slug}/categories/#{category_slug}", params, headers) end |
#find_datastore_form(form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a Datastore Form
63 64 65 66 |
# File 'lib/kinetic_sdk/core/lib/datastore_form.rb', line 63 def find_datastore_form(form_slug, params={}, headers=default_headers) @logger.info("Finding the \"#{form_slug}\" Datastore Form") get("#{@api_url}/datastore/forms/#{form_slug}", params, headers) end |
#find_datastore_form_attribute_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a datastore form attribute definition
38 39 40 41 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 38 def find_datastore_form_attribute_definition(name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" Datastore Form Attribute Definition") get("#{@api_url}/datastoreFormAttributeDefinitions/#{encode(name)}", params, headers) end |
#find_datastore_form_attribute_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all datastore form attribute definitions
48 49 50 51 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 48 def find_datastore_form_attribute_definitions(params={}, headers=default_headers) @logger.info("Finding Datastore Form Attribute Definitions") get("#{@api_url}/datastoreFormAttributeDefinitions", params, headers) end |
#find_datastore_forms(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Datastore Forms
52 53 54 55 |
# File 'lib/kinetic_sdk/core/lib/datastore_form.rb', line 52 def find_datastore_forms(params={}, headers=default_headers) @logger.info("Finding Forms.") get("#{@api_url}/datastore/forms", params, headers) end |
#find_datastore_submission(submission_id, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a Datastore submission
166 167 168 169 |
# File 'lib/kinetic_sdk/core/lib/datastore_submissions.rb', line 166 def find_datastore_submission(submission_id, params={}, headers=default_headers) @logger.info("Finding Datastore Submission \"#{submission_id}\"") get("#{@api_url}/datastore/submissions/#{encode(submission_id)}", params, headers) end |
#find_form(kapp_slug, form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a Form
68 69 70 71 |
# File 'lib/kinetic_sdk/core/lib/form.rb', line 68 def find_form(kapp_slug, form_slug, params={}, headers=default_headers) @logger.info("Finding the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp.") get("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}", params, headers) end |
#find_form_attribute_definition(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a form attribute definition
406 407 408 409 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 406 def find_form_attribute_definition(kapp_slug, name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" Form attribute definition in the \"#{kapp_slug}\" kapp.") get("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions/#{encode(name)}", params, headers) end |
#find_form_attribute_definitions(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all form attribute definition
417 418 419 420 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 417 def find_form_attribute_definitions(kapp_slug, params={}, headers=default_headers) @logger.info("Finding Form attribute definitions in the \"#{kapp_slug}\" kapp.") get("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions", params, headers) end |
#find_form_datastore_submissions(form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a page of Submissions for a Datastore form.
The page offset can be defined by passing in the "pageToken" parameter, indicating the value of the token that will represent the first submission in the result set. If not provided, the first page of submissions will be retrieved.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/kinetic_sdk/core/lib/datastore_submissions.rb', line 145 def find_form_datastore_submissions(form_slug, params={}, headers=default_headers) # Get next page token token = params["pageToken"] if token.nil? @logger.info("Finding first page of submissions for the \"#{form_slug}\" Datastore.") else @logger.info("Finding page of submissions starting with token \"#{token}\" for the \"#{form_slug}\" Form.") end # Build Submission URL url = "#{@api_url}/datastore/forms/#{form_slug}/submissions" # Return the response get(url, params, headers) end |
#find_form_submissions(kapp_slug, form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a page of Submissions for a form.
The page offset can be defined by passing in the "pageToken" parameter, indicating the value of the token that will represent the first submission in the result set. If not provided, the first page of submissions will be retrieved.
175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/kinetic_sdk/core/lib/submissions.rb', line 175 def find_form_submissions(kapp_slug, form_slug, params={}, headers=default_headers) # Get next page token token = params["pageToken"] if token.nil? @logger.info("Finding first page of submissions for the \"#{form_slug}\" Form.") else @logger.info("Finding page of submissions starting with token \"#{token}\" for the \"#{form_slug}\" Form.") end # Build Submission URL url = "#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/submissions" # Return the response get(url, params, headers) end |
#find_form_types_on_kapp(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Retrieve a list of all form types for a Kapp The method is being depreciated and replaced with find_formtypes
96 97 98 99 |
# File 'lib/kinetic_sdk/core/lib/form_types.rb', line 96 def find_form_types_on_kapp(kapp_slug, params={}, headers=default_headers) @logger.info("Finding Form Types for \"#{kapp_slug}\" kapp") get("#{@api_url}/kapps/#{kapp_slug}/formTypes", params, headers) end |
#find_form_workflow(kapp_slug, form_slug, workflow_id, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a form workflow
120 121 122 123 |
# File 'lib/kinetic_sdk/core/lib/form.rb', line 120 def find_form_workflow(kapp_slug, form_slug, workflow_id, params={}, headers=default_headers) @logger.info("Find workflow #{workflow_id} in the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp") get("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/workflows/#{workflow_id}", params, headers) end |
#find_form_workflows(kapp_slug, form_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Form workflows
106 107 108 109 |
# File 'lib/kinetic_sdk/core/lib/form.rb', line 106 def find_form_workflows(kapp_slug, form_slug, params={}, headers=default_headers) @logger.info("Find workflows in the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp") get("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/workflows", params, headers) end |
#find_forms(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Forms
56 57 58 59 |
# File 'lib/kinetic_sdk/core/lib/form.rb', line 56 def find_forms(kapp_slug, params={}, headers=default_headers) @logger.info("Finding Forms.") get("#{@api_url}/kapps/#{kapp_slug}/forms", params, headers) end |
#find_formtype(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Retrieve a single form types for a Kapp
84 85 86 87 |
# File 'lib/kinetic_sdk/core/lib/form_types.rb', line 84 def find_formtype(kapp_slug, name, params={}, headers=default_headers) @logger.info("Finding the #{name}Form Type for \"#{kapp_slug}\" kapp") get("#{@api_url}/kapps/#{kapp_slug}/formTypes/#{encode(name)}", params, headers) end |
#find_formtypes ⇒ KineticSdk::Utils::KineticHttpResponse
Retrieve a list of all form types for a Kapp The method is being depreciated and replaced with find_formtypes
101 102 103 104 |
# File 'lib/kinetic_sdk/core/lib/form_types.rb', line 101 def find_form_types_on_kapp(kapp_slug, params={}, headers=default_headers) @logger.info("Finding Form Types for \"#{kapp_slug}\" kapp") get("#{@api_url}/kapps/#{kapp_slug}/formTypes", params, headers) end |
#find_kapp(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a Kapp
65 66 67 68 |
# File 'lib/kinetic_sdk/core/lib/kapp.rb', line 65 def find_kapp(kapp_slug, params={}, headers=default_headers) @logger.info("Finding Kapp \"#{kapp_slug}\"") get("#{@api_url}/kapps/#{kapp_slug}", params, headers) end |
#find_kapp_attribute_definition(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a kapp attribute definition
471 472 473 474 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 471 def find_kapp_attribute_definition(kapp_slug, name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" Kapp attribute definition in the \"#{kapp_slug}\" kapp.") get("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions/#{encode(name)}", params, headers) end |
#find_kapp_attribute_definitions(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all kapp attribute definition
482 483 484 485 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 482 def find_kapp_attribute_definitions(kapp_slug, params={}, headers=default_headers) @logger.info("Finding Kapp attribute definitions in the \"#{kapp_slug}\" kapp.") get("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions", params, headers) end |
#find_kapp_submissions(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a page of Submissions for a kapp.
The page offset can be defined by passing in the "pageToken" parameter, indicating the value of the token that will represent the first submission in the result set. If not provided, the first page of submissions will be retrieved.
202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/kinetic_sdk/core/lib/submissions.rb', line 202 def find_kapp_submissions(kapp_slug, params={}, headers=default_headers) # Get next page token token = params["pageToken"] if token.nil? @logger.info("Finding first page of submissions for the \"#{kapp_slug}\" Kapp.") else @logger.info("Finding page of submissions starting with token \"#{token}\" for the \"#{kapp_slug}\" Kapp.") end # Build Submission URL url = "#{@api_url}/kapps/#{kapp_slug}/submissions" # Return the response get(url, params, headers) end |
#find_kapp_webapi(kapp_slug, slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a single Web API on the Kapp
78 79 80 81 |
# File 'lib/kinetic_sdk/core/lib/webapis.rb', line 78 def find_kapp_webapi(kapp_slug, slug, params={}, headers=default_headers) @logger.info("Finding the \"#{slug}\" Web API on the \"#{kapp_slug}\" Kapp.") get("#{@api_url}/kapps/#{kapp_slug}/webApis/#{slug}", params, headers) end |
#find_kapp_webapis(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Web APIs for a Kapp
66 67 68 69 |
# File 'lib/kinetic_sdk/core/lib/webapis.rb', line 66 def find_kapp_webapis(kapp_slug, params={}, headers=default_headers) @logger.info("Finding all Web APIs on the \"#{kapp_slug}\" Kapp.") get("#{@api_url}/kapps/#{kapp_slug}/webApis", params, headers) end |
#find_kapp_webhook_jobs(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find kapp webhook jobs
51 52 53 54 |
# File 'lib/kinetic_sdk/core/lib/webhook_jobs.rb', line 51 def find_kapp_webhook_jobs(kapp_slug, params={}, headers=default_headers) @logger.info("Finding webhook jobs in the \"#{kapp_slug}\" Kapp") get("#{@api_url}/kapps/#{kapp_slug}/webhookJobs", params, headers) end |
#find_kapp_workflow(kapp_slug, workflow_id, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a kapp workflow
112 113 114 115 |
# File 'lib/kinetic_sdk/core/lib/kapp.rb', line 112 def find_kapp_workflow(kapp_slug, workflow_id, params={}, headers=default_headers) @logger.info("Find workflow #{workflow_id} in the \"#{kapp_slug}\" Kapp") get("#{@api_url}/kapps/#{kapp_slug}/workflows/#{workflow_id}", params, headers) end |
#find_kapp_workflows(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Kapp workflows
99 100 101 102 |
# File 'lib/kinetic_sdk/core/lib/kapp.rb', line 99 def find_kapp_workflows(kapp_slug, params={}, headers=default_headers) @logger.info("Find workflows in the \"#{kapp_slug}\" Kapp") get("#{@api_url}/kapps/#{kapp_slug}/workflows", params, headers) end |
#find_kapps(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Kapps
54 55 56 57 |
# File 'lib/kinetic_sdk/core/lib/kapp.rb', line 54 def find_kapps(params={}, headers=default_headers) @logger.info("Finding Kapps.") get("#{@api_url}/kapps", params, headers) end |
#find_oauth_client(client_id, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find OAuth client
20 21 22 23 |
# File 'lib/kinetic_sdk/core/lib/oauth.rb', line 20 def find_oauth_client(client_id, params={}, headers=default_headers) @logger.info("Finding OAuth Client \"#{client_id}\"") get("#{@api_url}/oauthClients/#{encode(client_id)}", params, headers) end |
#find_security_policy_definition(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a single Kapp security policy definition
135 136 137 138 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 135 def find_security_policy_definition(kapp_slug, name, params={}, headers=default_headers) @logger.info("Finding Security Policy Definition \"#{name}\" on the \"#{kapp_slug}\" kapp.") get("#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions/#{encode(name)}", params, headers) end |
#find_security_policy_definitions(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Kapp security policy definitions
123 124 125 126 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 123 def find_security_policy_definitions(kapp_slug, params={}, headers=default_headers) @logger.info("Listing Security Policy Definitions on the \"#{kapp_slug}\" kapp.") get("#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions", params, headers) end |
#find_space(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find the space
152 153 154 155 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 152 def find_space(params={}, headers=default_headers) @logger.info("Finding Space \"#{@space_slug}\"") get("#{@api_url}/space", params, headers) end |
#find_space_attribute_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a space attribute definition
98 99 100 101 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 98 def find_space_attribute_definition(name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" Space Attribute Definition") get("#{@api_url}/spaceAttributeDefinitions/#{encode(name)}", params, headers) end |
#find_space_attribute_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all space attribute definitions
108 109 110 111 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 108 def find_space_attribute_definitions(params={}, headers=default_headers) @logger.info("Finding Space Attribute Definitions") get("#{@api_url}/spaceAttributeDefinitions", params, headers) end |
#find_space_in_system(slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find the space (System API)
43 44 45 46 |
# File 'lib/kinetic_sdk/core/lib/system_api.rb', line 43 def find_space_in_system(slug, params={}, headers=default_headers) @logger.info("Retrieving Space \"#{slug}\"") get("#{@api_url}/spaces/#{slug}", params, headers) end |
#find_space_security_policy_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a single Space security policy definition
56 57 58 59 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 56 def find_space_security_policy_definition(name, params={}, headers=default_headers) @logger.info("Finding Space Security Policy Definition \"#{name}\"") get("#{@api_url}/securityPolicyDefinitions/#{encode(name)}", params, headers) end |
#find_space_security_policy_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Space security policy definitions
45 46 47 48 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 45 def find_space_security_policy_definitions(params={}, headers=default_headers) @logger.info("Finding Space Security Policy Definitions.") get("#{@api_url}/securityPolicyDefinitions", params, headers) end |
#find_space_webapi(slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a single Web API on the Space
55 56 57 58 |
# File 'lib/kinetic_sdk/core/lib/webapis.rb', line 55 def find_space_webapi(slug, params={}, headers=default_headers) @logger.info("Finding the \"#{slug}\" Web API on the Space") get("#{@api_url}/webApis/#{slug}", params, headers) end |
#find_space_webapis(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all Web APIs for the Space
44 45 46 47 |
# File 'lib/kinetic_sdk/core/lib/webapis.rb', line 44 def find_space_webapis(params={}, headers=default_headers) @logger.info("Finding all Web APIs on the Space") get("#{@api_url}/webApis", params, headers) end |
#find_space_webhook_jobs(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find space webhook jobs
9 10 11 12 |
# File 'lib/kinetic_sdk/core/lib/webhook_jobs.rb', line 9 def find_space_webhook_jobs(params={}, headers=default_headers) @logger.info("Finding webhook jobs in the Space") get("#{@api_url}/webhookJobs", params, headers) end |
#find_space_workflow(workflow_id, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a space workflow
325 326 327 328 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 325 def find_space_workflow(workflow_id, params={}, headers=default_headers) @logger.info("Find space workflow #{workflow_id}") get("#{@api_url}/workflows/#{workflow_id}", params, headers) end |
#find_space_workflows(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Space workflows
313 314 315 316 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 313 def find_space_workflows(params={}, headers=default_headers) @logger.info("Find space workflows") get("#{@api_url}/workflows", params, headers) end |
#find_spaces(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all spaces
32 33 34 35 |
# File 'lib/kinetic_sdk/core/lib/system_api.rb', line 32 def find_spaces(params={}, headers=default_headers) @logger.info("Finding Spaces") get("#{@api_url}/spaces", params, headers) end |
#find_task_component(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find Task Component
11 12 13 14 |
# File 'lib/kinetic_sdk/core/lib/platform_components.rb', line 11 def find_task_component(params = {}, headers = default_headers) @logger.info("Finding Task Component.") get("#{@api_url}/platformComponents/task", params, headers) end |
#find_team(team_name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find the team
Attributes
117 118 119 120 121 |
# File 'lib/kinetic_sdk/core/lib/teams.rb', line 117 def find_team(team_name, params={}, headers=default_headers) team_slug = Digest::MD5.hexdigest(team_name) @logger.info("Finding the \"#{team_name}\" (#{team_slug}) Team.") get("#{@api_url}/teams/#{team_slug}", params, headers) end |
#find_team_attribute_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a team attribute definition
158 159 160 161 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 158 def find_team_attribute_definition(name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" Team Attribute Definition") get("#{@api_url}/teamAttributeDefinitions/#{encode(name)}", params, headers) end |
#find_team_attribute_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all team attribute definitions
168 169 170 171 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 168 def find_team_attribute_definitions(params={}, headers=default_headers) @logger.info("Finding Team Attribute Definitions") get("#{@api_url}/teamAttributeDefinitions", params, headers) end |
#find_teams(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find teams
93 94 95 96 |
# File 'lib/kinetic_sdk/core/lib/teams.rb', line 93 def find_teams(params={}, headers=default_headers) @logger.info("Finding Teams") get("#{@api_url}/teams", params, headers) end |
#find_user(username, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find the user
190 191 192 193 |
# File 'lib/kinetic_sdk/core/lib/users.rb', line 190 def find_user(username, params={}, headers=default_headers) @logger.info("Finding User \"#{username}\"") get("#{@api_url}/users/#{encode(username)}", params, headers) end |
#find_user_attribute_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a user attribute definition
218 219 220 221 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 218 def find_user_attribute_definition(name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" User Attribute Definition") get("#{@api_url}/userAttributeDefinitions/#{encode(name)}", params, headers) end |
#find_user_attribute_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all user attribute definitions
228 229 230 231 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 228 def find_user_attribute_definitions(params={}, headers=default_headers) @logger.info("Finding User Attribute Definitions") get("#{@api_url}/userAttributeDefinitions", params, headers) end |
#find_user_in_system(space_slug, username, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a user in a space (System API)
75 76 77 78 |
# File 'lib/kinetic_sdk/core/lib/system_api.rb', line 75 def find_user_in_system(space_slug, username, params={}, headers=default_headers) @logger.info("Finding User #{username} in Space #{space_slug}") get("#{@api_url}/spaces/#{space_slug}/users/#{encode(username)}", params, headers) end |
#find_user_profile_attribute_definition(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a user profile attribute definition
278 279 280 281 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 278 def find_user_profile_attribute_definition(name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" User Profile Attribute Definition") get("#{@api_url}/userProfileAttributeDefinitions/#{encode(name)}", params, headers) end |
#find_user_profile_attribute_definitions(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find user profile attribute definitions
288 289 290 291 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 288 def find_user_profile_attribute_definitions(params={}, headers=default_headers) @logger.info("Finding User Profile Attribute Definitions") get("#{@api_url}/userProfileAttributeDefinitions", params, headers) end |
#find_users(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all users
168 169 170 171 |
# File 'lib/kinetic_sdk/core/lib/users.rb', line 168 def find_users(params={}, headers=default_headers) @logger.info("Finding Users") get("#{@api_url}/users", params, headers) end |
#find_users_in_system(space_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all users with the system api
179 180 181 182 |
# File 'lib/kinetic_sdk/core/lib/users.rb', line 179 def find_users_in_system(space_slug, params={}, headers=default_headers) @logger.info("Finding Users") get("#{@api_url}/spaces/#{space_slug}/users", params, headers) end |
#find_webhook_on_kapp(kapp_slug, name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a webhook defined in a Kapp
133 134 135 136 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 133 def find_webhook_on_kapp(kapp_slug, name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" webhook on the \"#{kapp_slug}\" Kapp") get("#{@api_url}/kapps/#{kapp_slug}/webhooks/#{encode(name)}", params, headers) end |
#find_webhooks_on_kapp(kapp_slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all webhooks for a Kapp
111 112 113 114 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 111 def find_webhooks_on_kapp(kapp_slug, params={}, headers=default_headers) @logger.info("Finding all webhooks on the \"#{kapp_slug}\" Kapp") get("#{@api_url}/kapps/#{kapp_slug}/webhooks", params, headers) end |
#find_webhooks_on_space(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find all webhooks for a Space
121 122 123 124 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 121 def find_webhooks_on_space(params={}, headers=default_headers) @logger.info("Finding all webhooks on the Space") get("#{@api_url}/webhooks", params, headers) end |
#finding_webhook_on_space(name, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find a webhook defined in a Space
144 145 146 147 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 144 def finding_webhook_on_space(name, params={}, headers=default_headers) @logger.info("Finding the \"#{name}\" webhook on the Space") get("#{@api_url}/webhooks/#{encode(name)}", params, headers) end |
#generate_password_token(username, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Generate Password Reset Token.
240 241 242 243 |
# File 'lib/kinetic_sdk/core/lib/users.rb', line 240 def generate_password_token(username, body={}, headers=default_headers) @logger.info("Generating PW Token for \"#{username}\"") post("#{@api_url}/users/#{encode(username)}/passwordResetToken", body, headers) end |
#import_space(slug, headers = default_headers) ⇒ Object
Imports a full space definition from the export_directory, except for workflows. Those must be imported separately after the Kinetic Platform source exists in task.
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 163 def import_space(slug, headers=default_headers) raise StandardError.new "An export directory must be defined to import space." if @options[:export_directory].nil? @logger.info("Importing space definition from #{@options[:export_directory]}.") # Loop over all provided files sorting files before folders Dir["#{@options[:export_directory]}/**/*.json"].map { |file| [file.count("/"), file] }.sort.map { |file| file[1] }.each do |file| rel_path = file.gsub("#{@options[:export_directory]}/", '') body = JSON.parse(File.read(file)) if rel_path == "space.json" api_path = "/space" @logger.info("Importing #{rel_path} to #{api_path}.") body['slug'] = slug resp = put("#{@api_url}#{api_path}", body, headers) elsif rel_path.match?(/.*\/workflows\/.*/) # skip workflows,they are inported independently next elsif body.is_a?(Array) api_path = "/#{rel_path.sub(/^space\//,'').sub(/\.json$/,'')}" body.each do |part| @logger.info("Importing #{rel_path} to #{api_path}.") resp = post("#{@api_url}#{api_path}", part, headers) end else api_path = "/#{rel_path.sub(/^space\//,'').sub(/\/[^\/]+$/,'')}" # TODO: Remove this block when core API is updated to not export Key if api_path == "/bridges" && body.has_key?("key") body.delete("key") end @logger.info("Importing #{rel_path} to #{api_path}.") resp = post("#{@api_url}#{api_path}", body, headers) # TODO: Remove this block when core API is updated to not pre-create SPDs if api_path == "/kapps" kapp_slug = resp.content["kapp"]["slug"] delete_security_policy_definitions(kapp_slug) delete_form_types_on_kapp(kapp_slug) end end end @logger.info("Finished importing space definition to #{@options[:export_directory]}.") end |
#import_workflows(slug, headers = default_headers) ⇒ Object
Imports the workflows for the space. This method should be called after importing the Kinetic Platform source into task.
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 209 def import_workflows(slug, headers=default_headers) # Workflows were introduced in core v6 version = app_version(headers).content["version"] if version && version["version"] < "6" @logger.info("Skip importing workflows because the Core server version doesn't support workflows.") return end raise StandardError.new "An export directory must be defined to import space." if @options[:export_directory].nil? @logger.info("Importing workflows from #{@options[:export_directory]}.") # Map of existing workflows by space, kapp, form existing_workflows_cache = {} # Regular expressions to match workflow paths by space, kapp, or form form_re = /^\/kapps\/(?<kapp_slug>[a-z0-9]+(?:-[a-z0-9]+)*)\/forms\/(?<form_slug>[a-z0-9]+(?:-[a-z0-9]+)*)\/workflows/ kapp_re = /^\/kapps\/(?<kapp_slug>[a-z0-9]+(?:-[a-z0-9]+)*)\/workflows/ space_re = /^\/workflows/ # Loop over all provided files sorting files before folders Dir["#{@options[:export_directory]}/space/**/workflows/**/*.json"].map { |file| [file.count("/"), file] }.sort.map { |file| file[1] }.each do |file| rel_path = file.sub("#{@options[:export_directory]}/", '') path_parts = File.dirname(rel_path).split(File::SEPARATOR) api_parts_path = path_parts[0..-1] api_path = "/#{api_parts_path.join("/").sub(/^space\//,'').sub(/\/[^\/]+$/,'')}" # populate the existing workflows for the workflowable object matches = form_re.match(api_path) # form workflows if matches form_slug = matches["form_slug"] kapp_slug = matches["kapp_slug"] map_key = self.space_slug + "|" + kapp_slug + "|" + form_slug if !existing_workflows_cache.has_key?(map_key) response = find_form_workflows(kapp_slug, form_slug, { "includes" => "details" }, headers) existing_workflows_cache[map_key] = response.content["workflows"] end else matches = kapp_re.match(api_path) # kapp workflows if matches kapp_slug = matches["kapp_slug"] map_key = self.space_slug + "|" + kapp_slug if !existing_workflows_cache.has_key?(map_key) response = find_kapp_workflows(kapp_slug, { "includes" => "details" }, headers) existing_workflows_cache[map_key] = response.content["workflows"] end else # space workflows map_key = self.space_slug if !existing_workflows_cache.has_key?(map_key) response = find_space_workflows({ "includes" => "details" }, headers) existing_workflows_cache[map_key] = response.content["workflows"] end end end tree_json = JSON.parse(File.read(file)) event = path_parts.last.split("-").map { |part| part.capitalize }.join(" ") name = tree_json["name"] body = { "event" => event, "name" => name, "treeJson" => tree_json } # check if the workflow already exists existing_workflow = (existing_workflows_cache[map_key] || []).select { |wf| wf["event"] == event && wf["name"] == name }.first if existing_workflow workflow_id = existing_workflow["id"] url = "#{@api_url}#{api_path}/#{workflow_id}" @logger.info("Updating #{event} workflow #{workflow_id} from #{rel_path} to #{url}") resp = put(url, body, headers) @logger.warn("Failed to update workflow (#{resp.code}): #{resp.content}") unless resp.code == "200" else url = "#{@api_url}#{api_path}" @logger.info("Importing #{event} workflow from #{rel_path} to #{url}") resp = post(url, body, headers) @logger.warn("Failed to import workflow (#{resp.code}): #{resp.content}") unless resp.code == "200" end end end |
#jwt_code(client_id, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Gets an authentication code.
This method should really never need to be called externally.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/kinetic_sdk/core/lib/jwt.rb', line 35 def jwt_code(client_id, headers = default_headers) @logger.info("Retrieving JWT authorization code") url = "#{@server}/app/oauth/authorize?grant_type=authorization_code&response_type=code&client_id=#{client_id}" response = post(url, {}, headers, { :max_redirects => -1 }) if response.status == 401 raise StandardError.new "#{response.}: #{response.content["error"]}" elsif response.status == 302 location = response.headers["location"] if location.nil? raise StandardError.new "Unable to retrieve code: #{response.inspect}" else location.split("?code=").last.split("#/").first end else raise StandardError.new "Unable to retrieve code #{response.inspect}" end end |
#jwt_token(client_id, client_secret, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Gets an authentication token
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/kinetic_sdk/core/lib/jwt.rb', line 10 def jwt_token(client_id, client_secret, headers = default_headers) # retrieve the jwt code jwt_code = jwt_code(client_id, headers) # retrieve the jwt token @logger.info("Retrieving JWT authorization token") url = "#{@server}/app/oauth/token?grant_type=authorization_code&response_type=token&client_id=#{client_id}&code=#{jwt_code}" token_headers = header_accept_json.merge(header_basic_auth(client_id, client_secret)) response = post(url, {}, token_headers, { :max_redirects => 0 }) if response.status == 401 raise StandardError.new "#{response.}, the oauth client id and secret are invalid." elsif response.status == 200 response else raise StandardError.new "Unable to retrieve token: #{response}" end end |
#me(params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Find the current user
250 251 252 253 |
# File 'lib/kinetic_sdk/core/lib/users.rb', line 250 def me(params={}, headers=default_headers) @logger.info("Finding Me") get("#{@api_url}/me", params, headers) end |
#patch_datastore_submission(form_slug, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Patch a new Datastore Submission
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/kinetic_sdk/core/lib/datastore_submissions.rb', line 59 def patch_datastore_submission(form_slug, payload={}, headers=default_headers) # set the currentPage hash if currentPage was passed as a string payload["currentPage"] = { "name" => payload["currentPage"] } if payload["currentPage"].is_a? String # set origin hash if origin was passed as a string payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String # set parent hash if parent was passed as a string payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String # prepare any attachment values payload["values"] = prepare_new_datastore_submission_values(form_slug, payload["values"]) # Create the submission @logger.info("Patching a submission in the \"#{form_slug}\" Form.") patch("#{@api_url}/datastore/forms/#{form_slug}/submissions", payload, headers) end |
#patch_existing_datastore_submission(submission_id, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Patch an existing Datastore Submission
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/kinetic_sdk/core/lib/datastore_submissions.rb', line 83 def patch_existing_datastore_submission(submission_id, payload={}, headers=default_headers) # set the currentPage hash if currentPage was passed as a string payload["currentPage"] = { "name" => payload["currentPage"] } if payload["currentPage"].is_a? String # set origin hash if origin was passed as a string payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String # set parent hash if parent was passed as a string payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String # prepare any attachment values payload["values"] = prepare_updated_datastore_submission_values(submission_id, payload["values"]) # Update the submission @logger.info("Patching a submission with id \"#{submission_id}\"") patch("#{@api_url}/datastore/submissions/#{submission_id}", payload, headers) end |
#patch_existing_submission(submission_id, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Patch an existing Submission
111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/kinetic_sdk/core/lib/submissions.rb', line 111 def patch_existing_submission(submission_id, payload={}, headers=default_headers) # set the currentPage hash if currentPage was passed as a string payload["currentPage"] = { "name" => payload["currentPage"] } if payload["currentPage"].is_a? String # set origin hash if origin was passed as a string payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String # set parent hash if parent was passed as a string payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String # prepare any attachment values payload["values"] = prepare_updated_submission_values(submission_id, payload["values"]) # Create the submission @logger.info("Patching a submission with id \"#{submission_id}\"") patch("#{@api_url}/submissions/#{submission_id}", payload, headers) end |
#patch_new_submission(kapp_slug, form_slug, payload = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Patch a new Submission
87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/kinetic_sdk/core/lib/submissions.rb', line 87 def patch_new_submission(kapp_slug, form_slug, payload={}, headers=default_headers) # set the currentPage hash if currentPage was passed as a string payload["currentPage"] = { "name" => payload["currentPage"] } if payload["currentPage"].is_a? String # set origin hash if origin was passed as a string payload["origin"] = { "id" => payload["origin"] } if payload["origin"].is_a? String # set parent hash if parent was passed as a string payload["parent"] = { "id" => payload["parent"] } if payload["parent"].is_a? String # prepare any attachment values payload["values"] = prepare_new_submission_values(kapp_slug, form_slug, payload["values"]) # Create the submission @logger.info("Patching a submission in the \"#{form_slug}\" Form.") patch("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}/submissions", payload, headers) end |
#remove_team_membership(team_name, username, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
remove a team membership
82 83 84 85 86 |
# File 'lib/kinetic_sdk/core/lib/teams.rb', line 82 def remove_team_membership(team_name, username, headers=default_headers) team_slug = Digest::MD5.hexdigest(team_name) @logger.info("Removing user: \"#{username}\" from \"#{team_name}\" team") delete("#{@api_url}/memberships/#{team_slug}_#{username}", headers) end |
#reset_license_count(headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Reset the license count (System API)
63 64 65 66 |
# File 'lib/kinetic_sdk/core/lib/system_api.rb', line 63 def reset_license_count(headers=default_headers) @logger.info("Resetting License Count") put("#{@api_url}/license/reset", {}, headers) end |
#space_exists?(slug, params = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Checks if the space exists
301 302 303 304 305 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 301 def space_exists?(slug, params={}, headers=default_headers) @logger.info("Checking if the \"#{slug}\" space exists") response = get("#{@api_url}/spaces/#{slug}", params, headers) response.status == 200 end |
#update_agent_component(agent_slug, component_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update Agent Component
73 74 75 76 77 |
# File 'lib/kinetic_sdk/core/lib/platform_components.rb', line 73 def update_agent_component(agent_slug, component_properties, headers = default_headers) raise StandardError.new "Agent Component properties is not valid, must be a Hash." unless component_properties.is_a? Hash @logger.info("Updating Agent Component \"#{agent_slug}\".") put("#{@api_url}/platformComponents/agents/#{agent_slug}", component_properties, headers) end |
#update_bridge(name, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a bridge
55 56 57 58 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 55 def update_bridge(name, body={}, headers=default_headers) @logger.info("Updating the \"#{name}\" Bridge.") put("#{@api_url}/bridges/#{encode(name)}", body, headers) end |
#update_bridge_model(name, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Bridge Model
119 120 121 122 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 119 def update_bridge_model(name, body={}, headers=default_headers) @logger.info("Updating the \"#{name}\" Bridge Model.") put("#{@api_url}/models/#{encode(name)}", body, headers) end |
#update_bridge_model_mapping(model_name, mapping_name, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Bridge Model Mapping
136 137 138 139 |
# File 'lib/kinetic_sdk/core/lib/bridges.rb', line 136 def update_bridge_model_mapping(model_name, mapping_name, body={}, headers=default_headers) @logger.info("Updating the \"#{model_name} - #{mapping_name}\" Bridge Model Mapping.") put("#{@api_url}/models/#{encode(model_name)}/mappings/#{encode(mapping_name)}", body, headers) end |
#update_category_attribute_definition(kapp_slug, name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a category attribute definition
364 365 366 367 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 364 def update_category_attribute_definition(kapp_slug, name, body, headers=default_headers) @logger.info("Updating the \"#{name}\" Category attribute definition in the \"#{kapp_slug}\" kapp.") put("#{@api_url}/kapps/#{kapp_slug}/categoryAttributeDefinitions/#{encode(name)}",body, headers) end |
#update_category_on_kapp(kapp_slug, category_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a category on a Kapp
65 66 67 68 69 |
# File 'lib/kinetic_sdk/core/lib/categories.rb', line 65 def update_category_on_kapp(kapp_slug, category_slug, body, headers=default_headers) raise StandardError.new "Category properties is not valid, must be a Hash." unless body.is_a? Hash @logger.info("Updating Category \"#{body['name']}\" for \"#{kapp_slug}\" kapp") put("#{@api_url}/kapps/#{kapp_slug}/categories/#{category_slug}", body, headers) end |
#update_datastore_form(form_slug, properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Datastore Form
87 88 89 90 |
# File 'lib/kinetic_sdk/core/lib/datastore_form.rb', line 87 def update_datastore_form(form_slug, properties={}, headers=default_headers) @logger.info("Updating the \"#{form_slug}\" Datastore Form.") put("#{@api_url}/datastore/forms/#{form_slug}", properties, headers) end |
#update_datastore_form_attribute_definition(name, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a datastore form attribute definition
59 60 61 62 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 59 def update_datastore_form_attribute_definition(name, body={}, headers=default_headers) @logger.info("Updating the \"#{name}\" Datastore Form Attribute Definition.") put("#{@api_url}/datastoreFormAttributeDefinitions/#{encode(name)}",body, headers) end |
#update_datastore_submission(submission_id, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Datastore submission
178 179 180 181 |
# File 'lib/kinetic_sdk/core/lib/datastore_submissions.rb', line 178 def update_datastore_submission(submission_id, body={}, headers=default_headers) @logger.info("Updating Datastore Submission \"#{submission_id}\"") put("#{@api_url}/datastore/submissions/#{encode(submission_id)}", body, headers) end |
#update_form(kapp_slug, form_slug, properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Form
93 94 95 96 |
# File 'lib/kinetic_sdk/core/lib/form.rb', line 93 def update_form(kapp_slug, form_slug, properties={}, headers=default_headers) @logger.info("Updating the \"#{form_slug}\" Form in the \"#{kapp_slug}\" Kapp.") put("#{@api_url}/kapps/#{kapp_slug}/forms/#{form_slug}", properties, headers) end |
#update_form_attribute_definition(kapp_slug, name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a form attribute definition
429 430 431 432 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 429 def update_form_attribute_definition(kapp_slug, name, body, headers=default_headers) @logger.info("Updating the \"#{name}\" Form attribute definition in the \"#{kapp_slug}\" kapp.") put("#{@api_url}/kapps/#{kapp_slug}/formAttributeDefinitions/#{encode(name)}",body, headers) end |
#update_formtype(kapp_slug, name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a form type on a Kapp
34 35 36 37 38 |
# File 'lib/kinetic_sdk/core/lib/form_types.rb', line 34 def update_formtype(kapp_slug, name, body, headers=default_headers) raise StandardError.new "Form Type properties is not valid, must be a Hash." unless body.is_a? Hash @logger.info("Updating Form Type \"#{body['name']}\" for \"#{kapp_slug}\" kapp") put("#{@api_url}/kapps/#{kapp_slug}/formTypes/#{encode(name)}", body, headers) end |
#update_kapp(kapp_slug, properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Kapp
87 88 89 90 |
# File 'lib/kinetic_sdk/core/lib/kapp.rb', line 87 def update_kapp(kapp_slug, properties={}, headers=default_headers) @logger.info("Updating the \"#{kapp_slug}\" Kapp.") put("#{@api_url}/kapps/#{kapp_slug}", properties, headers) end |
#update_kapp_attribute_definition(kapp_slug, name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a kapp attribute definition
494 495 496 497 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 494 def update_kapp_attribute_definition(kapp_slug, name, body, headers=default_headers) @logger.info("Updating the \"#{name}\" Kapp attribute definition in the \"#{kapp_slug}\" kapp.") put("#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions/#{encode(name)}",body, headers) end |
#update_kapp_webapi(kapp_slug, slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Web API on a Kapp
All of the Web API properties are optional. Only the properties provided in the Hash will be updated, the other properties will retain their current values.
119 120 121 122 |
# File 'lib/kinetic_sdk/core/lib/webapis.rb', line 119 def update_kapp_webapi(kapp_slug, slug, body, headers=default_headers) @logger.info("Updating the \"#{slug}\" Web API on the \"#{kapp_slug}\" Kapp.") put("#{@api_url}/kapps/#{kapp_slug}/webApis/#{slug}", body, headers) end |
#update_kapp_webhook_job(kapp_slug, job_id, job_properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update kapp webhook job
136 137 138 139 |
# File 'lib/kinetic_sdk/core/lib/webhook_jobs.rb', line 136 def update_kapp_webhook_job(kapp_slug, job_id, job_properties={}, headers=default_headers) @logger.info("Updating the webhook job #{job_id} in the \"#{kapp_slug}\" Kapp") put("#{@api_url}/kapps/#{kapp_slug}/webhookJobs/#{job_id}", job_properties, headers) end |
#update_oauth_client(client_id, options, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update an OAuth client
31 32 33 34 |
# File 'lib/kinetic_sdk/core/lib/oauth.rb', line 31 def update_oauth_client(client_id, , headers=default_headers) @logger.info("Updating the \"#{client_id}\" OAuth client") put("#{@api_url}/oauthClients/#{encode(client_id)}", , headers) end |
#update_security_policy_definition(kapp_slug, name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Kapp security policy definition
151 152 153 154 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 151 def update_security_policy_definition(kapp_slug, name, body, headers=default_headers) @logger.info("Updating Security Policy Definition \"#{name}\" on the \"#{kapp_slug}\" kapp.") put("#{@api_url}/kapps/#{kapp_slug}/securityPolicyDefinitions/#{encode(name)}", body, headers) end |
#update_space(body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a space
52 53 54 55 |
# File 'lib/kinetic_sdk/core/lib/space.rb', line 52 def update_space(body={}, headers=default_headers) @logger.info("Updating Space \"#{@space_slug}\"") put("#{@api_url}/space", body, headers) end |
#update_space_attribute_definition(name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a space attribute definition
119 120 121 122 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 119 def update_space_attribute_definition(name, body, headers=default_headers) @logger.info("Updating the \"#{name}\" Space Attribute Definition.") put("#{@api_url}/spaceAttributeDefinitions/#{encode(name)}",body, headers) end |
#update_space_in_system(slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update the space (System API)
54 55 56 57 |
# File 'lib/kinetic_sdk/core/lib/system_api.rb', line 54 def update_space_in_system(slug, body, headers=default_headers) @logger.info("Updating Space \"#{slug}\"") put("#{@api_url}/spaces/#{slug}", body, headers) end |
#update_space_security_policy_definition(name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Space security policy definition
71 72 73 74 |
# File 'lib/kinetic_sdk/core/lib/security_policy_definitions.rb', line 71 def update_space_security_policy_definition(name, body, headers=default_headers) @logger.info("Updating Space Security Policy Definition \"#{name}\"") put("#{@api_url}/securityPolicyDefinitions/#{encode(name)}", body, headers) end |
#update_space_webapi(slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Web API on the Space
All of the Web API properties are optional. Only the properties provided in the Hash will be updated, the other properties will retain their current values.
98 99 100 101 |
# File 'lib/kinetic_sdk/core/lib/webapis.rb', line 98 def update_space_webapi(slug, body, headers=default_headers) @logger.info("Updating the \"#{slug}\" Web API on the Space.") put("#{@api_url}/webApis/#{slug}", body, headers) end |
#update_space_webhook_job(job_id, job_properties = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update space webhook job
108 109 110 111 |
# File 'lib/kinetic_sdk/core/lib/webhook_jobs.rb', line 108 def update_space_webhook_job(job_id, job_properties={}, headers=default_headers) @logger.info("Updating the webhook job #{job_id} in Space") put("#{@api_url}/webhookJobs/#{job_id}", job_properties, headers) end |
#update_submission(submission_id, body = {}, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a submission
223 224 225 226 |
# File 'lib/kinetic_sdk/core/lib/submissions.rb', line 223 def update_submission(submission_id, body={}, headers=default_headers) @logger.info("Updating Submission \"#{submission_id}\"") put("#{@api_url}/submissions/#{encode(submission_id)}", body, headers) end |
#update_task_component(component_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update Task Component
23 24 25 26 27 |
# File 'lib/kinetic_sdk/core/lib/platform_components.rb', line 23 def update_task_component(component_properties, headers = default_headers) raise StandardError.new "Task Component properties is not valid, must be a Hash." unless component_properties.is_a? Hash @logger.info("Updating Task Platform Component") put("#{@api_url}/platformComponents/task", component_properties, headers) end |
#update_team(team_slug, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a Team
131 132 133 134 135 |
# File 'lib/kinetic_sdk/core/lib/teams.rb', line 131 def update_team(team_slug, body, headers=default_headers) raise StandardError.new "Team properties is not valid, must be a Hash." unless body.is_a? Hash @logger.info("Updating Team #{team_slug}") put("#{@api_url}/teams/#{team_slug}", body, headers) end |
#update_team_attribute_definition(name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a team attribute definition
179 180 181 182 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 179 def update_team_attribute_definition(name, body, headers=default_headers) @logger.info("Updating the \"#{name}\" Team Attribute Definition.") put("#{@api_url}/teamAttributeDefinitions/#{encode(name)}",body, headers) end |
#update_user(username, user, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a user in a space.
If the SDK was initialized as a System user, the space_slug property must be provided in the user hash.
If the SDK was initialized as a Space user, the space_slug property is ignored.
Example
update_user("xyz", {
"space_slug" => "bar",
"username" => "foo",
"password" => "bar",
"displayName" => "Foo",
"email" => "[email protected]",
"enabled" => true,
"preferredLocale" => "en_US",
"spaceAdmin" => false
})
221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/kinetic_sdk/core/lib/users.rb', line 221 def update_user(username, user, headers=default_headers) if !@space_slug.nil? @logger.info("Updating user \"#{username}\" for Space \"#{@space_slug}\" as system user.") put("#{@api_url}/users/#{encode(username)}", user, headers) elsif !user['space_slug'].nil? space_slug = user.delete('space_slug') @logger.info("Updating user \"#{username}\" for Space \"#{space_slug}\".") put("#{@api_url}/spaces/#{space_slug}/users/#{encode(username)}", user, headers) else raise StandardError.new "The space slug must be supplied to update the user." end end |
#update_user_attribute_definition(name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a user attribute definition
239 240 241 242 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 239 def update_user_attribute_definition(name, body, headers=default_headers) @logger.info("Updating the \"#{name}\" User Attribute Definition.") put("#{@api_url}/userAttributeDefinitions/#{encode(name)}",body, headers) end |
#update_user_profile_attribute_definition(name, body, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a user profile attribute definition
299 300 301 302 |
# File 'lib/kinetic_sdk/core/lib/attribute_definitions.rb', line 299 def update_user_profile_attribute_definition(name, body, headers=default_headers) @logger.info("Updating the \"#{name}\" User Profile Attribute Definition.") put("#{@api_url}/userProfileAttributeDefinitions/#{encode(name)}",body, headers) end |
#update_webhook_on_kapp(kapp_slug, name, webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a webhook on a Kapp (either a Form or Submission webhook)
All of the webhook properties are optional. Only the properties provided in the Hash will be updated, the other properties will retain their current values.
165 166 167 168 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 165 def update_webhook_on_kapp(kapp_slug, name, webhook_properties, headers=default_headers) @logger.info("Updating the \"#{name}\" webhook on the \"#{kapp_slug}\" Kapp") put("#{@api_url}/kapps/#{kapp_slug}/webhooks/#{encode(name)}", webhook_properties, headers) end |
#update_webhook_on_space(name, webhook_properties, headers = default_headers) ⇒ KineticSdk::Utils::KineticHttpResponse
Update a webhook on a Space (either a Space or User webhook)
All of the webhook properties are optional. Only the properties provided in the Hash will be updated, the other properties will retain their current values.
186 187 188 189 |
# File 'lib/kinetic_sdk/core/lib/webhooks.rb', line 186 def update_webhook_on_space(name, webhook_properties, headers=default_headers) @logger.info("Updating the \"#{name}\" webhook on the Space") put("#{@api_url}/webhooks/#{encode(name)}", webhook_properties, headers) end |