Deployed Solutions API
This API is currently in public preview.
The Deployed Solutions API lets you add, manage, and run solutions that you indicate are deployed, so you can monitor their automation metrics in the Deployed Solutions app.
To authorize your request, the Deployed Solutions API requires an Authorization
header
with the value Bearer XYZ
, where XYZ is your access token. See API authorization.
In this document, URL_BASE
refers to the root URL of your Instabase instance, such as https://www.instabase.com
.
import requests
url_base = "https://www.instabase.com"
deployed_solutions_api_url = url_base + '/api/v2/solutions/deployed'
Deploy a solution
Method | Syntax |
---|---|
POST | URL_BASE/api/v2/solutions/deployed |
Description
Use this API to deploy an .ibsolution
file to production.
Request parameters
Parameter | Type | Description | Values |
---|---|---|---|
solution_path |
string | The path to the solution to deploy. | Path of a valid .ibsolution file. |
To package a flow binary into an .ibsolution
, use the Create Solution API.
Response schema
Key | Description |
---|---|
job_id |
The unique identifier for the deploy job. |
You can check the status of the deploy job with the Job API. The type of the job is async
.
Get solutions
Method | Syntax |
---|---|
GET | URL_BASE/api/v2/solutions/deployed |
Description
Get a list of deployed solutions.
Request parameters
Parameters are required unless marked as optional.
Parameter | Type | Description | Values |
---|---|---|---|
limit |
integer | Optional. The maximum number of deployed solutions to return. | Jobs limit per response (default 20). |
offset |
integer | Optional. Initial deployed solution start index. Used for pagination with limit. | Starting index (default 0). |
state |
string | The state of deployed solutions to return. | ACTIVE , INACTIVE |
name |
string | Optional. The name of deployed solutions to return. | Any string. Solutions is returned only if there is a matching solution name. |
Response schema
Key | Type | Description | Value |
---|---|---|---|
has_more |
List [bool] | Whether there are more solutions to list on a later page. | [true] , [false] |
next_offset |
List [int] | The value to use for the offset of a future request to get the next page. |
[-1] if has_more is false. |
solutions |
list | The list of returned solutions. | |
solutions/id |
string | The unique ID of the solution. | A valid UUID. |
solutions/name |
string | The name of the solution. | |
solutions/version |
string | The version of the solution . | |
solutions/createdAtMs |
int | When the solution was created. | Unix timestamp in epoch milliseconds. |
solutions/updatedAtMs |
int | When the solution was last updated. | Unix timestamp in epoch milliseconds. |
solutions/summary |
str | Short description of the solution. | |
solutions/state |
str | Current state of the solution. | ACTIVE , INACTIVE |
solutions/author |
str | The username of the user who published the solution. |
Example
Request
import json, requests, time
solution_name = 'My Solution'
url = url_base + f'/api/v2/solutions/deployed?state=ACTIVE&name={solution_name}'
headers = {
'Authorization': 'Bearer {0}'.format(token)
}
still_running = True
while still_running:
r = requests.get(url, headers=headers)
resp = json.loads(r.content)
still_running = (resp['status'] == 'OK') and (resp['state'] != 'DONE')
print('still running')
time.sleep(1)
print('Request finished!')
print(resp)
Response
{
"has_more": [false],
"next_offset": [-1],
"solutions": [
{
"id": "dummy-uuid-1",
"name": "My Solution",
"version": "0.0.1",
"createdAtMs": 12345,
"updatedAtMs": 12345,
"summary": "A short description",
"state": "ACTIVE",
"author": "user1"
},
{
"id": "dummy-uuid-2",
"name": "My Solution",
"version": "0.0.2",
"createdAtMs": 67890,
"updatedAtMs": 67890,
"summary": "A short description",
"state": "ACTIVE",
"author": "user2"
}
]
}
Get single solution API
Method | Syntax |
---|---|
GET | URL_BASE/api/v2/solutions/deployed/<solution-uuid> |
Description
Get more detailed information about a single solution. This API takes no parameters.
Response schema
Key | Type | Description | Value |
---|---|---|---|
solution |
dict | The returned solution. | |
solution/id |
string | The unique ID of the solution. | A valid UUID. |
solution/name |
string | The name of the solution. | |
solution/version |
string | The version of the solution. | |
solution/createdAtMs |
int | When the solution was created. | Unix timestamp in epoch milliseconds. |
solution/updatedAtMs |
int | When the solution was last updated. | Unix timestamp in epoch milliseconds. |
solution/summary |
str | Short description of the solution. | |
solution/description |
str | Long description of the solution. | |
solution/state |
str | Current state of the solution. | ACTIVE , INACTIVE |
solution/author |
str | The username of the user who published the solution. | |
solution/metadata |
str | Serialized JSON metadata for the solution. | Currently the metadata does not contain any more information than is provided within the base solution object. |
Example
Request
import json, requests, time
solution_name = 'My Solution'
solution_uuid = 'uuid_from_get_solutions_response'
url = url_base + f'/api/v2/solutions/deployed/{solution_uuid}'
headers = {
'Authorization': 'Bearer {0}'.format(token)
}
still_running = True
while still_running:
r = requests.get(url, headers=headers)
resp = json.loads(r.content)
still_running = (resp['status'] == 'OK') and (resp['state'] != 'DONE')
print('still running')
time.sleep(1)
print('Request finished!')
print(resp)
Response
{
"solution": {
"id": "dummy-uuid-1",
"name": "My Solution",
"version": "0.0.1",
"createdAtMs": 12345,
"updatedAtMs": 12345,
"summary": "A short description",
"description": "A longer description",
"state": "ACTIVE",
"author": "user1",
"metadata" "{\"authors\": [\"user1\"]}"
},
}
Run a solution
Method | Syntax |
---|---|
POST | URL_BASE/api/v2/solutions/deployed/<solution-uuid>/run |
Description
This request runs the specified deployed solution.
Request parameters
Parameter | Type | Description | Values |
---|---|---|---|
input_dir |
string | The path to the input folder. | Path of a valid directory. |
output_dir |
string | Optional. The path to the output folder. | Path of a valid directory. If left empty, an output directory is created within the input folder. |
job_id |
string | Optional. The job ID for this job. If omitted, a job ID is generated automatically. The job ID must be no more than 50 characters long. | |
settings |
dict | Settings for the run. | Format is identical to the settings for running a flow binary. |
Response schema
Key | Type | Description |
---|---|---|
job_id |
string | The id of the triggered job. |
Example
Request
import json, requests, time
solution_name = 'My Solution'
solution_uuid = 'uuid_from_get_solutions_response'
url = url_base + f'/api/v2/solutions/deployed/{solution_uuid}/run'
headers = {
'Authorization': 'Bearer {0}'.format(token)
}
still_running = True
while still_running:
r = requests.post(url, headers=headers)
resp = json.loads(r.content)
still_running = (resp['status'] == 'OK') and (resp['state'] != 'DONE')
print('still waiting')
time.sleep(1)
print('Run has started!')
print(resp)
Response
{
"job_id": "dummy-job-id"
}
Delete a solution
Method | Syntax |
---|---|
DELETE | URL_BASE/api/v2/solutions/deployed/<solution-uuid> |
Description
This request deletes the specified deployed solution via an asynchronous job. This API takes no parameters.
Response schema
Key | Type | Description |
---|---|---|
job_id |
string | The unique identifier for the deletion job. |
You can check the status of the deletion job with the Status API. The type of the job is async
.