Param¶
A Param defines metadata about a parameter that can be stored on machines, profiles, stages, and other DRP objects. It is the fundamental building block of DRP's configuration system, providing a named, typed, and optionally validated key that can hold arbitrary JSON values.
Each Param carries a JSON Schema (draft v4) that enforces type constraints on the values stored under its name. When a value is set on a machine or profile, DRP validates it against the Param's schema before accepting the change. Params also support a default value defined within the schema, which is used when no explicit value is found in the parameter resolution chain.
The Secure flag marks a Param as containing sensitive data. When set, API interactions use SecureData values, ensuring that secrets such as passwords or tokens are handled appropriately and not exposed in plain text through normal API responses.
Params include Description and Documentation fields for human-readable information about the parameter's purpose and usage. The Meta field on a Param controls UX rendering behavior, such as displaying values as passwords, providing copy-to-clipboard buttons, or rendering links. See Common Object Metadata for details on Param.Meta options.
Params are used throughout the system: they are set on Profile objects, directly on Machine objects, and declared as required or optional by Tasks, Stage, and BootEnv objects.
Fields¶
| Field | Definition |
|---|---|
| Description | Description is a string for providing a simple description |
| Documentation | Documentation is a string for providing additional in depth information. |
| Meta | Meta contains the meta data of the object. The type of this field is a key / value map/dictionary. The key type is string. The value type is also string. The general content of the field is undefined and can be an arbritary store. There are some common known keys: color - The color the UX uses when displaying icon - The icon the UX uses when displaying * title - The UX uses this for additional display information. Often the source of the object. Specific Object types use additional meta data fields. These are described at: https://docs.rackn.io/stable/redirect/?ref=rs_object_metadata |
| Name | Name is the name of the param. Params must be uniquely named. required: true |
| Schema | Schema must be a valid JSONSchema as of draft v4. |
| Secure | Secure implies that any API interactions with this Param will deal with SecureData values. required: true |
Some example types that can be used with Schema:
| Type | Description |
|---|---|
| integer | A numerical value (eg 12 or -3444) |
| boolean | True or False (true or false) |
| string | Textual string (eg "this is a string!") |
| array | A series of elements of the same type |
| map | A higher-order function that applies a given function to each element of a list, returning a list of results in the same order. |