Skip to content

Commit f00e6fe

Browse files
committed
Several Doc Changes
1 parent e973633 commit f00e6fe

19 files changed

Lines changed: 77 additions & 100 deletions

SoftLayer/managers/cci.py

Lines changed: 34 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,9 @@
1515
class CCIManager(IdentifierMixin, object):
1616
""" Manage CCIs """
1717
def __init__(self, client):
18-
#: A valid `SoftLayer.API.Client` object that will be used for all
19-
#: actions.
2018
self.client = client
21-
#: Reference to the SoftLayer_Account API object.
2219
self.account = client['Account']
23-
#: Reference to the SoftLayer_Virtual_Guest API object.
2420
self.guest = client['Virtual_Guest']
25-
#: A list of resolver functions. Used primarily by the CLI to provide
26-
#: a variety of methods for uniquely identifying an object such as
27-
#: hostname and IP address.
2821
self.resolvers = [self._get_ids_from_ip, self._get_ids_from_hostname]
2922

3023
def list_instances(self, hourly=True, monthly=True, tags=None, cpus=None,
@@ -226,41 +219,6 @@ def _generate_create_dict(
226219
dedicated=False, public_vlan=None, private_vlan=None,
227220
userdata=None, nic_speed=None, disks=None, post_uri=None,
228221
private=False, ssh_keys=None):
229-
"""
230-
Translates a list of arguments into a dictionary necessary for creating
231-
a CCI.
232-
233-
:param int cpus: The number of virtual CPUs to include in the instance.
234-
:param int memory: The amount of RAM to order.
235-
:param bool hourly: Flag to indicate if this server should be billed
236-
hourly (default) or monthly.
237-
:param string hostname: The hostname to use for the new server.
238-
:param string domain: The domain to use for the new server.
239-
:param bool local_disk: Flag to indicate if this should be a local disk
240-
(default) or a SAN disk.
241-
:param string datacenter: The short name of the data center in which
242-
the CCI should reside.
243-
:param string os_code: The operating system to use. Cannot be specified
244-
if image_id is specified.
245-
:param int image_id: The ID of the image to load onto the server.
246-
Cannot be specified if os_code is specified.
247-
:param bool dedicated: Flag to indicate if this should be housed on a
248-
dedicated or shared host (default). This will
249-
incur a fee on your account.
250-
:param int public_vlan: The ID of the public VLAN on which you want
251-
this CCI placed.
252-
:param int private_vlan: The ID of the public VLAN on which you want
253-
this CCI placed.
254-
:param bool bare_metal: Flag to indicate if this is a bare metal server
255-
or a dedicated server (default).
256-
:param list disks: A list of disk capacities for this server.
257-
:param string post_uri: The URI of the post-install script to run
258-
after reload
259-
:param bool private: If true, the CCI will be provisioned only with
260-
access to the private network. Defaults to false
261-
:param list ssh_keys: The SSH keys to add to the root user
262-
"""
263-
264222
required = [cpus, memory, hostname, domain]
265223

266224
mutually_exclusive = [
@@ -395,14 +353,45 @@ def wait_for_ready(self, instance_id, limit, delay=1, pending=False):
395353

396354
def verify_create_instance(self, **kwargs):
397355
""" Verifies an instance creation command without actually placing an
398-
order. See :func:`_generate_create_dict` for a list of available
356+
order. See :func:`create_instance` for a list of available
399357
options. """
400358
create_options = self._generate_create_dict(**kwargs)
401359
return self.guest.generateOrderTemplate(create_options)
402360

403361
def create_instance(self, **kwargs):
404-
""" Orders a new instance. See :func:`_generate_create_dict` for
405-
a list of available options. """
362+
"""
363+
Creates a new CCI instance
364+
365+
:param int cpus: The number of virtual CPUs to include in the instance.
366+
:param int memory: The amount of RAM to order.
367+
:param bool hourly: Flag to indicate if this server should be billed
368+
hourly (default) or monthly.
369+
:param string hostname: The hostname to use for the new server.
370+
:param string domain: The domain to use for the new server.
371+
:param bool local_disk: Flag to indicate if this should be a local disk
372+
(default) or a SAN disk.
373+
:param string datacenter: The short name of the data center in which
374+
the CCI should reside.
375+
:param string os_code: The operating system to use. Cannot be specified
376+
if image_id is specified.
377+
:param int image_id: The ID of the image to load onto the server.
378+
Cannot be specified if os_code is specified.
379+
:param bool dedicated: Flag to indicate if this should be housed on a
380+
dedicated or shared host (default). This will
381+
incur a fee on your account.
382+
:param int public_vlan: The ID of the public VLAN on which you want
383+
this CCI placed.
384+
:param int private_vlan: The ID of the public VLAN on which you want
385+
this CCI placed.
386+
:param bool bare_metal: Flag to indicate if this is a bare metal server
387+
or a dedicated server (default).
388+
:param list disks: A list of disk capacities for this server.
389+
:param string post_uri: The URI of the post-install script to run
390+
after reload
391+
:param bool private: If true, the CCI will be provisioned only with
392+
access to the private network. Defaults to false
393+
:param list ssh_keys: The SSH keys to add to the root user
394+
"""
406395
create_options = self._generate_create_dict(**kwargs)
407396
return self.guest.createObject(create_options)
408397

SoftLayer/managers/dns.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,9 @@ class DNSManager(IdentifierMixin, object):
1818
"""
1919

2020
def __init__(self, client):
21-
#: A valid `SoftLayer.API.Client` object that will be used for all
22-
#: actions.
2321
self.client = client
24-
#: Reference to the SoftLayer_Dns_Domain API object.
2522
self.service = self.client['Dns_Domain']
26-
#: Reference to the SoftLayer.Dns_Domain_ResourceRecord
27-
#: API object.
2823
self.record = self.client['Dns_Domain_ResourceRecord']
29-
#: A list of resolver functions. Used primarily by the CLI to provide
30-
#: a variety of methods for uniquely identifying an object such as zone
31-
#: name.
3224
self.resolvers = [self._get_zone_id_from_name]
3325

3426
def _get_zone_id_from_name(self, name):

SoftLayer/managers/firewall.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class FirewallManager(object):
2929
3030
"""
3131
def __init__(self, client):
32-
#: A valid `SoftLayer.API.Client` object that will be used for all
33-
#: actions.
3432
self.client = client
3533

3634
def get_firewalls(self):

SoftLayer/managers/hardware.py

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,9 @@ class HardwareManager(IdentifierMixin, object):
1818
"""
1919

2020
def __init__(self, client):
21-
#: A valid `SoftLayer.API.Client` object that will be used for all
22-
#: actions.
2321
self.client = client
24-
#: Reference to the SoftLayer_Hardware_Server API object.
2522
self.hardware = self.client['Hardware_Server']
26-
#: Reference to the SoftLayer_Account API object.
2723
self.account = self.client['Account']
28-
#: A list of resolver functions. Used primarily by the CLI to provide
29-
#: a variety of methods for uniquely identifying an object such as
30-
#: hostname and IP address.
3124
self.resolvers = [self._get_ids_from_ip, self._get_ids_from_hostname]
3225

3326
def cancel_hardware(self, hardware_id, reason='unneeded', comment=''):
@@ -317,8 +310,46 @@ def change_port_speed(self, hardware_id, public, speed):
317310
return func(speed, id=hardware_id)
318311

319312
def place_order(self, **kwargs):
320-
""" Places an order for a piece of hardware. See
321-
:func:`_generate_create_dict` for a list of available options.
313+
""" Places an order for a piece of hardware.
314+
315+
Translates a list of arguments into a dictionary necessary for creating
316+
a server.
317+
318+
.. warning::
319+
All items here must be price IDs, NOT quantities!
320+
321+
:param int server: The identification string for the server to
322+
order. This will either be the CPU/Memory
323+
combination ID for bare metal instances or the
324+
CPU model for dedicated servers.
325+
:param string hostname: The hostname to use for the new server.
326+
:param string domain: The domain to use for the new server.
327+
:param bool hourly: Flag to indicate if this server should be billed
328+
hourly (default) or monthly. Only applies to bare
329+
metal instances.
330+
:param string location: The location string (data center) for the
331+
server
332+
:param int os: The operating system to use
333+
:param array disks: An array of disks for the server. Disks will be
334+
added in the order specified.
335+
:param int port_speed: The port speed for the server.
336+
:param bool bare_metal: Flag to indicate if this is a bare metal server
337+
or a dedicated server (default).
338+
:param int ram: The amount of RAM to order. Only applies to dedicated
339+
servers.
340+
:param int package_id: The package_id to use for the server. This
341+
should either be a chassis ID for dedicated
342+
servers or the bare metal instance package ID,
343+
which can be obtained by calling
344+
_get_bare_metal_package_id
345+
:param int disk_controller: The disk controller to use.
346+
:param list ssh_keys: The SSH keys to add to the root user
347+
:param int public_vlan: The ID of the public VLAN on which you want
348+
this server placed.
349+
:param int private_vlan: The ID of the public VLAN on which you want
350+
this server placed.
351+
:param string post_uri: The URI of the post-install script to run
352+
after reload
322353
323354
.. warning::
324355
Due to how the ordering structure currently works, all ordering
@@ -385,7 +416,7 @@ def place_order(self, **kwargs):
385416

386417
def verify_order(self, **kwargs):
387418
""" Verifies an order for a piece of hardware without actually placing
388-
it. See :func:`_generate_create_dict` for a list of available options.
419+
it. See :func:`place_order` for a list of available options.
389420
"""
390421
create_options = self._generate_create_dict(**kwargs)
391422
return self.client['Product_Order'].verifyOrder(create_options)
@@ -450,8 +481,6 @@ def _generate_create_dict(
450481
this server placed.
451482
:param int private_vlan: The ID of the public VLAN on which you want
452483
this server placed.
453-
:param string post_uri: The URI of the post-install script to run
454-
after reload
455484
"""
456485
arguments = ['server', 'hostname', 'domain', 'location', 'os', 'disks',
457486
'port_speed', 'bare_metal', 'ram', 'package_id',

SoftLayer/managers/image.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,8 @@ class ImageManager(IdentifierMixin, object):
2020
"""
2121

2222
def __init__(self, client):
23-
#: A valid `SoftLayer.API.Client` object that will be used for all
24-
#: actions.
2523
self.client = client
26-
#: Reference to the Virtual_Guest_Block_Device_Template_Group API
27-
#: object.
2824
self.vgbdtg = self.client['Virtual_Guest_Block_Device_Template_Group']
29-
#: A list of resolver functions. Used primarily by the CLI to provide
30-
#: a variety of methods for uniquely identifying an object such as guid
3125
self.resolvers = [self._get_ids_from_name_public,
3226
self._get_ids_from_name_private]
3327

SoftLayer/managers/network.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@
1212
class NetworkManager(object):
1313
""" Manage Networks """
1414
def __init__(self, client):
15-
#: A valid `SoftLayer.API.Client` object that will be used for all
16-
#: actions.
1715
self.client = client
18-
#: Reference to the SoftLayer_Account API object.
1916
self.account = client['Account']
20-
#: Reference to the SoftLayer_Network_Vlan object.
2117
self.vlan = client['Network_Vlan']
2218
self.subnet = client['Network_Subnet']
2319

SoftLayer/managers/sshkey.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,8 @@ class SshKeyManager(IdentifierMixin, object):
1717
"""
1818

1919
def __init__(self, client):
20-
#: A valid `SoftLayer.API.Client` object that will be used for all
21-
#: actions.
2220
self.client = client
23-
#: Reference to the SoftLayer_Security_Ssh_Key API object.
2421
self.sshkey = client['Security_Ssh_Key']
25-
#: A list of resolver functions. Used primarily by the CLI to provide
26-
#: a variety of methods for uniquely identifying an object such as
27-
#: label.
2822
self.resolvers = [self._get_ids_from_label]
2923

3024
def add_key(self, key, label, notes=None):

SoftLayer/managers/ssl.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ class SSLManager(object):
1515
"""
1616

1717
def __init__(self, client):
18-
#: A valid `SoftLayer.API.Client` object that will be used for all
19-
#: actions.
2018
self.client = client
21-
#: Reference to the SoftLayer_Security_Certificate API object.
2219
self.ssl = self.client['Security_Certificate']
2320

2421
def list_certs(self, method='all'):

docs/api/client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ For day to day operation, most users will find the managers to be the most conve
6161
**Available managers**:
6262

6363
.. toctree::
64-
:maxdepth: 2
64+
:maxdepth: 1
6565
:glob:
6666

6767
managers/*

docs/api/managers/cci.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
.. automodule:: SoftLayer.managers.cci
44
:members:
55
:inherited-members:
6-
:undoc-members:

0 commit comments

Comments
 (0)