Skip to content

Commit 25ec715

Browse files
author
Nathan Beittenmiller
committed
Adding missing documentation
1 parent 0a7b793 commit 25ec715

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

SoftLayer/managers/hardware.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ def reload(self, id, post_uri=None):
255255
id=id)
256256

257257
def change_port_speed(self, id, public, speed):
258+
""" Allows you to change the port speed of a server's NICs.
259+
260+
:param int id: The ID of the server
261+
:param bool public: Flag to indicate which interface to change.
262+
True (default) means the public interface.
263+
False indicates the private interface.
264+
:param int speed: The port speed to set.
265+
"""
258266
if public:
259267
func = self.hardware.setPublicNetworkInterfaceSpeed
260268
else:
@@ -263,10 +271,16 @@ def change_port_speed(self, id, public, speed):
263271
return func(speed, id=id)
264272

265273
def place_order(self, **kwargs):
274+
""" Places an order for a piece of hardware. See _generate_create_dict
275+
for a list of available options.
276+
"""
266277
create_options = self._generate_create_dict(**kwargs)
267278
return self.client['Product_Order'].placeOrder(create_options)
268279

269280
def verify_order(self, **kwargs):
281+
""" Verifies an order for a piece of hardware without actually placing
282+
it. See _generate_create_dict for a list of available options.
283+
"""
270284
create_options = self._generate_create_dict(**kwargs)
271285
return self.client['Product_Order'].verifyOrder(create_options)
272286

@@ -288,7 +302,34 @@ def _generate_create_dict(
288302
self, server=None, hostname=None, domain=None, hourly=False,
289303
location=None, os=None, disks=None, port_speed=None,
290304
bare_metal=None, ram=None, package_id=None, disk_controller=None):
291-
305+
"""
306+
Translates a list of arguments into a dictionary necessary for creating
307+
a server. NOTE - All items here must be price IDs, NOT quantities!
308+
309+
:param string server: The identification string for the server to order.
310+
This will either be the CPU/Memory combination ID
311+
for bare metal instances or the CPU model for
312+
dedicated servers.
313+
:param string hostname: The hostname to use for the new server.
314+
:param string domain: The domain to use for the new server.
315+
:param bool hourly: Flag to indicate if this server should be billed
316+
hourly (default) or monthly. Only applies to bare
317+
metal instances.
318+
:param string location: The location string (data center) for the server
319+
:param int os: The operating system to use
320+
:param array disks: An array of disks for the server. Disks will be
321+
added in the order specified.
322+
:param int port_speed: The port speed for the server.
323+
:param bool bare_metal: Flag to indicate if this is a bare metal server
324+
or a dedicated server (default).
325+
:param int ram: The amount of RAM to order. Only applies to dedicated
326+
servers.
327+
:param int package_id: The package_id to use for the server. This should
328+
either be a chassis ID for dedicated servers or
329+
the bare metal instance package ID, which can be
330+
obtained by calling _get_bare_metal_package_id
331+
:param int disk_controller: The disk controller to use.
332+
"""
292333
arguments = ['server', 'hostname', 'domain', 'location', 'os', 'disks',
293334
'port_speed', 'bare_metal', 'ram', 'package_id',
294335
'disk_controller', 'server_core', 'disk0']

0 commit comments

Comments
 (0)