<s> import requests <EOL> from st2actions . runners . pythonrunner import Action <EOL> class GetAppHealthStatusAction ( Action ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( GetAppHealthStatusAction , self ) . __init__ ( * args , ** kwargs ) <EOL> self . url = '<STR_LIT>' <EOL> self . headers = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> self . headers [ '<STR_LIT>' ] = self . config [ '<STR_LIT>' ] <EOL> def run ( self , app_name = None ) : <EOL> params = None <EOL> if app_name : <EOL> params = { '<STR_LIT>' : app_name } <EOL> resp = requests . get ( self . url , headers = self . headers , params = params ) . json ( ) <EOL> app_status_map = { } <EOL> for application in resp [ '<STR_LIT>' ] : <EOL> app_status_map [ application [ '<STR_LIT:name>' ] ] = application [ '<STR_LIT>' ] <EOL> return app_status_map </s>
