Create/Edit Domain Type Definition dialog box

Ops Center Automator Service Builder User Guide

Version
11.0.x
Audience
anonymous
Part Number
MK-99AUT002-19

You can edit the schema for a selected domain type by selecting the Domain Type option available from the Create/Edit Input/Output Property for Service dialog box and then clicking the plus sign or wrench icon next to the domain type.

The following table describes the Edit Domain Type Definition dialog box fields, subfields, and field groups. A field group is a collection of fields that are related to a specific action or configuration.

When you enter information in a dialog box, if the information is not valid, errors that include a description of the problem appear at the right side of the box.

Field Subfield Description
Domain Type Name: * - Specifies the name for the domain type.
Domain Type ID: - Specifies an ID (address) for the domain type.
Domain Type Schema: - Specifies the schema for the domain type.

The format conforms to the JSON schema (http://json-schema.org/).

Generate Template (Button): - Generates a GUI Definition based on the domain type schema. You do not need to enter the GUI Definition from scratch because the basic structure is the same as for the Domain Type ID.
GUI Definition ID: - Specifies UI definition ID.
GUI Definition: - Specifies the UI definition.
Fields with an asterisk (*) are required.

The following table shows the property definition attributes in the GUI Definition.

Key Description
displayName Display name of property.
description Description of property.
presentation Presentation type of property. "input", "textarea", "url", "select", "radio", "check box", "spinbox", "capacity", "capacityInKB", "capacityInMB", "capacityInGB", "capacityInTB", "capacityiB", "capacityInKiB", "capacityInMiB", "capacityInGiB", "capacityInTiB", "datePicker", "hex", or "file".
permission Permission of property; "locked", "unlocked", or "hidden"
visibility Visibility of property; "exec" or "config"
required Specifies whether the property is required; true or false.
pattern Accepted regular expression pattern of the property value.
validationScript Validation script of the property value.
showIf Show condition of property.
enableIf Activate condition of property.
enum Specifies an array. You can define JSON objects in it.
enumDataSource Specifies an external resource provider as in the following example:
"enumDataSource": {
"url":"/Automation/v1/objects/ExternalResources/1eb39858-48b5-4d3a-b82a-9af5c91af8c4",
"contentType": "application/json",
"nameField": "hostGroupName",
"valueField": "id"
}
contentType Content type of composite type; "application/json", "application/javascript", "application/xml", "text/html", "text/plain", "text/csv", or "application/octet-stream"
hidden Show or hide a column in a table.

true: Hide a column by default.

false: Show a column by default.

Following are examples of the domain type schema and UI definition representing a volume setting in the built-in Allocate Volumes with Smart Provisioning service:

Domain type schema

{
  "type": "object",
  "properties": {
    "volumeUsage": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "pattern": "^[A-Za-z0-9 ~!@#\\$%\\^&()_\\+\\-=\\{\\}\\[\\]'\\.`]*$"
    },
    "numberOfVolumes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "default": 1
    },
    "volumeCapacityInMiB": {
      "type": "integer",
      "minimum": 47,
      "maximum": 268435456
    },
    "blockCapacity": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "validationScript": "function validate(value, language, displayType) {var errorMessages = [];if (!value || !value.indexOf) {return errorMessages;}if (Number(value) > 549755813888) {errorMessages.push('The maximum value is 549755813888.');}else if (Number(value) < 96000) {errorMessages.push('The minimum value is 96000');}return errorMessages;}"
    },
    "volumeLabel": {
      "type": "string",
      "maxLength": 32,
      "pattern": "^[A-Za-z0-9\\.:@_][A-Za-z0-9\\-\\.:@_]*$",
      "validationScript": "function validate(value, language, displayType) {var errorMessages = []; var re = /^[A-Za-z0-9\\.:@_][A-Za-z0-9\\-\\.:@_]*$/; if (!value || !value.indexOf) {return errorMessages;} if (!re.test(value)) {errorMessages.push('You can use only following caracters and white space: a-z,A-Z,0-9,-,.,:,@,_')} else if (value.indexOf(' ') === 0) {errorMessages.push('LDEV label must not start with a white space.');} else if (value.indexOf(' ') === value.length - 1) {errorMessages.push('LDEV label must not end with a white space.');} return errorMessages;}"
    },
    "diskType": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "ldevSetting": {
      "type": "object",
      "properties": {
        "ldevIdStartsFrom": {
          "type": "integer",
          "minimum": 0,
          "maximum": 16777215
        },
        "virtualLdevIdStartsFrom": {
          "type": "integer",
          "minimum": 0,
          "maximum": 65279
        }
      }
    },
    "lunSetting": {
      "type": "object",
      "properties": {
        "lunStartsFrom": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4095
        }
      }
    }
  }
}

GUI definition

{
  "properties": {
    "volumeUsage": {
      "displayName": "Volume Usage",
      "required": true
    },
    "numberOfVolumes": {
      "displayName": "Number of Volumes",
      "description": "Specify the number of volumes.",
      "required": true
    },
    "volumeCapacityInMiB": {
      "displayName": "Volume Capacity",
      "description": "Specify the volume capacity in bytes.",
      "presentation": "capacityInMiB",
      "showIf": "function showIf(properties, language, displayType) { return ( properties.CapacityFormat === \"Byte\"); }",
      "enableIf": "function enableIf(properties, language, displayType) { return ( properties.CapacityFormat === \"Byte\"); }",
      "required": true
    },
    "blockCapacity": {
      "displayName": "Volume Capacity",
      "description": "Specify the volume capacity in blocks. (1 block = 512 bytes)",
      "showIf": "function showIf(properties, language, displayType) { return ( properties.CapacityFormat === \"Block\"); }",
      "enableIf": "function enableIf(properties, language, displayType) { return ( properties.CapacityFormat === \"Block\"); }",
      "required": true
    },
    "volumeLabel": {
      "displayName": "Volume Label",
      "description": "Specify the volume label.",
      "required": false
    },
    "diskType": {
      "displayName": "Disk Type",
      "description": "Specify the disk type of the pool to use.",
      "required": false,
      "items": {
        "presentation": "select",
        "enumDataSource": {
          "url": "/Automation/v1/objects/ExternalResources/8890eb8d-c1fd-4067-954d-c91f47f4de42",
          "contentType": "application/json",
          "nameField": "name",
          "valueField": "value"
        }
      },
      "showIf": "function showIf(properties, language, displayType) { return ((properties.StorageSelection === \"Automatic\") || (properties.PoolSelection === \"Automatic\"));}"
    },
    "ldevSetting": {
      "displayName": "LDEV Setting",
      "properties": {
        "ldevIdStartsFrom": {
          "displayName": "LDEV ID Starts From",
          "description": "Specify the startup LDEV ID as a hexadecimal number for the volume to allocate.",
          "presentation": "hex",
          "required": false
        },
        "virtualLdevIdStartsFrom": {
          "displayName": "Virtual LDEV ID Starts From",
          "description": "Specify the startup Virtual LDEV ID  for the volume to allocate.",
          "presentation": "hex",
          "required": false,
          "showIf": "function showIf(properties, language, displayType) { return properties.SelectFrom !== 'Virtual Storage Machine' || properties.StorageSelection !== 'Automatic'; }"
        }
      }
    },
    "lunSetting": {
      "displayName": "LUN Setting",
      "properties": {
        "lunStartsFrom": {
          "displayName": "LUN Starts From",
          "description": "Specify the starting logical unit number assigned to the volume for a host.",
          "required": false,
          "presentation": "hex"
        }
      }
    }
  }
}