File: v1_os.py

package info (click to toggle)
python-vultr 1.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: python: 1,004; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 654 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'''Partial class to handle Vultr OS API calls'''
from .utils import VultrBase


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

    def list(self, params=None):
        ''' /v1/os/list
        GET - public
        Retrieve a list of available operating systems. If
        the 'windows' flag is true, a Windows licenses will
        be included with the instance, which will increase the cost.

        Link: https://www.vultr.com/api/#os_os_list
        '''
        params = params if params else dict()
        return self.request('/v1/os/list', params, 'GET')