Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: softlayer/softlayer-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.1.0
Choose a base ref
...
head repository: softlayer/softlayer-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.1.1
Choose a head ref
Loading
Showing with 1,264 additions and 189 deletions.
  1. +13 −0 .github/dependabot.yml
  2. +3 −2 .github/workflows/release.yml
  3. +42 −6 CHANGELOG.md
  4. +109 −0 SoftLayer/CLI/block/options.py
  5. +0 −2 SoftLayer/CLI/block/subnets/list.py
  6. +10 −3 SoftLayer/CLI/cdn/edit.py
  7. +1 −1 SoftLayer/CLI/dedicatedhost/create_options.py
  8. +4 −0 SoftLayer/CLI/environment.py
  9. +110 −0 SoftLayer/CLI/file/options.py
  10. +14 −7 SoftLayer/CLI/formatting.py
  11. +2 −4 SoftLayer/CLI/hardware/create.py
  12. +1 −3 SoftLayer/CLI/hardware/create_options.py
  13. +2 −1 SoftLayer/CLI/hardware/reflash_firmware.py
  14. +19 −8 SoftLayer/CLI/hardware/sensor.py
  15. +78 −9 SoftLayer/CLI/object_storage/list_endpoints.py
  16. +8 −7 SoftLayer/CLI/order/item_list.py
  17. +10 −16 SoftLayer/CLI/order/place.py
  18. +5 −0 SoftLayer/CLI/routes.py
  19. +60 −0 SoftLayer/CLI/user/device_access.py
  20. +46 −0 SoftLayer/CLI/user/remove_access.py
  21. +4 −1 SoftLayer/CLI/virt/cancel.py
  22. +1 −3 SoftLayer/CLI/virt/create.py
  23. +10 −1 SoftLayer/CLI/vlan/create.py
  24. +41 −6 SoftLayer/CLI/vlan/detail.py
  25. +4 −0 SoftLayer/CLI/vlan/edit.py
  26. +38 −11 SoftLayer/CLI/vlan/list.py
  27. +34 −0 SoftLayer/CLI/vpn/ipsec/order.py
  28. +1 −1 SoftLayer/consts.py
  29. +18 −1 SoftLayer/fixtures/SoftLayer_Hardware.py
  30. +1 −12 SoftLayer/fixtures/SoftLayer_Location.py
  31. +18 −0 SoftLayer/fixtures/SoftLayer_Product_Order.py
  32. +45 −0 SoftLayer/fixtures/SoftLayer_Product_Package.py
  33. +79 −0 SoftLayer/fixtures/SoftLayer_User_Customer.py
  34. +10 −2 SoftLayer/managers/cdn.py
  35. +15 −0 SoftLayer/managers/ipsec.py
  36. +37 −8 SoftLayer/managers/network.py
  37. +3 −23 SoftLayer/managers/object_storage.py
  38. +21 −1 SoftLayer/managers/ordering.py
  39. +54 −0 SoftLayer/managers/user.py
  40. +4 −0 docs/cli/block.rst
  41. +4 −0 docs/cli/file.rst
  42. +4 −0 docs/cli/ipsec.rst
  43. +8 −0 docs/cli/users.rst
  44. +2 −2 setup.py
  45. +16 −0 tests/CLI/helper_tests.py
  46. +5 −0 tests/CLI/modules/block_tests.py
  47. +4 −0 tests/CLI/modules/file_tests.py
  48. +12 −0 tests/CLI/modules/ipsec_tests.py
  49. +52 −13 tests/CLI/modules/object_storage_tests.py
  50. +16 −12 tests/CLI/modules/order_tests.py
  51. +24 −1 tests/CLI/modules/server_tests.py
  52. +20 −0 tests/CLI/modules/user_tests.py
  53. +12 −0 tests/CLI/modules/vs/vs_create_tests.py
  54. +20 −0 tests/managers/ipsec_tests.py
  55. +16 −0 tests/managers/network_tests.py
  56. +38 −18 tests/managers/object_storage_tests.py
  57. +11 −3 tests/managers/ordering_tests.py
  58. +24 −0 tests/managers/user_tests.py
  59. +1 −1 tools/requirements.txt
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Use `allow` to specify which dependencies to maintain
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-update

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "pip prod"
prefix-development: "pip dev"
include: "scope"
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ jobs:
- name: Publish 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.CGALLO_TEST_PYPI }}
repository_url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.CGALLO_PYPI }}
repository_url: https://pypi.org/legacy/

