mirror of
https://github.com/hanzo-kt/sdk.git
synced 2026-10-30 20:43:57 +00:00
Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and Android. Generated with openapi-generator kotlin (library=jvm-okhttp4, useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai. Co-authored-by: Hanzo Dev <[email protected]>
5.1 KiB
5.1 KiB
MachinesApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| visorDeleteMachine | DELETE /v1/machines/{id} | Terminate a machine |
| visorGetMachine | GET /v1/machines/{id} | Get one machine by org-scoped name |
| visorLaunchMachine | POST /v1/machines | Launch a machine (or dryRun for a price quote) |
| visorListMachines | GET /v1/machines | List the org's machines |
visorDeleteMachine
visorDeleteMachine(id)
Terminate a machine
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = MachinesApi()
val id : kotlin.String = id_example // kotlin.String |
try {
apiInstance.visorDeleteMachine(id)
} catch (e: ClientException) {
println("4xx response calling MachinesApi#visorDeleteMachine")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling MachinesApi#visorDeleteMachine")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | kotlin.String |
Return type
null (empty response body)
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
visorGetMachine
VisorMachineView visorGetMachine(id)
Get one machine by org-scoped name
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = MachinesApi()
val id : kotlin.String = id_example // kotlin.String | Org-scoped machine name
try {
val result : VisorMachineView = apiInstance.visorGetMachine(id)
println(result)
} catch (e: ClientException) {
println("4xx response calling MachinesApi#visorGetMachine")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling MachinesApi#visorGetMachine")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | kotlin.String | Org-scoped machine name |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
visorLaunchMachine
kotlin.Any visorLaunchMachine(visorLaunchRequest)
Launch a machine (or dryRun for a price quote)
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = MachinesApi()
val visorLaunchRequest : VisorLaunchRequest = // VisorLaunchRequest |
try {
val result : kotlin.Any = apiInstance.visorLaunchMachine(visorLaunchRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling MachinesApi#visorLaunchMachine")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling MachinesApi#visorLaunchMachine")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| visorLaunchRequest | VisorLaunchRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
visorListMachines
VisorListMachines200Response visorListMachines()
List the org's machines
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = MachinesApi()
try {
val result : VisorListMachines200Response = apiInstance.visorListMachines()
println(result)
} catch (e: ClientException) {
println("4xx response calling MachinesApi#visorListMachines")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling MachinesApi#visorListMachines")
e.printStackTrace()
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json