Skip to content

Commit 3fd889f

Browse files
authored
Merge pull request #22 from rescale/rebase-softlayer-07-22-2019
Rebase softlayer to upstream - 07 22 2019
2 parents 7940e1b + 1cdf2f7 commit 3fd889f

246 files changed

Lines changed: 11491 additions & 4011 deletions

File tree

Some content is hidden

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

.readthedocs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
builder: htmldir
11+
configuration: docs/conf.py
12+
13+
# Build documentation with MkDocs
14+
#mkdocs:
15+
# configuration: mkdocs.yml
16+
17+
# Optionally build your docs in additional formats such as PDF and ePub
18+
formats: all
19+
20+
# Optionally set the version of Python and requirements required to build your docs
21+
python:
22+
version: 3.7
23+
install:
24+
- requirements: docs/requirements.txt

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1+
# https://docs.travis-ci.com/user/languages/python/#python-37-and-higher
2+
dist: xenial
13
language: python
24
sudo: false
35
matrix:
46
include:
5-
- python: "2.7"
6-
env: TOX_ENV=py27
77
- python: "3.5"
88
env: TOX_ENV=py35
99
- python: "3.6"
1010
env: TOX_ENV=py36
11-
- python: "pypy2.7-5.8.0"
11+
- python: "3.7"
12+
env: TOX_ENV=py37
13+
- python: "pypy3.5"
1214
env: TOX_ENV=pypy
13-
- python: "2.7"
15+
- python: "3.6"
1416
env: TOX_ENV=analysis
15-
- python: "2.7"
17+
- python: "3.6"
1618
env: TOX_ENV=coverage
1719
install:
1820
- pip install tox

CHANGELOG.md

Lines changed: 118 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,124 @@
11
# Change Log
22

3+
4+
## [5.7.2] - 2019-05-03
5+
- https://github.com/softlayer/softlayer-python/compare/v5.7.1...v5.7.2
6+
7+
+ #1107 Added exception to handle json parsing error when ordering
8+
+ #1068 Support for -1 when changing port speed
9+
+ #1109 Fixed docs about placement groups
10+
+ #1112 File storage endurance iops upgrade
11+
+ #1101 Handle the new user creation exceptions
12+
+ #1116 Fix order place quantity option
13+
+ #1002 Invoice commands
14+
* account invoices
15+
* account invoice-detail
16+
* account summary
17+
+ #1004 Event Notification Management commands
18+
* account events
19+
* account event-detail
20+
+ #1117 Two PCIe items can be added at order time
21+
+ #1121 Fix object storage apiType for S3 and Swift.
22+
+ #1100 Event Log performance improvements.
23+
+ #872 column 'name' was renamed to 'hostname'
24+
+ #1127 Fix object storage credentials.
25+
+ #1129 Fixed unexpected errors in slcli subnet create
26+
+ #1134 Change encrypt parameters for importing of images. Adds root-key-crn
27+
+ #208 Quote ordering commands
28+
* order quote
29+
* order quote-detail
30+
* order quote-list
31+
+ #1113 VS usage information command
32+
* virtual usage
33+
+ #1131 made sure config_tests dont actually make api calls.
34+
35+
36+
## [5.7.1] - 2019-02-26
37+
- https://github.com/softlayer/softlayer-python/compare/v5.7.0...v5.7.1
38+
39+
+ #1089 removed legacy SL message queue commands
40+
+ Support for Hardware reflash firmware CLI/Manager method
41+
42+
## [5.7.0] - 2019-02-15
43+
- Changes: https://github.com/softlayer/softlayer-python/compare/v5.6.4...v5.7.0
44+
45+
+ #1099 Support for security group Ids
46+
+ event-log cli command
47+
+ #1069 Virtual Placement Group Support
48+
```
49+
slcli vs placementgroup --help
50+
Commands:
51+
create Create a placement group.
52+
create-options List options for creating a placement group.
53+
delete Delete a placement group.
54+
detail View details of a placement group.
55+
list List placement groups.
56+
```
57+
+ #962 Rest Transport improvements. Properly handle HTTP exceptions instead of crashing.
58+
+ #1090 removed power_state column option from "slcli server list"
59+
+ #676 - ipv6 support for creating virtual guests
60+
* Refactored virtual guest creation to use Product_Order::placeOrder instead of Virtual_Guest::createObject, because createObject doesn't allow adding IPv6
61+
+ #882 Added table which shows the status of each url in object storage
62+
+ #1085 Update provisionedIops reading to handle float-y values
63+
+ #1074 fixed issue with config setup
64+
+ #1081 Fix file volume-cancel
65+
+ #1059 Support for SoftLayer_Hardware_Server::toggleManagementInterface
66+
* `slcli hw toggle-ipmi`
67+
68+
69+
## [5.6.4] - 2018-11-16
70+
71+
- Changes: https://github.com/softlayer/softlayer-python/compare/v5.6.3...v5.6.4
72+
73+
+ #1041 Dedicated host cancel, cancel-guests, list-guests
74+
+ #1071 added createDate and modifyDate parameters to sg rule-list
75+
+ #1060 Fixed slcli subnet list
76+
+ #1056 Fixed documentation link in image manager
77+
+ #1062 Added description to slcli order
78+
79+
## [5.6.3] - 2018-11-07
80+
81+
- Changes: https://github.com/softlayer/softlayer-python/compare/v5.6.0...v5.6.3
82+
83+
+ #1065 Updated urllib3 and requests libraries due to CVE-2018-18074
84+
+ #1070 Fixed an ordering bug
85+
+ Updated release process and fab-file
86+
87+
## [5.6.0] - 2018-10-16
88+
- Changes: https://github.com/softlayer/softlayer-python/compare/v5.5.3...v5.6.0
89+
90+
+ #1026 Support for [Reserved Capacity](https://console.bluemix.net/docs/vsi/vsi_about_reserved.html#about-reserved-virtual-servers)
91+
* `slcli vs capacity create`
92+
* `slcli vs capacity create-guest`
93+
* `slcli vs capacity create-options`
94+
* `slcli vs capacity detail`
95+
* `slcli vs capacity list`
96+
+ #1050 Fix `post_uri` parameter name on docstring
97+
+ #1039 Fixed suspend cloud server order.
98+
+ #1055 Update to use click 7
99+
+ #1053 Add export/import capabilities to/from IBM Cloud Object Storage to the image manager as well as the slcli.
100+
101+
102+
## [5.5.3] - 2018-08-31
103+
- Changes: https://github.com/softlayer/softlayer-python/compare/v5.5.2...v5.5.3
104+
105+
+ Added `slcli user delete`
106+
+ #1023 Added `slcli order quote` to let users create a quote from the slcli.
107+
+ #1032 Fixed vs upgrades when using flavors.
108+
+ #1034 Added pagination to ticket list commands
109+
+ #1037 Fixed DNS manager to be more flexible and support more zone types.
110+
+ #1044 Pinned Click library version at >=5 < 7
111+
112+
## [5.5.2] - 2018-08-31
113+
- Changes: https://github.com/softlayer/softlayer-python/compare/v5.5.1...v5.5.2
114+
115+
+ #1018 Fixed hardware credentials.
116+
+ #1019 support for ticket priorities
117+
+ #1025 create dedicated host with gpu fixed.
118+
119+
3120
## [5.5.1] - 2018-08-06
4-
- Changes: https://github.com/softlayer/softlayer-python/compare/v5.5.0...master
121+
- Changes: https://github.com/softlayer/softlayer-python/compare/v5.5.0...v5.5.1
5122

