|
15 | 15 | class CCIManager(IdentifierMixin, object): |
16 | 16 | """ Manage CCIs """ |
17 | 17 | def __init__(self, client): |
18 | | - #: A valid `SoftLayer.API.Client` object that will be used for all |
19 | | - #: actions. |
20 | 18 | self.client = client |
21 | | - #: Reference to the SoftLayer_Account API object. |
22 | 19 | self.account = client['Account'] |
23 | | - #: Reference to the SoftLayer_Virtual_Guest API object. |
24 | 20 | 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. |
28 | 21 | self.resolvers = [self._get_ids_from_ip, self._get_ids_from_hostname] |
29 | 22 |
|
30 | 23 | def list_instances(self, hourly=True, monthly=True, tags=None, cpus=None, |
@@ -226,41 +219,6 @@ def _generate_create_dict( |
226 | 219 | dedicated=False, public_vlan=None, private_vlan=None, |
227 | 220 | userdata=None, nic_speed=None, disks=None, post_uri=None, |
228 | 221 | 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 | | - |
264 | 222 | required = [cpus, memory, hostname, domain] |
265 | 223 |
|
266 | 224 | mutually_exclusive = [ |
@@ -395,14 +353,45 @@ def wait_for_ready(self, instance_id, limit, delay=1, pending=False): |
395 | 353 |
|
396 | 354 | def verify_create_instance(self, **kwargs): |
397 | 355 | """ 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 |
399 | 357 | options. """ |
400 | 358 | create_options = self._generate_create_dict(**kwargs) |
401 | 359 | return self.guest.generateOrderTemplate(create_options) |
402 | 360 |
|
403 | 361 | 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 | + """ |
406 | 395 | create_options = self._generate_create_dict(**kwargs) |
407 | 396 | return self.guest.createObject(create_options) |
408 | 397 |
|
|
0 commit comments