lvlup-js

LvlupApi

Class is representing a API user.

Constructor

new LvlupApi(apiKey, environmentopt)

Create a new instance with API-KEY.
Parameters:
Name Type Attributes Description
apiKey string API key
environment object <optional>
Startup Arguments Object
Name Type Attributes Default Description
env string <optional>
deployment Sets enviroment, "deployment" for api.lvlup.pro or "sandbox" for api.sandbox.lvlup.pro

Methods

sandboxCreateAccount() → {Promise.<sandboxAccount>}

Create temporary test account on sandbox environment Account created this way can be removed automatically after 30 days of creation
Returns:
Type:
Promise.<sandboxAccount>

sandboxAcceptPayment(id) → {Promise.<status>}

Emulates successful wallet payment Use this after creating payment to test webhooks
Parameters:
Name Type Description
id string ID of payment
Returns:
Type:
Promise.<status>

reportPerformance(description) → {Promise.<status>}

Report bad performance of your game server This endpoint doesn't need auth but must be called from IP which belongs to VPS in lvlup.pro
Parameters:
Name Type Description
description string max length: 255, example: 23% drop (37/164)
Returns:
Type:
Promise.<status>

grafanaPing() → {Promise.<status>}

Respond with "ok" as health check when adding data source to Grafana
Returns:
Type:
Promise.<status>

grafanaGetData(body) → {Promise}

Fetch selected metrics data. Can respond with table or time series type. This method is not validated!
Parameters:
Name Type Description
body object body of request
Returns:
Type:
Promise

grafanaListOfMetrics(body) → {Promise}

List available metrics. Currently "target" parameter is ignored. This method is not validated!
Parameters:
Name Type Description
body object body of request
Returns:
Type:
Promise

user() → {Promise.<userInfo>}

Show currently logged in user details
Returns:
Type:
Promise.<userInfo>

userWalletBalance() → {Promise.<walletBalance>}

Wallet balance Shows current balance in lvlup.pro wallet Wallet is used to buy or extend services in lvlup.pro
Returns:
Type:
Promise.<walletBalance>

userAuditLogs() → {Promise.<list>}

Shows paginated important actions on account. This includes login, logout, failed login attempt Each log entry has IP and useragent
Returns:
Type:
Promise.<list>

userPromoCodes() → {Promise.<promoCodes>}

Show all promo codes assigned to logged in user List also includes approximate payout for prev month and commission in this month so far
Returns:
Type:
Promise.<promoCodes>

userCreatePromoCode() → {Promise.<newPromoCode>}

Create new generic and random promo code Codes that have name of domain can be created by contacting support via ticket We plan adding endpoint for domain verification to fully automate this process
Returns:
Type:
Promise.<newPromoCode>

getOrders(queryParameter) → {Promise.<list>}

Paginated order list
Parameters:
Name Type Description
queryParameter object limit or afterId or beforeId with integer, example: {limit: 10}
Returns:
Type:
Promise.<list>

getPayments(queryParameter) → {Promise.<list>}

Paginated payments and fees list
Parameters:
Name Type Description
queryParameter object limit or afterId or beforeId with integer, example: {limit: 10}
Returns:
Type:
Promise.<list>

getServices() → {Promise.<listServices>}

Service list Show currently logged in user service list. In this list you can find VPS and domains
Returns:
Type:
Promise.<listServices>

createPayment(amount, redirectUrl, webhookUrl) → {Promise.<paymentLink>}

Create link for payment Allows to top up wallet by any person using link provided in API response URL received from this endpoint will work (allow payments) for up to 7 days of creation
Parameters:
Name Type Description
amount string For 13,37 PLN wallet top up, provide 13.37 in this field If user selects payment channel with additional fees then it can cost more than specified amount This field is required
redirectUrl string URL which will be used to redirect user after payment Optional - leave empty to disable
webhookUrl string URL which will receive POST request when payment is done Optional - leave empty to disable
Returns:
Type:
Promise.<paymentLink>

paymentInfo(id) → {Promise.<paymentInfo>}

Info about payment Allows you to check if payment by user is already done Even if you receive webhook, you should still call this method to verify
Parameters:
Name Type Description
id string ID of payment.
Returns:
Type:
Promise.<paymentInfo>

vpsAttacksList(id, queryParameter) → {Promise.<list>}

VPS DDoS list Paginated list of attacks Data presented by our API is parsed from OVH API every 2 minutes
Parameters:
Name Type Description
id string ID of VPS.
queryParameter object limit or afterId or beforeId with integer, example: {limit: 10}
Returns:
Type:
Promise.<list>

vpsUdpFilter(id) → {Promise.<filteringStatus>}

VPS UDP filter UDP filtering status Data presented by our API is parsed from OVH API almost realtime
Parameters:
Name Type Description
id string ID of VPS.
Returns:
Type:
Promise.<filteringStatus>

vpsUdpFilterWhitelist(id) → {Promise.<filteringWhitelist>}

VPS UDP filter whitelist List rules (exceptions) in UDP filtering whitelist Data presented by our API is parsed from OVH API almost realtime
Parameters:
Name Type Description
id string ID of VPS.
Returns:
Type:
Promise.<filteringWhitelist>

vpsUdpFilterSwitch(id, bool) → {Promise.<information>}

VPS UDP filter ON/OFF Switch UDP filtering status on and off
Parameters:
Name Type Description
id string ID of VPS.
bool boolean Set filtering as enabled (true) or disabled (false)
Returns:
Type:
Promise.<information>

vpsUdpFilterWhitelistAdd(id, ports, protocol) → {Promise.<status>}

Add rule (exception) to UDP filtering whitelist
Parameters:
Name Type Description
id string ID of VPS.
ports object
Name Type Description
from number Port range from [ 1 .. 65535 ]
to number Port range to [ 1 .. 65535 ]
protocol string Enum: "arkSurvivalEvolved" "arma" "gtaMultiTheftAutoSanAndreas" "gtaSanAndreasMultiplayerMod" "hl2Source" "minecraftPocketEdition" "minecraftQuery" "mumble" "rust" "teamspeak2" "teamspeak3" "trackmaniaShootmania" "other" - Game protocol that should be whitelisted Use "other" if game is not listed.
Returns:
Type:
Promise.<status>

vpsUdpFilterWhitelistDelete(vpsId, whitelistId) → {Promise.<status>}

Remove rule (exception) from UDP filtering whitelist
Parameters:
Name Type Description
vpsId string ID of VPS.
whitelistId string ID of whitelist rule.
Returns:
Type:
Promise.<status>

vpsGenerateProxmoxAccount(id) → {Promise.<proxmoxAccount>}

Generate Proxmox account login/password
Parameters:
Name Type Description
id string ID of VPS.
Returns:
Type:
Promise.<proxmoxAccount>

vpsState(id) → {Promise.<vpsStatus>}

VPS State Data presented by API is gathered almost realtime from Proxmox.
Parameters:
Name Type Description
id string ID of VPS.
Returns:
Type:
Promise.<vpsStatus>

vpsStart(id) → {Promise.<status>}

Starts your VPS via Proxmox panel.
Parameters:
Name Type Description
id string ID of VPS.
Returns:
Type:
Promise.<status>

vpsStop(id) → {Promise.<status>}

Stops your VPS via Proxmox panel.
Parameters:
Name Type Description
id string ID of VPS.
Returns:
Type:
Promise.<status>

partner(ip) → {Promise.<status>}

Check if selected IPv4 is hosted by lvlup.pro This is for partners only. Contact us for details
Parameters:
Name Type Description
ip string IPv4
Returns:
Type:
Promise.<status>