HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/vultr/v1_reservedip.py
'''Partial class to handle Vultr ReservedIP API calls'''
from .utils import VultrBase, update_params


class VultrReservedIP(VultrBase):
    '''Handles Vultr ReservedIP API calls'''
    def __init__(self, api_key):
        VultrBase.__init__(self, api_key)

    def create(self, dcid, ip_type, params=None):
        ''' /v1/reservedip/create
        POST - account
        Create a new reserved IP. Reserved IPs can only be used within the
        same datacenter for which they were created.

        Link: https://www.vultr.com/api/#reservedip_create
        '''
        params = update_params(params, {
            'DCID': dcid,
            'ip_type': ip_type
        })
        return self.request('/v1/reservedip/create', params, 'POST')