Skip to main content

Resource Models

Fix has a unified data model (UDM) with support for static typing and inheritance.

Supported Resource Types

resource Base Kind

Every resource collected by Fix has the resource base kind, which defines properties common to all resources.

Base Resource Data Model

PropertyDescription
idResource identifier (does not need to be unique across all resources)
nameCloud-specific resource name
kindResource kind in Fix

Example
tagsKey-value string pairs held in a dictionary
ctimeResource creation time

note
Fix uses the time this resource was first discovered when the cloud provider does not provide this value.
atimeLast accessed time as of the most recent resource collection

note
Fix attempts to synthesize the last access timestamp when the cloud provider does not provide this value.
mtimeLast modified time as of the most recent resource collection

note
Fix attempts to synthesize the last modified timestamp when the cloud provider does not provide this value.

Resource Kinds

Complex and Simple Kinds

We have looked at complex kinds so far: a complex kind has a name and a set of properties.

Each property has a name and also a kind. The kind of such a property can be a complex or a simple kind.

There are several simple kinds that are available in Fix out of the box:

KindJSON TypeExample
stringstring"foo", "bla", "some long string"
booleanbooleantrue, false
nullnullnull
int32number1234, 4321, -123
int64number1234, 4321, -123
floatnumber12, 12.1234, -23.123
doublenumber12, 12.1234, -23.123
datetimestring"2021-03-15T23:04:56Z", "2021-03-15", "-3d"
datestring"2021-03-15", "03/15/2021", "-3d"
anyany of the above *null, true, "test", 123, -12.43

* The special type any is only used in scenarios where the type is really not known and could be anything. Coercing is not possible for such a type.

Since Fix uses JSON in order to exchange data, all the different simple types have to be expressed as simple type.

Fix also introduces some additional simple types like datetime or date. The reason for this is the ability to coerce proper values from values given to Fix.

Example

Assume a user wants to query a resource by creation time.

According to the model, we would need to filter for the ctime property. Since Fix knows the type ctime (which is of kind datetime), it can interpret the value given by the user.

ctime < "2018-09-28"

ctime is of type datetime. datetime values in Fix are always stored as ISO-formatted datetime strings, so "2018-09-28" is coerced into a valid datetime. Depending on the server time, the value would be evaluated to something like:

ctime < "2021-09-28T22:00:00Z"

This also allows the usage of relative times. If we want to query resources that have been created in the last 3 days, we could express this with a relative datetime string:

ctime > "-3d"

This translates "-3d" using the current server time into a valid datetime string.