import * as API from "@distilled.cloud/core/api"; import * as C from "@distilled.cloud/core/category"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-stackit). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; import type * as Redacted from "effect/Redacted"; import { StackitServiceErrors } from "../errors.ts"; import { StackitProtocol, type StackitOpError, type StackitOpContext } from "../protocol.ts"; import * as Retry from "../retry.ts"; import * as T from "../traits.ts"; // Schema table, filled on first reach (see __S at the end). const __s: any[] = []; export type { StackitOpError, StackitOpContext }; /** Span facts shared by every operation (com.distilled.telemetry#service). */ const TELEMETRY = { system: "stackit-api", responseHeaders: [ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" }, { header: "request-id", name: "http.response.header.request-id", transform: "list" }, ], prefix: "STACKIT", service: "Valkey", labels: "stackit", propagate: "w3c", } as const; export class BadRequest extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("BadRequest", { code: S.Number, message: S.String, body: /*@__PURE__*/ S.optional( /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(0, __c0, 0)), S.String]), ), headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), }).pipe(C.withBadRequestError), [{ status: 400 }], ) { declare readonly body?: Error | string; } export class Conflict extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Conflict", { code: S.Number, message: S.String, body: /*@__PURE__*/ S.optional( /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(0, __c0, 0)), S.String]), ), headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), }).pipe(C.withConflictError), [{ status: 409 }], ) { declare readonly body?: Error | string; } export class NotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("NotFound", { code: S.Number, message: S.String, body: /*@__PURE__*/ S.optional( /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(0, __c0, 0)), S.String]), ), headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)), }).pipe(C.withBadRequestError), [{ status: 404 }], ) { declare readonly body?: Error | string; } export interface CreateBackupRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } export interface CreateBackupResponseItem { id: number; message: string; } export interface CreateCredentialsRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; parameters?: unknown | undefined; } export type CredentialsHostsList = Array; export interface Credentials { host: string; hosts?: CredentialsHostsList | undefined; load_balanced_host?: string | undefined; password: string | Redacted.Redacted; port?: number | undefined; uri?: string | undefined; username: string; } export interface RawCredentials { credentials: Credentials; } export interface CredentialsResponse { id: string; raw?: RawCredentials | undefined; uri: string; } export type InstanceParametersLazyfreeLazyEviction = "yes" | "no"; export type InstanceParametersLazyfreeLazyExpire = "yes" | "no"; export type InstanceParametersMaxmemoryPolicy = | "volatile-lru" | "allkeys-lru" | "volatile-random" | "allkeys-random" | "volatile-ttl" | "noeviction"; export type InstanceParametersSyslogList = Array; export interface InstanceParameters { /** The unit is milliseconds. */ down_after_milliseconds?: number | undefined; enable_monitoring?: boolean | undefined; /** The unit is milliseconds. */ failover_timeout?: number | undefined; /** If you want to monitor your service with Graphite, you can set the custom parameter graphite. It expects the host and port where the Graphite metrics should be sent to. */ graphite?: string | undefined; lazyfree_lazy_eviction?: InstanceParametersLazyfreeLazyEviction | (string & {}) | undefined; lazyfree_lazy_expire?: InstanceParametersLazyfreeLazyExpire | (string & {}) | undefined; lua_time_limit?: number | undefined; /** This component monitors ephemeral and persistent disk usage. If one of these disk usages reaches the default configured threshold of 80%, the a9s Parachute stops all processes on that node. */ max_disk_threshold?: number | undefined; maxclients?: number | undefined; maxmemory_policy?: InstanceParametersMaxmemoryPolicy | (string & {}) | undefined; maxmemory_samples?: number | undefined; /** Frequency of metrics being emitted in seconds */ metrics_frequency?: number | undefined; /** Depending on your graphite provider, you might need to prefix the metrics with a certain value, like an API key for example. */ metrics_prefix?: string | undefined; /** The amount of connected replicas that are required for the primary to accept write operations. It can be set to 0 to disable it. Should not be greater than the number of nodes (e.g. 1 or 3). */ min_replicas_to_write?: number | undefined; /** The unit is seconds. */ min_replicas_max_lag?: number | undefined; monitoring_instance_id?: string | undefined; /** The allowed value must include the following characters only: [K,E,g,$,l,s,h,z,x,e,A,t] */ notify_keyspace_events?: string | undefined; /** Set the replication backlog size for the cluster. */ repl_backlog_size?: string | undefined; /** Comma separated list of IP networks in CIDR notation which are allowed to access this instance. */ sgw_acl?: string | undefined; /** This setting must follow the original Redis configuration for RDB. */ snapshot?: string | undefined; syslog?: InstanceParametersSyslogList | undefined; } export interface CreateInstanceRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; instanceName: string; parameters?: InstanceParameters | undefined; planId: string; } export interface CreateInstanceResponse { instanceId: string; } export interface DeleteCredentialsRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; /** Id of the credentials being deleted */ credentialsId: string; } export interface DeleteCredentialsResponse {} export interface DeleteInstanceRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } export interface DeleteInstanceResponse {} export interface DownloadBackupRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; /** Backup id */ backupId: number; } export interface DownloadBackupResponse {} export interface GetCredentialsRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; /** Credentials id of credentials to fetch */ credentialsId: string; } export interface GetInstanceRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } /** Current state of a service instance */ export type InstanceInstanceStatus = | "provisioned" | "available" | "deleted" | "deploying" | "failed" | "stopped" | "unknown"; export type InstanceLastOperationState = "in progress" | "succeeded" | "failed"; export type InstanceLastOperationType = "create" | "update" | "delete"; export interface InstanceLastOperation { description: string; state: InstanceLastOperationState; type: InstanceLastOperationType; } /** State of the last operation and this instance */ export type InstanceStatus = "active" | "failed" | "stopped" | "creating" | "deleting" | "updating"; export interface Instance { cfGuid: string; cfOrganizationGuid: string; cfSpaceGuid: string; dashboardUrl: string; imageUrl: string; instanceId?: string | undefined; /** Current state of a service instance */ instanceStatus?: InstanceInstanceStatus | undefined; lastOperation: InstanceLastOperation; name: string; offeringName: string; offeringVersion: string; parameters: unknown; planId: string; planName: string; /** State of the last operation and this instance */ status?: InstanceStatus | undefined; } export interface GetMetricsRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } export interface GetMetricsResponse { cpuIdleTime?: number | undefined; cpuLoadPercent: number; cpuSystemTime?: number | undefined; cpuUserTime?: number | undefined; diskEphemeralTotal: number; diskEphemeralUsed: number; diskPersistentTotal: number; diskPersistentUsed: number; load1: number; load15: number; load5: number; memoryTotal: number; memoryUsed: number; parachuteDiskEphemeralActivated: boolean; parachuteDiskEphemeralTotal: number; parachuteDiskEphemeralUsed: number; parachuteDiskEphemeralUsedPercent: number; parachuteDiskEphemeralUsedThreshold: number; parachuteDiskPersistentActivated: boolean; parachuteDiskPersistentTotal: number; parachuteDiskPersistentUsed: number; parachuteDiskPersistentUsedPercent: number; parachuteDiskPersistentUsedThreshold: number; } export interface GetUpdatesRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } export interface GetUpdatesResponse { /** Whether automatic updates are allowed. */ automaticUpdatesEnabled: boolean; /** Number of available update components. */ availableUpdates: number; } export interface ListBackupsRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } export interface Backup { downloadable?: boolean | undefined; finished_at: string; id: number; size?: number | undefined; status: string; triggered_at?: string | undefined; } export type ListBackupsResponse = Array; export type ListBackupsResponse2 = ListBackupsResponse; export interface ListCredentialsRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } export interface CredentialsListItem { id: string; } export type ListCredentialsResponseCredentialsListList = Array; export interface ListCredentialsResponse { credentialsList: ListCredentialsResponseCredentialsListList; } export interface ListInstancesRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; } export type ListInstancesResponseInstancesList = Array; export interface ListInstancesResponse { instances: ListInstancesResponseInstancesList; } export interface ListOfferingsRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; } export interface Plan { description: string; free: boolean; id: string; name: string; skuName: string; } export type OfferingPlansList = Array; export interface Schema { parameters: unknown; } export interface InstanceSchema { create: Schema; update: Schema; } export interface Offering { description: string; documentationUrl: string; imageUrl: string; latest: boolean; lifecycle?: string | undefined; name: string; plans: OfferingPlansList; quotaCount: number; schema?: InstanceSchema | undefined; version: string; } export type ListOfferingsResponseOfferingsList = Array; export interface ListOfferingsResponse { offerings: ListOfferingsResponseOfferingsList; } export interface ListRestoresRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } export interface Restore { backup_id: number; finished_at: string; id: number; status: string; triggered_at?: string | undefined; } export type ListRestoresResponseInstanceRestoresList = Array; export interface ListRestoresResponse { instanceRestores: ListRestoresResponseInstanceRestoresList; } export interface PartialUpdateInstanceRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; instanceName?: string | undefined; parameters?: InstanceParameters | undefined; planId?: string | undefined; } export interface PartialUpdateInstanceResponse {} export interface TriggerRecreateRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } export interface TriggerRestartRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } export interface TriggerRestoreRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; /** Backup id */ backupId: number; } export interface TriggerRestoreResponse { id: number; } export interface TriggerUpdateRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; } export interface UpdateBackupsConfigRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; encryption_key?: string | Redacted.Redacted | undefined; } export interface UpdateBackupsConfigResponse { message: string; } export interface UpdateUpdatesSettingsRequest { /** Project id on which user has permissions */ projectId: string; /** region in which the project resides */ regionId: string; /** Instance id */ instanceId: string; /** Set to true to enable automatic updates or false to disable them. */ automaticUpdatesEnabled: boolean; } export interface UpdateUpdatesSettingsResponse { /** Whether automatic updates are allowed. */ automaticUpdatesEnabled: boolean; } export interface Error { description: string; error: string; } export type CreateBackupError = BadRequest | NotFound | StackitOpError; /** create a backup */ export const createBackup: API.OperationMethod< CreateBackupRequest, CreateBackupResponseItem, CreateBackupError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(136, __c17, 0) as any as S.Schema, output: __S(137, __c17, 1) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateBackup", })); export type CreateCredentialsError = BadRequest | StackitOpError; /** create new credentials Create new service credentials */ export const createCredentials: API.OperationMethod< CreateCredentialsRequest, CredentialsResponse, CreateCredentialsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(144, __c18, 0) as any as S.Schema, output: __S(162, __c20, 2) as any as S.Schema, errors: [BadRequest], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateCredentials", })); export type CreateInstanceError = BadRequest | Conflict | StackitOpError; /** provision Provision a service instance. */ export const createInstance: API.OperationMethod< CreateInstanceRequest, CreateInstanceResponse, CreateInstanceError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(168, __c21, 0) as any as S.Schema, output: __S(184, __c23, 0) as any as S.Schema, errors: [BadRequest, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateInstance", })); export type DeleteCredentialsError = BadRequest | NotFound | StackitOpError; /** delete credentials by id Delete a service credentials. */ export const deleteCredentials: API.OperationMethod< DeleteCredentialsRequest, DeleteCredentialsResponse, DeleteCredentialsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(192, __c24, 0) as any as S.Schema, output: __S(200, __c25, 0) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteCredentials", })); export type DeleteInstanceError = BadRequest | NotFound | StackitOpError; /** delete service instance Deprovision a service instance. */ export const deleteInstance: API.OperationMethod< DeleteInstanceRequest, DeleteInstanceResponse, DeleteInstanceError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(208, __c26, 0) as any as S.Schema, output: __S(200, __c25, 0) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteInstance", })); export type DownloadBackupError = BadRequest | NotFound | StackitOpError; /** download backup */ export const downloadBackup: API.OperationMethod< DownloadBackupRequest, DownloadBackupResponse, DownloadBackupError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(216, __c27, 0) as any as S.Schema, output: __S(200, __c25, 0) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DownloadBackup", })); export type GetCredentialsError = BadRequest | NotFound | StackitOpError; /** get credentials by id get a service credentials by credentials id */ export const getCredentials: API.OperationMethod< GetCredentialsRequest, CredentialsResponse, GetCredentialsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(224, __c28, 0) as any as S.Schema, output: __S(162, __c20, 2) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetCredentials", })); export type GetInstanceError = BadRequest | NotFound | StackitOpError; /** get a service instance get a service instance */ export const getInstance: API.OperationMethod< GetInstanceRequest, Instance, GetInstanceError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(8, __c1, 0) as any as S.Schema, output: __S(17, __c2, 1) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetInstance", })); export type GetMetricsError = BadRequest | NotFound | StackitOpError; /** get latest metrics for cpu load, memory and disk usage */ export const getMetrics: API.OperationMethod< GetMetricsRequest, GetMetricsResponse, GetMetricsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(24, __c3, 0) as any as S.Schema, output: __S(25, __c3, 1) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetMetrics", })); export type GetUpdatesError = BadRequest | NotFound | Conflict | StackitOpError; /** get update settings Returns whether automatic updates are enabled and the number of available updates. */ export const getUpdates: API.OperationMethod< GetUpdatesRequest, GetUpdatesResponse, GetUpdatesError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c4, 0) as any as S.Schema, output: __S(33, __c4, 1) as any as S.Schema, errors: [BadRequest, NotFound, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetUpdates", })); export type ListBackupsError = BadRequest | NotFound | StackitOpError; /** get latest backup information for provided instanceId */ export const listBackups: API.OperationMethod< ListBackupsRequest, ListBackupsResponse2, ListBackupsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(40, __c5, 0) as any as S.Schema, output: __S(43, __c5, 3) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListBackups", })); export type ListCredentialsError = BadRequest | NotFound | StackitOpError; /** get list of credentials ids get list all credentials ids for instance */ export const listCredentials: API.OperationMethod< ListCredentialsRequest, ListCredentialsResponse, ListCredentialsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(48, __c6, 0) as any as S.Schema, output: __S(51, __c6, 3) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListCredentials", })); export type ListInstancesError = BadRequest | NotFound | StackitOpError; /** get service instances list Get a list of available instances */ export const listInstances: API.OperationMethod< ListInstancesRequest, ListInstancesResponse, ListInstancesError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(56, __c7, 0) as any as S.Schema, output: __S(58, __c7, 2) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListInstances", })); export type ListOfferingsError = BadRequest | NotFound | StackitOpError; /** get the service offerings Get the service offerings that the service broker offers. */ export const listOfferings: API.OperationMethod< ListOfferingsRequest, ListOfferingsResponse, ListOfferingsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(64, __c8, 0) as any as S.Schema, output: __S(71, __c8, 7) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListOfferings", })); export type ListRestoresError = BadRequest | NotFound | StackitOpError; /** get latest restore information for provided instanceId */ export const listRestores: API.OperationMethod< ListRestoresRequest, ListRestoresResponse, ListRestoresError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(72, __c9, 0) as any as S.Schema, output: __S(75, __c9, 3) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListRestores", })); export type PartialUpdateInstanceError = BadRequest | NotFound | StackitOpError; /** update a service instance Update a service instance. This could be a sgw acl update or a plan upgrade. */ export const partialUpdateInstance: API.OperationMethod< PartialUpdateInstanceRequest, PartialUpdateInstanceResponse, PartialUpdateInstanceError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(80, __c10, 0) as any as S.Schema, output: __S(200, __c25, 0) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "PartialUpdateInstance", })); export type TriggerRecreateError = BadRequest | NotFound | StackitOpError; /** trigger a recreate */ export const triggerRecreate: API.OperationMethod< TriggerRecreateRequest, CreateInstanceResponse, TriggerRecreateError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(88, __c11, 0) as any as S.Schema, output: __S(184, __c23, 0) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "TriggerRecreate", })); export type TriggerRestartError = BadRequest | NotFound | StackitOpError; /** trigger a restart */ export const triggerRestart: API.OperationMethod< TriggerRestartRequest, CreateInstanceResponse, TriggerRestartError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(96, __c12, 0) as any as S.Schema, output: __S(184, __c23, 0) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "TriggerRestart", })); export type TriggerRestoreError = BadRequest | NotFound | StackitOpError; /** trigger a restore */ export const triggerRestore: API.OperationMethod< TriggerRestoreRequest, TriggerRestoreResponse, TriggerRestoreError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(104, __c13, 0) as any as S.Schema, output: __S(105, __c13, 1) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "TriggerRestore", })); export type TriggerUpdateError = BadRequest | NotFound | Conflict | StackitOpError; /** start updates Starts all available updates asynchronously using the instance's service offering. No request body is required. */ export const triggerUpdate: API.OperationMethod< TriggerUpdateRequest, CreateInstanceResponse, TriggerUpdateError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(112, __c14, 0) as any as S.Schema, output: __S(184, __c23, 0) as any as S.Schema, errors: [BadRequest, NotFound, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "TriggerUpdate", })); export type UpdateBackupsConfigError = BadRequest | NotFound | StackitOpError; /** backups configuration update Update the configuration for backups for your instance. */ export const updateBackupsConfig: API.OperationMethod< UpdateBackupsConfigRequest, UpdateBackupsConfigResponse, UpdateBackupsConfigError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(120, __c15, 0) as any as S.Schema, output: __S(121, __c15, 1) as any as S.Schema, errors: [BadRequest, NotFound], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateBackupsConfig", })); export type UpdateUpdatesSettingsError = BadRequest | NotFound | Conflict | StackitOpError; /** update update settings Enables or disables automatic updates. The platform operator must allow changing this setting. */ export const updateUpdatesSettings: API.OperationMethod< UpdateUpdatesSettingsRequest, UpdateUpdatesSettingsResponse, UpdateUpdatesSettingsError, StackitOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(128, __c16, 0) as any as S.Schema, output: __S(129, __c16, 1) as any as S.Schema, errors: [BadRequest, NotFound, Conflict], serviceErrors: StackitServiceErrors, protocol: StackitProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateUpdatesSettings", })); // Schema builders: each runs one schema initializer, on that schema's first use. function __c0(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ description: S.String, error: S.String, }), ).annotate({ identifier: "Error" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "GetInstanceRequest" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ description: S.String, state: S.String, type: S.String, }), ).annotate({ identifier: "InstanceLastOperation" }); case 1: return S.suspend(() => S.Struct({ cfGuid: S.String, cfOrganizationGuid: S.String, cfSpaceGuid: S.String, dashboardUrl: S.String, imageUrl: S.String, instanceId: S.optional(S.String), instanceStatus: S.optional(S.String), lastOperation: __S(16, __c2, 0), name: S.String, offeringName: S.String, offeringVersion: S.String, parameters: S.Unknown, planId: S.String, planName: S.String, status: S.optional(S.String), }), ).annotate({ identifier: "Instance" }); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/metrics", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "GetMetricsRequest" }); case 1: return S.suspend(() => S.Struct({ cpuIdleTime: S.optional(S.Number), cpuLoadPercent: S.Number, cpuSystemTime: S.optional(S.Number), cpuUserTime: S.optional(S.Number), diskEphemeralTotal: S.Number, diskEphemeralUsed: S.Number, diskPersistentTotal: S.Number, diskPersistentUsed: S.Number, load1: S.Number, load15: S.Number, load5: S.Number, memoryTotal: S.Number, memoryUsed: S.Number, parachuteDiskEphemeralActivated: S.Boolean, parachuteDiskEphemeralTotal: S.Number, parachuteDiskEphemeralUsed: S.Number, parachuteDiskEphemeralUsedPercent: S.Number, parachuteDiskEphemeralUsedThreshold: S.Number, parachuteDiskPersistentActivated: S.Boolean, parachuteDiskPersistentTotal: S.Number, parachuteDiskPersistentUsed: S.Number, parachuteDiskPersistentUsedPercent: S.Number, parachuteDiskPersistentUsedThreshold: S.Number, }), ).annotate({ identifier: "GetMetricsResponse" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/updates", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "GetUpdatesRequest" }); case 1: return S.suspend(() => S.Struct({ automaticUpdatesEnabled: S.Boolean, availableUpdates: S.Number, }), ).annotate({ identifier: "GetUpdatesResponse" }); } } function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "ListBackupsRequest" }); case 1: return S.suspend(() => S.Struct({ downloadable: S.optional(S.Boolean), finished_at: S.String, id: S.Number, size: S.optional(S.Number), status: S.String, triggered_at: S.optional(S.String), }), ).annotate({ identifier: "Backup" }); case 2: return S.Array(__S(41, __c5, 1)); case 3: return S.suspend(() => __S(42, __c5, 2).pipe(T.RawResponseRoot())).annotate({ identifier: "ListBackupsResponse2", }); } } function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "ListCredentialsRequest" }); case 1: return S.suspend(() => S.Struct({ id: S.String, }), ).annotate({ identifier: "CredentialsListItem" }); case 2: return S.Array(__S(49, __c6, 1)); case 3: return S.suspend(() => S.Struct({ credentialsList: __S(50, __c6, 2), }), ).annotate({ identifier: "ListCredentialsResponse" }); } } function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{projectId}/regions/{regionId}/instances", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "ListInstancesRequest" }); case 1: return S.Array(__S(17, __c2, 1)); case 2: return S.suspend(() => S.Struct({ instances: __S(57, __c7, 1), }), ).annotate({ identifier: "ListInstancesResponse" }); } } function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{projectId}/regions/{regionId}/offerings", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "ListOfferingsRequest" }); case 1: return S.suspend(() => S.Struct({ description: S.String, free: S.Boolean, id: S.String, name: S.String, skuName: S.String, }), ).annotate({ identifier: "Plan" }); case 2: return S.Array(__S(65, __c8, 1)); case 3: return S.suspend(() => S.Struct({ parameters: S.Unknown, }), ).annotate({ identifier: "Schema" }); case 4: return S.suspend(() => S.Struct({ create: __S(67, __c8, 3), update: __S(67, __c8, 3), }), ).annotate({ identifier: "InstanceSchema" }); case 5: return S.suspend(() => S.Struct({ description: S.String, documentationUrl: S.String, imageUrl: S.String, latest: S.Boolean, lifecycle: S.optional(S.String), name: S.String, plans: __S(66, __c8, 2), quotaCount: S.Number, schema: S.optional(__S(68, __c8, 4)), version: S.String, }), ).annotate({ identifier: "Offering" }); case 6: return S.Array(__S(69, __c8, 5)); case 7: return S.suspend(() => S.Struct({ offerings: __S(70, __c8, 6), }), ).annotate({ identifier: "ListOfferingsResponse" }); } } function __c9(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restores", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "ListRestoresRequest" }); case 1: return S.suspend(() => S.Struct({ backup_id: S.Number, finished_at: S.String, id: S.Number, status: S.String, triggered_at: S.optional(S.String), }), ).annotate({ identifier: "Restore" }); case 2: return S.Array(__S(73, __c9, 1)); case 3: return S.suspend(() => S.Struct({ instanceRestores: __S(74, __c9, 2), }), ).annotate({ identifier: "ListRestoresResponse" }); } } function __c10(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), instanceName: S.optional(S.String), parameters: S.optional(__S(176, __c22, 0)), planId: S.optional(S.String), }).pipe( T.Http({ method: "PATCH", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "PartialUpdateInstanceRequest" }); } } function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "PATCH", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/recreate", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "TriggerRecreateRequest" }); } } function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "PATCH", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/restart", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "TriggerRestartRequest" }); } } function __c13(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), backupId: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/restore", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "TriggerRestoreRequest" }); case 1: return S.suspend(() => S.Struct({ id: S.Number, }), ).annotate({ identifier: "TriggerRestoreResponse" }); } } function __c14(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/updates/start", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "TriggerUpdateRequest" }); } } function __c15(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), encryption_key: S.optional(S.String.pipe(T.SensitiveValue({}))), }).pipe( T.Http({ method: "PATCH", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups-config", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "UpdateBackupsConfigRequest" }); case 1: return S.suspend(() => S.Struct({ message: S.String, }), ).annotate({ identifier: "UpdateBackupsConfigResponse" }); } } function __c16(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), automaticUpdatesEnabled: S.Boolean, }).pipe( T.Http({ method: "PATCH", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/updates", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "UpdateUpdatesSettingsRequest" }); case 1: return S.suspend(() => S.Struct({ automaticUpdatesEnabled: S.Boolean, }), ).annotate({ identifier: "UpdateUpdatesSettingsResponse" }); } } function __c17(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "CreateBackupRequest" }); case 1: return S.suspend(() => S.Struct({ id: S.Number, message: S.String, }), ).annotate({ identifier: "CreateBackupResponseItem" }); } } function __c18(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), parameters: S.optional(S.Unknown), }).pipe( T.Http({ method: "POST", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "CreateCredentialsRequest" }); } } function __c19(j: number): any { switch (j) { case 0: return S.Array(S.String); } } function __c20(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ host: S.String, hosts: S.optional(__S(152, __c19, 0)), load_balanced_host: S.optional(S.String), password: S.String.pipe(T.SensitiveValue({})), port: S.optional(S.Number), uri: S.optional(S.String), username: S.String, }), ).annotate({ identifier: "Credentials" }); case 1: return S.suspend(() => S.Struct({ credentials: __S(160, __c20, 0), }), ).annotate({ identifier: "RawCredentials" }); case 2: return S.suspend(() => S.Struct({ id: S.String, raw: S.optional(__S(161, __c20, 1)), uri: S.String, }), ).annotate({ identifier: "CredentialsResponse" }); } } function __c21(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceName: S.String, parameters: S.optional(__S(176, __c22, 0)), planId: S.String, }).pipe( T.Http({ method: "POST", uri: "/v2/projects/{projectId}/regions/{regionId}/instances", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "CreateInstanceRequest" }); } } function __c22(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ down_after_milliseconds: S.optional(S.Number.pipe(T.Body("down-after-milliseconds"))), enable_monitoring: S.optional(S.Boolean), failover_timeout: S.optional(S.Number.pipe(T.Body("failover-timeout"))), graphite: S.optional(S.String), lazyfree_lazy_eviction: S.optional(S.String.pipe(T.Body("lazyfree-lazy-eviction"))), lazyfree_lazy_expire: S.optional(S.String.pipe(T.Body("lazyfree-lazy-expire"))), lua_time_limit: S.optional(S.Number.pipe(T.Body("lua-time-limit"))), max_disk_threshold: S.optional(S.Number), maxclients: S.optional(S.Number), maxmemory_policy: S.optional(S.String.pipe(T.Body("maxmemory-policy"))), maxmemory_samples: S.optional(S.Number.pipe(T.Body("maxmemory-samples"))), metrics_frequency: S.optional(S.Number), metrics_prefix: S.optional(S.String), min_replicas_to_write: S.optional(S.Number.pipe(T.Body("min-replicas-to-write"))), min_replicas_max_lag: S.optional(S.Number), monitoring_instance_id: S.optional(S.String), notify_keyspace_events: S.optional(S.String.pipe(T.Body("notify-keyspace-events"))), repl_backlog_size: S.optional(S.String.pipe(T.Body("repl-backlog-size"))), sgw_acl: S.optional(S.String), snapshot: S.optional(S.String), syslog: S.optional(__S(152, __c19, 0)), }), ).annotate({ identifier: "InstanceParameters" }); } } function __c23(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ instanceId: S.String, }), ).annotate({ identifier: "CreateInstanceResponse" }); } } function __c24(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), credentialsId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "DeleteCredentialsRequest" }); } } function __c25(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteCredentialsResponse" }); } } function __c26(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "DeleteInstanceRequest" }); } } function __c27(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), backupId: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/backups/{backupId}/download", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "DownloadBackupRequest" }); } } function __c28(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ projectId: S.String.pipe(T.Label()), regionId: S.String.pipe(T.Label()), instanceId: S.String.pipe(T.Label()), credentialsId: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}/credentials/{credentialsId}", code: 200, baseUrl: "https://valkey.api.stackit.cloud", }), ), ).annotate({ identifier: "GetCredentialsRequest" }); } } // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); }