Skip to content

Commit 9f99ed3

Browse files
#1026 mostly done with the bits that actually do things. still need unit tests and detox
1 parent 39f9e1b commit 9f99ed3

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

SoftLayer/CLI/virt/capacity/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from SoftLayer.CLI import formatting
1010

1111
from pprint import pprint as pp
12+
CONTEXT = {'help_option_names': ['-h', '--help'],
13+
'max_content_width': 999}
1214
class capacityCommands(click.MultiCommand):
1315
"""Loads module for capacity related commands."""
1416

@@ -18,7 +20,6 @@ def __init__(self, *path, **attrs):
1820

1921
def list_commands(self, ctx):
2022
"""List all sub-commands."""
21-
2223
rv = []
2324
for filename in os.listdir(self.path):
2425
if filename == '__init__.py':
@@ -34,9 +35,9 @@ def get_command(self, ctx, name):
3435
module = importlib.import_module(path)
3536
return getattr(module, 'cli')
3637

37-
@click.group(cls=capacityCommands,
38-
help="Manages virtual server reserved capacity")
38+
@click.group(cls=capacityCommands,
39+
context_settings=CONTEXT)
3940
@environment.pass_env
4041
def cli(env):
41-
"""Manages Capacity"""
42+
"""Manages Reserved Capacity"""
4243
pass

SoftLayer/CLI/virt/capacity/create-guest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def _parse_create_args(client, args):
117117
help="Test order, will return the order container, but not actually order a server.")
118118
@environment.pass_env
119119
def cli(env, **args):
120+
"""Allows for creating a virtual guest in a reserved capacity."""
120121
create_args = _parse_create_args(env.client, args)
121122
manager = CapacityManager(env.client)
122123
capacity_id = args.get('capacity_id')

SoftLayer/CLI/virt/capacity/create.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
"""Create a Reserved Capacity instance"""
1+
"""Create a Reserved Capacity instance.
2+
3+
4+
"""
25
# :license: MIT, see LICENSE for more details.
36

47
import click
@@ -27,7 +30,7 @@
2730
help="Do not actually create the virtual server")
2831
@environment.pass_env
2932
def cli(env, name, datacenter, backend_router_id, capacity, quantity, test=False):
30-
"""Create a Reserved Capacity instance"""
33+
"""Create a Reserved Capacity instance. *WARNING*: Reserved Capacity is on a yearly contract and not cancelable until the contract is expired."""
3134
manager = CapacityManager(env.client)
3235
result = manager.create(
3336
name=name,

SoftLayer/CLI/virt/capacity/detail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
show_default=True)
4848
@environment.pass_env
4949
def cli(env, identifier, columns):
50-
"""Reserved Capacity Group Details"""
50+
"""Reserved Capacity Group details. Will show which guests are assigned to a reservation."""
5151
manager = CapacityManager(env.client)
5252
mask = "mask[instances[billingItem[category], guest]]"
5353
result = manager.get_object(identifier, mask)

SoftLayer/CLI/virt/capacity/list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@click.command()
1515
@environment.pass_env
1616
def cli(env):
17-
"""List Reserved Capacity"""
17+
"""List Reserved Capacity groups."""
1818
manager = CapacityManager(env.client)
1919
result = manager.list()
2020
table = formatting.Table(

0 commit comments

Comments
 (0)