33import os
44from http import HTTPStatus
55from time import sleep
6- from typing import Dict , TYPE_CHECKING
6+ from typing import TYPE_CHECKING
77
88from cloudfoundry_client .doppler .client import EnvelopeStream
99from cloudfoundry_client .errors import InvalidStatusCode
1717
1818
1919class Application (Entity ):
20- def instances (self ) -> Dict [str , JsonObject ]:
20+ def instances (self ) -> dict [str , JsonObject ]:
2121 return self .client .v2 .apps .get_instances (self ["metadata" ]["guid" ])
2222
2323 def start (self ) -> "Application" :
@@ -29,10 +29,10 @@ def stop(self) -> "Application":
2929 def restart_instance (self , instance_id : int ):
3030 return self .client .v2 .apps .restart_instance (self ["metadata" ]["guid" ], instance_id )
3131
32- def stats (self ) -> Dict [str , JsonObject ]:
32+ def stats (self ) -> dict [str , JsonObject ]:
3333 return self .client .v2 .apps .get_stats (self ["metadata" ]["guid" ])
3434
35- def env (self ) -> Dict [str , JsonObject ]:
35+ def env (self ) -> dict [str , JsonObject ]:
3636 return self .client .v2 .apps .get_env (self ["metadata" ]["guid" ])
3737
3838 def summary (self ) -> JsonObject :
@@ -80,13 +80,13 @@ def __init__(self, target_endpoint: str, client: "CloudFoundryClient"):
8080 target_endpoint , client , "/v2/apps" , lambda pairs : Application (target_endpoint , client , pairs )
8181 )
8282
83- def get_stats (self , application_guid : str ) -> Dict [str , JsonObject ]:
83+ def get_stats (self , application_guid : str ) -> dict [str , JsonObject ]:
8484 return self ._get ("%s/%s/stats" % (self .entity_uri , application_guid ), JsonObject )
8585
86- def get_instances (self , application_guid : str ) -> Dict [str , JsonObject ]:
86+ def get_instances (self , application_guid : str ) -> dict [str , JsonObject ]:
8787 return self ._get ("%s/%s/instances" % (self .entity_uri , application_guid ), JsonObject )
8888
89- def get_env (self , application_guid : str ) -> Dict [str , JsonObject ]:
89+ def get_env (self , application_guid : str ) -> dict [str , JsonObject ]:
9090 return self ._get ("%s/%s/env" % (self .entity_uri , application_guid ), JsonObject )
9191
9292 def get_summary (self , application_guid : str ) -> JsonObject :
@@ -195,7 +195,7 @@ def _wait_for_instances_in_state(
195195 sleep (check_time )
196196 sum_waiting += check_time
197197
198- def _safe_get_instances (self , application_guid : str ) -> Dict [str , JsonObject ]:
198+ def _safe_get_instances (self , application_guid : str ) -> dict [str , JsonObject ]:
199199 try :
200200 return self .get_instances (application_guid )
201201 except InvalidStatusCode as ex :
0 commit comments