UNPKG

@soft-stech/autoscaler

Version:
138 lines (137 loc) 4.57 kB
import { addSchema } from "@soft-stech/apimachinery/_schemas/IoK8sApimachineryPkgApisMetaV1ObjectMeta"; import { Model, setSchema, createTypeMetaGuard } from "@soft-stech/base"; import { register } from "@soft-stech/validate"; const schemaId = "autoscaling.k8s.io.v1.VerticalPodAutoscalerCheckpoint"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "autoscaling.k8s.io/v1" ] }, "kind": { "type": "string", "enum": [ "VerticalPodAutoscalerCheckpoint" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "spec": { "properties": { "containerName": { "type": "string", "nullable": true }, "vpaObjectName": { "type": "string", "nullable": true } }, "type": "object", "nullable": true }, "status": { "properties": { "cpuHistogram": { "properties": { "bucketWeights": { "type": "object", "properties": {}, "nullable": true }, "referenceTimestamp": { "format": "date-time", "nullable": true, "type": "string" }, "totalWeight": { "type": "number", "nullable": true } }, "type": "object", "nullable": true }, "firstSampleStart": { "format": "date-time", "nullable": true, "type": "string" }, "lastSampleStart": { "format": "date-time", "nullable": true, "type": "string" }, "lastUpdateTime": { "format": "date-time", "nullable": true, "type": "string" }, "memoryHistogram": { "properties": { "bucketWeights": { "type": "object", "properties": {}, "nullable": true }, "referenceTimestamp": { "format": "date-time", "nullable": true, "type": "string" }, "totalWeight": { "type": "number", "nullable": true } }, "type": "object", "nullable": true }, "totalSamplesCount": { "type": "integer", "nullable": true }, "version": { "type": "string", "nullable": true } }, "type": "object", "nullable": true } }, "required": [ "apiVersion", "kind" ] }; /** * VerticalPodAutoscalerCheckpoint is the checkpoint of the internal state of VPA that is used for recovery after recommender's restart. */ export class VerticalPodAutoscalerCheckpoint extends Model { constructor(data) { super({ apiVersion: VerticalPodAutoscalerCheckpoint.apiVersion, kind: VerticalPodAutoscalerCheckpoint.kind, ...data }); } } VerticalPodAutoscalerCheckpoint.apiVersion = "autoscaling.k8s.io/v1"; VerticalPodAutoscalerCheckpoint.kind = "VerticalPodAutoscalerCheckpoint"; VerticalPodAutoscalerCheckpoint.is = createTypeMetaGuard(VerticalPodAutoscalerCheckpoint); setSchema(VerticalPodAutoscalerCheckpoint, schemaId, () => { addSchema(); register(schemaId, schema); });