Skip to main content

Accessing and Manipulating Records

All content that is stored in Cloudomation is stored in the form of records. This includes flow scripts, files, messages, users, executions and anything else you or the system create on the platform. All records can be accessed and manipulated with the same methods.

This section describes three methods for creating, accessing, manipulating, and deleting records. More detailed information can be found in the REST API documentation, and the Flow-API documentation.

Creating

Via the User Interface

  1. Press "+ Create" and select the type of record you like to create.

    The create button

  2. The new record is opened in the main section.

Via the REST API

Send a POST request to:

https://<your-workspace-name>.cloudomation.com/api/latest/<record-type>

The JSON payload should contain all fields you wish to set.

Via the Cloudomation Flow-API

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution):
system.<record-type>('name of the new record').save()
# for example:
system.setting('my-new-setting').save()
# you can set fields of the new record:
system.setting('my-new-setting').save(value=42, description='some number')

Please note, that .save() is necessary for the record to be created.

danger

Cloudomation resource names must not start or end with a blank. Cloudomation will implicitly remove any leading or trailing blanks from resource names.

Listing

Via the User Interface

  1. Switch to the workspace dashboard by clicking the Cloudomation logo in the menu.
  2. Scroll down to the resource tabs.

Via the REST API

Send a GET request to:

$ curl https://<your-workspace-name>.cloudomation.com/api/latest/<record-type>

You can use filter expressions:

$ curl 'https://<your-workspace-name>.cloudomation.com/api/latest/<record-type>?filter={"field":"name","op":"like","value":"my-%"}'

Via the Cloudomation Flow-API

danger

Listing via the Flow-API will return all records which exist when the listing starts. This means when records are created during the listing, they will not be included in a currently running listing. Also, when records are deleted during the listing, they are still returned. Make sure to handle the ResourceNotFoundError while iterating over a listing result.

Use the following method:

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution):
# for record in system.<record-type>s():
# # do something with "record"

# for example:
this.log(all_webhooks=list(system.webhooks()))
# you can use filter expressions
this.log(all_enabled_webhooks=list(system.webhooks(filter_={
'field': 'is_enabled',
'op': 'eq',
'value': 'True',
})))
info

The default limit to how many records are returned is 1000. Therefore, if you have more than 1000 records of a specific record type you need to set the limit higher to list all records.

The parameters for system.<record-type>s are as follows:

ParameterDescriptionDefault value
fieldsWhich fields to return (string of comma-separated field-names).None
limitHow many records to return.1000
offsetHow many records to skip before returning records.0
filter_Filter to limit the results.None
orderHow to order the records before applying limit and offset (string of comma-separated field-names).None
allow_normalIf to include normal records in the response (That is records which are neither archived nor deleted).True
allow_archivedIf to include archived records in the response.False
allow_deletedIf to include deleted records in the response.False

filter_

The filter is a dictionary consisting of 3 key-value pairs:

  • 'field': the field to match against
  • 'op': the operation used for matching, possible values: eq, neq, like, notlike, lt, gt, lte, gte, set, unset
  • 'value': match to this value

Reading

Via the User Interface

  1. Enter the name or parts of the name of the record in the quick search bar.
  2. Click on the record in the quick search results.
  3. The record is opened in the main section.

Via the REST API

Send a GET request to

https://<your-workspace-name>.cloudomation.com/api/latest/<record-type>/<record-id>

You can also access resources by name:

Send a GET request to:

https://<your-workspace-name>.cloudomation.com/api/latest/<resource-type>/<resource-name>?by=name
note

See the records reference to learn about the different resources and activities

You can specify the fields you are interested in:

https://<your-workspace-name>.cloudomation.com/api/latest/<record-type>/<record-id>?fields=id,name,description

Via the Cloudomation Flow API

Use the following method:

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution):
system.<record-type>('name of the record').get('name of field to read')
# for example:
description = system.flow('my-flow').get('description')
# you can read several fields at once:
created_at, modified_at = system.flow('my-flow').get('created_at', 'modified_at')

Updating

Via the User Interface

  1. Open the record you want to modify.
  2. Change any field of the record.
  3. Press the "save" button.

Via the REST API

Send a PATCH request to:

https://<your-workspace-name>.cloudomation.com/api/latest/<record-type>/<record-id>

The JSON payload should contain all fields you wish to update.

Via the Cloudomation Flow API

Use the following method:

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution):
system.user('<my-user-name>').save(description='This is me')

Deleting

Via the User Interface

  1. Open the record you want to delete.
  2. Press the "delete" button.

Via the REST API

Send a DELETE request to:

https://<your-workspace-name>.cloudomation.com/api/latest/<record-type>/<record-id>

Via the Cloudomation Flow API

Use the following method:

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution):
system.file('document.pdf').delete()
danger

Deleting Execution records is executed asynchronous! Therefore, Execution records may still exist after the delete() method returns.

Learn More

Records reference
Authentication
Git Integration