feat: supported simple deployments and worker node types
This commit is contained in:
parent
9b9776f9ac
commit
684b5b511a
5 changed files with 39 additions and 14 deletions
14
entities/deployment.d.ts
vendored
14
entities/deployment.d.ts
vendored
|
@ -1,9 +1,19 @@
|
||||||
import type { Compose } from "./compose.d.ts"
|
import type { Compose } from "./compose.d.ts"
|
||||||
|
import type { Unit } from "./unit.d.ts"
|
||||||
|
|
||||||
type Spec = string | Compose
|
type Spec = string | Compose | Simple
|
||||||
|
|
||||||
|
type Simple = {
|
||||||
|
container: string
|
||||||
|
cpu?: Unit
|
||||||
|
ram?: Unit
|
||||||
|
name?: string
|
||||||
|
envs?: string[]
|
||||||
|
volumes?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
export type Deployment = {
|
export type Deployment = {
|
||||||
kind: string
|
kind: "compose" | "simple" | "deployment"
|
||||||
spec: Spec
|
spec: Spec
|
||||||
promocode?: string
|
promocode?: string
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,3 +2,4 @@ export * from "./account.d.ts"
|
||||||
export * from "./compose.d.ts"
|
export * from "./compose.d.ts"
|
||||||
export * from "./provider.d.ts"
|
export * from "./provider.d.ts"
|
||||||
export * from "./deployment.d.ts"
|
export * from "./deployment.d.ts"
|
||||||
|
export * from "./worked.d.ts"
|
||||||
|
|
14
entities/provider.d.ts
vendored
14
entities/provider.d.ts
vendored
|
@ -1,3 +1,5 @@
|
||||||
|
import type { Unit } from "./unit.d.ts"
|
||||||
|
|
||||||
export type Provider = {
|
export type Provider = {
|
||||||
uuid: string
|
uuid: string
|
||||||
name: string
|
name: string
|
||||||
|
@ -8,18 +10,6 @@ export type Provider = {
|
||||||
address: string
|
address: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Unit = {
|
|
||||||
unit: string
|
|
||||||
count: number
|
|
||||||
}
|
|
||||||
|
|
||||||
type ComputingUnit = {
|
|
||||||
cpu: number | Unit
|
|
||||||
mem: number | Unit
|
|
||||||
persistence: number | Unit
|
|
||||||
bandwitch: number | Unit
|
|
||||||
}
|
|
||||||
|
|
||||||
type PriceTable = {
|
type PriceTable = {
|
||||||
[x: string]: ComputingUnit | Unit
|
[x: string]: ComputingUnit | Unit
|
||||||
}
|
}
|
||||||
|
|
13
entities/unit.d.ts
vendored
Normal file
13
entities/unit.d.ts
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
export type Unit = {
|
||||||
|
unit: string
|
||||||
|
count: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ComputingUnit = {
|
||||||
|
cpu: number | Unit
|
||||||
|
mem: number | Unit
|
||||||
|
persistence: number | Unit
|
||||||
|
bandwitch: number | Unit
|
||||||
|
}
|
||||||
|
|
||||||
|
|
11
entities/worker.d.ts
vendored
Normal file
11
entities/worker.d.ts
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import type { ComputingUnit } from "./unit.d.ts"
|
||||||
|
|
||||||
|
export type Worker = {
|
||||||
|
uuid: string
|
||||||
|
/* address for receive payments */
|
||||||
|
address?: string
|
||||||
|
name?: string
|
||||||
|
price?: ComputingUnit
|
||||||
|
/* address to node server */
|
||||||
|
node?: string
|
||||||
|
}
|
Loading…
Reference in a new issue