'Performs a specified action on a stack.
The body is expecting to contain exactly one item whose key specifies
the action.'

@util.identified_stack
def action(self, req, identity, body=None):

    body = (body or {})
    if (len(body) < 1):
        raise exc.HTTPBadRequest(_('No    action    specified'))
    if (len(body) > 1):
        raise exc.HTTPBadRequest(_('Multiple    actions    specified'))
    ac = next(six.iterkeys(body))
    if (ac not in self.ACTIONS):
        raise exc.HTTPBadRequest((_('Invalid    action    %s    specified') % ac))
    if (ac == self.SUSPEND):
        self.rpc_client.stack_suspend(req.context, identity)
    elif (ac == self.RESUME):
        self.rpc_client.stack_resume(req.context, identity)
    elif (ac == self.CHECK):
        self.rpc_client.stack_check(req.context, identity)
    elif (ac == self.CANCEL_UPDATE):
        self.rpc_client.stack_cancel_update(req.context, identity)
    else:
        raise exc.HTTPInternalServerError((_('Unexpected    action    %s') % ac))
