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]>
9.7 KiB
ServeApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| engineCreateServingEndpoint | POST /v1/engine/serve/endpoints | Create serving endpoint |
| engineDeleteServingEndpoint | DELETE /v1/engine/serve/endpoints/{name} | Delete serving endpoint |
| engineGetServingEndpoint | GET /v1/engine/serve/endpoints/{name} | Get serving endpoint |
| engineGetServingMetrics | GET /v1/engine/serve/endpoints/{name}/metrics | Get serving endpoint metrics |
| engineListServingEndpoints | GET /v1/engine/serve/endpoints | List serving endpoints |
| engineUpdateServingEndpoint | PUT /v1/engine/serve/endpoints/{name} | Update serving endpoint |
engineCreateServingEndpoint
EngineServingEndpoint engineCreateServingEndpoint(engineServingEndpointCreate)
Create serving endpoint
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ServeApi()
val engineServingEndpointCreate : EngineServingEndpointCreate = // EngineServingEndpointCreate |
try {
val result : EngineServingEndpoint = apiInstance.engineCreateServingEndpoint(engineServingEndpointCreate)
println(result)
} catch (e: ClientException) {
println("4xx response calling ServeApi#engineCreateServingEndpoint")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ServeApi#engineCreateServingEndpoint")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| engineServingEndpointCreate | EngineServingEndpointCreate |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
engineDeleteServingEndpoint
kotlin.Any engineDeleteServingEndpoint(name)
Delete serving endpoint
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ServeApi()
val name : kotlin.String = name_example // kotlin.String |
try {
val result : kotlin.Any = apiInstance.engineDeleteServingEndpoint(name)
println(result)
} catch (e: ClientException) {
println("4xx response calling ServeApi#engineDeleteServingEndpoint")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ServeApi#engineDeleteServingEndpoint")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | kotlin.String |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
engineGetServingEndpoint
EngineServingEndpoint engineGetServingEndpoint(name)
Get serving endpoint
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ServeApi()
val name : kotlin.String = name_example // kotlin.String |
try {
val result : EngineServingEndpoint = apiInstance.engineGetServingEndpoint(name)
println(result)
} catch (e: ClientException) {
println("4xx response calling ServeApi#engineGetServingEndpoint")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ServeApi#engineGetServingEndpoint")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | kotlin.String |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
engineGetServingMetrics
kotlin.collections.List<EngineServingMetrics> engineGetServingMetrics(name, from, to, granularity)
Get serving endpoint metrics
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ServeApi()
val name : kotlin.String = name_example // kotlin.String |
val from : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime |
val to : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime |
val granularity : kotlin.String = granularity_example // kotlin.String |
try {
val result : kotlin.collections.List<EngineServingMetrics> = apiInstance.engineGetServingMetrics(name, from, to, granularity)
println(result)
} catch (e: ClientException) {
println("4xx response calling ServeApi#engineGetServingMetrics")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ServeApi#engineGetServingMetrics")
e.printStackTrace()
}
Parameters
| name | kotlin.String| | | | from | java.time.OffsetDateTime| | [optional] | | to | java.time.OffsetDateTime| | [optional] |
| Name | Type | Description | Notes |
|---|---|---|---|
| granularity | kotlin.String | [optional] [default to Granularity.hour] [enum: minute, hour, day] |
Return type
kotlin.collections.List<EngineServingMetrics>
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
engineListServingEndpoints
EngineListServingEndpoints200Response engineListServingEndpoints(status, page, pageSize)
List serving endpoints
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ServeApi()
val status : kotlin.String = status_example // kotlin.String |
val page : kotlin.Int = 56 // kotlin.Int |
val pageSize : kotlin.Int = 56 // kotlin.Int |
try {
val result : EngineListServingEndpoints200Response = apiInstance.engineListServingEndpoints(status, page, pageSize)
println(result)
} catch (e: ClientException) {
println("4xx response calling ServeApi#engineListServingEndpoints")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ServeApi#engineListServingEndpoints")
e.printStackTrace()
}
Parameters
| status | kotlin.String| | [optional] [enum: provisioning, running, scaling, failed, stopped] | | page | kotlin.Int| | [optional] [default to 1] |
| Name | Type | Description | Notes |
|---|---|---|---|
| pageSize | kotlin.Int | [optional] [default to 20] |
Return type
EngineListServingEndpoints200Response
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
engineUpdateServingEndpoint
EngineServingEndpoint engineUpdateServingEndpoint(name, engineUpdateServingEndpointRequest)
Update serving endpoint
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ServeApi()
val name : kotlin.String = name_example // kotlin.String |
val engineUpdateServingEndpointRequest : EngineUpdateServingEndpointRequest = // EngineUpdateServingEndpointRequest |
try {
val result : EngineServingEndpoint = apiInstance.engineUpdateServingEndpoint(name, engineUpdateServingEndpointRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling ServeApi#engineUpdateServingEndpoint")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ServeApi#engineUpdateServingEndpoint")
e.printStackTrace()
}
Parameters
| name | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| engineUpdateServingEndpointRequest | EngineUpdateServingEndpointRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json