Constrained Workflow Parameters - Oracle ZFS Storage Appliance Administration Manual

Hide thumbs Also See for ZFS Storage Appliance:
Table of Contents

Advertisement

Constrained Workflow Parameters

EXAMPLE 20
Based on the specified types, an appropriate input form will be generated upon execution of the
workflow. For example, here is a workflow that has two parameters, the name of a business unit
(to be used as a project) and the name of a share (to be used as the share name):
var workflow = {
};
If you upload this workflow and execute it, you will be prompted with a dialog box to fill in the
name of the share and the business unit. When the share has been created, a message will be
generated indicating as much.
Constrained Workflow Parameters
For some parameters, one does not wish to allow an arbitrary string, but wishes to rather limit
input to one of a small number of alternatives. These parameters should be specified to be of
type ChooseOne, and the object containing the parameter must have two additional members:
TABLE 128
Required Member
options
optionlabels
590
Oracle ZFS Storage Appliance Administration Guide, Release OS8.6.x • September 2016
Workflow Using Two Parameters
name: 'New share',
description: 'Creates a new share in a business unit',
parameters: {
name: {
label: 'Name of new share',
type: 'String'
},
unit: {
label: 'Business unit',
type: 'String'
}
},
execute: function (params) {
run('shares select ' + params.unit);
run('filesystem ' + params.name);
run('commit');
return ('Created new share "' + params.name + '"');
}
Constrained Parameters Required Members
Type
Array
Array
Description
An array of strings that specifies the
valid options
An array of strings that specifies the
labels associated with the options
specified in options

Advertisement

Table of Contents
loading

Table of Contents