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
Press "+ Create" and select the type of record you like to create.
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_apidef 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')
Listing
Via the User Interface
- Switch to the workspace dashboard by clicking the Cloudomation logo in the menu.
- 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
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_apidef handler(system: flow_api.System, this: flow_api.Execution):for record in system.<record-type>s():# do something with "record"# for example:for webhook in system.webhooks():webhook.save(is_enabled=False)# you can use filter expressionsfor webhook in system.webhooks(filter={'field': 'is_enabled','op': 'eq','value': True,}):webhook.save(is_enabled=False)
Reading
Via the User Interface
- Enter the name or parts of the name of the record in the quick search bar
- Click on the record in the quick search results
- 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
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_apidef 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
- Open the record you want to modify
- Change any field of the record
- 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_apidef handler(system: flow_api.System, this: flow_api.Execution):system.user('myself').save(description='This is me')
Deleting
Via the User Interface
- Open the record you want to delete
- 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_apidef handler(system: flow_api.System, this: flow_api.Execution):system.file('document.pdf').delete()