48 changes: 42 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,46 @@
# Change Log

## [6.1.1] - 2022-08-18

#### What's Changed
* v6.1.0 Changelog and version bump by @allmightyspiff in https://github.com/softlayer/softlayer-python/pull/1674
* item-list fix by @allmightyspiff in https://github.com/softlayer/softlayer-python/pull/1679
* updating release job to actually publish to pypi by @allmightyspiff in https://github.com/softlayer/softlayer-python/pull/1680
* Update command - slcli object-storage endpoints by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1685
* add the block volume-options command by @caberos in https://github.com/softlayer/softlayer-python/pull/1681
* add the file volume-options command by @caberos in https://github.com/softlayer/softlayer-python/pull/1684
* fixed issues where a message warned users about closing datacenter by @allmightyspiff in https://github.com/softlayer/softlayer-python/pull/1688
* Enable --format=raw and fixes table width by @allmightyspiff in https://github.com/softlayer/softlayer-python/pull/1689
* Update `slcli hardware sensor` by @BrianSantivanez in https://github.com/softlayer/softlayer-python/pull/1691
* Improved successful response to command - slcli vs cancel by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1695
* Fixed an issue with printing tables that contained empty items by @allmightyspiff in https://github.com/softlayer/softlayer-python/pull/1697
* Added a dependabot scanner by @allmightyspiff in https://github.com/softlayer/softlayer-python/pull/1699
* block|file volume-options improvements by @caberos in https://github.com/softlayer/softlayer-python/pull/1700
* Option create-options in commands hardware and dedicatedhost fixed by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1703
* pip prod(deps): bump rich from 12.3.0 to 12.5.1 by @dependabot in https://github.com/softlayer/softlayer-python/pull/1704
* block/file volume-options improvements 2 by @caberos in https://github.com/softlayer/softlayer-python/pull/1702
* New command ipsec order by @caberos in https://github.com/softlayer/softlayer-python/pull/1698
* block/file volume-options improvement 3 by @caberos in https://github.com/softlayer/softlayer-python/pull/1705
* Command slcli vlan create - displaying an error message by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1707
* New Command: user device-access by @caberos in https://github.com/softlayer/softlayer-python/pull/1712
* Command slcli vlan edit accept that we do not send any parameters by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1709
* Updated command - slcli vlan list by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1713
* `slcli block subnets-list` command display an error message by @BrianSantivanez in https://github.com/softlayer/softlayer-python/pull/1716
* add user remove-access command by @caberos in https://github.com/softlayer/softlayer-python/pull/1717
* Add Devices with Trunks to vlan detail by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1721
* slcli hardware reflash-firmware command does not display success message by @BrianSantivanez in https://github.com/softlayer/softlayer-python/pull/1724
* Fix bug with command - slcli cdn edit by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1726

#### New Contributors
* @dependabot made their first contribution in https://github.com/softlayer/softlayer-python/pull/1704

**Full Changelog**: https://github.com/softlayer/softlayer-python/compare/v6.1.0...v6.1.1



## [6.1.0] - 2022-06-30

