Skip to content

Commit ceceb6e

Browse files
added delete_app
1 parent d0ebbc3 commit ceceb6e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

chirpstack_api_wrapper/client.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)