joyent-portal/packages/cloudapi-gql/src/api/roles.js
Sérgio Ramos 8295bd6882 chore: initial lerna setup
this shall be a progressive process
2017-05-25 10:56:50 +01:00

32 lines
617 B
JavaScript

const request = require('./request');
module.exports.list = () => {
return request('listRoles');
};
module.exports.get = ctx => {
return request('getRole', ctx);
};
module.exports.create = ctx => {
return request('createRole', ctx);
};
module.exports.set = ctx => {
const id = ctx.id ? `/${ctx.id}` : '';
const resource = `/${request.client.account}/${ctx.resource}${id}`;
return request('setRoleTags', {
roleTags: ctx.role,
resource
});
};
module.exports.update = ctx => {
return request('updateRole', ctx);
};
module.exports.destroy = ctx => {
return request('deleteRole', ctx);
};