-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from skalenetwork/feature/SKALE-1410-sgx-statu…
…s-cmd SKALE-1410 Add SGX status cmd
- Loading branch information
Showing
5 changed files
with
83 additions
and
5 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = '0.7.0' | ||
__version__ = '0.8.0' | ||
|
||
if __name__ == "__main__": | ||
print(__version__) |
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,52 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of skale-node-cli | ||
# | ||
# Copyright (C) 2019 SKALE Labs | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import click | ||
from terminaltables import SingleTable | ||
|
||
from core.helper import login_required, get, safe_load_texts | ||
|
||
|
||
TEXTS = safe_load_texts() | ||
|
||
|
||
@click.group() | ||
def sgx_cli(): | ||
pass | ||
|
||
|
||
@sgx_cli.group('sgx', help="SGX commands") | ||
def sgx(): | ||
pass | ||
|
||
|
||
@sgx.command(help="Status of the SGX server") | ||
@login_required | ||
def status(): | ||
result = get('sgx_status') | ||
if not result: | ||
return | ||
else: | ||
table_data = [ | ||
['SGX server URL', result['sgx_server_url']], | ||
['Status', result['status_name']] | ||
] | ||
table = SingleTable(table_data) | ||
print('SGX server status:') | ||
print(table.table) |
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