API
api
v1
clusters
Client
Source code in denvr/api/v1/clusters.py
get_all
Get a list of allocated clusters ::
client.get_all()
Source code in denvr/api/v1/clusters.py
servers
applications
Client
Source code in denvr/api/v1/servers/applications.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 |
|
create_catalog_application
Create a new application using a pre-defined configuration and application catalog item ::
client.create_catalog_application(
name="my-jupyter-application",
cluster="Msc1",
hardware_package_name="g-nvidia-1xa100-40gb-pcie-14vcpu-112gb",
application_catalog_item_name="jupyter-notebook",
application_catalog_item_version="python-3.11.9",
resource_pool="on-demand",
ssh_keys=["string"],
persist_direct_attached_storage=False,
personal_shared_storage=True,
tenant_shared_storage=True,
jupyter_token="abc123",
)
Other Parameters:
Name | Type | Description |
---|---|---|
name |
str
|
The application name |
cluster |
str
|
The cluster you're operating on |
hardware_package_name |
str
|
The name or unique identifier of the application hardware configuration to use for the application. |
application_catalog_item_name |
str
|
The name of the application catalog item. |
application_catalog_item_version |
str
|
The version name of the application catalog item. |
resource_pool |
str
|
The resource pool to use for the application |
ssh_keys |
list
|
The SSH keys for accessing the application |
persist_direct_attached_storage |
bool
|
Indicates whether to persist direct attached storage (if resource pool is reserved) |
personal_shared_storage |
bool
|
Enable personal shared storage for the application |
tenant_shared_storage |
bool
|
Enable tenant shared storage for the application |
jupyter_token |
str
|
An authentication token for accessing Jupyter Notebook enabled applications |
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
|
cluster |
str
|
|
status |
str
|
|
tenant |
str
|
|
created_by |
str
|
|
private_ip |
str
|
|
public_ip |
str
|
|
resource_pool |
str
|
|
dns |
str
|
|
ssh_username |
str
|
|
application_catalog_item_name |
str
|
|
application_catalog_item_version_name |
str
|
|
hardware_package_name |
str
|
|
persisted_direct_attached_storage |
bool
|
|
personal_shared_storage |
bool
|
|
tenant_shared_storage |
bool
|
|
Source code in denvr/api/v1/servers/applications.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
|
create_custom_application
Create a new custom application using a pre-defined configuration and user-defined container image. ::
client.create_custom_application(
name="my-custom-application",
cluster="Msc1",
hardware_package_name="g-nvidia-1xa100-40gb-pcie-14vcpu-112gb",
image_url="docker.io/{namespace}/{repository}:{tag}",
image_cmd_override=["python", "train.py"],
environment_variables={},
image_repository={
"hostname": "https://index.docker.io/v1/",
"username": "your-docker-username",
"password": "dckr_pat__xxx1234567890abcdef",
},
resource_pool="on-demand",
readiness_watcher_port=443,
proxy_port=8888,
persist_direct_attached_storage=False,
personal_shared_storage=True,
tenant_shared_storage=True,
user_scripts={},
security_context={"runAsRoot": False},
)
Other Parameters:
Name | Type | Description |
---|---|---|
name |
str
|
The application name |
cluster |
str
|
The cluster you're operating on |
hardware_package_name |
str
|
The name or unique identifier of the application hardware configuration to use for the application. |
image_url |
str
|
Image URL for the custom application. |
image_cmd_override |
list
|
Optional Image CMD override allows users to specify a custom command to run in the container.... |
environment_variables |
dict
|
Environment variables for the application. Names must start with a letter or underscore and... |
image_repository |
dict
|
|
resource_pool |
str
|
The resource pool to use for the application |
readiness_watcher_port |
int
|
The port used for monitoring application readiness and status. Common examples: - 443... |
proxy_port |
int
|
The port your application uses to receive HTTPS traffic. Port 443 is reserved for the reverse... |
persist_direct_attached_storage |
bool
|
Indicates whether to persist direct attached storage (if resource pool is reserved) |
personal_shared_storage |
bool
|
Enable personal shared storage for the application |
tenant_shared_storage |
bool
|
Enable tenant shared storage for the application |
user_scripts |
dict
|
Dictionary of script filenames to script content. Each scripts to be mounted at... |
security_context |
dict
|
|
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
|
cluster |
str
|
|
status |
str
|
|
tenant |
str
|
|
created_by |
str
|
|
private_ip |
str
|
|
public_ip |
str
|
|
resource_pool |
str
|
|
dns |
str
|
|
ssh_username |
str
|
|
application_catalog_item_name |
str
|
|
application_catalog_item_version_name |
str
|
|
hardware_package_name |
str
|
|
persisted_direct_attached_storage |
bool
|
|
personal_shared_storage |
bool
|
|
tenant_shared_storage |
bool
|
|
Source code in denvr/api/v1/servers/applications.py
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
|
destroy_application
Permanently delete a specified application, effectively wiping all its data and freeing up resources for other uses ::
client.destroy_application(id="my-jupyter-application", cluster="Msc1")
Other Parameters:
Name | Type | Description |
---|---|---|
id |
str
|
The application name |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
The application name |
cluster |
str
|
The cluster you're operating on |
Source code in denvr/api/v1/servers/applications.py
get_application_catalog_items
Get a list of application catalog items ::
client.get_application_catalog_items()
Returns:
Name | Type | Description |
---|---|---|
items |
list
|
|
Source code in denvr/api/v1/servers/applications.py
get_application_details
Get detailed information about a specific application ::
client.get_application_details(id="my-jupyter-application", cluster="Msc1")
Other Parameters:
Name | Type | Description |
---|---|---|
id |
str
|
The application name |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
instance_details |
dict
|
|
application_catalog_item |
dict
|
|
hardware_package |
dict
|
|
Source code in denvr/api/v1/servers/applications.py
get_applications
Get a list of applications ::
client.get_applications()
Returns:
Name | Type | Description |
---|---|---|
items |
list
|
|
Source code in denvr/api/v1/servers/applications.py
get_availability
Get detailed information on available configurations for applications ::
client.get_availability(cluster="Msc1", resource_pool="on-demand")
Other Parameters:
Name | Type | Description |
---|---|---|
cluster |
str
|
|
resource_pool |
str
|
|
Returns:
Name | Type | Description |
---|---|---|
items |
list
|
|
Source code in denvr/api/v1/servers/applications.py
get_configurations
Get a list of application configurations ::
client.get_configurations()
Returns:
Name | Type | Description |
---|---|---|
items |
list
|
|
Source code in denvr/api/v1/servers/applications.py
start_application
Start an application that has been previously set up and provisioned, but is currently OFFLINE ::
client.start_application(id="my-jupyter-application", cluster="Msc1")
Other Parameters:
Name | Type | Description |
---|---|---|
id |
str
|
The application name |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
The application name |
cluster |
str
|
The cluster you're operating on |
Source code in denvr/api/v1/servers/applications.py
stop_application
Stop an application that has been previously set up and provisioned, but is currently ONLINE ::
client.stop_application(id="my-jupyter-application", cluster="Msc1")
Other Parameters:
Name | Type | Description |
---|---|---|
id |
str
|
The application name |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
The application name |
cluster |
str
|
The cluster you're operating on |
Source code in denvr/api/v1/servers/applications.py
images
Client
Source code in denvr/api/v1/servers/images.py
get_operating_system_images
Get a list of operating sytem images available for the tenant ::
client.get_operating_system_images()
Returns:
Name | Type | Description |
---|---|---|
items |
list
|
|
Source code in denvr/api/v1/servers/images.py
metal
Client
Source code in denvr/api/v1/servers/metal.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
|
get_host
Get detailed information about a specific metal host ::
client.get_host(id="Id", cluster="Hou1")
Other Parameters:
Name | Type | Description |
---|---|---|
id |
str
|
Unique identifier for a resource within the cluster |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
The bare metal id, unique identifier |
cluster |
str
|
The cluster where the bare metal host is allocated |
tenancy_name |
str
|
Name of the tenant where the node has been allocated |
node_type |
str
|
The specific host node type |
image |
str
|
The image used to provision the host |
private_ip |
str
|
private IP address of the host |
provisioned_hostname |
str
|
host name provisioned by the system |
operational_status |
str
|
operational status of the host |
powered_on |
bool
|
true if the host is powered on |
provisioning_state |
str
|
provisioning status of the host |
Source code in denvr/api/v1/servers/metal.py
get_hosts
Get a list of bare metal hosts in a cluster ::
client.get_hosts(cluster="Hou1")
Other Parameters:
Name | Type | Description |
---|---|---|
cluster |
str
|
|
Returns:
Name | Type | Description |
---|---|---|
items |
list
|
|
Source code in denvr/api/v1/servers/metal.py
reboot_host
Reboot the bare metal host ::
client.reboot_host(id="string", cluster="Hou1")
Other Parameters:
Name | Type | Description |
---|---|---|
id |
str
|
Unique identifier for a resource within the cluster |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
The bare metal id, unique identifier |
cluster |
str
|
The cluster where the bare metal host is allocated |
tenancy_name |
str
|
Name of the tenant where the node has been allocated |
node_type |
str
|
The specific host node type |
image |
str
|
The image used to provision the host |
private_ip |
str
|
private IP address of the host |
provisioned_hostname |
str
|
host name provisioned by the system |
operational_status |
str
|
operational status of the host |
powered_on |
bool
|
true if the host is powered on |
provisioning_state |
str
|
provisioning status of the host |
Source code in denvr/api/v1/servers/metal.py
reprovision_host
Reprovision the bare metal host ::
client.reprovision_host(
image_url="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img",
image_checksum="https://cloud-images.ubuntu.com/jammy/current/MD5SUMS",
cloud_init_base64="SGVsbG8sIFdvcmxkIQ==",
id="string",
cluster="Hou1",
)
Other Parameters:
Name | Type | Description |
---|---|---|
image_url |
str
|
The URL to the image to use for the host |
image_checksum |
str
|
The checksum url of the image to use for the host |
cloud_init_base64 |
str
|
Base64 encoded cloud-init data yaml file to use for the host |
id |
str
|
Unique identifier for a resource within the cluster |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
The bare metal id, unique identifier |
cluster |
str
|
The cluster where the bare metal host is allocated |
tenancy_name |
str
|
Name of the tenant where the node has been allocated |
node_type |
str
|
The specific host node type |
image |
str
|
The image used to provision the host |
private_ip |
str
|
private IP address of the host |
provisioned_hostname |
str
|
host name provisioned by the system |
operational_status |
str
|
operational status of the host |
powered_on |
bool
|
true if the host is powered on |
provisioning_state |
str
|
provisioning status of the host |
Source code in denvr/api/v1/servers/metal.py
virtual
Client
Source code in denvr/api/v1/servers/virtual.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
|
create_server
Create a new virtual machine using a pre-defined configuration ::
client.create_server(
name="my-denvr-vm",
rpool="reserved-denvr",
vpc="denvr-vpc",
configuration="A100_40GB_PCIe_1x",
cluster="Hou1",
ssh_keys=["string"],
snapshot_name="string",
operating_system_image="Ubuntu 22.04.4 LTS",
personal_storage_mount_path="/home/ubuntu/personal",
tenant_shared_additional_storage="/home/ubuntu/tenant-shared",
persist_storage=False,
direct_storage_mount_path="/home/ubuntu/direct-attached",
root_disk_size=500,
)
Other Parameters:
Name | Type | Description |
---|---|---|
name |
str
|
Name of virtual server to be created. If not provided, name will be auto-generated. |
rpool |
str
|
Name of the pool to be used. If not provided, first pool assigned to a tenant will be used. In... |
vpc |
str
|
Name of the VPC to be used. Usually this will match the tenant name. |
configuration |
str
|
Name of the configuration to be used. For possible values, refer to the otput of... |
cluster |
str
|
Cluster to be used. For possible values, refer to the otput of api/v1/clusters/GetAll"/> |
ssh_keys |
list
|
|
snapshot_name |
str
|
Snapshot name. |
operating_system_image |
str
|
Name of the Operating System image to be used. |
personal_storage_mount_path |
str
|
Personal storage file system mount path. |
tenant_shared_additional_storage |
str
|
Tenant shared storage file system mount path. |
persist_storage |
bool
|
Whether direct attached storage should be persistant or ephemeral. |
direct_storage_mount_path |
str
|
Direct attached storage mount path. |
root_disk_size |
int
|
Size of root disk to be created (Gi). |
Returns:
Name | Type | Description |
---|---|---|
username |
str
|
The user that creatd the vm |
tenancy_name |
str
|
Name of the tenant where the VM has been created |
rpool |
str
|
Resource pool where the VM has been created |
direct_attached_storage_persisted |
bool
|
|
id |
str
|
The name of the virtual machine |
namespace |
str
|
|
configuration |
str
|
A VM configuration ID |
storage |
int
|
The amount of storage attached to the VM in GB |
gpu_type |
str
|
The specific host GPU type |
gpus |
int
|
Number of GPUs attached to the VM |
vcpus |
int
|
Number of vCPUs available to the VM |
memory |
int
|
Amount of system memory available in GB |
ip |
str
|
The public IP address of the VM |
private_ip |
str
|
The private IP address of the VM |
image |
str
|
Name of the VM image used |
cluster |
str
|
The cluster where the VM is allocated |
status |
str
|
The status of the VM (e.g. 'PLANNED', 'PENDING' 'PENDING_RESOURCES', 'PENDING_READINESS',... |
storage_type |
str
|
|
root_disk_size |
str
|
|
last_updated |
str
|
|
Source code in denvr/api/v1/servers/virtual.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
destroy_server
Permanently delete a specified virtual machine, effectively wiping all its data and freeing up resources for other uses ::
client.destroy_server(
delete_snapshots=True, id="vm-2024093009357617", namespace="denvr", cluster="Hou1"
)
Other Parameters:
Name | Type | Description |
---|---|---|
delete_snapshots |
bool
|
Should also delete snapshots with virtual machine. |
id |
str
|
The virtual machine id |
namespace |
str
|
The namespace/vpc where the virtual machine lives. Default one is same as tenant name. |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
|
cluster |
str
|
|
status |
str
|
|
Source code in denvr/api/v1/servers/virtual.py
get_availability
Get information about the current availability of different virtual machine configurations ::
client.get_availability(cluster="Hou1", resource_pool="reserved-denvr", report_nodes=True)
Other Parameters:
Name | Type | Description |
---|---|---|
cluster |
str
|
|
resource_pool |
str
|
|
report_nodes |
bool
|
controls if Count and MaxCount is calculated and returned in the response. If they are not... |
Returns:
Name | Type | Description |
---|---|---|
items |
list
|
|
Source code in denvr/api/v1/servers/virtual.py
get_configurations
Get detailed information on available configurations for virtual machines ::
client.get_configurations()
Returns:
Name | Type | Description |
---|---|---|
items |
list
|
|
Source code in denvr/api/v1/servers/virtual.py
get_server
Get detailed information about a specific virtual machine ::
client.get_server(id="vm-2024093009357617", namespace="denvr", cluster="Hou1")
Other Parameters:
Name | Type | Description |
---|---|---|
id |
str
|
The virtual machine id |
namespace |
str
|
The namespace/vpc where the virtual machine lives. Default one is same as tenant name. |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
username |
str
|
The user that creatd the vm |
tenancy_name |
str
|
Name of the tenant where the VM has been created |
rpool |
str
|
Resource pool where the VM has been created |
direct_attached_storage_persisted |
bool
|
|
id |
str
|
The name of the virtual machine |
namespace |
str
|
|
configuration |
str
|
A VM configuration ID |
storage |
int
|
The amount of storage attached to the VM in GB |
gpu_type |
str
|
The specific host GPU type |
gpus |
int
|
Number of GPUs attached to the VM |
vcpus |
int
|
Number of vCPUs available to the VM |
memory |
int
|
Amount of system memory available in GB |
ip |
str
|
The public IP address of the VM |
private_ip |
str
|
The private IP address of the VM |
image |
str
|
Name of the VM image used |
cluster |
str
|
The cluster where the VM is allocated |
status |
str
|
The status of the VM (e.g. 'PLANNED', 'PENDING' 'PENDING_RESOURCES', 'PENDING_READINESS',... |
storage_type |
str
|
|
root_disk_size |
str
|
|
last_updated |
str
|
|
Source code in denvr/api/v1/servers/virtual.py
get_servers
Get a list of virtual machines ::
client.get_servers(cluster="Cluster")
Other Parameters:
Name | Type | Description |
---|---|---|
cluster |
str
|
|
Returns:
Name | Type | Description |
---|---|---|
items |
list
|
|
Source code in denvr/api/v1/servers/virtual.py
start_server
Start a virtual machine that has been previously set up and provisioned, but is currently OFFLINE ::
client.start_server(id="vm-2024093009357617", namespace="denvr", cluster="Hou1")
Other Parameters:
Name | Type | Description |
---|---|---|
id |
str
|
The virtual machine id |
namespace |
str
|
The namespace/vpc where the virtual machine lives. Default one is same as tenant name. |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
|
cluster |
str
|
|
status |
str
|
|
Source code in denvr/api/v1/servers/virtual.py
stop_server
Stop a virtual machine, ensuring a secure and orderly shutdown of its operations within the cloud environment ::
client.stop_server(id="vm-2024093009357617", namespace="denvr", cluster="Hou1")
Other Parameters:
Name | Type | Description |
---|---|---|
id |
str
|
The virtual machine id |
namespace |
str
|
The namespace/vpc where the virtual machine lives. Default one is same as tenant name. |
cluster |
str
|
The cluster you're operating on |
Returns:
Name | Type | Description |
---|---|---|
id |
str
|
|
cluster |
str
|
|
status |
str
|
|
Source code in denvr/api/v1/servers/virtual.py
auth
Auth
Bases: AuthBase
Auth(server, username, password)
Handles authorization, renewal and logouts given a username and password.
Source code in denvr/auth.py
client
client
client("servers/virtual", config=None)
A shorthand for loading a specific client with a default session/config. Optionally, a Config object can be supplied as a keyword.
Source code in denvr/client.py
config
Config
Stores the auth and defaults.
Source code in denvr/config.py
config
Construct a Config object from the provide config file path.
Source code in denvr/config.py
session
Session
Session(config: Config)
Handles authentication and HTTP requests to Denvr's API.
Source code in denvr/session.py
utils
raise_for_status
Given a response object return either resp.json() or resp.json()["error"]. This is basically just a modified version of https://requests.readthedocs.io/en/latest/_modules/requests/models/#Response.raise_for_status
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resp
|
Response
|
The request response object. |
required |
Returns:
Type | Description |
---|---|
The request response error. |
Source code in denvr/utils.py
retry
Generates a reasonable default Retry object for use with the requests library given a total number of retries.
NOTES
- by default only retry on idempotent requests (including DELETE and PUT)
- only retry for 5xx or 429 errors
- Allow redirects, but remove Authorization headers
- Leave error handling to the caller
Source code in denvr/utils.py
snakecase
Convert camelcase and titlecase strings to snakecase.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
str
|
str
|
The string to convert. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The converted string. |
Source code in denvr/utils.py
validate
validate_kwargs
For None
values in kwargs
error if they are in required
or drop them.
Source code in denvr/validate.py
waiters
Waiter
A utility class which waits on a check function to return True after executing an action function.
For example, waiting for get_server
to return status "ONLINE" after calling create_server
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
action
|
callable
|
Function which takes kwargs, runs an operation and returns a response. |
required |
check
|
callable
|
Function which takes the action response and returns (bool, result) representing whether a check has passed and any results to return. |
required |
cleanup
|
callable
|
An optional function to run in failure conditions. |
None
|
Source code in denvr/waiters.py
waiter
A waiter factory function that creates a Waiter instance for a given operation.
Example:
create_server = waiter(virtual.create_server)
create_server(name="my-test-vm", rpool="on-demand", vpc="denvr", ...)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operation
|
Callable
|
The operation to wait for. |
required |
Returns:
Type | Description |
---|---|
Waiter
|
A Waiter instance. |
Raises:
Type | Description |
---|---|
ValueError
|
If the operation is not supported. |