Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c39e4fb

Browse files
Merge pull request #2097 from allmightyspiff/issues2095
A few more additions to the documentation updates
2 parents 2130aa5 + 98d1ec6 commit c39e4fb

File tree

75 files changed

+1444
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1444
-230
lines changed

.readthedocs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
# Required
66
version: 2
77

8+
build:
9+
os: ubuntu-23.04
10+
tools:
11+
python: "3.10"
12+
813
# Build documentation in the docs/ directory with Sphinx
914
sphinx:
1015
builder: htmldir
@@ -15,10 +20,11 @@ sphinx:
1520
# configuration: mkdocs.yml
1621

1722
# Optionally build your docs in additional formats such as PDF and ePub
18-
formats: all
23+
# formats: all
1924

2025
# Optionally set the version of Python and requirements required to build your docs
2126
python:
22-
version: 3.7
27+
version: 3.11
2328
install:
2429
- requirements: docs/requirements.txt
30+
- method: pip

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ sphinx-build -b html -d _build/doctrees . _build/html
4949
```
5050

5151

52+
### Note
53+
54+
If you get this error, or similar... you might just need to remove the `_build/html/*` directory and try again, that seems to generally work.
55+
```
56+
docs\cli\hardware.rst:15: ERROR: Failed to import "cli" from "SoftLayer.CLI.hardware.cancel". The following exception was raised:
57+
Traceback (most recent call last):
58+
File "py311\Lib\site-packages\sphinx_click\ext.py", line 403, in _load_module
59+
mod = __import__(module_name, globals(), locals(), [attr_name])
60+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61+
File "SoftLayer\CLI\hardware\cancel.py", line 13, in <module>
62+
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
63+
^^^^^^^^^^^^^^^^^^^^^
64+
AttributeError: module 'SoftLayer.CLI' has no attribute 'command'
65+
```
66+
5267
## Unit Tests
5368

5469
All new features should be 100% code covered, and your pull request should at the very least increase total code overage.

SoftLayer/CLI/event_log/get.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
def cli(env, date_min, date_max, obj_event, obj_id, obj_type, utc_offset, metadata, limit):
3131
"""Get Event Logs
3232
33-
Example:
33+
Example::
34+
3435
slcli event-log get -d 01/01/2019 -D 02/01/2019 -t User -l 10
3536
"""
3637
columns = ['Event', 'Object', 'Type', 'Date', 'Username']

SoftLayer/CLI/licenses/create_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from SoftLayer.CLI.command import SLCommand as SLCommand
77
from SoftLayer.CLI import environment
88
from SoftLayer.CLI import formatting
9-
from SoftLayer.managers.licenses import LicensesManager
9+
from SoftLayer.managers.license import LicensesManager
1010
from SoftLayer import utils
1111

1212

SoftLayer/managers/license.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
SoftLayer.license
3-
~~~~~~~~~~~~~~~
3+
~~~~~~~~~~~~~~~~~
44
License Manager
55
66
:license: MIT, see LICENSE for more details.
@@ -11,6 +11,8 @@
1111
from SoftLayer.managers import ordering
1212
from SoftLayer import utils
1313

14+
LICENSE_PACKAGE_ID = 301
15+
1416

1517
class LicensesManager(object):
1618
"""Manages account license."""
@@ -63,3 +65,7 @@ def create(self, datacenter, item_package):
6365
item_keynames=item_package,
6466
complex_type=complex_type,
6567
hourly=False)
68+
69+
def get_create_options(self):
70+
"""Returns valid options for ordering Licenses."""
71+
return self.client.call('SoftLayer_Product_Package', 'getItems', id=LICENSE_PACKAGE_ID)

SoftLayer/managers/licenses.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

SoftLayer/managers/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
SoftLayer.storage
3-
~~~~~~~~~~~~~~~
3+
~~~~~~~~~~~~~~~~~
44
Network Storage Manager
55
66
:license: MIT, see LICENSE for more details.

SoftLayer/managers/storage_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
SoftLayer.storage_utils
3-
~~~~~~~~~~~~~~~
3+
~~~~~~~~~~~~~~~~~~~~~~~
44
Utility functions used by File and Block Storage Managers
55
66
:license: MIT, see LICENSE for more details.

SoftLayer/managers/tags.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
SoftLayer.tags
3-
~~~~~~~~~~~~
3+
~~~~~~~~~~~~~~
44
Tag Manager
55
66
:license: MIT, see LICENSE for more details.
@@ -83,18 +83,20 @@ def reference_lookup(self, resource_table_id, tag_type):
8383
8484
From SoftLayer_Tag::getAllTagTypes()
8585
86-
|Type |Service |
87-
| ----------------------------- | ------ |
88-
|Hardware |HARDWARE|
89-
|CCI |GUEST|
90-
|Account Document |ACCOUNT_DOCUMENT|
91-
|Ticket |TICKET|
92-
|Vlan Firewall |NETWORK_VLAN_FIREWALL|
93-
|Contract |CONTRACT|
94-
|Image Template |IMAGE_TEMPLATE|
95-
|Application Delivery Controller |APPLICATION_DELIVERY_CONTROLLER|
96-
|Vlan |NETWORK_VLAN|
97-
|Dedicated Host |DEDICATED_HOST|
86+
::
87+
88+
|Type |Service |
89+
| ----------------------------- | ------ |
90+
|Hardware |HARDWARE|
91+
|CCI |GUEST|
92+
|Account Document |ACCOUNT_DOCUMENT|
93+
|Ticket |TICKET|
94+
|Vlan Firewall |NETWORK_VLAN_FIREWALL|
95+
|Contract |CONTRACT|
96+
|Image Template |IMAGE_TEMPLATE|
97+
|Application Delivery Controller |APPLICATION_DELIVERY_CONTROLLER|
98+
|Vlan |NETWORK_VLAN|
99+
|Dedicated Host |DEDICATED_HOST|
98100
"""
99101
service = self.type_to_service(tag_type)
100102
if service is None:

SoftLayer/managers/user.py

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def enable_notifications(self, notifications_names):
101101
:returns: True on success
102102
103103
Example::
104+
104105
enable_notifications(['Order Approved','Reload Complete'])
105106
"""
106107

@@ -120,6 +121,7 @@ def disable_notifications(self, notifications_names):
120121
:returns: True on success
121122
122123
Example::
124+
123125
disable_notifications(['Order Approved','Reload Complete'])
124126
"""
125127

@@ -140,6 +142,7 @@ def add_permissions(self, user_id, permissions):
140142
:returns: True on success, Exception otherwise
141143
142144
Example::
145+
143146
add_permissions(123, ['BANDWIDTH_MANAGE'])
144147
"""
145148
pretty_permissions = self.format_permission_object(permissions)
@@ -154,6 +157,7 @@ def remove_permissions(self, user_id, permissions):
154157
:returns: True on success, Exception otherwise
155158
156159
Example::
160+
157161
remove_permissions(123, ['BANDWIDTH_MANAGE'])
158162
"""
159163
pretty_permissions = self.format_permission_object(permissions)
@@ -196,7 +200,9 @@ def get_logins(self, user_id, start_date=None):
196200
:param int id: User id to get
197201
:param string start_date: "%m/%d/%Y %H:%M:%s" formatted string.
198202
:returns: list https://softlayer.github.io/reference/datatypes/SoftLayer_User_Customer_Access_Authentication/
203+
199204
Example::
205+
200206
get_logins(123, '04/08/2018 0:0:0')
201207
"""
202208

@@ -366,7 +372,6 @@ def vpn_enable_or_disable(self, user_id, value):
366372
367373
:param int user_id: User to edit.
368374
:param bool value: Value for vpn enable flag.
369-
or
370375
:param bool value: Value for vpn disable flag.
371376
"""
372377
user_object = {'sslVpnAllowedFlag': value}
@@ -426,93 +431,86 @@ def get_overrides_list(self, user_id, subnet_ids):
426431
def grant_hardware_access(self, user_id, hardware_id):
427432
"""Grants the user access to a single hardware device.
428433
429-
:param int user_id:
430-
:param int hardware_id
431-
434+
:param int user_id: User Id
435+
:param int hardware_id: Hardware Id
432436
:returns: true
433437
"""
434438
return self.user_service.addHardwareAccess(hardware_id, id=user_id)
435439

436440
def grant_virtual_access(self, user_id, virtual_id):
437441
"""Grants the user access to a single VS device.
438442
439-
:param int user_id:
440-
:param int virtual_id
441-
443+
:param int user_id: User Id
444+
:param int virtual_id: Hardware Id
442445
:returns: true
443446
"""
444447
return self.user_service.addVirtualGuestAccess(virtual_id, id=user_id)
445448

446449
def grant_dedicated_access(self, user_id, dedicated_id):
447450
"""Grants the user access to a single dedicated host device.
448451
449-
:param int user_id:
450-
:param int dedicated_id
451-
452+
:param int user_id: User Id
453+
:param int dedicated_id: Dedicatd Host Id
452454
:returns: true
453455
"""
454456
return self.user_service.addDedicatedHostAccess(dedicated_id, id=user_id)
455457

456458
def remove_hardware_access(self, user_id, hardware_id):
457459
"""Remove hardware from a portal user’s hardware access list.
458460
459-
:param int user_id:
460-
:param int hardware_id
461-
461+
:param int user_id: User Id
462+
:param int hardware_id: Hardware Id
462463
:returns: true
463464
"""
464465
return self.user_service.removeHardwareAccess(hardware_id, id=user_id)
465466

466467
def remove_virtual_access(self, user_id, virtual_id):
467468
"""Remove hardware from a portal user’s virtual guests access list.
468469
469-
:param int user_id:
470-
:param int hardware_id
471-
470+
:param int user_id: User Id
471+
:param int hardware_id: Hardware Id
472472
:returns: true
473473
"""
474474
return self.user_service.removeVirtualGuestAccess(virtual_id, id=user_id)
475475

476476
def remove_dedicated_access(self, user_id, dedicated_id):
477477
"""Remove hardware from a portal user’s dedicated host access list.
478478
479-
:param int user_id:
480-
:param int dedicated_id
481-
479+
:param int user_id: User Id
480+
:param int dedicated_id: Dedicated Host Id
482481
:returns: true
483482
"""
484483
return self.user_service.removeDedicatedHostAccess(dedicated_id, id=user_id)
485484

486485
def get_user_hardware(self, user_id):
487486
"""User Hardware list.
488487
489-
:param int user_id:
488+
:param int user_id: User Id
490489
:return: List hardware relate to user
491490
"""
492491
return self.user_service.getHardware(id=user_id)
493492

494493
def get_user_dedicated_host(self, user_id):
495494
"""User dedicate host list.
496495
497-
:param int user_id:
496+
:param int user_id: User Id
498497
:return: List dedicated host relate to user
499498
"""
500499
return self.user_service.getDedicatedHosts(id=user_id)
501500

502501
def get_user_virtuals(self, user_id):
503502
"""User virtual guest list.
504503
505-
:param int user_id:
504+
:param int user_id: User Id
506505
:return: List virtual guest relate to user
507506
"""
508507
return self.user_service.getVirtualGuests(id=user_id)
509508

510509
def update_vpn_password(self, user_id, password):
511510
"""Update a user's VPN password.
512511
513-
:param int user_id:
514-
:param string password:
515-
512+
:param int user_id: User Id
513+
:param string password: Password
516514
:returns: true
517515
"""
518516
return self.user_service.updateVpnPassword(password, id=user_id)

docs/_templates/manager_template.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{ objname }}
2+
{{ underline }}
3+
4+
.. currentmodule:: {{ module }}
5+
6+
.. autoclass:: {{ objname }}
7+
:members:
8+
:inherited-members:
9+
10+
{% block methods %}
11+
.. automethod:: __init__
12+
13+
{% if methods %}
14+
.. rubric:: Methods
15+
16+
.. autosummary::
17+
{% for item in methods %}
18+
~{{ name }}.{{ item }}
19+
{%- endfor %}
20+
{% endif %}
21+
{% endblock %}
22+
23+
{% block attributes %}
24+
{% if attributes %}
25+
.. rubric:: Attributes
26+
27+
.. autosummary::
28+
{% for item in attributes %}
29+
~{{ name }}.{{ item }}
30+
{%- endfor %}
31+
{% endif %}
32+
{% endblock %}

0 commit comments

Comments
 (0)