'Temporarily set the state of a given watch.
:param cnxt: RPC context.
:param watch_name: Name of the watch.
:param state: State (must be one defined in WatchRule class.'

@context.request_context
def set_watch_state(self, cnxt, watch_name, state):

    wr = watchrule.WatchRule.load(cnxt, watch_name)
    if (wr.state == rpc_api.WATCH_STATE_CEILOMETER_CONTROLLED):
        return
    actions = wr.set_watch_state(state)
    for action in actions:
        self.thread_group_mgr.start(wr.stack_id, action)
    result = api.format_watch(wr)
    result[rpc_api.WATCH_STATE_VALUE] = state
    return result
