Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add neuro admin add-quota / set-quota commands #1275

Merged
merged 20 commits into from
Jan 14, 2020

Conversation

anayden
Copy link
Contributor

@anayden anayden commented Dec 30, 2019

Closes #1255

Until https://github.com/neuromation/platform-admin/pull/92 is merged and deployed, we can't have e2e tests, so only stubbed ones for now.

@anayden anayden changed the title WIP: Add neuro admin add-quota / set-quota commands Add neuro admin add-quota / set-quota commands Jan 13, 2020
neuromation/api/admin.py Outdated Show resolved Hide resolved
neuromation/cli/formatters/config.py Outdated Show resolved Hide resolved
neuromation/cli/admin.py Outdated Show resolved Hide resolved
neuromation/cli/admin.py Outdated Show resolved Hide resolved
if value is None:
return None
try:
result = float(value[:-1]) * {"h": 60, "m": 1}[value[-1]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please improve the error reporting; _parse_quota_value("5z") generates obscure KeyError: 'z' exception.

neuromation/cli/admin.py Outdated Show resolved Hide resolved
neuromation/cli/admin.py Outdated Show resolved Hide resolved
cluster_name = root.client.config.cluster_name
click.echo(
f"In order to increase your quota, please navigate to "
f"https://neuro.payments.com/{user_name}/{cluster_name}?pay=usd100"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this URL be a part of a server provided config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually, yes. But this particular part is not finished yet (and the command is disabled). It will be completely released after Evil Martians complete their part and it's tracked via a separate issue.

@anayden anayden merged commit 3fe898a into master Jan 14, 2020
@anayden anayden deleted the an/1142-add-quota-command branch January 14, 2020 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce neuro admin set-user-quota
3 participants