@@ -39,7 +39,6 @@ Python 3 wrapper for the Vultr API v2.
3939Vultr API Reference: [ https://www.vultr.com/api ] ( https://www.vultr.com/api/?ref=6905748 )
4040
4141> [ !TIP]
42- > This project is not complete, but has many useful functions.
4342> Please submit a [ Feature Request] ( https://github.com/cssnr/vultr-python/discussions/categories/feature-requests )
4443> or report any [ Issues] ( https://github.com/cssnr/vultr-python/issues ) .
4544
@@ -62,12 +61,11 @@ python -m pip install vultr-python
6261
6362## Usage
6463
65- You will need to create an api key and whitelist your IP address.
66- Most functions do not work without an API Key.
64+ You will need to create an api key and whitelist your IP address for most functions.
6765
6866- [ https://my.vultr.com/settings/#settingsapi ] ( https://my.vultr.com/settings/#settingsapi )
6967
70- Initialize the class with your API Key or with the ` VULTR_API_KEY ` environment variable.
68+ Initialize the ` Vultr ` class with your API Key or use the ` VULTR_API_KEY ` environment variable.
7169
7270``` python
7371from vultr import Vultr
@@ -112,16 +110,23 @@ instance = vultr.create_instance(available[0], plan, **data)
112110Arbitrary Methods ` get ` , ` post ` , ` patch ` , ` delete `
113111
114112``` python
115- # vultr.get('url', params)
116- instances = vultr.get(' instances' , {' type' : ' vc2' })
117- # vultr.post('url', **kwargs)
113+ plans = vultr.get(' plans' , {' type' : ' vc2' })
118114sshkey = vultr.post(' ssh-keys' , name = ' key-name' , ssh_key = ' ssh-rsa AAAA...' )
119- # vultr.delete('url' )
115+ instance = vultr.patch( ' instances ' , plan = plans[ 1 ][ ' id ' ] )
120116vultr.delete(f " instances/019ad1a8-2aa3-7650-83d1-8520d65ed6af " )
121117```
122118
123119Error Handling
124120
121+ ``` python
122+ >> > instance = vultr.create_instance(" atl" , " vc2-1c-0.5gb-v6" , ** data)
123+ Traceback (most recent call last):
124+ ...
125+ vultr.vultr.VultrException: Error 400 : Server add failed: Ubuntu 24.04 LTS x64 requires a plan with at least 1000 MB memory.
126+ ```
127+
128+ Using the ` VultrException ` class
129+
125130``` python
126131from vultr import VultrException
127132
0 commit comments