'Set the application service state.
Args:
service(ApplicationService): The service whose state to set.
state(ApplicationServiceState): The connectivity state to apply.
Returns:
A Deferred which resolves when the state was set successfully.'

def set_appservice_state(self, service, state):

    return self._simple_upsert('application_services_state', dict(as_id=service.id), dict(state=state))
