@haakco/hostingctl 1.0.811 → 1.0.813
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +158 -64
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/platform/darwin-arm64/hostingctl +0 -0
- package/platform/darwin-x64/hostingctl +0 -0
- package/platform/linux-arm64/hostingctl +0 -0
- package/platform/linux-x64/hostingctl +0 -0
- package/platform/windows-x64/hostingctl.exe +0 -0
package/dist/main.js
CHANGED
|
@@ -33789,6 +33789,22 @@ function hostingCancellationReconfirm(options) {
|
|
|
33789
33789
|
}));
|
|
33790
33790
|
}
|
|
33791
33791
|
/**
|
|
33792
|
+
* {@link /c/:company/hosting/clusters/:cluster/storage-classes}
|
|
33793
|
+
*/
|
|
33794
|
+
function hostingClusterStorageClassesIndex(options) {
|
|
33795
|
+
const { client: request = client, ...config } = options;
|
|
33796
|
+
return withUnwrap(request({
|
|
33797
|
+
method: "GET",
|
|
33798
|
+
url: "/c/{company}/hosting/clusters/{cluster}/storage-classes",
|
|
33799
|
+
security: [{
|
|
33800
|
+
type: "http",
|
|
33801
|
+
scheme: "bearer"
|
|
33802
|
+
}],
|
|
33803
|
+
...config,
|
|
33804
|
+
throwOnError: config.throwOnError ?? true
|
|
33805
|
+
}));
|
|
33806
|
+
}
|
|
33807
|
+
/**
|
|
33792
33808
|
* {@link /c/:company/hosting/pool}
|
|
33793
33809
|
*/
|
|
33794
33810
|
function hostingPoolShow(options) {
|
|
@@ -55449,7 +55465,8 @@ var createHostingEnvironmentRequestSchema = object({
|
|
|
55449
55465
|
certificateIssuer: hostingCertificateIssuerEnumSchema.optional(),
|
|
55450
55466
|
storageSelections: array(object({
|
|
55451
55467
|
volumeType: hostingVolumeEnumSchema,
|
|
55452
|
-
storageClassUuid: uuid()
|
|
55468
|
+
storageClassUuid: uuid().optional(),
|
|
55469
|
+
storageClass: string().max(253).optional()
|
|
55453
55470
|
})).max(3).refine((items) => new Set(items).size === items.length, { message: "Array entries must be unique" }).optional(),
|
|
55454
55471
|
resourceProfile: _enum([
|
|
55455
55472
|
"small_sites",
|
|
@@ -57568,6 +57585,23 @@ var hostingClusterDataSchema = object({
|
|
|
57568
57585
|
name: string(),
|
|
57569
57586
|
baseDomain: string()
|
|
57570
57587
|
});
|
|
57588
|
+
var hostingOfferedStorageClassDataSchema = object({
|
|
57589
|
+
uuid: string(),
|
|
57590
|
+
kubernetesName: string(),
|
|
57591
|
+
name: string(),
|
|
57592
|
+
description: string(),
|
|
57593
|
+
sharedAcrossNodes: boolean(),
|
|
57594
|
+
encryptedAtRest: boolean().nullable()
|
|
57595
|
+
});
|
|
57596
|
+
var hostingVolumeTypeStorageOfferDataSchema = object({
|
|
57597
|
+
volumeType: string(),
|
|
57598
|
+
classes: array(hostingOfferedStorageClassDataSchema)
|
|
57599
|
+
});
|
|
57600
|
+
object({
|
|
57601
|
+
cluster: hostingClusterDataSchema,
|
|
57602
|
+
placement: boolean(),
|
|
57603
|
+
volumeTypes: array(hostingVolumeTypeStorageOfferDataSchema)
|
|
57604
|
+
});
|
|
57571
57605
|
var hostingCompanyNvmeBlocksDataSchema = object({
|
|
57572
57606
|
recorded: boolean(),
|
|
57573
57607
|
blocks: int().nullable().describe("The whole 10 GB blocks the company holds now, or null when it holds none."),
|
|
@@ -59734,7 +59768,8 @@ object({
|
|
|
59734
59768
|
var hostingStorageBackendEnumSchema = _enum([
|
|
59735
59769
|
"longhorn",
|
|
59736
59770
|
"ceph",
|
|
59737
|
-
"local-path"
|
|
59771
|
+
"local-path",
|
|
59772
|
+
"cephfs"
|
|
59738
59773
|
]);
|
|
59739
59774
|
var hostingStorageBindingDataSchema = object({
|
|
59740
59775
|
uuid: string(),
|
|
@@ -59823,7 +59858,8 @@ object({
|
|
|
59823
59858
|
reclaimPolicy: string().nullable(),
|
|
59824
59859
|
allowVolumeExpansion: boolean().nullable(),
|
|
59825
59860
|
volumeBindingMode: string().nullable(),
|
|
59826
|
-
reason: string().nullable()
|
|
59861
|
+
reason: string().nullable(),
|
|
59862
|
+
encryptedAtRest: boolean().nullable().describe("Whether the class reports `encrypted: \"true\"` with a KMS binding; null when it could not be read.")
|
|
59827
59863
|
});
|
|
59828
59864
|
var hostingStorageContentFormatEnumSchema = _enum(["native", "rclone_crypt"]);
|
|
59829
59865
|
object({ items: array(object({
|
|
@@ -60329,10 +60365,6 @@ object({
|
|
|
60329
60365
|
maxRecipients: int(),
|
|
60330
60366
|
deliveries: array(platformAlertDeliveryDataSchema)
|
|
60331
60367
|
});
|
|
60332
|
-
var platformAllowanceHolderDataSchema = object({
|
|
60333
|
-
email: string(),
|
|
60334
|
-
roles: array(string())
|
|
60335
|
-
});
|
|
60336
60368
|
var platformCompanyAdminDataSchema = object({
|
|
60337
60369
|
uuid: string(),
|
|
60338
60370
|
name: string(),
|
|
@@ -60423,11 +60455,6 @@ var platformPoolTenantMoveDataSchema = object({
|
|
|
60423
60455
|
plan: hostingPoolTenantMovePlanDataSchema,
|
|
60424
60456
|
message: string()
|
|
60425
60457
|
});
|
|
60426
|
-
object({
|
|
60427
|
-
clientEnvironmentsPerCompany: int(),
|
|
60428
|
-
operatorEnvironmentsPerCompany: int(),
|
|
60429
|
-
holders: array(platformAllowanceHolderDataSchema).describe("Accounts whose platform grants include `platform.clients.manage`, oldest first.")
|
|
60430
|
-
});
|
|
60431
60458
|
var platformStorageAccountingRowDataSchema = object({
|
|
60432
60459
|
companySlug: string(),
|
|
60433
60460
|
companyName: string(),
|
|
@@ -61550,7 +61577,8 @@ var storePlatformHostingEnvironmentRequestSchema = object({
|
|
|
61550
61577
|
certificateIssuer: hostingCertificateIssuerEnumSchema.optional(),
|
|
61551
61578
|
storageSelections: array(object({
|
|
61552
61579
|
volumeType: hostingVolumeEnumSchema,
|
|
61553
|
-
storageClassUuid: uuid()
|
|
61580
|
+
storageClassUuid: uuid().optional(),
|
|
61581
|
+
storageClass: string().max(253).optional()
|
|
61554
61582
|
})).max(3).refine((items) => new Set(items).size === items.length, { message: "Array entries must be unique" }).optional(),
|
|
61555
61583
|
resourceProfile: _enum([
|
|
61556
61584
|
"small_sites",
|
|
@@ -61857,8 +61885,9 @@ var updateHostingEnvironmentRequestSchema = object({
|
|
|
61857
61885
|
}).describe("A change to an existing environment's budget and allocations.\n\nThe submitted lists must name exactly the workloads and volumes that already\nexist: this request replaces values, and adding or removing a workload or\nvolume is a different operation. `desiredGeneration` must match the stored\ngeneration, which the service checks under its lock.");
|
|
61858
61886
|
var updateHostingEnvironmentStorageSelectionRequestSchema = object({
|
|
61859
61887
|
volumeType: hostingVolumeEnumSchema,
|
|
61860
|
-
storageClassUuid: uuid()
|
|
61861
|
-
|
|
61888
|
+
storageClassUuid: uuid().optional(),
|
|
61889
|
+
storageClass: string().max(253).optional()
|
|
61890
|
+
}).describe("Choose the storage class one environment allocates a claim type from.\n\nThe class is named by UUID or by its Kubernetes name on the environment's cluster, exactly one of the two.\nThe chosen class must be enabled, registered on the environment's own cluster and offered for the\ntype; the writer refuses anything else with a field error. Existing volumes keep their binding.");
|
|
61862
61891
|
var updateHostingGeneratedHostnameWordRequestSchema = object({ enabled: boolean() }).describe("Switch one word in the generated-hostname vocabulary on or off.\n\nDisabling is the only write: a word already drawn into an address is never removed or renamed, because\nthe address is a client's permanent fallback route. Disabling stops a word being drawn again.");
|
|
61863
61892
|
var updateHostingObjectCacheSettingsRequestSchema = object({
|
|
61864
61893
|
desiredGeneration: int().min(1),
|
|
@@ -64396,6 +64425,16 @@ object({
|
|
|
64396
64425
|
environmentUuid: string(),
|
|
64397
64426
|
cancellationUuid: string()
|
|
64398
64427
|
});
|
|
64428
|
+
string().describe("`placement` for the cluster new environments are created on, or a cluster UUID.");
|
|
64429
|
+
union([
|
|
64430
|
+
object({ message: string().describe("Error overview.") }),
|
|
64431
|
+
object({ message: string().describe("Error overview.") }),
|
|
64432
|
+
messageDataSchema
|
|
64433
|
+
]);
|
|
64434
|
+
object({
|
|
64435
|
+
company: string(),
|
|
64436
|
+
cluster: string().describe("`placement` for the cluster new environments are created on, or a cluster UUID.")
|
|
64437
|
+
});
|
|
64399
64438
|
union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
|
|
64400
64439
|
object({ company: string() });
|
|
64401
64440
|
int().min(1);
|
|
@@ -64924,7 +64963,7 @@ union([
|
|
|
64924
64963
|
object({ message: string().describe("Error overview.") }),
|
|
64925
64964
|
messageDataSchema
|
|
64926
64965
|
]);
|
|
64927
|
-
updateHostingEnvironmentStorageSelectionRequestSchema.describe("Choose the storage class one environment allocates a claim type from.\n\nThe chosen class must be enabled, registered on the environment's own cluster and offered for the\ntype; the writer refuses anything else with a field error. Existing volumes keep their binding.");
|
|
64966
|
+
updateHostingEnvironmentStorageSelectionRequestSchema.describe("Choose the storage class one environment allocates a claim type from.\n\nThe class is named by UUID or by its Kubernetes name on the environment's cluster, exactly one of the two.\nThe chosen class must be enabled, registered on the environment's own cluster and offered for the\ntype; the writer refuses anything else with a field error. Existing volumes keep their binding.");
|
|
64928
64967
|
object({
|
|
64929
64968
|
company: string(),
|
|
64930
64969
|
environmentUuid: string()
|
|
@@ -67648,7 +67687,6 @@ union([
|
|
|
67648
67687
|
messageDataSchema
|
|
67649
67688
|
]);
|
|
67650
67689
|
object({ operation: string() });
|
|
67651
|
-
union([object({ message: string().describe("Error overview.") }), messageDataSchema]);
|
|
67652
67690
|
union([object({ message: string().describe("Error overview.") }), object({ message: string().describe("Error overview.") })]);
|
|
67653
67691
|
object({
|
|
67654
67692
|
type: string(),
|
|
@@ -74052,11 +74090,51 @@ function stated(flags, flag, usage) {
|
|
|
74052
74090
|
if (value === null) throw new UsageError(`${flag} needs a whole number of at least 1.\n\n${usage}`);
|
|
74053
74091
|
return value;
|
|
74054
74092
|
}
|
|
74093
|
+
// src/commands/environment-storage-selections.ts
|
|
74094
|
+
var STORAGE_VOLUME_TYPES = [
|
|
74095
|
+
"application-files",
|
|
74096
|
+
"database-data",
|
|
74097
|
+
"redis-data"
|
|
74098
|
+
];
|
|
74099
|
+
var UUID_PATTERN$1 = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
74100
|
+
var CLASS_NAME_PATTERN = /^[a-z0-9]([-a-z0-9.]{0,251}[a-z0-9])?$/;
|
|
74101
|
+
/** Parse the optional initial per-role class choices before the command reads a catalog or sends a write. */
|
|
74102
|
+
function storageSelectionsFor(flags, usage) {
|
|
74103
|
+
if (!flags.has("--storage-classes")) return null;
|
|
74104
|
+
const value = flags.get("--storage-classes")?.trim() ?? "";
|
|
74105
|
+
if (value === "") throw new UsageError(`--storage-classes needs at least one type=class choice.\n\n${usage}`);
|
|
74106
|
+
const seen = /* @__PURE__ */ new Set();
|
|
74107
|
+
const selections = [];
|
|
74108
|
+
for (const entry of value.split(",")) {
|
|
74109
|
+
const separator = entry.indexOf("=");
|
|
74110
|
+
const volumeType = entry.slice(0, separator).trim();
|
|
74111
|
+
const storageClass = entry.slice(separator + 1).trim();
|
|
74112
|
+
if (separator < 1 || entry.indexOf("=", separator + 1) !== -1) throw new UsageError(`Each --storage-classes choice must be <volume-type>=<class>.\n\n${usage}`);
|
|
74113
|
+
if (!STORAGE_VOLUME_TYPES.includes(volumeType)) throw new UsageError(`--storage-classes volume types are ${STORAGE_VOLUME_TYPES.join(", ")} (got ${volumeType}).\n\n${usage}`);
|
|
74114
|
+
if (seen.has(volumeType)) throw new UsageError(`--storage-classes names ${volumeType} more than once.\n\n${usage}`);
|
|
74115
|
+
seen.add(volumeType);
|
|
74116
|
+
selections.push({
|
|
74117
|
+
volumeType,
|
|
74118
|
+
...classReference(storageClass, volumeType, usage)
|
|
74119
|
+
});
|
|
74120
|
+
}
|
|
74121
|
+
return selections;
|
|
74122
|
+
}
|
|
74123
|
+
/** The class one choice names: a UUID is sent as `storageClassUuid`, anything else as its Kubernetes name. */
|
|
74124
|
+
function classReference(value, volumeType, usage) {
|
|
74125
|
+
if (UUID_PATTERN$1.test(value)) return { storageClassUuid: value };
|
|
74126
|
+
if (CLASS_NAME_PATTERN.test(value)) return { storageClass: value };
|
|
74127
|
+
throw new UsageError(`--storage-classes needs a class name or UUID for ${volumeType}.\n\n${usage}`);
|
|
74128
|
+
}
|
|
74129
|
+
/** One initial choice as the confirmation reads it back: the claim type and the class it names. */
|
|
74130
|
+
function initialSelectionText(selection) {
|
|
74131
|
+
return `${selection.volumeType}: ${selection.storageClass ?? selection.storageClassUuid ?? ""}`;
|
|
74132
|
+
}
|
|
74055
74133
|
// src/commands/environment-create.ts
|
|
74056
74134
|
var USAGE$25 = [
|
|
74057
74135
|
"Usage: hostingctl environment create --company <slug> --name <name> [--slug <slug>] [--package <key>]",
|
|
74058
74136
|
" hostingctl environment create --client <slug> --name <name> [--slug <slug>] [--package <key>]",
|
|
74059
|
-
" [--storage-classes <volume-type>=<class
|
|
74137
|
+
" [--storage-classes <volume-type>=<class>[,<volume-type>=<class>...]]",
|
|
74060
74138
|
" [--cpu-request <millicores> --cpu-limit <millicores> --memory-request <MiB> --memory-limit <MiB>",
|
|
74061
74139
|
" --storage-limit <MiB>]",
|
|
74062
74140
|
"",
|
|
@@ -74074,14 +74152,9 @@ var USAGE$25 = [
|
|
|
74074
74152
|
"",
|
|
74075
74153
|
"The package is one of the keys this environment's catalog offers; the platform chooses the placement,",
|
|
74076
74154
|
"so no cluster is sent or accepted.",
|
|
74077
|
-
"Initial storage classes are optional; each is reviewed and recorded before the environment's first reconcile."
|
|
74155
|
+
"Initial storage classes are optional; each is reviewed and recorded before the environment's first reconcile.",
|
|
74156
|
+
"A class is its Kubernetes name (see `hostingctl storage-classes`) or its UUID."
|
|
74078
74157
|
].join("\n");
|
|
74079
|
-
var STORAGE_VOLUME_TYPES = [
|
|
74080
|
-
"application-files",
|
|
74081
|
-
"database-data",
|
|
74082
|
-
"redis-data"
|
|
74083
|
-
];
|
|
74084
|
-
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
74085
74158
|
/**
|
|
74086
74159
|
* The flags this command reads, declared once and published by the group's metadata.
|
|
74087
74160
|
*
|
|
@@ -74107,7 +74180,7 @@ var CREATE_FLAG_SPECS = [
|
|
|
74107
74180
|
{
|
|
74108
74181
|
name: "--storage-classes",
|
|
74109
74182
|
takesValue: true,
|
|
74110
|
-
description: "Initial per-claim-type class choices, each written as `<volume-type>=<class
|
|
74183
|
+
description: "Initial per-claim-type class choices, each written as `<volume-type>=<class>` (the class's Kubernetes name or UUID) and separated by commas."
|
|
74111
74184
|
},
|
|
74112
74185
|
{
|
|
74113
74186
|
name: "--client",
|
|
@@ -74138,29 +74211,6 @@ async function create$2(context, rest) {
|
|
|
74138
74211
|
};
|
|
74139
74212
|
return await confirmableWrite(context, describeCreate$1(name, slug, chosen.key, scope, slice, storageSelections), async () => await sendCreate(scope, body));
|
|
74140
74213
|
}
|
|
74141
|
-
/** Parse the optional initial per-role class choices before the command reads a catalog or sends a write. */
|
|
74142
|
-
function storageSelectionsFor(flags, usage) {
|
|
74143
|
-
if (!flags.has("--storage-classes")) return null;
|
|
74144
|
-
const value = flags.get("--storage-classes")?.trim() ?? "";
|
|
74145
|
-
if (value === "") throw new UsageError(`--storage-classes needs at least one type=uuid choice.\n\n${usage}`);
|
|
74146
|
-
const seen = /* @__PURE__ */ new Set();
|
|
74147
|
-
const selections = [];
|
|
74148
|
-
for (const entry of value.split(",")) {
|
|
74149
|
-
const separator = entry.indexOf("=");
|
|
74150
|
-
const volumeType = entry.slice(0, separator).trim();
|
|
74151
|
-
const storageClassUuid = entry.slice(separator + 1).trim();
|
|
74152
|
-
if (separator < 1 || entry.indexOf("=", separator + 1) !== -1) throw new UsageError(`Each --storage-classes choice must be <volume-type>=<class-uuid>.\n\n${usage}`);
|
|
74153
|
-
if (!STORAGE_VOLUME_TYPES.includes(volumeType)) throw new UsageError(`--storage-classes volume types are ${STORAGE_VOLUME_TYPES.join(", ")} (got ${volumeType}).\n\n${usage}`);
|
|
74154
|
-
if (seen.has(volumeType)) throw new UsageError(`--storage-classes names ${volumeType} more than once.\n\n${usage}`);
|
|
74155
|
-
if (!UUID_PATTERN.test(storageClassUuid)) throw new UsageError(`--storage-classes needs a UUID for ${volumeType}.\n\n${usage}`);
|
|
74156
|
-
seen.add(volumeType);
|
|
74157
|
-
selections.push({
|
|
74158
|
-
volumeType,
|
|
74159
|
-
storageClassUuid
|
|
74160
|
-
});
|
|
74161
|
-
}
|
|
74162
|
-
return selections;
|
|
74163
|
-
}
|
|
74164
74214
|
/** Which company or client the create is for, from exactly one of `--company` and `--client`. */
|
|
74165
74215
|
async function scopeFor(flags) {
|
|
74166
74216
|
const client = flags.get("--client")?.trim() ?? "";
|
|
@@ -74209,7 +74259,7 @@ function describeCreate$1(name, slug, packageKey, scope, slice, storageSelection
|
|
|
74209
74259
|
return [
|
|
74210
74260
|
`Create environment "${name}" (${slug}) ${scope.mode === "client" ? `for client ${scope.client} through the platform route (this account holds no membership in it)` : `in company ${scope.company} through the company's own route`}, with the ${packageKey} package.`,
|
|
74211
74261
|
...slice === null ? [] : [describeSlice(slice)],
|
|
74212
|
-
...storageSelections === null ? [] : [" Initial storage classes (recorded before the first reconcile):", ...storageSelections.map((one) => ` ${one
|
|
74262
|
+
...storageSelections === null ? [] : [" Initial storage classes (recorded before the first reconcile):", ...storageSelections.map((one) => ` ${initialSelectionText(one)}`)],
|
|
74213
74263
|
" The platform chooses the placement from its own configuration: no cluster is sent or accepted, and",
|
|
74214
74264
|
" the package supplies the purchase and the composition, not the cluster or the namespace."
|
|
74215
74265
|
].join("\n");
|
|
@@ -75112,7 +75162,7 @@ var ENVIRONMENT_SUBCOMMANDS = [
|
|
|
75112
75162
|
var ENVIRONMENT_USAGE = [
|
|
75113
75163
|
"Usage: hostingctl environment create --company <slug> --name <name> [--slug <slug>] [--package <key>]",
|
|
75114
75164
|
" hostingctl environment create --client <slug> --name <name> [--slug <slug>] [--package <key>]",
|
|
75115
|
-
" [--storage-classes <volume-type>=<class
|
|
75165
|
+
" [--storage-classes <volume-type>=<class>[,<volume-type>=<class>...]]",
|
|
75116
75166
|
" [--cpu-request <millicores> --cpu-limit <millicores> --memory-request <MiB> --memory-limit <MiB>",
|
|
75117
75167
|
" --storage-limit <MiB>]",
|
|
75118
75168
|
" hostingctl environment show|profile <uuid> --company <slug>",
|
|
@@ -76058,7 +76108,7 @@ var ENVIRONMENT_METADATA = {
|
|
|
76058
76108
|
{
|
|
76059
76109
|
name: "--class",
|
|
76060
76110
|
takesValue: true,
|
|
76061
|
-
description: "The storage class `environment storage set` chooses."
|
|
76111
|
+
description: "The storage class `environment storage set` chooses, by Kubernetes name or UUID."
|
|
76062
76112
|
},
|
|
76063
76113
|
{
|
|
76064
76114
|
name: "--template",
|
|
@@ -76547,7 +76597,7 @@ var SETUP_USAGE = [
|
|
|
76547
76597
|
"Usage: hostingctl environment setup --company <slug> --file <hosting.yaml> --confirm",
|
|
76548
76598
|
" [--environment <uuid> | --name <name> [--slug <slug>] [--package <key>]",
|
|
76549
76599
|
" [--cpu-request <millicores> --cpu-limit <millicores> --memory-request <MiB> --memory-limit <MiB>",
|
|
76550
|
-
" --storage-limit <MiB>] [--storage-classes <volume-type>=<class
|
|
76600
|
+
" --storage-limit <MiB>] [--storage-classes <volume-type>=<class>[,...]]]",
|
|
76551
76601
|
" [--source-dir <repository-root> | --source-archive <project.zip>] [--switch-mode]",
|
|
76552
76602
|
" [--timeout <seconds>] [--dry-run]",
|
|
76553
76603
|
"",
|
|
@@ -76684,6 +76734,7 @@ function objectCacheText(settings) {
|
|
|
76684
76734
|
].join("\n");
|
|
76685
76735
|
}
|
|
76686
76736
|
// src/commands/environment-storage-choice.ts
|
|
76737
|
+
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
76687
76738
|
/** The claim types the platform allocates, as the API spells them. */
|
|
76688
76739
|
var VOLUME_TYPES$1 = [
|
|
76689
76740
|
"application-files",
|
|
@@ -76698,7 +76749,7 @@ function volumeType(value) {
|
|
|
76698
76749
|
var ENVIRONMENT_STORAGE_USAGE = [
|
|
76699
76750
|
"Usage: hostingctl environment storage get <environment-uuid> --company <slug>",
|
|
76700
76751
|
" hostingctl environment storage set <environment-uuid> --company <slug>",
|
|
76701
|
-
" --volume-type <type> --class <uuid>",
|
|
76752
|
+
" --volume-type <type> --class <kubernetes-name|uuid>",
|
|
76702
76753
|
" hostingctl environment storage clear <environment-uuid> --volume-type <type> --company <slug>",
|
|
76703
76754
|
"",
|
|
76704
76755
|
" get Each claim type, the class a new claim would take, and the classes this environment may choose.",
|
|
@@ -76727,14 +76778,14 @@ async function environmentStorage(context, rest) {
|
|
|
76727
76778
|
};
|
|
76728
76779
|
if (action === "set") {
|
|
76729
76780
|
const type = volumeType(required$3(context, "--volume-type"));
|
|
76730
|
-
const
|
|
76781
|
+
const storageClass = required$3(context, "--class");
|
|
76731
76782
|
return {
|
|
76732
76783
|
kind: "storage-write",
|
|
76733
|
-
outcome: await confirm$2(context, `Allocate future ${type} claims in environment ${uuid} from class ${
|
|
76784
|
+
outcome: await confirm$2(context, `Allocate future ${type} claims in environment ${uuid} from class ${storageClass}`, async () => (await hostingEnvironmentStorageUpdate({
|
|
76734
76785
|
path,
|
|
76735
76786
|
body: {
|
|
76736
76787
|
volumeType: type,
|
|
76737
|
-
storageClassUuid
|
|
76788
|
+
...UUID_PATTERN.test(storageClass) ? { storageClassUuid: storageClass } : { storageClass }
|
|
76738
76789
|
}
|
|
76739
76790
|
})).data)
|
|
76740
76791
|
};
|
|
@@ -77219,7 +77270,7 @@ function setupPlan(name, existing, file, sourceDir, sourceArchive, slice, storag
|
|
|
77219
77270
|
...slice === null ? [] : [describeSlice(slice)],
|
|
77220
77271
|
...storageSelections === null ? [] : [
|
|
77221
77272
|
" Initial storage classes (used only if a new environment is created):",
|
|
77222
|
-
...storageSelections.map((one) => ` ${one
|
|
77273
|
+
...storageSelections.map((one) => ` ${initialSelectionText(one)}`),
|
|
77223
77274
|
" If this slug already exists, setup refuses before applying the document."
|
|
77224
77275
|
],
|
|
77225
77276
|
" apply the document and wait for the platform to accept it",
|
|
@@ -85265,7 +85316,7 @@ function classLine(one) {
|
|
|
85265
85316
|
const types = one.volumeTypes.join(", ");
|
|
85266
85317
|
return `${one.name} [${one.kubernetesName}] on ${one.clusterName}, ${one.backendName}, ${types}${one.enabled ? "" : " disabled"}${one.restricted ? " trial" : ""}`;
|
|
85267
85318
|
}
|
|
85268
|
-
function classText(one) {
|
|
85319
|
+
function classText$1(one) {
|
|
85269
85320
|
return [
|
|
85270
85321
|
`Kubernetes name: ${one.kubernetesName}`,
|
|
85271
85322
|
`Name: ${one.name}`,
|
|
@@ -85582,12 +85633,54 @@ var storageClass = {
|
|
|
85582
85633
|
},
|
|
85583
85634
|
human(report) {
|
|
85584
85635
|
if (report.kind === "catalogue") return catalogueText(report.catalogue);
|
|
85585
|
-
if (report.kind === "class") return classText(report.storageClass);
|
|
85636
|
+
if (report.kind === "class") return classText$1(report.storageClass);
|
|
85586
85637
|
if (report.kind === "default") return defaultText(report.default);
|
|
85587
85638
|
if (report.kind === "observation") return observationText(report.observation);
|
|
85588
|
-
return renderWriteOutcome(report.outcome, (result) => "kubernetesName" in result ? classText(result) : defaultText(result));
|
|
85639
|
+
return renderWriteOutcome(report.outcome, (result) => "kubernetesName" in result ? classText$1(result) : defaultText(result));
|
|
85589
85640
|
}
|
|
85590
85641
|
};
|
|
85642
|
+
// src/commands/storage-classes.ts
|
|
85643
|
+
var STORAGE_CLASSES_USAGE = [
|
|
85644
|
+
"Usage: hostingctl storage-classes --company <slug> [--cluster <uuid|placement>]",
|
|
85645
|
+
"",
|
|
85646
|
+
"The storage classes this company may choose on a cluster, per claim type, before an environment exists:",
|
|
85647
|
+
"each class's Kubernetes name, whether a claim is shared across nodes and whether it is encrypted at rest.",
|
|
85648
|
+
"Without --cluster it reads the cluster new environments are created on.",
|
|
85649
|
+
"",
|
|
85650
|
+
"Name a class by its Kubernetes name when creating an environment (see `hostingctl environment create --help`)."
|
|
85651
|
+
].join("\n");
|
|
85652
|
+
/** `storage-classes`: what a company may choose on a cluster, so a create can name a class by its Kubernetes name. */
|
|
85653
|
+
var storageClasses = {
|
|
85654
|
+
name: "storage-classes",
|
|
85655
|
+
summary: "The storage classes this company may choose on a cluster, per claim type.",
|
|
85656
|
+
usage: STORAGE_CLASSES_USAGE,
|
|
85657
|
+
flags: [{
|
|
85658
|
+
name: "--cluster",
|
|
85659
|
+
takesValue: true,
|
|
85660
|
+
description: "The cluster, by UUID, or `placement` (the default) for where new environments are created."
|
|
85661
|
+
}],
|
|
85662
|
+
subcommands: [],
|
|
85663
|
+
async run(context) {
|
|
85664
|
+
if (context.positional.length > 0) throw new UsageError(STORAGE_CLASSES_USAGE);
|
|
85665
|
+
const cluster = context.flags.get("--cluster")?.trim() || "placement";
|
|
85666
|
+
return (await hostingClusterStorageClassesIndex({ path: {
|
|
85667
|
+
company: await requireCompany(context.flags),
|
|
85668
|
+
cluster
|
|
85669
|
+
} })).data;
|
|
85670
|
+
},
|
|
85671
|
+
human(report) {
|
|
85672
|
+
return [`${report.cluster.name} (${report.cluster.uuid})${report.placement ? ", where new environments are created" : ""}`, ...report.volumeTypes.flatMap((type) => [` ${type.volumeType}`, ...type.classes.length === 0 ? [" no class is offered"] : type.classes.map((one) => ` ${classText(one)}`)])].join("\n");
|
|
85673
|
+
}
|
|
85674
|
+
};
|
|
85675
|
+
function classText(one) {
|
|
85676
|
+
const encryption = one.encryptedAtRest === null ? "encryption not observable" : one.encryptedAtRest ? "encrypted" : "not encrypted";
|
|
85677
|
+
return [
|
|
85678
|
+
one.kubernetesName,
|
|
85679
|
+
one.name,
|
|
85680
|
+
one.sharedAcrossNodes ? "shared across nodes" : "one node",
|
|
85681
|
+
encryption
|
|
85682
|
+
].join(" ");
|
|
85683
|
+
}
|
|
85591
85684
|
// src/commands/system-metadata.ts
|
|
85592
85685
|
/**
|
|
85593
85686
|
* `system` — what this system sees left on the cluster it manages.
|
|
@@ -86316,7 +86409,7 @@ function writeUpdateState(state, env = process.env) {
|
|
|
86316
86409
|
} catch {}
|
|
86317
86410
|
}
|
|
86318
86411
|
// src/version.ts
|
|
86319
|
-
var VERSION = "1.0.
|
|
86412
|
+
var VERSION = "1.0.813";
|
|
86320
86413
|
// src/commands/update.ts
|
|
86321
86414
|
/**
|
|
86322
86415
|
* `update` — bring this copy of the CLI up to the published version.
|
|
@@ -86390,7 +86483,7 @@ var update = {
|
|
|
86390
86483
|
}, process.env);
|
|
86391
86484
|
return {
|
|
86392
86485
|
...known,
|
|
86393
|
-
current: after ?? "1.0.
|
|
86486
|
+
current: after ?? "1.0.813",
|
|
86394
86487
|
latest: after ?? latest,
|
|
86395
86488
|
upToDate: after !== null && (latest === null || !isNewerVersion(latest, after)),
|
|
86396
86489
|
action: "run",
|
|
@@ -86557,6 +86650,7 @@ var COMMANDS = [
|
|
|
86557
86650
|
register(backupDestination),
|
|
86558
86651
|
register(storage),
|
|
86559
86652
|
register(storageClass),
|
|
86653
|
+
register(storageClasses),
|
|
86560
86654
|
register(logs),
|
|
86561
86655
|
register(pricing),
|
|
86562
86656
|
register(purchases),
|
|
@@ -86671,7 +86765,7 @@ async function printUpdateNotice(options) {
|
|
|
86671
86765
|
}, env, { waitMs: NOTICE_LOCK_WAIT_MS });
|
|
86672
86766
|
} catch {}
|
|
86673
86767
|
if (latest === null) return;
|
|
86674
|
-
if (!isNewerVersion(latest, "1.0.
|
|
86768
|
+
if (!isNewerVersion(latest, "1.0.813")) return;
|
|
86675
86769
|
process.stderr.write(`A newer hostingctl is published: ${latest} (this copy is ${VERSION}). Run \`hostingctl update\` to update.\n`);
|
|
86676
86770
|
}
|
|
86677
86771
|
/** Whether an environment variable is set to something, which is how CI and the opt-out are read. */
|