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]>
7.5 KiB
BranchesApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| dbCreateBranch | POST /v1/db/projects/{id}/branches | Create branch |
| dbDeleteBranch | DELETE /v1/db/projects/{id}/branches/{branch_id} | Delete branch |
| dbGetBranch | GET /v1/db/projects/{id}/branches/{branch_id} | Get branch |
| dbListBranches | GET /v1/db/projects/{id}/branches | List branches |
| dbRestoreBranch | POST /v1/db/projects/{id}/branches/{branch_id}/restore | Point-in-time restore |
dbCreateBranch
DbCreateBranch201Response dbCreateBranch(id, dbCreateBranchRequest)
Create branch
Creates an instant copy-on-write branch from the parent branch. Branching is near-instant regardless of database size.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = BranchesApi()
val id : kotlin.String = id_example // kotlin.String |
val dbCreateBranchRequest : DbCreateBranchRequest = // DbCreateBranchRequest |
try {
val result : DbCreateBranch201Response = apiInstance.dbCreateBranch(id, dbCreateBranchRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling BranchesApi#dbCreateBranch")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling BranchesApi#dbCreateBranch")
e.printStackTrace()
}
Parameters
| id | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| dbCreateBranchRequest | DbCreateBranchRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
dbDeleteBranch
DbGetBranch200Response dbDeleteBranch(id, branchId)
Delete branch
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = BranchesApi()
val id : kotlin.String = id_example // kotlin.String |
val branchId : kotlin.String = branchId_example // kotlin.String |
try {
val result : DbGetBranch200Response = apiInstance.dbDeleteBranch(id, branchId)
println(result)
} catch (e: ClientException) {
println("4xx response calling BranchesApi#dbDeleteBranch")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling BranchesApi#dbDeleteBranch")
e.printStackTrace()
}
Parameters
| id | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| branchId | 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
dbGetBranch
DbGetBranch200Response dbGetBranch(id, branchId)
Get branch
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = BranchesApi()
val id : kotlin.String = id_example // kotlin.String |
val branchId : kotlin.String = branchId_example // kotlin.String |
try {
val result : DbGetBranch200Response = apiInstance.dbGetBranch(id, branchId)
println(result)
} catch (e: ClientException) {
println("4xx response calling BranchesApi#dbGetBranch")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling BranchesApi#dbGetBranch")
e.printStackTrace()
}
Parameters
| id | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| branchId | 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
dbListBranches
DbListBranches200Response dbListBranches(id)
List branches
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = BranchesApi()
val id : kotlin.String = id_example // kotlin.String |
try {
val result : DbListBranches200Response = apiInstance.dbListBranches(id)
println(result)
} catch (e: ClientException) {
println("4xx response calling BranchesApi#dbListBranches")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling BranchesApi#dbListBranches")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | 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
dbRestoreBranch
DbRestoreBranch200Response dbRestoreBranch(id, branchId, dbRestoreBranchRequest)
Point-in-time restore
Restore a branch to a specific point in time or LSN. Uses WAL history for precise recovery.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = BranchesApi()
val id : kotlin.String = id_example // kotlin.String |
val branchId : kotlin.String = branchId_example // kotlin.String |
val dbRestoreBranchRequest : DbRestoreBranchRequest = // DbRestoreBranchRequest |
try {
val result : DbRestoreBranch200Response = apiInstance.dbRestoreBranch(id, branchId, dbRestoreBranchRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling BranchesApi#dbRestoreBranch")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling BranchesApi#dbRestoreBranch")
e.printStackTrace()
}
Parameters
| id | kotlin.String| | | | branchId | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| dbRestoreBranchRequest | DbRestoreBranchRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json