joyent-portal/cloudapi-graphql/src/api/roles.js
Tom Gallacher e71fc374bc triton-graphql -> Joyent cloudapi-graphql (#22)
This brings the name of the application inline with the terminology in
the Joyent triton / cloud api documentation.
2016-10-14 12:51:09 +01:00

32 lines
626 B
JavaScript

const request = require('./request');
module.exports.list = (ctx) => {
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 ? `/${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);
};