#NEWLINE# @ web . authenticated #NEWLINE# def post( self , workername ) : #NEWLINE# #INDENT# '\nShut down a worker\n\n**Example request**:\n\n.. sourcecode:: http\n\n  POST /api/worker/shutdown/celery@worker2 HTTP/1.1\n  Content-Length: 0\n  Host: localhost:5555\n\n**Example response**:\n\n.. sourcecode:: http\n\n  HTTP/1.1 200 OK\n  Content-Length: 29\n  Content-Type: application/json; charset=UTF-8\n\n  {\n      "message": "Shutting down!"\n  }\n\n:reqheader Authorization: optional OAuth token to authenticate\n:statuscode 200: no error\n:statuscode 401: unauthorized request\n:statuscode 404: unknown worker\n        ' #NEWLINE# if ( not self . is_worker ( workername ) ) : #NEWLINE# #INDENT# raise web . HTTPError ( 404 , ( "Unknown worker '%s'" % workername ) ) #NEWLINE# #UNINDENT# logger . info ( "Shutting down '%s' worker" , workername ) #NEWLINE# self . capp . control . broadcast ( 'shutdown' , destination = [ workername ] ) #NEWLINE# self . write ( dict ( message = 'Shutting down!' ) )