## Major Updates
#### Major Updates
* [Rich](https://github.com/Textualize/rich) tables by @allmightyspiff in https://github.com/softlayer/softlayer-python/pull/1646
* [Rich](https://github.com/Textualize/rich) Text support by @allmightyspiff in https://github.com/softlayer/softlayer-python/pull/1635

@@ -14,7 +50,7 @@ Rich Text and Rich Tables will modernize the output of the SLCLI to be a little
![image](https://user-images.githubusercontent.com/7408017/176753845-32af33f0-454f-4bab-ac63-1ae3db788ede.png)


## What's Changed
#### What's Changed
* slcli licenses is missing the help text by @caberos in https://github.com/softlayer/softlayer-python/pull/1605
* Add a warning if user orders in a POD that is being closed by @caberos in https://github.com/softlayer/softlayer-python/pull/1600
* updated number of updates in the command account event-detail by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1609
@@ -50,15 +86,15 @@ Rich Text and Rich Tables will modernize the output of the SLCLI to be a little
* new feature block object-storage permissions command by @caberos in https://github.com/softlayer/softlayer-python/pull/1668
* fix the vlan table by @caberos in https://github.com/softlayer/softlayer-python/pull/1672

## New Contributors
#### New Contributors
* @BrianSantivanez made their first contribution in https://github.com/softlayer/softlayer-python/pull/1629

**Full Changelog**: https://github.com/softlayer/softlayer-python/compare/v6.0.2...v6.1.0


## [6.0.2] - 2022-03-30
### [6.0.2] - 2022-03-30

## What's Changed
#### What's Changed
* New Command slcli hardware|virtual monitoring by @caberos in https://github.com/softlayer/softlayer-python/pull/1593
* When listing datacenters/pods, mark those that are closing soon. by @caberos in https://github.com/softlayer/softlayer-python/pull/1597

@@ -68,7 +104,7 @@ Rich Text and Rich Tables will modernize the output of the SLCLI to be a little
## [6.0.1] - 2022-03-11


## What's Changed
#### What's Changed
* Replace the use of ptable with prettytable by @dvzrv in https://github.com/softlayer/softlayer-python/pull/1584
* Bandwidth pool management by @caberos in https://github.com/softlayer/softlayer-python/pull/1582
* Add id in the result in the command bandwidth-pools by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1586
109 changes: 109 additions & 0 deletions SoftLayer/CLI/block/options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
"""List all options for ordering a block storage."""
# :license: MIT, see LICENSE for more details.

import click

import SoftLayer
from SoftLayer.CLI.command import SLCommand
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting

PACKAGE_STORAGE = 759


@click.command(cls=SLCommand)
@click.argument('location', required=False)
@click.option('--prices', '-p', is_flag=True,
help='Use --prices to list the server item prices, and to list the Item Prices by location,'
'add it to the --prices option using location short name, e.g. --prices dal13')
@environment.pass_env
def cli(env, prices, location=None):
"""List all options for ordering a block storage"""

order_manager = SoftLayer.OrderingManager(env.client)
items = order_manager.get_items(PACKAGE_STORAGE)
datacenters = order_manager.get_regions(PACKAGE_STORAGE, location)

tables = []
network = SoftLayer.NetworkManager(env.client)
pods = network.get_closed_pods()

if datacenters != []:
datacenter_table = formatting.Table(['Id', 'Description', 'KeyName'], title='Datacenter')

for datacenter in datacenters:
closure = []
for pod in pods:
if datacenter['location']['location']['name'] in str(pod['name']):
closure.append(pod['name'])

notes = '-'
if len(closure) > 0:
notes = 'closed soon: %s' % (', '.join(closure))
datacenter_table.add_row([datacenter['location']['locationId'],
datacenter.get('description'),
datacenter['keyname'], notes])
tables.append(datacenter_table)
else:
raise exceptions.CLIAbort('Location does not exit.')

tables.append(_block_ios_get_table(items, prices))
tables.append(_block_storage_table(items, prices))
tables.append(_block_snapshot_get_table(items, prices))
env.fout(tables)


def _block_ios_get_table(items, prices):
if prices:
table = formatting.Table(['Id', 'Description', 'KeyName', 'Prices'], title='IOPS')
for block_item in items:
if block_item['itemCategory']['categoryCode'] == 'storage_tier_level':
table.add_row([block_item.get('id'), block_item.get('description'),
block_item.get('keyName'), block_item['prices'][0]['recurringFee']])
else:
table = formatting.Table(['Id', 'Description', 'KeyName'], title='IOPS')
for block_item in items:
if block_item['itemCategory']['categoryCode'] == 'storage_tier_level':
table.add_row([block_item.get('id'), block_item.get('description'),
block_item.get('keyName')])
table.sortby = 'Id'
table.align = 'l'
return table


def _block_storage_table(items, prices):
if prices:
table = formatting.Table(['Id', 'Description', 'KeyName', 'Capacity Minimum', 'Prices'], title='Storage')
for block_item in items:
if block_item['itemCategory']['categoryCode'] == 'performance_storage_space':
table.add_row([block_item.get('id'), block_item.get('description'),
block_item.get('keyName'), block_item.get('capacityMinimum') or '-',
block_item['prices'][0]['recurringFee']])
else:
table = formatting.Table(['Id', 'Description', 'KeyName', 'Capacity Minimum'], title='Storage')
for block_item in items:
if block_item['itemCategory']['categoryCode'] == 'performance_storage_space':
table.add_row([block_item.get('id'), block_item.get('description'),
block_item.get('keyName'), block_item.get('capacityMinimum') or '-', ])
table.sortby = 'Id'
table.align = 'l'
return table


def _block_snapshot_get_table(items, prices):
if prices:
table = formatting.Table(['Id', 'Description', 'KeyName', 'Prices'], title='Snapshot')
for block_item in items:
if block_item['itemCategory']['categoryCode'] == 'storage_snapshot_space':
table.add_row([block_item.get('id'), block_item.get('description'),
block_item.get('keyName'), block_item['prices'][0]['recurringFee']])
else:
table = formatting.Table(['Id', 'Description', 'KeyName'], title='Snapshot')
for block_item in items:
if block_item['itemCategory']['categoryCode'] == 'storage_snapshot_space':
table.add_row([block_item.get('id'), block_item.get('description'),
block_item.get('keyName')])
table.sortby = 'Id'
table.align = 'l'
return table
2 changes: 0 additions & 2 deletions SoftLayer/CLI/block/subnets/list.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@

COLUMNS = [
'id',
'createDate',
'networkIdentifier',
'cidr'
]
@@ -33,7 +32,6 @@ def cli(env, access_id):
table = formatting.Table(COLUMNS)
for subnet in subnets:
row = ["{0}".format(subnet['id']),
"{0}".format(subnet['createDate']),
"{0}".format(subnet['networkIdentifier']),
"{0}".format(subnet['cidr'])]
table.add_row(row)
13 changes: 10 additions & 3 deletions SoftLayer/CLI/cdn/edit.py
Original file line number Diff line number Diff line change
@@ -19,6 +19,10 @@
type=click.INT,
help="HTTP port."
)
@click.option('--https-port', '-s',
type=click.INT,
help="HTTPS port."
)
@click.option('--origin', '-o',
type=click.STRING,
help="Origin server address."
@@ -39,7 +43,7 @@
"the Dynamic content acceleration option is not added because this has a special configuration."
)
@environment.pass_env
def cli(env, identifier, header, http_port, origin, respect_headers, cache, performance_configuration):
def cli(env, identifier, header, http_port, https_port, origin, respect_headers, cache, performance_configuration):
"""Edit a CDN Account.
Note: You can use the hostname or uniqueId as IDENTIFIER.
@@ -56,7 +60,7 @@ def cli(env, identifier, header, http_port, origin, respect_headers, cache, perf
else:
cache_result['cacheKeyQueryRule'] = cache[0]

cdn_result = manager.edit(cdn_id, header=header, http_port=http_port, origin=origin,
cdn_result = manager.edit(cdn_id, header=header, http_port=http_port, https_port=https_port, origin=origin,
respect_headers=respect_headers, cache=cache_result,
performance_configuration=performance_configuration)

@@ -67,7 +71,10 @@ def cli(env, identifier, header, http_port, origin, respect_headers, cache, perf
for cdn in cdn_result:
table.add_row(['Create Date', cdn.get('createDate')])
table.add_row(['Header', cdn.get('header')])
table.add_row(['Http Port', cdn.get('httpPort')])
if cdn.get('httpPort'):
table.add_row(['Http Port', cdn.get('httpPort')])
if cdn.get('httpsPort'):
table.add_row(['Https Port', cdn.get('httpsPort')])
table.add_row(['Origin Type', cdn.get('originType')])
table.add_row(['Performance Configuration', cdn.get('performanceConfiguration')])
table.add_row(['Protocol', cdn.get('protocol')])
2 changes: 1 addition & 1 deletion SoftLayer/CLI/dedicatedhost/create_options.py
Original file line number Diff line number Diff line change
@@ -58,4 +58,4 @@ def cli(env, **kwargs):
br_table.add_row([router['hostname']])
tables.append(br_table)

env.fout(formatting.listing(tables, separator='\n'))
env.fout(tables)
4 changes: 4 additions & 0 deletions SoftLayer/CLI/environment.py
Original file line number Diff line number Diff line change
@@ -45,6 +45,10 @@ def __init__(self):

def out(self, output):
"""Outputs a string to the console (stdout)."""

# If we output to a | or file, need to set default width so all output is printed.
if not self.console.is_terminal:
self.console.width = 1000000
if self.format == 'json':
try:
self.console.print_json(output)
Loading