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

fix: payment cli #142

Merged
merged 6 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions silverback/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,16 @@ def pay():
@click.option(
"-t",
"--tier",
default=ClusterTier.PERSONAL.name.capitalize(),
default=ClusterTier.STANDARD.name.capitalize(),
metavar="NAME",
type=click.Choice(
[
ClusterTier.PERSONAL.name.capitalize(),
ClusterTier.PROFESSIONAL.name.capitalize(),
]
ClusterTier.STANDARD.name.capitalize(),
ClusterTier.PREMIUM.name.capitalize(),
],
case_sensitive=False,
dtdang marked this conversation as resolved.
Show resolved Hide resolved
),
help="Named set of options to use for cluster as a base (Defaults to Personal)",
help="Named set of options to use for cluster as a base (Defaults to Standard)",
)
@click.option(
"-c",
Expand Down Expand Up @@ -420,7 +421,8 @@ def create_payment_stream(
assert token_amount # mypy happy

click.echo(yaml.safe_dump(dict(configuration=configuration.settings_display_dict())))
click.echo(f"duration: {stream_time}\n")
click.echo(f"duration: {stream_time}")
click.echo(f"payment: {token_amount / 1e18} {token.symbol()}\n")
dtdang marked this conversation as resolved.
Show resolved Hide resolved

if not click.confirm(
f"Do you want to use this configuration to fund Cluster '{cluster_path}'?"
Expand Down
4 changes: 2 additions & 2 deletions silverback/cluster/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ def validate_product_code(
class ClusterTier(enum.IntEnum):
"""Suggestions for different tier configurations"""

PERSONAL = ClusterConfiguration(
STANDARD = ClusterConfiguration(
cpu="0.25 vCPU",
memory="512 MiB",
networks=3,
bots=5,
bandwidth="512 B/sec", # 1.236 GB/mo
duration=3, # months
).encode()
PROFESSIONAL = ClusterConfiguration(
PREMIUM = ClusterConfiguration(
cpu="1 vCPU",
memory="2 GB",
networks=10,
Expand Down
Loading