File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ '''Partial class to handle Vultr ReservedIP API calls'''
2+ from .utils import VultrBase , update_params
3+
4+
5+ class VultrReservedIP (VultrBase ):
6+ '''Handles Vultr ReservedIP API calls'''
7+ def __init__ (self , api_key ):
8+ VultrBase .__init__ (self , api_key )
9+
10+ def create (self , dcid , ip_type , params = None ):
11+ ''' /v1/reservedip/create
12+ POST - account
13+ Create a new reserved IP. Reserved IPs can only be used within the
14+ same datacenter for which they were created.
15+
16+ Link: https://www.vultr.com/api/#reservedip_create
17+ '''
18+ params = update_params (params , {
19+ 'DCID' : dcid ,
20+ 'ip_type' : ip_type
21+ })
22+ return self .request ('/v1/reservedip/create' , params , 'POST' )
Original file line number Diff line number Diff line change 99from .v1_os import VultrOS
1010from .v1_plans import VultrPlans
1111from .v1_regions import VultrRegions
12+ from .v1_reservedip import VultrReservedIP
1213from .v1_server import VultrServer
1314from .v1_snapshot import VultrSnapshot
1415from .v1_sshkey import VultrSSHKey
@@ -33,6 +34,7 @@ def __init__(self, api_key):
3334 self .os = VultrOS (api_key )
3435 self .plans = VultrPlans (api_key )
3536 self .regions = VultrRegions (api_key )
37+ self .reservedip = VultrReservedIP (api_key )
3638 self .server = VultrServer (api_key )
3739 self .snapshot = VultrSnapshot (api_key )
3840 self .sshkey = VultrSSHKey (api_key )
You can’t perform that action at this time.
0 commit comments