-
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.
Add support of balance in admin commands (#2391)
* Add support of balance in admin commands * Add new tests * Add changelog
- Loading branch information
Showing
21 changed files
with
381 additions
and
105 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,5 @@ | ||
Added "Spent credits" to add "neuro admin get-cluster-users". Splitted 'quota' into 'balance' and 'quota': | ||
|
||
- `neuro admin set-user-quota` changes only `max_running_jobs` quota. | ||
- `neuro admin set-user-credits` changes only `credits` balance of user. | ||
- `neuro admin add-user-credits` updates `credits` balance of user by delta. |
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
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
1 change: 1 addition & 0 deletions
1
neuro-cli/tests/unit/formatters/ascii/TestAdminQuotaFormatter.test_output_0.ref
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 @@ | ||
Jobs: 10 |
1 change: 1 addition & 0 deletions
1
neuro-cli/tests/unit/formatters/ascii/TestAdminQuotaFormatter.test_output_no_quota_0.ref
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 @@ | ||
Jobs: infinity |
1 change: 1 addition & 0 deletions
1
neuro-cli/tests/unit/formatters/ascii/TestAdminQuotaFormatter.test_output_zeroes_0.ref
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 @@ | ||
Jobs: 0 |
2 changes: 2 additions & 0 deletions
2
neuro-cli/tests/unit/formatters/ascii/TestBalanceFormatter.test_output_0.ref
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,2 @@ | ||
Credits: 10.00 | ||
Spend credits: 0.23 |
2 changes: 2 additions & 0 deletions
2
neuro-cli/tests/unit/formatters/ascii/TestBalanceFormatter.test_output_no_quota_0.ref
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,2 @@ | ||
Credits: infinity | ||
Spend credits: 0.00 |
2 changes: 2 additions & 0 deletions
2
neuro-cli/tests/unit/formatters/ascii/TestBalanceFormatter.test_output_rounding_0.ref
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,2 @@ | ||
Credits: 10.00 | ||
Spend credits: 0.33 |
16 changes: 8 additions & 8 deletions
16
neuro-cli/tests/unit/formatters/ascii/TestClusterUserFormatter.test_cluster_list_0.ref
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,8 +1,8 @@ | ||
╷ ╷ ╷ ╷ ╷ ╷ | ||
Name │ Role │ Email │ Full name │ Registered │ Credits │ Max jobs | ||
╺━━━━━━━━┿━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━┿━━━━━━━━━━╸ | ||
alex │ user │ [email protected] │ │ │ 10 │ 2 | ||
andrew │ manager │ [email protected] │ andrew │ 2017-03-04T12:28:59.759433+00:00 │ 100 │ infinity | ||
denis │ admin │ [email protected] │ denis admin │ 2017-03-04T12:28:59.759433+00:00 │ infinity │ infinity | ||
ivan │ user │ [email protected] │ user │ 2017-03-04T12:28:59.759433+00:00 │ infinity │ 1 | ||
╵ ╵ ╵ ╵ ╵ ╵ | ||
╷ ╷ ╷ ╷ ╷ ╷ ╷ | ||
Name │ Role │ Email │ Full name │ Registered │ Credits │ Spent credits │ Max jobs | ||
╺━━━━━━━━┿━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━┿━━━━━━━━━━━━━━━┿━━━━━━━━━━╸ | ||
alex │ user │ [email protected] │ │ │ 100.00 │ 20.00 │ 2 | ||
andrew │ manager │ [email protected] │ andrew │ 2017-03-04T12:28:59.759433+00:00 │ 100.00 │ 0.00 │ infinity | ||
denis │ admin │ [email protected] │ denis admin │ 2017-03-04T12:28:59.759433+00:00 │ infinity │ 0.00 │ infinity | ||
ivan │ user │ [email protected] │ user │ 2017-03-04T12:28:59.759433+00:00 │ infinity │ 0.00 │ 1 | ||
╵ ╵ ╵ ╵ ╵ ╵ ╵ |
2 changes: 1 addition & 1 deletion
2
neuro-cli/tests/unit/formatters/ascii/TestQuotaFormatter.test_output_0.ref
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,2 +1,2 @@ | ||
Credits: 10 | ||
Credits: 10.00 | ||
Jobs: 10 |
2 changes: 1 addition & 1 deletion
2
neuro-cli/tests/unit/formatters/ascii/TestQuotaFormatter.test_output_only_credits_0.ref
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,2 +1,2 @@ | ||
Credits: 10 | ||
Credits: 10.00 | ||
Jobs: infinity |
2 changes: 1 addition & 1 deletion
2
neuro-cli/tests/unit/formatters/ascii/TestQuotaFormatter.test_output_zeroes_0.ref
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,2 +1,2 @@ | ||
Credits: 0 | ||
Credits: 0.00 | ||
Jobs: 0 |
Oops, something went wrong.