HomeGuidesAPI Reference
CommunityWebsiteDocumentationExchangeSupportDeveloperLog In

Example of an Option Type Record

Option types can easily represent some common input types, including text, number, radio, checkbox, and dropdown/multiple choice.

JSON Parameters

ParameterDescription
nameThe name of the option type for handy reference
descriptionShort description of the option type (the CLI actually shows this when pressing ? for help)
fieldNameThe property key for when posting this option type to a JSON POST request
fieldLabelUser friendly label for prompting a user for input
fieldContextSome properties need nested i.e. in a config: {} block. This is a . separated context of where the property should be constructed
placeHolderAny placeholder text when nothing is yet entered
helpBlockShort help text describing the option
defaultValueThe default value if no user entry is specified. This value should be passed to the desired JSON Map if nothing else is entered
optionSourceOption source references an API endpoint for receiving a JSON list of available options for this field.
typeThe type of input. I.e. text, select, radio,checkbox, etc.
requiredIs this field entry required for the request
editableUsed primarily on tasks and workflows. Basically wether or not the field can be overridden optionally when the object is run
displayOrderThe order with which the fields should be prompted. This is rather important when using optionSource in some scenarios for determining available values.
configAny special configuration options pertaining to specific input types, like a radio button.

Example

{
    "optionTypes": [
                {
                    "name": "subnet",
                    "description": null,
                    "fieldName": "subnetId",
                    "fieldLabel": "Subnet",
                    "fieldContext": "config",
                    "fieldAddOn": null,
                    "placeHolder": null,
                    "helpBlock": "",
                    "defaultValue": null,
                    "optionSource": "amazonSubnet",
                    "type": "select",
                    "advanced": false,
                    "required": true,
                    "editable": false,
                    "config": [],
                    "displayOrder": 100
                },
                {
                    "name": "security group",
                    "description": null,
                    "fieldName": "securityId",
                    "fieldLabel": "Security Group",
                    "fieldContext": "config",
                    "fieldAddOn": null,
                    "placeHolder": null,
                    "helpBlock": "",
                    "defaultValue": null,
                    "optionSource": "amazonSecurityGroup",
                    "type": "select",
                    "advanced": false,
                    "required": true,
                    "editable": false,
                    "config": [],
                    "displayOrder": 101
                },
                {
                    "name": "public key",
                    "description": null,
                    "fieldName": "publicKeyId",
                    "fieldLabel": "Public Key",
                    "fieldContext": "config",
                    "fieldAddOn": null,
                    "placeHolder": null,
                    "helpBlock": "",
                    "defaultValue": null,
                    "optionSource": "keyPairs",
                    "type": "select",
                    "advanced": false,
                    "required": false,
                    "editable": false,
                    "config": [],
                    "displayOrder": 9
                }
            ]
}