class LosantRest::Application
Class containing all the actions for the Application
Resource
Public Class Methods
# File lib/losant_rest/application.rb, line 30 def initialize(client) @client = client end
Public Instance Methods
Add resources to an application via an application template
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, application.*, or application.applyTemplate.
Parameters:
-
{string} applicationId - ID of the associated application
-
{hash} options - Object containing template import options (api.losant.com/#/definitions/applicationApplyTemplatePatch)
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - Updated application information (api.losant.com/#/definitions/application)
-
202 - If a job was enqueued for the resources to be imported into the application (api.losant.com/#/definitions/jobEnqueuedResult)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application is not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 57 def apply_template(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) raise ArgumentError.new("options is required") unless params.has_key?(:options) body = params[:options] if params.has_key?(:options) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/applyTemplate" @client.request( method: :patch, path: path, query: query_params, headers: headers, body: body) end
Returns success when a job has been enqueued to archive this application's device data for a given day
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, application.*, or application.archiveData.
Parameters:
-
{string} applicationId - ID of the associated application
-
{string} date - The date to archive data (ms since epoch), it must be within the archive time range older than 31 days and newer than the organizations dataTTL
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - Enqueued a job to archive this applications device data (api.losant.com/#/definitions/success)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 104 def archive_data(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) raise ArgumentError.new("date is required") unless params.has_key?(:date) query_params[:date] = params[:date] if params.has_key?(:date) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/archiveData" @client.request( method: :get, path: path, query: query_params, headers: headers, body: body) end
Returns success when a job has been enqueued to backfill all current data to its archive
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, application.*, or application.backfillArchiveData.
Parameters:
-
{string} applicationId - ID of the associated application
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - Enqueued a job to backfill device data to this application archive location (api.losant.com/#/definitions/success)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 150 def backfill_archive_data(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/backfillArchiveData" @client.request( method: :get, path: path, query: query_params, headers: headers, body: body) end
Copy an application into a new application
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, application.*, or application.clone.
Parameters:
-
{string} applicationId - ID of the associated application
-
{hash} options - Object containing optional clone fields (api.losant.com/#/definitions/applicationClonePost)
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - if dryRun is set and successful, then return success (api.losant.com/#/definitions/applicationCloneDryRunResult)
-
201 - If application was successfully cloned (api.losant.com/#/definitions/applicationCreationByTemplateResult)
-
202 - If application was enqueued to be cloned (api.losant.com/#/definitions/jobEnqueuedResult)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application is not found (api.losant.com/#/definitions/error)
-
422 - Error if too many validation errors occurred on other resources (api.losant.com/#/definitions/validationErrors)
# File lib/losant_rest/application.rb, line 198 def clone(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) body = params[:options] if params.has_key?(:options) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/clone" @client.request( method: :post, path: path, query: query_params, headers: headers, body: body) end
Deletes an application
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, application.*, or application.delete.
Parameters:
-
{string} applicationId - ID of the associated application
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - If application was successfully deleted (api.losant.com/#/definitions/success)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 243 def delete(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}" @client.request( method: :delete, path: path, query: query_params, headers: headers, body: body) end
Export an application and all of its resources
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, application.*, or application.export.
Parameters:
-
{string} applicationId - ID of the associated application
-
{hash} options - Object containing export application options (api.losant.com/#/definitions/applicationExportPost)
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - a url to download the zip of exported resources (api.losant.com/#/definitions/applicationExportResult)
-
202 - If application was enqueued to be exported (api.losant.com/#/definitions/jobEnqueuedResult)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application is not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 289 def export(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) raise ArgumentError.new("options is required") unless params.has_key?(:options) body = params[:options] if params.has_key?(:options) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/export" @client.request( method: :post, path: path, query: query_params, headers: headers, body: body) end
Returns success when a job has been enqueued to archive all selected data tables
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, application.*, or application.fullDataTablesArchive.
Parameters:
-
{string} applicationId - ID of the associated application
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - Enqueued a job to archive all selected data tables of this application archive location (api.losant.com/#/definitions/success)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 335 def full_data_tables_archive(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/fullDataTablesArchive" @client.request( method: :get, path: path, query: query_params, headers: headers, body: body) end
Returns success when a job has been enqueued to archive all current events
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, application.*, or application.fullEventsArchive.
Parameters:
-
{string} applicationId - ID of the associated application
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - Enqueued a job to archive all events to this application archive location (api.losant.com/#/definitions/success)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 379 def full_events_archive(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/fullEventsArchive" @client.request( method: :get, path: path, query: query_params, headers: headers, body: body) end
Retrieves information on an application
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, application.*, or application.get.
Parameters:
-
{string} applicationId - ID of the associated application
-
{string} summaryExclude - Comma-separated list of summary fields to exclude from application summary
-
{string} summaryInclude - Comma-separated list of summary fields to include in application summary
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 -
Application
information (api.losant.com/#/definitions/application)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 425 def get(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) query_params[:summaryExclude] = params[:summaryExclude] if params.has_key?(:summaryExclude) query_params[:summaryInclude] = params[:summaryInclude] if params.has_key?(:summaryInclude) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}" @client.request( method: :get, path: path, query: query_params, headers: headers, body: body) end
Updates an application global at the given key
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.
Parameters:
-
{string} applicationId - ID of the associated application
-
{hash} globals - Array of objects containing new application global information (api.losant.com/#/definitions/applicationGlobalPatch)
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - Updated application information (api.losant.com/#/definitions/application)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 472 def globals(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) raise ArgumentError.new("globals is required") unless params.has_key?(:globals) body = params[:globals] if params.has_key?(:globals) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/globals" @client.request( method: :patch, path: path, query: query_params, headers: headers, body: body) end
Publishes the given message to the given MQTT topic
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, application.*, or application.mqttPublishMessage.
Parameters:
-
{string} applicationId - ID of the associated application
-
{hash} payload - Object containing topic and message (api.losant.com/#/definitions/mqttPublishBody)
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - Message successfully published (api.losant.com/#/definitions/success)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 519 def mqtt_publish_message(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) raise ArgumentError.new("payload is required") unless params.has_key?(:payload) body = params[:payload] if params.has_key?(:payload) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/mqttPublishMessage" @client.request( method: :post, path: path, query: query_params, headers: headers, body: body) end
Updates information about an application
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.
Parameters:
-
{string} applicationId - ID of the associated application
-
{hash} application - Object containing new application properties (api.losant.com/#/definitions/applicationPatch)
-
{string} summaryExclude - Comma-separated list of summary fields to exclude from application summary
-
{string} summaryInclude - Comma-separated list of summary fields to include in application summary
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - Updated application information (api.losant.com/#/definitions/application)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 568 def patch(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) raise ArgumentError.new("application is required") unless params.has_key?(:application) body = params[:application] if params.has_key?(:application) query_params[:summaryExclude] = params[:summaryExclude] if params.has_key?(:summaryExclude) query_params[:summaryInclude] = params[:summaryInclude] if params.has_key?(:summaryInclude) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}" @client.request( method: :patch, path: path, query: query_params, headers: headers, body: body) end
Returns payload counts for the time range specified for this application
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.payloadCounts.
Parameters:
-
{string} applicationId - ID of the associated application
-
{string} start - Start of range for payload count query (ms since epoch)
-
{string} end - End of range for payload count query (ms since epoch)
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - Payload counts, by type and source (api.losant.com/#/definitions/payloadStats)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 618 def payload_counts(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) query_params[:start] = params[:start] if params.has_key?(:start) query_params[:end] = params[:end] if params.has_key?(:end) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/payloadCounts" @client.request( method: :get, path: path, query: query_params, headers: headers, body: body) end
Get the current application readme information
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, application.*, or application.get.
Parameters:
-
{string} applicationId - ID of the associated application
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - The application readme information (api.losant.com/#/definitions/applicationReadme)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 664 def readme(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/readme" @client.request( method: :get, path: path, query: query_params, headers: headers, body: body) end
Update the current application readme information
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.
Parameters:
-
{string} applicationId - ID of the associated application
-
{hash} readme - Object containing new readme information (api.losant.com/#/definitions/applicationReadmePatch)
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - Updated readme information (api.losant.com/#/definitions/applicationReadme)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application was not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 709 def readme_patch(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) raise ArgumentError.new("readme is required") unless params.has_key?(:readme) body = params[:readme] if params.has_key?(:readme) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/readme" @client.request( method: :patch, path: path, query: query_params, headers: headers, body: body) end
Search across an application's resources by target identifier
Authentication: The client must be configured with a valid api access token to call this action. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.search.
Parameters:
-
{string} applicationId - ID of the associated application
-
{string} filter - The partial resource name being searched for
-
{string} losantdomain - Domain scope of request (rarely needed)
-
{boolean} _actions - Return resource actions in response
-
{boolean} _links - Return resource link in response
-
{boolean} _embedded - Return embedded resources in response
Responses:
-
200 - An array of resource ids, names, descriptions, and types matching the search query (api.losant.com/#/definitions/applicationSearchResult)
Errors:
-
400 - Error if malformed request (api.losant.com/#/definitions/error)
-
404 - Error if application is not found (api.losant.com/#/definitions/error)
# File lib/losant_rest/application.rb, line 756 def search(params = {}) params = Utils.symbolize_hash_keys(params) query_params = { _actions: false, _links: true, _embedded: true } headers = {} body = nil raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId) raise ArgumentError.new("filter is required") unless params.has_key?(:filter) query_params[:filter] = params[:filter] if params.has_key?(:filter) headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain) query_params[:_actions] = params[:_actions] if params.has_key?(:_actions) query_params[:_links] = params[:_links] if params.has_key?(:_links) query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded) path = "/applications/#{params[:applicationId]}/search" @client.request( method: :get, path: path, query: query_params, headers: headers, body: body) end