(self, request, tenant_id, entity_id, alarm_id)
return b''
Updates an alarm in place.

        Documentation for this API can be found in the Rackspace Cloud
        Monitoring Developer Guide, section 5.12.5, "Update alarm by ID".
        The full link is quite long, but you can reach it by browsing
        to the following goo.gl URL:

            http://goo.gl/NhxgTZ
Updates an alarm in place.
Updates an alarm in place .
def update_alarm(self, request, tenant_id, entity_id, alarm_id):
        """
        Updates an alarm in place.

        Documentation for this API can be found in the Rackspace Cloud
        Monitoring Developer Guide, section 5.12.5, "Update alarm by ID".
        The full link is quite long, but you can reach it by browsing
        to the following goo.gl URL:

            http://goo.gl/NhxgTZ
        """
        content = request.content.read()
        update = json.loads(content.decode("utf-8"))
        update_kwargs = dict(update)
        entities = self._entity_cache_for_tenant(tenant_id).entities

        try:
            alarm = _get_alarm(entities, entity_id, alarm_id)
            alarm.update(clock=self._session_store.clock, **update_kwargs)
        except (ObjectDoesNotExist, ParentDoesNotExist) as e:
            request.setResponseCode(e.code)
            self._audit('alarms', request, tenant_id, e.code, content)
            return json.dumps(e.to_json())

        status = 204
        request.setResponseCode(status)
        request.setHeader(b'location', base_uri_from_request(request).rstrip('/').encode('utf-8') +
                          request.path)
        request.setHeader(b'x-object-id', alarm_id.encode('utf-8'))
        request.setHeader(b'content-type', b'text/plain')
        self._audit('alarms', request, tenant_id, status, content)
        return b''
def update_alarm ( self , request , tenant_id , entity_id , alarm_id ) : content = request . content . read ( ) update = json . loads ( content . decode ( "utf-8" ) ) update_kwargs = dict ( update ) entities = self . _entity_cache_for_tenant ( tenant_id ) . entities try : alarm = _get_alarm ( entities , entity_id , alarm_id ) alarm . update ( clock = self . _session_store . clock , * * update_kwargs ) except ( ObjectDoesNotExist , ParentDoesNotExist ) as e : request . setResponseCode ( e . code ) self . _audit ( 'alarms' , request , tenant_id , e . code , content ) return json . dumps ( e . to_json ( ) ) status = 204 request . setResponseCode ( status ) request . setHeader ( b'location' , base_uri_from_request ( request ) . rstrip ( '/' ) . encode ( 'utf-8' ) + request . path ) request . setHeader ( b'x-object-id' , alarm_id . encode ( 'utf-8' ) ) request . setHeader ( b'content-type' , b'text/plain' ) self . _audit ( 'alarms' , request , tenant_id , status , content ) return b''