'Permit admins to reset the state of a server.'

@wsgi.response(202)
@extensions.expected_errors(404)
@wsgi.action('os-resetState')
@validation.schema(reset_server_state.reset_state)
def _reset_state(self, req, id, body):

    context = req.environ['nova.context']
    context.can((aa_policies.POLICY_ROOT % 'reset_state'))
    state = state_map[body['os-resetState']['state']]
    instance = common.get_instance(self.compute_api, context, id)
    instance.vm_state = state
    instance.task_state = None
    instance.save(admin_state_reset=True)
