Skip to content

roman-bergman/LEASEWEB-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INSTALL

For install module use pip package manager.

pip3 install --upgrade leasewebrestapi

AUTHENTICATION

For authentication your need using parameter API_KEY in config or set the parameter when calling API() class.

You can generate API keys in the Customer Portal.

Example

When calling API() class:

import leasewebrestapi

api = leasewebrestapi.API(API_KEY='<some api key>')

In config:

import leasewebrestapi

api = leasewebrestapi.API()
api.config['API_KEY'] = '<some api key>'

USAGE

To use the API, you need to generate an API key on the Leaseweb Customer Portal. See Authentication section.

API usage follows the pattern api.<API_SERVICE>.<API_FUNCTION>, where:

Example:

Get Dedicated Servers List, single server info and hardware information for server.

import leasewebrestapi

api = leasewebrestapi.API(API_KEY="<some_api_key>")

# get servers list
api.DedicatedServers.list_servers()

# get server info
api.DedicatedServers.get_server('<SERVER_ID>')

# get hardware info
api.DedicatedServers.show_hardware_information('<SERVER_ID>')

Get Invoice list and single invoice info.

import leasewebrestapi

api = leasewebrestapi.API(API_KEY="<some_api_key>")

# get invoices list
api.Invoice.list_invoices()

# get single invoice info
api.Invoice.inspect_invoice('<INVOICE_ID>')

API SERVICES SUPPORT

  • DedicatedServers - Fully manage your dedicated servers.
  • Invoice - Get your invoice data with this Invoice API.

API FUNCTION SUPPORT

See the following sections to view the supported API functions:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages