CloudPortal™ Business Manager (CPBM) Business Support System (BSS) API Client
This is a minimal wrapper around CPBM BSS API.
It simplifies creating signed requests to the API and also implements a high-level abstraction for commonly used methods.
Ideally we'll implement high-level wrappers for every possible API calls, however we're not there yet.
$ pip install git+https://github.com/leap-solutions-asia/python-bss-client.git
With high-level API wrapper
from bss_client import BSSClient
endpoint = 'http://myhost.com/portal/api'
key = 'my api key'
secret = 'my api secret'
client = BSSClient(endpoint, key, secret)
rsp_json = client.list_subscriptions()
print(rsp_json)
With low-level signed request wrapper
from bss_client import BSSClient
client = BSSClient(endpoint, key, secret)
req = client.create_request()
req.add_param('tenantparam', 'uuid')
req.add_param('productbundleid', 'mybundleid')
...
rsp = req.request('POST', '/subscriptions')
print(rsp)
cat <<EOF > ~/.cloudstack.ini
[cpbm]
endpoint = YOUR_API_ENDPOINT
key=YOUR_API_KEY
secret= YOUR_SECRET_KEY
EOF
$ bss [-m METHOD] PATH [[key=value] [key=value] ...]
Get account list
$ bss /accounts
Get account list with state is NEW
$ bss /accounts state=NEW
Create a new account
$ bss -m POST /accounts \
accountname=test \
accounttypeid=10 \
currencycode=THB \
ownerfirstname=Test \
ownerlastname=Test \
[email protected] \
ownerusername=test \
countrycode=66 \
state=test \
city=bangkok \
street1=test \
zipcode=11111 \
isdcode=1 \
phonenumber=111111 \
creditCardInformationCaptured=YES
Get docker image
$ docker pull leapsolutionsasia/python-bss-client
Run command with docker
$ docker run \
--rm \
-v $(pwd):/work \
-it leapsolutionsasia/python-bss-client \
[-m METHOD] PATH [[key=value] [key=value] ...]
Run command via wrapper script
$ ./run.sh [-m METHOD] PATH [[key=value] [key=value] ...]