File: v1_plans.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 (25 lines) | stat: -rw-r--r-- 937 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'''Partial class to handle Vultr Plans API calls'''
from .utils import VultrBase


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

    def list(self, params=None):
        ''' /v1/plans/list
        GET - public
        Retrieve a list of all active plans. Plans that are
        no longer available will not be shown. The 'windows'
        field is no longer in use, and will always be false.
        Windows licenses will be automatically added to any
        plan as necessary. If your account has special plans
        available, you will need to pass your api_key in in
        order to see them. For all other accounts, the API
        key is not optional.

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