Files
sdk/docs/DeploymentsApi.md
zeekayandHanzo Dev b55332704a feat: Hanzo Cloud SDK for Kotlin (generated from OpenAPI v8.0.0)
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]>
2026-07-25 07:10:32 -07:00

16 KiB

DeploymentsApi

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
mlDeployModel POST /v1/ml/deploy Deploy a model
mlGetDeployment GET /v1/ml/deployments/{deployment_id} Get deployment details
mlListDeployments GET /v1/ml/deployments List deployments
mlStopDeployment DELETE /v1/ml/deployments/{deployment_id} Stop a deployment
projectsCompleteDeployment POST /v1/projects/{slug}/deployments/{id}/complete CI completion hook for a git deployment
projectsDeployProject POST /v1/projects/{slug}/deploy Deploy a project to the S3 origin
projectsGetDeployment GET /v1/projects/{slug}/deployments/{id} Get a deployment
projectsListDeployments GET /v1/projects/{slug}/deployments List deployments for a project
projectsPurgeProject POST /v1/projects/{slug}/purge Purge the site's edge cache

mlDeployModel

MlDeployment mlDeployModel(mlDeployModelRequest)

Deploy a model

Deploy a model from the registry to Hanzo Cloud.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = DeploymentsApi()
val mlDeployModelRequest : MlDeployModelRequest = {"model_id":"my-finetune","model_version":"v3","runtime":"vllm","gpu":"a100","replicas":2,"environment":"production"} // MlDeployModelRequest | 
try {
    val result : MlDeployment = apiInstance.mlDeployModel(mlDeployModelRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling DeploymentsApi#mlDeployModel")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling DeploymentsApi#mlDeployModel")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
mlDeployModelRequest MlDeployModelRequest

Return type

MlDeployment

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

mlGetDeployment

MlDeployment mlGetDeployment(deploymentId)

Get deployment details

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = DeploymentsApi()
val deploymentId : kotlin.String = deploymentId_example // kotlin.String | 
try {
    val result : MlDeployment = apiInstance.mlGetDeployment(deploymentId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling DeploymentsApi#mlGetDeployment")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling DeploymentsApi#mlGetDeployment")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
deploymentId kotlin.String

Return type

MlDeployment

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

mlListDeployments

MlListDeployments200Response mlListDeployments(environment, status)

List deployments

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = DeploymentsApi()
val environment : kotlin.String = environment_example // kotlin.String | 
val status : kotlin.String = status_example // kotlin.String | 
try {
    val result : MlListDeployments200Response = apiInstance.mlListDeployments(environment, status)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling DeploymentsApi#mlListDeployments")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling DeploymentsApi#mlListDeployments")
    e.printStackTrace()
}

Parameters

| environment | kotlin.String| | [optional] [enum: dev, staging, production] |

Name Type Description Notes
status kotlin.String [optional] [enum: deploying, active, failed, stopped]

Return type

MlListDeployments200Response

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

mlStopDeployment

mlStopDeployment(deploymentId)

Stop a deployment

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = DeploymentsApi()
val deploymentId : kotlin.String = deploymentId_example // kotlin.String | 
try {
    apiInstance.mlStopDeployment(deploymentId)
} catch (e: ClientException) {
    println("4xx response calling DeploymentsApi#mlStopDeployment")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling DeploymentsApi#mlStopDeployment")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
deploymentId 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: Not defined

projectsCompleteDeployment

ProjectsDeployment projectsCompleteDeployment(slug, id, projectsCompleteDeploymentRequest)

CI completion hook for a git deployment

After CI syncs the built site to the S3 origin it flips the `queued` deployment to `live` (or `error`). `status` must be `live` or `error`. When `liveUrl` is omitted on a live completion it defaults to the project's canonical live URL.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = DeploymentsApi()
val slug : kotlin.String = slug_example // kotlin.String | Org-unique project handle (lowercased); also the S3-origin key segment and the subdomain label.
val id : kotlin.String = id_example // kotlin.String | Deployment id (e.g. dep_...).
val projectsCompleteDeploymentRequest : ProjectsCompleteDeploymentRequest =  // ProjectsCompleteDeploymentRequest | 
try {
    val result : ProjectsDeployment = apiInstance.projectsCompleteDeployment(slug, id, projectsCompleteDeploymentRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling DeploymentsApi#projectsCompleteDeployment")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling DeploymentsApi#projectsCompleteDeployment")
    e.printStackTrace()
}

Parameters

| slug | kotlin.String| Org-unique project handle (lowercased); also the S3-origin key segment and the subdomain label. | | | id | kotlin.String| Deployment id (e.g. dep_...). | |

Name Type Description Notes
projectsCompleteDeploymentRequest ProjectsCompleteDeploymentRequest

Return type

ProjectsDeployment

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

projectsDeployProject

ProjectsDeployment projectsDeployProject(slug, projectsGitDeployRequest)

Deploy a project to the S3 origin

The artifact/git entrypoint. Two modes on one endpoint, selected by Content-Type; both funnel through the one publish core. - Artifact (default): the request body is a zip or tar(.gz) of the BUILT site (index.html at the root, or inside a single wrapper directory), sent as a raw body or a multipart file. It is unpacked to the S3 origin under `<org>/<slug>/`, marked public-read, recorded as a `live` deployment, and served at `https://<slug>.<apex>`. Responds `200` with the finalized deployment. - Git (`Content-Type: application/json`, body `{&quot;source&quot;:&quot;git&quot;, ...}`): records a `queued` deployment and responds `202`. CI builds the linked repo, syncs `dist/` to the same prefix, then calls the completion hook to flip it `live`. Requires the project to have a linked repo.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = DeploymentsApi()
val slug : kotlin.String = slug_example // kotlin.String | Org-unique project handle (lowercased); also the S3-origin key segment and the subdomain label.
val projectsGitDeployRequest : ProjectsGitDeployRequest =  // ProjectsGitDeployRequest | 
try {
    val result : ProjectsDeployment = apiInstance.projectsDeployProject(slug, projectsGitDeployRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling DeploymentsApi#projectsDeployProject")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling DeploymentsApi#projectsDeployProject")
    e.printStackTrace()
}

Parameters

| slug | kotlin.String| Org-unique project handle (lowercased); also the S3-origin key segment and the subdomain label. | |

Name Type Description Notes
projectsGitDeployRequest ProjectsGitDeployRequest

Return type

ProjectsDeployment

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

projectsGetDeployment

ProjectsDeployment projectsGetDeployment(slug, id)

Get a deployment

Read one deployment of a project by id.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = DeploymentsApi()
val slug : kotlin.String = slug_example // kotlin.String | Org-unique project handle (lowercased); also the S3-origin key segment and the subdomain label.
val id : kotlin.String = id_example // kotlin.String | Deployment id (e.g. dep_...).
try {
    val result : ProjectsDeployment = apiInstance.projectsGetDeployment(slug, id)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling DeploymentsApi#projectsGetDeployment")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling DeploymentsApi#projectsGetDeployment")
    e.printStackTrace()
}

Parameters

| slug | kotlin.String| Org-unique project handle (lowercased); also the S3-origin key segment and the subdomain label. | |

Name Type Description Notes
id kotlin.String Deployment id (e.g. dep_...).

Return type

ProjectsDeployment

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

projectsListDeployments

kotlin.collections.List<ProjectsDeployment> projectsListDeployments(slug)

List deployments for a project

List the project's deployments, newest version first.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = DeploymentsApi()
val slug : kotlin.String = slug_example // kotlin.String | Org-unique project handle (lowercased); also the S3-origin key segment and the subdomain label.
try {
    val result : kotlin.collections.List<ProjectsDeployment> = apiInstance.projectsListDeployments(slug)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling DeploymentsApi#projectsListDeployments")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling DeploymentsApi#projectsListDeployments")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
slug kotlin.String Org-unique project handle (lowercased); also the S3-origin key segment and the subdomain label.

Return type

kotlin.collections.List<ProjectsDeployment>

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

projectsPurgeProject

ProjectsProject projectsPurgeProject(slug)

Purge the site's edge cache

Flush the site's edge cache without redeploying: invalidate the edge cache-tag `site-<org>-<slug>`, then stamp `lastPurgeAt` (unix seconds). The S3 origin and the deployment history are untouched — only cached copies at the edge are dropped, so the next request re-fetches the current artifact from origin. Idempotent.

Example

// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*

val apiInstance = DeploymentsApi()
val slug : kotlin.String = slug_example // kotlin.String | Org-unique project handle (lowercased); also the S3-origin key segment and the subdomain label.
try {
    val result : ProjectsProject = apiInstance.projectsPurgeProject(slug)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling DeploymentsApi#projectsPurgeProject")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling DeploymentsApi#projectsPurgeProject")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
slug kotlin.String Org-unique project handle (lowercased); also the S3-origin key segment and the subdomain label.

Return type

ProjectsProject

Authorization

Configure bearerAuth statically:

ApiClient.accessToken = ""

Configure bearerAuth dynamically:

apiInstance.accessTokenProvider = { "" }

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json