-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AP-1696] Added list_schedule_ids and delete_schedule commands (#145)
* Added list_schedule_ids and delete_schedule commands * Added list_schedule_ids and delete_schedule commands * added option for getting version * added requirements * add workflow
- Loading branch information
Showing
8 changed files
with
121 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
runChecks: true |
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,3 +1,9 @@ | ||
0.7.0 | ||
----- | ||
- Add delete_schedule command | ||
- Add list_schedule_ids command | ||
|
||
|
||
0.5.1 | ||
----- | ||
- Bug fix setup | ||
|
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,22 @@ | ||
"""Delete a schedule using schedule_id.""" | ||
|
||
import sys | ||
|
||
from tabulate import tabulate | ||
|
||
from cicada.lib import postgres | ||
from cicada.lib import scheduler | ||
from cicada.lib import utils | ||
|
||
|
||
@utils.named_exception_handler("delete_schedule") | ||
def main(schedule_id, dbname=None): | ||
"""Delete a schedule using schedule_id.""" | ||
|
||
db_conn = postgres.db_cicada(dbname) | ||
db_cur = db_conn.cursor() | ||
scheduler.delete_schedule(db_cur, str(schedule_id)) | ||
db_cur.close() | ||
db_conn.close() | ||
|
||
print("schedule_id '" + str(schedule_id) + "' is deleted!") |
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,19 @@ | ||
"""List all schedule ID's.""" | ||
|
||
from tabulate import tabulate | ||
|
||
from cicada.lib import postgres | ||
from cicada.lib import scheduler | ||
from cicada.lib import utils | ||
|
||
|
||
@utils.named_exception_handler("list_schedule_ids") | ||
def main(dbname=None): | ||
"""Show all Cicada schedule ID's.""" | ||
db_conn = postgres.db_cicada(dbname) | ||
db_cur = db_conn.cursor() | ||
obj_schedules = scheduler.get_all_schedule_ids(db_cur) | ||
db_cur.close() | ||
db_conn.close() | ||
print("") | ||
print(tabulate(obj_schedules, headers=['Server ID', 'Schedule ID', 'Description'])) |
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
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