https://github.com/esno/lua-lsw
an api client for leaseweb api
https://github.com/esno/lua-lsw
api cli command-line-tool leaseweb leaseweb-api lua lua-lsw
Last synced: about 1 year ago
JSON representation
an api client for leaseweb api
- Host: GitHub
- URL: https://github.com/esno/lua-lsw
- Owner: esno
- License: mit
- Created: 2017-09-17T19:30:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-17T20:14:03.000Z (about 5 years ago)
- Last Synced: 2025-01-09T05:51:20.645Z (about 1 year ago)
- Topics: api, cli, command-line-tool, leaseweb, leaseweb-api, lua, lua-lsw
- Language: Lua
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lua-lsw
a lua based client for [leaseweb api](http://developer.leaseweb.com/)
## binding
### install
% > luarocks install lua-lsw
### usage
% > lua
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
>
> lswMetals = require('leaseweb.bareMetals')
> metals = lswMetals:init('').listServers()
>
> for k, v in pairs(metals[1]) do if type(v) == 'function' then print(k) end end
retrieveSwitchPortStatus
retrieveBareMetal
closeSwitchPort
updateIp
retrieveLease
retrieveBandwidthUsage
deleteLeases
retrievePowerStatus
retrieveDataTrafficUsage
listIps
updateBareMetal
listLeases
retrieveIp
openSwitchPort
reboot
deleteLease
retrieveInstallationStatus
retrieveNetworkUsage
createLease
retrievePassword
## cli
### install
% > luarocks install lua-lswcli
### usage
#### authentication
lsw cli is asking for the api key if config file doesn't exists.
As soon as you entered the api key it will persisted in `~/.config/lsw/rc.lua`
welcome to leaseweb api client. help for help
token > 689990ad-ca3f-4d35-b299-0c493a86e985
> :q
#### common
% > lsw
welcome to leaseweb api client. help for help
> help
the following commands are available
bareMetal manage your bare metal servers
> bareMetal
bareMetal > help
the following commands are available
info prints detailed information about the selected server
ls shows all bareMetal servers
ref update server reference
select select a server
status prints information about server status
bareMetal > ls
123456 ROFL001/Bare Metal rofl1.example.org
234567 ROFL002/Bare Metal rofl2.example.org
bareMetal > status
no server selected
bareMetal > select
1) ROFL001 / rofl1.example.org
2) ROFL002 / rofl2.example.org
select > 1
bareMetal [ROFL001] > status
power: on switch: open
a.b.c.d: routed
b.c.d.e: routed
c.d.e.f: routed
::1: routed
bareMetal [ROFL001] > select
1) ROFL001 / rofl1.example.org
2) ROFL002 / rofl2.example.org
select > 2
bareMetal [ROFL002] > status
power: on switch: open
d.e.f.g: routed
e.f.g.h: routed
bareMetal [ROFL002] > exit
> exit