6123
- #1006, added paginations to several slcli methods, making them work better with large result sets.
7124
- #995, Fixed an issue displaying VLANs.

CONTRIBUTING.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,80 @@ Code is tested and style checked with tox, you can run the tox tests individuall
2525
* create pull request
2626

2727

28+
## Documentation
2829

30+
CLI command should have a more human readable style of documentation.
31+
Manager methods should have a decent docblock describing any parameters and what the method does.
2932

33+
Docs are generated with [Sphinx](https://docs.readthedocs.io/en/latest/intro/getting-started-with-sphinx.html) and once Sphinx is setup, you can simply do
34+
35+
`make html` in the softlayer-python/docs directory, which should generate the HTML in softlayer-python/docs/_build/html for testing.
36+
37+
38+
## Unit Tests
39+
40+
All new features should be 100% code covered, and your pull request should at the very least increase total code overage.
41+
42+
### Mocks
43+
To tests results from the API, we keep mock results in SoftLayer/fixtures/<SoftLayer_Service>/ with the method name matching the variable name.
44+
45+
Any call to a service that doesn't have a fixture will result in a TransportError
46+
47+
### Overriding Fixtures
48+
49+
Adding your expected output in the fixtures file with a unique name is a good way to define a fixture that gets used frequently in a test.
50+
51+
```python
52+
from SoftLayer.fixtures import SoftLayer_Product_Package
53+
54+
def test_test(self):
55+
amock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
56+
amock.return_value = fixtures.SoftLayer_Product_Package.RESERVED_CAPACITY
57+
```
58+
59+
Otherwise defining it on the spot works too.
60+
```python
61+
def test_test(self):
62+
mock = self.set_mock('SoftLayer_Network_Storage', 'getObject')
63+
mock.return_value = {
64+
'billingItem': {'hourlyFlag': True, 'id': 449},
65+
}
66+
```
67+
68+
69+
### Call testing
70+
Testing your code to make sure it makes the correct API call is also very important.
71+
72+
The testing.TestCase class has a method call `assert_called_with` which is pretty handy here.
73+
74+
```python
75+
self.assert_called_with(
76+
'SoftLayer_Billing_Item', # Service
77+
'cancelItem', # Method
78+
args=(True, True, ''), # Args
79+
identifier=449, # Id
80+
mask=mock.ANY, # object Mask,
81+
filter=mock.ANY, # object Filter
82+
limit=0, # result Limit
83+
offset=0 # result Offset
84+
)
85+
```
86+
87+
Making sure a API was NOT called
88+
89+
```python
90+
self.assertEqual([], self.calls('SoftLayer_Account', 'getObject'))
91+
```
92+
93+
Making sure an API call has a specific arg, but you don't want to list out the entire API call (like with a place order test)
94+
95+
```python
96+
# Get the API Call signature
97+
order_call = self.calls('SoftLayer_Product_Order', 'placeOrder')
98+
99+
# Get the args property of that API call, which is a tuple, with the first entry being our data.
100+
order_args = getattr(order_call[0], 'args')[0]
101+
102+
# Test our specific argument value
103+
self.assertEqual(123, order_args['hostId'])
104+
```

0 commit comments

Comments
 (0)