Go to main content

Oracle® ZFS Storage Appliance RESTful API Guide, Release OS8.8.0

Exit Print View

Updated: November 2018
 
 

Get Workflow

Gets properties for a single workflow. In the header, if Accept is specified as application/javascript, it returns the content of the workflow, otherwise it returns workflow properties.

Example request where Accept is specified as application/javascript:

GET /api/workflow/v1/workflows/cc574599-4763-4523-9e72-b74e1246d448 HTTP/1.1
Authorization: Basic cm9vdDpsMWE=
Host: zfs-storage.example.com:215
Accept: application/javascript

Example Response:

HTTP/1.1 200 OK
X-Zfssa-Appliance-Api: 1.0
Content-Type: application/javascript; charset=utf-8
Content-Length: 916
            
    var workflow = {
    	name: 'Clear locks',
    	description: 'Clear locks held on behalf of an NFS client',
    	origin: 'Oracle Corporation',
    	version: '1.0.0',
    	parameters: {
    		hostname: {
    			label: 'Client hostname',
    			type: 'String'
    		},
    		ipaddrs: {
    			label: 'Client IP address',
    			type: 'String'
    		}
    	},
    	validate: function (params) {
    		if (params.hostname == '') {
    			return ({ hostname: 'Hostname cannot be empty.' });
    		}
    
    		if (params.ipaddrs == '') {
    			return ({ ipaddrs: 'IP address cannot be empty.' });
    		}
    	},
    	execute: function (params) {
    		try {
    			nas.clearLocks(params.hostname, params.ipaddrs);
    		} catch (err) {
    			return ('Failed to clear NFS locks: ' + err.message);
    		}
    
    		return ('Clear of locks held for ' + params.hostname +
    		    ' returned success.' );
    	}
    };

Example request where Accept is specified as application/json:

GET /api/workflow/v1/workflows/cc574599-4763-4523-9e72-b74e1246d448 HTTP/1.1
Authorization: Basic cm9vdDpsMWE=
Host: zfs-storage.example.com:215
Accept: application/json

Example Response:

HTTP/1.1 200 OK
X-Zfssa-Appliance-Api: 1.0
Content-Type: application/json; charset=utf-8
Content-Length: 649
            
{
    "workflow": {
        "href": "/api/workflow/v1/workflows/cc574599-4763-4523-9e72-b74e1246d448",
        "name": "Clear locks",
        "description": "Clear locks held on behalf of an NFS client",
        "uuid": "cc574599-4763-4523-9e72-b74e1246d448",
        "checksum": "695d029224f614258e626fe0b3c449c1233dee119571f23b678f245f7748d13c",
        "installdate": "Wed Apr 01 2015 17:59:44 GMT+0000 (UTC)",
        "owner": "root",
        "origin": "Oracle Corporation",
        "setid": false,
        "alert": false,
        "version": "1.0.0",
        "scheduled": false
    }
}