Solution Configuration Service

This service provides access to the active solution context information and usage.

Operations

Events

Operations


getParameters

Get the services configuration parameters.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
service string Indicates the service name

Responses

The services configuration parameters

Content: [ object ]

Name Type Description
parameters object The service configuration parameters elements.
Failed to get the services configuration.

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

local parameters = Config.getParameters({service = 'content'})
print(parameters)


listServices

Get the list of services configured for this solution. This is useful to see what additional services has been added from scripting logic. As Murano Product are exposed as services added to the solution this function can be used to list available Products.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
type "core", "exosite", "exchange", "product", "application" The type filter to indicate the type of service. - core: Native Murano services - exosite: Additional services provided by Exosite and available on Exchange marketplace - exchange: Service available on Exchange marketplace and provided by 3rd party - product: A Murano product - application: A Murano solution exposed through the Interface Service

Responses

Returns the list of services configuration within this solution.

Content: [ object ] List of services configuration

Name Type Description
id string(uuid) Unique Id for the service configuration.
type "core", "exosite", "exchange", "product", "application" The type filter to indicate the type of service. - core: Native Murano services - exosite: Additional services provided by Exosite and available on Exchange marketplace - exchange: Service available on Exchange marketplace and provided by 3rd party - product: Murano product - application: A Murano solution exposed through the Interface Service
service string Service alias reference.
script_key string Scripting key reference, unique per solution.
Failed to get the services configuration.

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

-- Get all Product services linked to this solution
local products = Config.listServices({type = "product"})
local results = {}
for i, product in ipairs(products) do
  -- get product details
  results[product.script_key] = murano.service_call(product.service, "getGatewaySettings")
end
return results


setParameters

Set the services configuration parameters.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
service string Indicates the service name
* any Any other properties are accepted.

Responses

Successfully updated

Content: nil

Failed to get the services configuration.

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

local result = Config.setParameters({service = 'content', parameters = {p1=1234}})
print(result)


solution

Get the solution information.

Responses

Returns the solution data.

Content: object Represents a Murano solution data

Name Type Description
id ^[a-zA-Z0-9]+$ Unique reference of the solution
name string {..100} User defined custom name
domain ^[a-zA-Z0-9\_\-\.]+$ Solution API domain name used by the Webservice core service.
(deprecated) products [ ^[a-zA-Z0-9\_\-\.]+$ ] The list of products from legacy Device service associated with this solution.
In most case you probably are using Murano Product attached to your solution as services. You then want to use the 'listServices' operation.
business_id ^[a-zA-Z0-9\_\-]+$ Customer Account ID
Failed to retrieve the data.

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

local solution = Config.solution()
print(solution.id)


usage

Get the solution usage and limitation by services.

Arguments

parameters - object - Object containing service call parameters.
Name Type Description
services [ string {1..100} ] {..10} List of services to return metrics from.

Responses

Returns the solution usage.

Content: object Current solution usage. A map of serviceAlias (e.g., email or webservice).

Name Type Description
serviceAlias object Current usage & quota for this particular service.
serviceAlias.quota object Current quota for this service.
serviceAlias.quota.calls_daily number Service call limitation per day.
serviceAlias.quota.other_quota number Other Service specific limitation. See http://docs.exosite.com/murano/services for more information on service limitations.
serviceAlias.quota.calls_monthly number Service call limitation per month.
serviceAlias.usage object Current usage for this service.
serviceAlias.usage.calls_daily number Today's service calls counts.
serviceAlias.usage.calls_total number Total service calls counts for this solution.
serviceAlias.usage.other_metric number Other service specific metrics. See http://docs.exosite.com/murano/services for more information on service available metrics and quota.
serviceAlias.usage.calls_monthly number Service calls counts so far this month.
serviceAlias.service ^[a-z][a-z0-9]+$ Unique name used as service reference in scripts.
Failed to get the current usage.

Content: object Error response

Name Type Description
type string Error type
error string Error message
status integer Response code

Example

local usage = Config.usage({services={"keystore", "tsdb"}})
local total_services_calls_today = 0
for alias, serviceinfo in pairs(usage) do
  if serviceinfo.usage.calls_daily ~= nil then
    total_services_calls_today = total_services_calls_today + serviceinfo.usage.calls_daily
  end
end
print(total_services_calls_today)

Events


status

Event triggered by Murano UI to provide information related to solution health.

Arguments

service - object - Query data (TBD)
Name Type Description

Responses

The service status trigger response object.

Content: object

Name Type Description
* any Any other properties are accepted.

Example

function handle_config_status (service)

 -- Your logic comes here 

end

service

Notification indicating a service configuration has changed withing the solution.

Arguments

service - object - The list of services configured by the user within this solution.
Name Type Description
id string(uuid) Unique Id for the service configuration.
type "core", "exosite", "exchange", "product", "application" The type filter to indicate the type of service. - core: Native Murano services - exosite: Additional services provided by Exosite and available on Exchange marketplace - exchange: Service available on Exchange marketplace and provided by 3rd party - product: A Murano product - application: A Murano solution exposed through the Interface Service
action "added", "updated", "removed" Action of service config changed.
service string Service alias reference.
script_key string Scripting key reference, unique per solution.

Example

print("Service " .. service.service .. "(" .. service.script_key .. ") has been " .. service.action)


fallback

A generic event which gets executed as fallback if the specific handler is not defined. This is useful for applications requiring to handle dynamic products/service to be added at run-time. To know what service & event is being triggered, used the execution 'context' information. Eg. context.service, context.event, context.service_type (product, application, ..) More information on http://docs.exosite.com/articles/working-with-apis/#context Event argument 'event' contains the data from the original event.

Arguments

event - object - The event data as provided by the service.
Name Type Description

Example

print("Fallback on event " .. context.service .. "." .. context.event)