Parameter Types

YAML Types

Many of the types we use in this profile are built-in types from the YAML 1.2 specification (i.e., those identified by the ‘tag:yaml.org,2002’ version tag).

The following table declares the valid YAML type URIs and aliases that SHALL be used when defining parameters or properties within an OpenWhisk package manifest:

Requirements

  • The ‘string’ type SHALL be the default type when not specified on a parameter or property declaration.
  • All ‘boolean’ values SHALL be lowercased (i.e., ‘true’ or ‘false’).

OpenWhisk Types

In addition to the YAML built-in types, OpenWhisk supports the types listed in the table below. A complete description of each of these types is provided below.

scalar-unit types

Scalar-unit types can be used to define scalar values along with a unit from the list of recognized units (a subset of GNU units) provided below.

Grammar

<scalar> <unit>

Example

inputs:
  max_storage_size:
    type: scalar-unit.size
    default: 10 GB
  archive_period:
    type: scalar-unit.time
    default: 30 d

Requirements

  • Whitespace: any number of spaces (including zero or none) SHALL be allowed between the scalar value and the unit value.
  • It SHALL be considered an error if either the scalar or unit portion is missing on a property or attribute declaration derived from any scalar-unit type.

scalar-unit.size

Recognized units for sizes (i.e., scalar-unit.size)

Example

inputs:
  memory_size:
    type: scalar-unit.size
    value: 256 MB

scalar-unit.time

Recognized units for times (i.e., scalar-unit.time)

Example

inputs:
  max_execution_time:
    type: scalar-unit.time
    value: 600 s

Object type example

The Object type allows for complex objects to be declared as parameters with an optional validatable schema.

inputs:
  person:
    type: object
    parameters: <schema>