From 0072a077543785788fafdd44ba027c2030985a3f Mon Sep 17 00:00:00 2001 From: Shailaja Date: Fri, 7 Jun 2024 19:32:12 +0530 Subject: [PATCH] Fixed payload --- agent.py | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/agent.py b/agent.py index 94b4ad9..f5deb03 100644 --- a/agent.py +++ b/agent.py @@ -47,21 +47,32 @@ class ServerData: def create_post_data(self): ram, disk = self.get_ram_and_disk() - cpu_count = self.get_cpu_count() - bandwidth = self.get_bandwidth() - os_id = self.get_os() - post_data = { - 'hostname': self.hostname, - 'public_ip': self.public_ip, - 'ram': ram, - 'disk': disk, - 'cpu_count': cpu_count, - 'bandwidth': bandwidth, - 'os_id': os_id + "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(f"Post Data: {post_data}") + logging.info("Post data created") return post_data