OXIESEC PANEL
- Current Dir:
/
/
snap
/
certbot-dns-digitalocean
/
4349
/
lib
/
python3.12
/
site-packages
/
digitalocean
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/10/2025 09:50:12 PM
rwxr-xr-x
📄
Account.py
904 bytes
06/10/2025 09:50:08 PM
rw-r--r--
📄
Action.py
2.22 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Balance.py
847 bytes
06/10/2025 09:50:08 PM
rw-r--r--
📄
Certificate.py
4.28 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Domain.py
5.22 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Droplet.py
20.65 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Firewall.py
8.26 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
FloatingIP.py
3.02 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Image.py
5.55 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Kernel.py
328 bytes
06/10/2025 09:50:08 PM
rw-r--r--
📄
LoadBalancer.py
15.47 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Manager.py
14.09 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Metadata.py
1.3 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Project.py
4.91 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Record.py
3.92 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Region.py
386 bytes
06/10/2025 09:50:08 PM
rw-r--r--
📄
SSHKey.py
2.55 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Size.py
453 bytes
06/10/2025 09:50:08 PM
rw-r--r--
📄
Snapshot.py
1.17 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Tag.py
5.71 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
VPC.py
3.73 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
Volume.py
6.62 KB
06/10/2025 09:50:08 PM
rw-r--r--
📄
__init__.py
1.1 KB
06/10/2025 09:50:08 PM
rw-r--r--
📁
__pycache__
-
06/10/2025 09:50:12 PM
rwxr-xr-x
📄
baseapi.py
7.94 KB
06/10/2025 09:50:08 PM
rw-r--r--
Editing: Action.py
Close
# -*- coding: utf-8 -*- from time import sleep from .baseapi import BaseAPI class Action(BaseAPI): def __init__(self, *args, **kwargs): self.id = None self.status = None self.type = None self.started_at = None self.completed_at = None self.resource_id = None self.resource_type = None self.region = None self.region_slug = None # Custom, not provided by the json object. self.droplet_id = None super(Action, self).__init__(*args, **kwargs) @classmethod def get_object(cls, api_token, action_id): """ Class method that will return a Action object by ID. """ action = cls(token=api_token, id=action_id) action.load_directly() return action def load_directly(self): action = self.get_data("actions/%s" % self.id) if action: action = action[u'action'] # Loading attributes for attr in action.keys(): setattr(self, attr, action[attr]) def load(self): if not self.droplet_id: action = self.load_directly() else: action = self.get_data( "droplets/%s/actions/%s" % ( self.droplet_id, self.id ) ) if action: action = action[u'action'] # Loading attributes for attr in action.keys(): setattr(self, attr, action[attr]) def wait(self, update_every_seconds=1, repeat=20): """ Wait until the action is marked as completed or with an error. It will return True in case of success, otherwise False. Optional Args: update_every_seconds - int : number of seconds to wait before checking if the action is completed. """ counter = 0 while self.status == u'in-progress': sleep(update_every_seconds) self.load() counter += 1 if counter > repeat: break return self.status == u'completed' def __str__(self): return "<Action: %s %s %s>" % (self.id, self.type, self.status)