@@ -5,6 +5,7 @@ Instances and Volumes
55
66 import os
77 from verda import VerdaClient
8+ from verda.constants import Actions, VolumeTypes
89
910 # Get client secret from environment variable
1011 CLIENT_SECRET = os.environ[' VERDA_CLIENT_SECRET' ]
@@ -14,8 +15,8 @@ Instances and Volumes
1415 verda = VerdaClient(CLIENT_ID , CLIENT_SECRET )
1516
1617 # Get some volume type constants
17- NVMe = verda.constants.volume_types .NVMe
18- HDD = verda.constants.volume_types .HDD
18+ NVMe = VolumeTypes .NVMe
19+ HDD = VolumeTypes .HDD
1920
2021 EXISTING_OS_VOLUME_ID = ' 81e45bf0-5da2-412b-97d7-c20a7564fca0'
2122 EXAMPLE_VOLUME_ID = ' 225dde24-ae44-4787-9224-2b9f56f44394'
@@ -56,15 +57,15 @@ Instances and Volumes
5657
5758 # Delete instance AND OS volume (the rest of the volumes would be detached)
5859 verda.instances.action(instance_id = EXAMPLE_INSTANCE_ID ,
59- action = verda.constants.instance_actions .DELETE )
60+ action = Actions .DELETE )
6061
6162 # Delete instance WITHOUT deleting the OS volume (will detach all volumes of the instance)
6263 verda.instances.action(instance_id = EXAMPLE_INSTANCE_ID ,
63- action = verda.constants.instance_actions .DELETE ,
64+ action = Actions .DELETE ,
6465 volume_ids = [])
6566
6667
6768 # Delete instance and one of it's volumes (will delete one volume, detach the rest)
6869 verda.instances.action(instance_id = EXAMPLE_INSTANCE_ID ,
69- action = verda.constants.instance_actions .DELETE ,
70+ action = Actions .DELETE ,
7071 volume_ids = [EXAMPLE_VOLUME_ID ])
0 commit comments