Skip to content

Commit 6fdb936

Browse files
caberoscaberos
authored andcommitted
update branch
2 parents f543f3d + 7a90f9d commit 6fdb936

31 files changed

+1492
-1214
lines changed

.gitattributes

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Language aware diff headers
5+
# https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more
6+
# https://gist.github.com/tekin/12500956bd56784728e490d8cef9cb81
7+
*.css diff=css
8+
*.html diff=html
9+
*.py diff=python
10+
*.md diff=markdown
11+
12+
13+
# Declare files that will always have CRLF line endings on checkout.
14+
*.sln text eol=crlf
15+
16+
# Denote all files that are truly binary and should not be modified.
17+
*.png binary
18+
*.jpg binary
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
name: documentation
2-
3-
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
8-
jobs:
9-
build:
10-
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
python-version: [3.8]
14-
15-
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v1
19-
with:
20-
python-version: ${{ matrix.python-version }}
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install -r tools/test-requirements.txt
25-
- name: Documentation Checks
26-
run: |
27-
python docCheck.py
1+
name: documentation
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: [3.8]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -r tools/test-requirements.txt
25+
- name: Documentation Checks
26+
run: |
27+
python docCheck.py
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2-
3-
name: Publish 📦 to TestPyPI
4-
5-
on:
6-
push:
7-
branches: [test-pypi ]
8-
9-
jobs:
10-
build-n-publish:
11-
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@master
15-
- name: Set up Python 3.8
16-
uses: actions/setup-python@v2
17-
with:
18-
python-version: 3.8
19-
- name: Install pypa/build
20-
run: >-
21-
python -m
22-
pip install
23-
build
24-
--user
25-
- name: Build a binary wheel and a source tarball
26-
run: >-
27-
python -m
28-
build
29-
--sdist
30-
--wheel
31-
--outdir dist/
32-
.
33-
- name: Publish 📦 to Test PyPI
34-
uses: pypa/gh-action-pypi-publish@master
35-
with:
36-
password: ${{ secrets.CGALLO_TEST_PYPI }}
1+
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2+
3+
name: Publish 📦 to TestPyPI
4+
5+
on:
6+
push:
7+
branches: [test-pypi ]
8+
9+
jobs:
10+
build-n-publish:
11+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@master
15+
- name: Set up Python 3.8
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.8
19+
- name: Install pypa/build
20+
run: >-
21+
python -m
22+
pip install
23+
build
24+
--user
25+
- name: Build a binary wheel and a source tarball
26+
run: >-
27+
python -m
28+
build
29+
--sdist
30+
--wheel
31+
--outdir dist/
32+
.
33+
- name: Publish 📦 to Test PyPI
34+
uses: pypa/gh-action-pypi-publish@master
35+
with:
36+
password: ${{ secrets.CGALLO_TEST_PYPI }}
3737
repository_url: https://test.pypi.org/legacy/

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Christopher Gallo <chrisagallo@gmail.com>

CHANGELOG.md

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

33

4-
## [5.9.9] - 2021-12-07
4+
## [6.0.1] - 2022-03-11
5+
6+
7+
## What's Changed
8+
* Replace the use of ptable with prettytable by @dvzrv in https://github.com/softlayer/softlayer-python/pull/1584
9+
* Bandwidth pool management by @caberos in https://github.com/softlayer/softlayer-python/pull/1582
10+
* Add id in the result in the command bandwidth-pools by @edsonarios in https://github.com/softlayer/softlayer-python/pull/1586
11+
* Datacenter closure report by @allmightyspiff in https://github.com/softlayer/softlayer-python/pull/1592
12+
* fix to errors in slcli hw create-options by @caberos in https://github.com/softlayer/softlayer-python/pull/1594
13+
14+
15+
**Full Changelog**: https://github.com/softlayer/softlayer-python/compare/v5.9.9...v6.0.1
16+
17+
6.0.0 was skipped.
18+
19+
## [5.9.9] - 2022-02-04
520

