Skip to content

Commit ac3b1e0

Browse files
updating readme and setup.py
1 parent d8714dd commit ac3b1e0

File tree

3 files changed

+52
-76
lines changed

3 files changed

+52
-76
lines changed

README.rst

Lines changed: 46 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,53 @@
11
SoftLayer API Python Client
22
===========================
3-
.. image:: https://github.com/softlayer/softlayer-python/workflows/Tests/badge.svg
4-
:target: https://github.com/softlayer/softlayer-python/actions?query=workflow%3ATests
53

6-
.. image:: https://github.com/softlayer/softlayer-python/workflows/documentation/badge.svg
7-
:target: https://github.com/softlayer/softlayer-python/actions?query=workflow%3Adocumentation
4+
This library is provided `as is` to make internal IMS API calls. You are responsible for your API usage, and any abuse, intentional or accidental, will result in your employee account being locked or limited.
85

9-
.. image:: https://landscape.io/github/softlayer/softlayer-python/master/landscape.svg
10-
:target: https://landscape.io/github/softlayer/softlayer-python/master
11-
12-
.. image:: https://badge.fury.io/py/SoftLayer.svg
13-
:target: http://badge.fury.io/py/SoftLayer
14-
15-
.. image:: https://coveralls.io/repos/github/softlayer/softlayer-python/badge.svg?branch=master
16-
:target: https://coveralls.io/github/softlayer/softlayer-python?branch=master
17-
18-
.. image:: https://snapcraft.io//slcli/badge.svg
19-
:target: https://snapcraft.io/slcli
20-
21-
22-
This library provides a simple Python client to interact with `SoftLayer's
23-
XML-RPC API <https://softlayer.github.io/reference/softlayerapi>`_.
24-
25-
A command-line interface is also included and can be used to manage various
26-
SoftLayer products and services.
276

7+
Make sure you use the HTTPS url `https://internal.app0lb.dal10.softlayer.local/v3/internal/xmlrpc/`
288

299
Documentation
3010
-------------
31-
Documentation for the Python client is available at `Read the Docs <https://softlayer-python.readthedocs.io/en/latest/index.html>`_ .
11+
DThis project is based off the `SLCLI <https://github.com/softlayer/softlayer-python>`_ , and most things that work there will work here.
3212

33-
Additional API documentation can be found on the SoftLayer Development Network:
34-
35-
* `SoftLayer API reference
36-
<https://sldn.softlayer.com/reference/softlayerapi>`_
37-
* `Object mask information and examples
38-
<https://sldn.softlayer.com/article/object-masks>`_
39-
* `Code Examples
40-
<https://sldn.softlayer.com/python/>`_
13+
There is no internal API documentation like SLDN.
4114

4215
Installation
4316
------------
4417
Install via pip:
4518

4619
.. code-block:: bash
4720
48-
$ pip install softlayer
49-
50-
51-
Or you can install from source. Download source and run:
21+
$ git clone https://github.ibm.com/SoftLayer/internal-softlayer-cli
22+
$ cd internal-softlayer-cli
23+
$ python setup.py install
24+
$ ./islcli login
5225
53-
.. code-block:: bash
5426
55-
$ python setup.py install
27+
Configuration
28+
-------------
5629

57-
Another (safer) method of installation is to use the published snap. Snaps are available for any Linux OS running snapd, the service that runs and manage snaps. Snaps are "auto-updating" packages and will not disrupt the current versions of libraries and software packages on your Linux-based system. To learn more, please visit: https://snapcraft.io/
30+
The config file is located at `~/.softlayer` or `~/AppData/Roaming/softlayer` for Windows systems.
5831

59-
To install the slcli snap:
32+
Your config file should look something like this for using the islcli. Beware the `islcli` and `slcli` use the same config for the moment. You need to set `verify = False` in the config because the internal endpoint uses a self-signed SSL certificate.
6033

6134
.. code-block:: bash
62-
63-
$ sudo snap install slcli
64-
65-
(or to get the latest release)
66-
67-
$ sudo snap install slcli --edge
68-
69-
35+
36+
[softlayer]
37+
username = imsUsername
38+
verify = False
39+
endpoint_url = https://internal.app0lb.dal10.softlayer.local/v3/internal/xmlrpc/
7040
7141
72-
The most up-to-date version of this library can be found on the SoftLayer
73-
GitHub public repositories at http://github.com/softlayer. For questions regarding the use of this library please post to Stack Overflow at https://stackoverflow.com/ and your posts with “SoftLayer” so our team can easily find your post. To report a bug with this library please create an Issue on github.
74-
75-
InsecurePlatformWarning Notice
76-
------------------------------
77-
This library relies on the `requests <http://docs.python-requests.org/>`_ library to make HTTP requests. On Python versions below Python 2.7.9, requests has started emitting a security warning (InsecurePlatformWarning) due to insecurities with creating SSL connections. To resolve this, upgrade to Python 2.7.9+ or follow the instructions here: http://stackoverflow.com/a/29099439.
7842
7943
Basic Usage
8044
-----------
8145

82-
- `The Complete Command Directory <https://softlayer-python.readthedocs.io/en/latest/cli_directory/>`_
46+
.. code-block:: bash
47+
48+
$ islcli login
49+
$ islcli -a <account_id> vs list
50+
8351
8452
Advanced Usage
8553
--------------
@@ -90,26 +58,40 @@ You can automatically set some parameters via environment variables with by usin
9058
9159
$ export SLCLI_VERBOSE=3
9260
$ export SLCLI_FORMAT=json
93-
$ slcli vs list
61+
$ slcli -a <account_id> vs list
9462
9563
is equivalent to
9664

