API Types

API types are objects returned by calls that return non product responses from Client. So this would include things like tasks, stock statuses and auto-renew settings but exclude a server, dedicated server and hosting. There really isnt a reason to import these beyond type annotating.

class vshieldpy.api_defs.Invoice

Invoice object containing response information.

identifier

Invoice ID

Type:

int

status

Status of the invoice True if paid and False if unpaid.

Type:

bool

amount

Amount paid in USD.

Type:

str

amount_due

Remaining amount to be paid.

Type:

str

kind

Type of the invoice.

Type:

str

service

Service ID. This includes Server ID’s and services. Can be None if a server hasnt been deployed yet.

Type:

int | None

payment_method

Method of payment.

Type:

str

date_paid

Date the invoice was paid. Can also be None if the invoice hasn’t been paid yet.

Type:

datetime.datetime | None

date

The date that the invoice was created.

Type:

datetime.datetime

due_date

Due date for the invoice.

Type:

datetime.datetime

class vshieldpy.api_defs.StockStatus

StockStatus for ease of use for per plan lookups.

check_stock(plan: Plans, location: Locations) bool

Check stock for provided plan and country code.

get_locations(plan: Plans, only_in_stocks: bool = False) tuple[Locations, ...]

Get locations for the provided plan.

class vshieldpy.api_defs.Task

A task and all of its information.

action

Server or service action that was performed or being performed.

Type:

vshieldpy.api_defs.tasks.Actions

completion_date

Time of the task completion.

Type:

datetime.datetime

start_date

Time of when the task was started.

Type:

datetime.datetime

status

Current status of the task.

Type:

vshieldpy.api_defs.tasks.TaskStatus

class vshieldpy.api_defs.Payment

Payment information returned by the API.

price

Amount that was paid.

Type:

str

new_balance

Current balance of the account.

Type:

str

expiration

Expiration of the invoice.

Type:

datetime.datetime | None

invoice_id

The invoices identifier.

Type:

str | None

class vshieldpy.api_defs.ServerStats

Ease of use properties related to statistics.

property cpu_avg_last_1hr: float

Average CPU load for the last hour.

property cpu_avg_last_24hrs: float

Average CPU load for the last 24 hours.

property network_avg_last_1hr: tuple[float, float]

Average network input and output for the last hour.

property network_avg_last_24hrs: tuple[float, float]

Average network input and output for the last 24 hours.

property ram_avg_last_1hr: float

Average ram usage for the last hour.

property ram_avg_last_24hrs: float

Average RAM load for the last 24 hours.

enum vshieldpy.api_defs.TaskStatus(value)

Possible task statuses.

Valid values are as follows:

Failed = <TaskStatus.Failed: 0>
Completed = <TaskStatus.Completed: 1>
InProgress = <TaskStatus.InProgress: 2>
enum vshieldpy.api_defs.Status(value)

All of statuses are quite self explanitory.

However its worth noting that “Installing” is for an initial install of an OS on a server.

Valid values are as follows:

Stopped = <Status.Stopped: 0>
Running = <Status.Running: 1>
Suspended = <Status.Suspended: 2>
Installing = <Status.Installing: 3>
Reinstalling = <Status.Reinstalling: 4>