Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Several Doc Changes

  • Loading branch information...
commit f00e6fe1865681a796197d9d3c29833bbab3db7d 1 parent e973633
@sudorandom authored
View
79 SoftLayer/managers/cci.py
@@ -15,16 +15,9 @@
class CCIManager(IdentifierMixin, object):
""" Manage CCIs """
def __init__(self, client):
- #: A valid `SoftLayer.API.Client` object that will be used for all
- #: actions.
self.client = client
- #: Reference to the SoftLayer_Account API object.
self.account = client['Account']
- #: Reference to the SoftLayer_Virtual_Guest API object.
self.guest = client['Virtual_Guest']
- #: A list of resolver functions. Used primarily by the CLI to provide
- #: a variety of methods for uniquely identifying an object such as
- #: hostname and IP address.
self.resolvers = [self._get_ids_from_ip, self._get_ids_from_hostname]
def list_instances(self, hourly=True, monthly=True, tags=None, cpus=None,
@@ -226,41 +219,6 @@ def _generate_create_dict(
dedicated=False, public_vlan=None, private_vlan=None,
userdata=None, nic_speed=None, disks=None, post_uri=None,
private=False, ssh_keys=None):
- """
- Translates a list of arguments into a dictionary necessary for creating
- a CCI.
-
- :param int cpus: The number of virtual CPUs to include in the instance.
- :param int memory: The amount of RAM to order.
- :param bool hourly: Flag to indicate if this server should be billed
- hourly (default) or monthly.
- :param string hostname: The hostname to use for the new server.
- :param string domain: The domain to use for the new server.
- :param bool local_disk: Flag to indicate if this should be a local disk
- (default) or a SAN disk.
- :param string datacenter: The short name of the data center in which
- the CCI should reside.
- :param string os_code: The operating system to use. Cannot be specified
- if image_id is specified.
- :param int image_id: The ID of the image to load onto the server.
- Cannot be specified if os_code is specified.
- :param bool dedicated: Flag to indicate if this should be housed on a
- dedicated or shared host (default). This will
- incur a fee on your account.
- :param int public_vlan: The ID of the public VLAN on which you want
- this CCI placed.
- :param int private_vlan: The ID of the public VLAN on which you want
- this CCI placed.
- :param bool bare_metal: Flag to indicate if this is a bare metal server
- or a dedicated server (default).
- :param list disks: A list of disk capacities for this server.
- :param string post_uri: The URI of the post-install script to run
- after reload
- :param bool private: If true, the CCI will be provisioned only with
- access to the private network. Defaults to false
- :param list ssh_keys: The SSH keys to add to the root user
- """
-
required = [cpus, memory, hostname, domain]
mutually_exclusive = [
@@ -395,14 +353,45 @@ def wait_for_ready(self, instance_id, limit, delay=1, pending=False):
def verify_create_instance(self, **kwargs):
""" Verifies an instance creation command without actually placing an
- order. See :func:`_generate_create_dict` for a list of available
+ order. See :func:`create_instance` for a list of available
options. """
create_options = self._generate_create_dict(**kwargs)
return self.guest.generateOrderTemplate(create_options)
def create_instance(self, **kwargs):
- """ Orders a new instance. See :func:`_generate_create_dict` for
- a list of available options. """
+ """
+ Creates a new CCI instance
+
+ :param int cpus: The number of virtual CPUs to include in the instance.
+ :param int memory: The amount of RAM to order.
+ :param bool hourly: Flag to indicate if this server should be billed
+ hourly (default) or monthly.
+ :param string hostname: The hostname to use for the new server.
+ :param string domain: The domain to use for the new server.
+ :param bool local_disk: Flag to indicate if this should be a local disk
+ (default) or a SAN disk.
+ :param string datacenter: The short name of the data center in which
+ the CCI should reside.
+ :param string os_code: The operating system to use. Cannot be specified
+ if image_id is specified.
+ :param int image_id: The ID of the image to load onto the server.
+ Cannot be specified if os_code is specified.
+ :param bool dedicated: Flag to indicate if this should be housed on a
+ dedicated or shared host (default). This will
+ incur a fee on your account.
+ :param int public_vlan: The ID of the public VLAN on which you want
+ this CCI placed.
+ :param int private_vlan: The ID of the public VLAN on which you want
+ this CCI placed.
+ :param bool bare_metal: Flag to indicate if this is a bare metal server
+ or a dedicated server (default).
+ :param list disks: A list of disk capacities for this server.
+ :param string post_uri: The URI of the post-install script to run
+ after reload
+ :param bool private: If true, the CCI will be provisioned only with
+ access to the private network. Defaults to false
+ :param list ssh_keys: The SSH keys to add to the root user
+ """
create_options = self._generate_create_dict(**kwargs)
return self.guest.createObject(create_options)
View
8 SoftLayer/managers/dns.py
@@ -18,17 +18,9 @@ class DNSManager(IdentifierMixin, object):
"""
def __init__(self, client):
- #: A valid `SoftLayer.API.Client` object that will be used for all
- #: actions.
self.client = client
- #: Reference to the SoftLayer_Dns_Domain API object.
self.service = self.client['Dns_Domain']
- #: Reference to the SoftLayer.Dns_Domain_ResourceRecord
- #: API object.
self.record = self.client['Dns_Domain_ResourceRecord']
- #: A list of resolver functions. Used primarily by the CLI to provide
- #: a variety of methods for uniquely identifying an object such as zone
- #: name.
self.resolvers = [self._get_zone_id_from_name]
def _get_zone_id_from_name(self, name):
View
2  SoftLayer/managers/firewall.py
@@ -29,8 +29,6 @@ class FirewallManager(object):
"""
def __init__(self, client):
- #: A valid `SoftLayer.API.Client` object that will be used for all
- #: actions.
self.client = client
def get_firewalls(self):
View
53 SoftLayer/managers/hardware.py
@@ -18,16 +18,9 @@ class HardwareManager(IdentifierMixin, object):
"""
def __init__(self, client):
- #: A valid `SoftLayer.API.Client` object that will be used for all
- #: actions.
self.client = client
- #: Reference to the SoftLayer_Hardware_Server API object.
self.hardware = self.client['Hardware_Server']
- #: Reference to the SoftLayer_Account API object.
self.account = self.client['Account']
- #: A list of resolver functions. Used primarily by the CLI to provide
- #: a variety of methods for uniquely identifying an object such as
- #: hostname and IP address.
self.resolvers = [self._get_ids_from_ip, self._get_ids_from_hostname]
def cancel_hardware(self, hardware_id, reason='unneeded', comment=''):
@@ -317,8 +310,46 @@ def change_port_speed(self, hardware_id, public, speed):
return func(speed, id=hardware_id)
def place_order(self, **kwargs):
- """ Places an order for a piece of hardware. See
- :func:`_generate_create_dict` for a list of available options.
+ """ Places an order for a piece of hardware.
+
+ Translates a list of arguments into a dictionary necessary for creating
+ a server.
+
+ .. warning::
+ All items here must be price IDs, NOT quantities!
+
+ :param int server: The identification string for the server to
+ order. This will either be the CPU/Memory
+ combination ID for bare metal instances or the
+ CPU model for dedicated servers.
+ :param string hostname: The hostname to use for the new server.
+ :param string domain: The domain to use for the new server.
+ :param bool hourly: Flag to indicate if this server should be billed
+ hourly (default) or monthly. Only applies to bare
+ metal instances.
+ :param string location: The location string (data center) for the
+ server
+ :param int os: The operating system to use
+ :param array disks: An array of disks for the server. Disks will be
+ added in the order specified.
+ :param int port_speed: The port speed for the server.
+ :param bool bare_metal: Flag to indicate if this is a bare metal server
+ or a dedicated server (default).
+ :param int ram: The amount of RAM to order. Only applies to dedicated
+ servers.
+ :param int package_id: The package_id to use for the server. This
+ should either be a chassis ID for dedicated
+ servers or the bare metal instance package ID,
+ which can be obtained by calling
+ _get_bare_metal_package_id
+ :param int disk_controller: The disk controller to use.
+ :param list ssh_keys: The SSH keys to add to the root user
+ :param int public_vlan: The ID of the public VLAN on which you want
+ this server placed.
+ :param int private_vlan: The ID of the public VLAN on which you want
+ this server placed.
+ :param string post_uri: The URI of the post-install script to run
+ after reload
.. warning::
Due to how the ordering structure currently works, all ordering
@@ -385,7 +416,7 @@ def place_order(self, **kwargs):
def verify_order(self, **kwargs):
""" Verifies an order for a piece of hardware without actually placing
- it. See :func:`_generate_create_dict` for a list of available options.
+ it. See :func:`place_order` for a list of available options.
"""
create_options = self._generate_create_dict(**kwargs)
return self.client['Product_Order'].verifyOrder(create_options)
@@ -450,8 +481,6 @@ def _generate_create_dict(
this server placed.
:param int private_vlan: The ID of the public VLAN on which you want
this server placed.
- :param string post_uri: The URI of the post-install script to run
- after reload
"""
arguments = ['server', 'hostname', 'domain', 'location', 'os', 'disks',
'port_speed', 'bare_metal', 'ram', 'package_id',
View
6 SoftLayer/managers/image.py
@@ -20,14 +20,8 @@ class ImageManager(IdentifierMixin, object):
"""
def __init__(self, client):
- #: A valid `SoftLayer.API.Client` object that will be used for all
- #: actions.
self.client = client
- #: Reference to the Virtual_Guest_Block_Device_Template_Group API
- #: object.
self.vgbdtg = self.client['Virtual_Guest_Block_Device_Template_Group']
- #: A list of resolver functions. Used primarily by the CLI to provide
- #: a variety of methods for uniquely identifying an object such as guid
self.resolvers = [self._get_ids_from_name_public,
self._get_ids_from_name_private]
View
4 SoftLayer/managers/network.py
@@ -12,12 +12,8 @@
class NetworkManager(object):
""" Manage Networks """
def __init__(self, client):
- #: A valid `SoftLayer.API.Client` object that will be used for all
- #: actions.
self.client = client
- #: Reference to the SoftLayer_Account API object.
self.account = client['Account']
- #: Reference to the SoftLayer_Network_Vlan object.
self.vlan = client['Network_Vlan']
self.subnet = client['Network_Subnet']
View
6 SoftLayer/managers/sshkey.py
@@ -17,14 +17,8 @@ class SshKeyManager(IdentifierMixin, object):
"""
def __init__(self, client):
- #: A valid `SoftLayer.API.Client` object that will be used for all
- #: actions.
self.client = client
- #: Reference to the SoftLayer_Security_Ssh_Key API object.
self.sshkey = client['Security_Ssh_Key']
- #: A list of resolver functions. Used primarily by the CLI to provide
- #: a variety of methods for uniquely identifying an object such as
- #: label.
self.resolvers = [self._get_ids_from_label]
def add_key(self, key, label, notes=None):
View
3  SoftLayer/managers/ssl.py
@@ -15,10 +15,7 @@ class SSLManager(object):
"""
def __init__(self, client):
- #: A valid `SoftLayer.API.Client` object that will be used for all
- #: actions.
self.client = client
- #: Reference to the SoftLayer_Security_Certificate API object.
self.ssl = self.client['Security_Certificate']
def list_certs(self, method='all'):
View
2  docs/api/client.rst
@@ -61,7 +61,7 @@ For day to day operation, most users will find the managers to be the most conve
**Available managers**:
.. toctree::
- :maxdepth: 2
+ :maxdepth: 1
:glob:
managers/*
View
1  docs/api/managers/cci.rst
@@ -3,4 +3,3 @@
.. automodule:: SoftLayer.managers.cci
:members:
:inherited-members:
- :undoc-members:
View
1  docs/api/managers/dns.rst
@@ -3,4 +3,3 @@
.. automodule:: SoftLayer.managers.dns
:members:
:inherited-members:
- :undoc-members:
View
1  docs/api/managers/firewall.rst
@@ -3,4 +3,3 @@
.. automodule:: SoftLayer.managers.firewall
:members:
:inherited-members:
- :undoc-members:
View
3  docs/api/managers/hardware.rst
@@ -2,5 +2,4 @@
.. automodule:: SoftLayer.managers.hardware
:members:
- :inherited-members:
- :undoc-members:
+ :inherited-members:
View
1  docs/api/managers/image.rst
@@ -3,4 +3,3 @@
.. automodule:: SoftLayer.managers.image
:members:
:inherited-members:
- :undoc-members:
View
3  docs/api/managers/messaging.rst
@@ -1,8 +1,5 @@
.. _messaging:
-SoftLayer.messaging
-===================
.. automodule:: SoftLayer.managers.messaging
:members:
:inherited-members:
- :undoc-members:
View
1  docs/api/managers/metadata.rst
@@ -3,6 +3,5 @@
.. automodule:: SoftLayer.managers.metadata
:members:
:inherited-members:
- :undoc-members:
.. autoattribute:: SoftLayer.managers.metadata.METADATA_ATTRIBUTES
View
1  docs/api/managers/network.rst
@@ -3,4 +3,3 @@
.. automodule:: SoftLayer.managers.network
:members:
:inherited-members:
- :undoc-members:
View
1  docs/api/managers/sshkey.rst
@@ -3,4 +3,3 @@
.. automodule:: SoftLayer.managers.sshkey
:members:
:inherited-members:
- :undoc-members:
View
1  docs/api/managers/ssl.rst
@@ -3,4 +3,3 @@
.. automodule:: SoftLayer.managers.ssl
:members:
:inherited-members:
- :undoc-members:
Please sign in to comment.
Something went wrong with that request. Please try again.