-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43035c7
commit 3a7f58a
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from datetime import datetime | ||
import os | ||
import socket | ||
|
||
class Info: | ||
"""Get information about service""" | ||
|
||
def __init__(self) -> None: | ||
"""Read info""" | ||
self.app_start_time = datetime.utcnow() | ||
self.host_name = socket.gethostname() | ||
self.app_branch = os.getenv("APP_BRANCH", "undefined") | ||
self.app_name = os.getenv("APP_NAME", "undefined") | ||
self.app_build_time = os.getenv("APP_BUILD_TIME", "undefined") | ||
self.app_version = os.getenv("APP_VERSION", "undefined") | ||
self.stack_name = os.getenv("STACK_NAME", "undefined") | ||
self.app_revision = os.getenv("APP_REVISION", "undefined") | ||
|
||
def get(self) -> dict: | ||
info = {} | ||
info['APP_START_TIME'] = self.app_start_time.strftime('%Y-%m-%dT%H:%M:%SZ') | ||
info['HOST_NAME'] = self.host_name | ||
info['APP_BRANCH'] = self.app_branch | ||
info['APP_NAME'] = self.app_name | ||
info['APP_BUILD_TIME'] = self.app_build_time | ||
info['APP_VERSION'] = self.app_version | ||
info['STACK_NAME'] = self.stack_name | ||
info['APP_REVISION'] = self.app_revision | ||
return info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
boto3~=1.17.101 | ||
gunicorn>=3.5 | ||
flask~=2.0.1 | ||
pika~=1.2.0 | ||
flask~=3.0.0 | ||
pika~=1.2.0 |