Compare commits

...

2 Commits

Author SHA1 Message Date
0072a07754
Fixed payload 2024-06-07 19:32:12 +05:30
f1d1387dd6
fixed the indentation and defination for empty function 2024-06-07 15:46:42 +05:30

View File

@ -46,6 +46,35 @@ class ServerData:
return os_id
def create_post_data(self):
ram, disk = self.get_ram_and_disk()
post_data = {
"server_type": 1,
"os_id": self.get_os(),
"provider_id": 10,
"location_id": 15,
"ssh_port": 22,
"ram": ram >> 10, # convert to GB
"ram_as_mb": ram, # in MB
"disk": disk, # in GB
"disk_as_gb": disk, # in GB
"cpu": self.get_cpu_count(),
"bandwidth": self.get_bandwidth(),
"was_promo": 1,
"active": 1,
"show_public": 0,
"owned_since": "2022-01-01",
"ram_type": "GB",
"disk_type": "GB",
"currency": "USD",
"price": 4,
"payment_term": 1,
"hostname": self.hostname,
"next_due_date": "2022-02-01",
"ip1": self.public_ip,
}
logging.info("Post data created")
return post_data
class ServerManager:
def __init__(self, host, api_key):