9765
.. code-block:: bash
9866
99-
$ slcli -vvv --format=json vs list
67+
$ slcli -vvv --format=json -a <account_id> vs list
10068
10169
Getting Help
10270
------------
103-
Bugs and feature requests about this library should have a `GitHub issue <https://github.com/softlayer/softlayer-python/issues>`_ opened about them.
10471

105-
Issues with the Softlayer API itself should be addressed by opening a ticket.
72+
Feel free to open an issue if you think there is a bug, or a feature you want. Or asking in #sl-api on IBM slack. This is considered an unofficial project however, so questions might take some time to get answered.
10673

10774

10875
Examples
10976
--------
11077

11178
A curated list of examples on how to use this library can be found at `SLDN <https://softlayer.github.io/python/>`_
11279

80+
81+
.. code-block:: python
82+
83+
import SoftLayer
84+
client = SoftLayer.employee_client()
85+
username = input("Username:")
86+
password = input("Password:")
87+
yubikey = input("Yubi key:")
88+
client.authenticate_with_password(username, password, yubikey)
89+
result = client.call('SoftLayer_Account', 'getObject', id="12345", mask="mask[id]")
90+
91+
92+
After logging in with `authenticate_with_password` the EmployeeClient will try to automatically refresh the login token when it gets a TokenExpired exception. It will also record the token in the config file for future use in the CLI.
93+
94+
11395
Debugging
11496
---------
11597
To get the exact API call that this library makes, you can do the following.
@@ -131,7 +113,7 @@ If you are using the library directly in python, you can do something like this.
131113
class invoices():
132114
133115
def __init__(self):
134-
self.client = SoftLayer.Client()
116+
self.client = SoftLayer.EmployeeClient()
135117
debugger = SoftLayer.DebugTransport(self.client.transport)
136118
self.client.transport = debugger
137119
@@ -153,16 +135,13 @@ If you are using the library directly in python, you can do something like this.
153135
154136
System Requirements
155137
-------------------
156-
* Python 3.5, 3.6, 3.7, 3.8, or 3.9.
157-
* A valid SoftLayer API username and key.
158-
* A connection to SoftLayer's private network is required to use
159-
our private network API endpoints.
138+
* Python 3.7, 3.8, or 3.9.
139+
* A valid SoftLayer Employee API username, password, Yubi Key
140+
* A connection to SoftLayer's Employee VPN
160141

161142
Python 2.7 Support
162143
------------------
163-
As of version 5.8.0 SoftLayer-Python will no longer support python2.7, which is `End Of Life as of 2020 <https://www.python.org/dev/peps/pep-0373/>`_ .
164-
If you cannot install python 3.6+ for some reason, you will need to use a version of softlayer-python <= 5.7.2
165-
144+
Python 2.7 is `End Of Life as of 2020 <https://www.python.org/dev/peps/pep-0373/>`_ . Its not supported, you will need to upgrade to python 3.7 at least.
166145

167146

168147
Python Packages
@@ -173,6 +152,7 @@ Python Packages
173152
* prompt_toolkit >= 2
174153
* pygments >= 2.0.0
175154
* urllib3 >= 1.24
155+
* Rich
176156

177157
Copyright
178158
---------

SoftLayer/CLI/login.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def cli(env):
3333
username = settings.get('username') or os.environ.get('SLCLI_USER', None)
3434
password = os.environ.get('SLCLI_PASSWORD', '')
3535
yubi = None
36-
# client = EmployeeClient(config_file=env.config_file)
3736
client = env.client
3837

3938
# Might already be logged in, try and refresh token

setup.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# pylint: disable=inconsistent-return-statements
88

9-
DESCRIPTION = "A library for SoftLayer's API"
9+
DESCRIPTION = "A library for SoftLayer's IMS API"
1010

1111
if os.path.exists('README.rst'):
1212
with codecs.open('README.rst', 'r', 'utf-8') as readme_file:
@@ -15,7 +15,7 @@
1515
LONG_DESCRIPTION = DESCRIPTION
1616

1717
setup(
18-
name='SoftLayer',
18+
name='SoftLayer-Internal',
1919
version='6.0.2',
2020
description=DESCRIPTION,
2121
long_description=LONG_DESCRIPTION,
@@ -25,14 +25,13 @@
2525
packages=find_packages(exclude=['tests']),
2626
license='MIT',
2727
zip_safe=False,
28-
url='http://github.com/softlayer/softlayer-python',
28+
url='https://github.ibm.com/SoftLayer/internal-softlayer-cli',
2929
entry_points={
3030
'console_scripts': [
31-
'slcli = SoftLayer.CLI.core:main',
32-
'sl = SoftLayer.CLI.deprecated:main',
31+
'islcli = SoftLayer.CLI.core:main',
3332
],
3433
},
35-
python_requires='>=3.6',
34+
python_requires='>=3.7',
3635
install_requires=[
3736
'prettytable >= 2.5.0',
3837
'click >= 8.0.4',
@@ -42,7 +41,7 @@
4241
'urllib3 >= 1.24',
4342
'rich == 12.3.0'
4443
],
45-
keywords=['softlayer', 'cloud', 'slcli'],
44+
keywords=['islcli'],
4645
classifiers=[
4746
'Environment :: Console',
4847
'Environment :: Web Environment',
@@ -51,8 +50,6 @@
5150
'License :: OSI Approved :: MIT License',
5251
'Operating System :: OS Independent',
5352
'Topic :: Software Development :: Libraries :: Python Modules',
54-
'Programming Language :: Python :: 3',
55-
'Programming Language :: Python :: 3.6',
5653
'Programming Language :: Python :: 3.7',
5754
'Programming Language :: Python :: 3.8',
5855
'Programming Language :: Python :: 3.9',

0 commit comments

Comments
 (0)