621
https://github.com/softlayer/softlayer-python/compare/v5.9.8...v5.9.9
722

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
"""Lists all active billing items on this account. See https://cloud.ibm.com/billing/billing-items"""
2-
# :license: MIT, see LICENSE for more details.
3-
import click
4-
5-
from SoftLayer.CLI import environment
6-
from SoftLayer.CLI import formatting
7-
from SoftLayer.managers.account import AccountManager as AccountManager
8-
from SoftLayer import utils
9-
10-
11-
@click.command()
12-
@environment.pass_env
13-
def cli(env):
14-
"""Lists billing items with some other useful information.
15-
16-
Similiar to https://cloud.ibm.com/billing/billing-items
17-
"""
18-
19-
manager = AccountManager(env.client)
20-
items = manager.get_account_billing_items()
21-
table = item_table(items)
22-
23-
env.fout(table)
24-
25-
26-
def item_table(items):
27-
"""Formats a table for billing items"""
28-
table = formatting.Table([
29-
"Id",
30-
"Create Date",
31-
"Cost",
32-
"Category Code",
33-
"Ordered By",
34-
"Description",
35-
"Notes"
36-
], title="Billing Items")
37-
table.align['Description'] = 'l'
38-
table.align['Category Code'] = 'l'
39-
for item in items:
40-
description = item.get('description')
41-
fqdn = "{}.{}".format(item.get('hostName', ''), item.get('domainName', ''))
42-
if fqdn != ".":
43-
description = fqdn
44-
user = utils.lookup(item, 'orderItem', 'order', 'userRecord')
45-
ordered_by = "IBM"
46-
create_date = utils.clean_time(item.get('createDate'), in_format='%Y-%m-%d', out_format='%Y-%m-%d')
47-
if user:
48-
# ordered_by = "{} ({})".format(user.get('displayName'), utils.lookup(user, 'userStatus', 'name'))
49-
ordered_by = user.get('displayName')
50-
51-
table.add_row([
52-
item.get('id'),
53-
create_date,
54-
item.get('nextInvoiceTotalRecurringAmount'),
55-
item.get('categoryCode'),
56-
ordered_by,
57-
utils.trim_to(description, 50),
58-
utils.trim_to(item.get('notes', 'None'), 40),
59-
])
60-
return table
1+
"""Lists all active billing items on this account. See https://cloud.ibm.com/billing/billing-items"""
2+
# :license: MIT, see LICENSE for more details.
3+
import click
4+
5+
from SoftLayer.CLI import environment
6+
from SoftLayer.CLI import formatting
7+
from SoftLayer.managers.account import AccountManager as AccountManager
8+
from SoftLayer import utils
9+
10+
11+
@click.command()
12+
@environment.pass_env
13+
def cli(env):
14+
"""Lists billing items with some other useful information.
15+
16+
Similiar to https://cloud.ibm.com/billing/billing-items
17+
"""
18+
19+
manager = AccountManager(env.client)
20+
items = manager.get_account_billing_items()
21+
table = item_table(items)
22+
23+
env.fout(table)
24+
25+
26+
def item_table(items):
27+
"""Formats a table for billing items"""
28+
table = formatting.Table([
29+
"Id",
30+
"Create Date",
31+
"Cost",
32+
"Category Code",
33+
"Ordered By",
34+
"Description",
35+
"Notes"
36+
], title="Billing Items")
37+
table.align['Description'] = 'l'
38+
table.align['Category Code'] = 'l'
39+
for item in items:
40+
description = item.get('description')
41+
fqdn = "{}.{}".format(item.get('hostName', ''), item.get('domainName', ''))
42+
if fqdn != ".":
43+
description = fqdn
44+
user = utils.lookup(item, 'orderItem', 'order', 'userRecord')
45+
ordered_by = "IBM"
46+
create_date = utils.clean_time(item.get('createDate'), in_format='%Y-%m-%d', out_format='%Y-%m-%d')
47+
if user:
48+
# ordered_by = "{} ({})".format(user.get('displayName'), utils.lookup(user, 'userStatus', 'name'))
49+
ordered_by = user.get('displayName')
50+
51+
table.add_row([
52+
item.get('id'),
53+
create_date,
54+
item.get('nextInvoiceTotalRecurringAmount'),
55+
item.get('categoryCode'),
56+
ordered_by,
57+
utils.trim_to(description, 50),
58+
utils.trim_to(item.get('notes', 'None'), 40),
59+
])
60+
return table
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
"""Cancels a billing item."""
2-
# :license: MIT, see LICENSE for more details.
3-
import click
4-
5-
from SoftLayer.CLI import environment
6-
from SoftLayer.managers.account import AccountManager as AccountManager
7-
8-
9-
@click.command()
10-
@click.argument('identifier')
11-
@environment.pass_env
12-
def cli(env, identifier):
13-
"""Cancels a billing item."""
14-
15-
manager = AccountManager(env.client)
16-
item = manager.cancel_item(identifier)
17-
18-
env.fout(item)
1+
"""Cancels a billing item."""
2+
# :license: MIT, see LICENSE for more details.
3+
import click
4+
5+
from SoftLayer.CLI import environment
6+
from SoftLayer.managers.account import AccountManager as AccountManager
7+
8+
9+
@click.command()
10+
@click.argument('identifier')
11+
@environment.pass_env
12+
def cli(env, identifier):
13+
"""Cancels a billing item."""
14+
15+
manager = AccountManager(env.client)
16+
item = manager.cancel_item(identifier)
17+
18+
env.fout(item)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Autoscale"""
1+
"""Autoscale"""

0 commit comments

Comments
 (0)