From de920c8b62d63a546a26afeb070dd2fc959121e9 Mon Sep 17 00:00:00 2001 From: nick Date: Wed, 5 Feb 2020 03:52:16 +0000 Subject: [PATCH] add convet function to vultr/v1_reservedip --- vultr/v1_reservedip.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vultr/v1_reservedip.py b/vultr/v1_reservedip.py index c869b33..078ecfc 100644 --- a/vultr/v1_reservedip.py +++ b/vultr/v1_reservedip.py @@ -20,3 +20,17 @@ def create(self, dcid, ip_type, params=None): 'ip_type': ip_type }) return self.request('/v1/reservedip/create', params, 'POST') + + def convert(self, subid, ip_address, params=None): + ''' /v1/reservedip/convert + POST - account + Convert an existing IP on a subscription to a reserved IP. + Returns the SUBID of the newly created reserved IP. + + Link: https://www.vultr.com/api/#reservedip_convert + ''' + params = update_params(params, { + 'SUBID': subid, + 'ip_address': ip_address + }) + return self.request('/v1/reservedip/convert', params, 'POST')