/*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
name: 'Configuration for OpenStack Cinder Driver',
origin: 'Oracle Corporation',
description: 'Setup environment for OpenStack Cinder Driver',
version: '1.0.0',
parameters: {
name: {
label: 'Cinder\'s User\'s Name',
type: 'String'
},
password: {
label: 'Password',
type: 'Password'
}
},
/*
* Check for REST service to be enabled
*/
try {
run('configuration services rest');
run('enable');
} catch (err) {
return ('The REST API is not available on this version of \
appliance software and is required to run with the \
ZFSSA cinder driver. Please upgrade the appliance \
software.');
}
/*
* Cinder role
*/
run('cd /');
run('configuration roles');
try {
} catch(err) {
run('set description="OpenStack Cinder Driver"');
run('commit');
}
run('authorizations');
run('create');
run('set scope=stmf');
run('set allow_configure=true');
run('commit');
run('create');
run('set scope=nas');
run('set allow_clone=true');
run('set allow_createProject=true');
run('set allow_createShare=true');
run('set allow_changeSpaceProps=true');
run('set allow_changeGeneralProps=true');
run('set allow_destroy=true');
run('set allow_rollback=true');
run('set allow_takeSnap=true');
run('commit');
/*
* Set user with Cinder role
*/
run('cd /')
run('configuration users');
try {
msg += ' updated.';
} catch (err) {
run('set fullname="OpenStack Cinder Driver"');
run('commit');
msg += ' created.';
}
run('commit');
return (msg);
}
};