File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -518,6 +518,28 @@ def create_gateway(self,gateway:Gateway) -> None:
518518 except grpc .RpcError as e :
519519 return self .refresh_token (e , self .create_gateway , gateway )
520520
521+ def delete_app (self , app_id :str ) -> None :
522+ """
523+ Delete an Application.
524+
525+ Params:
526+ - app_id: unique identifier of the application.
527+ Passing in an Application object will also work.
528+ """
529+ client = api .ApplicationServiceStub (self .channel )
530+
531+ # Define the JWT key metadata.
532+ metadata = [("authorization" , "Bearer %s" % self .auth_token )]
533+
534+ #Construct request
535+ req = api .DeleteApplicationRequest ()
536+ req .id = str (app_id )
537+
538+ try :
539+ return client .Delete (req , metadata = metadata )
540+ except grpc .RpcError as e :
541+ return self .refresh_token (e , self .delete_app , app_id )
542+
521543 def delete_device (self , dev_eui :str ) -> None :
522544 """
523545 Delete a Device.
You can’t perform that action at this time.
0 commit comments