@reyemtech/pulumi-rackspace-spot 0.2.0 → 0.2.2

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.
Files changed (46) hide show
  1. package/cmd/package.json +17 -0
  2. package/cmd/provider/auth.d.ts +15 -0
  3. package/cmd/provider/auth.js +77 -0
  4. package/cmd/provider/auth.js.map +1 -0
  5. package/cmd/provider/client.d.ts +17 -0
  6. package/cmd/provider/client.js +75 -0
  7. package/cmd/provider/client.js.map +1 -0
  8. package/cmd/provider/functions/getCloudspace.d.ts +14 -0
  9. package/cmd/provider/functions/getCloudspace.js +18 -0
  10. package/cmd/provider/functions/getCloudspace.js.map +1 -0
  11. package/cmd/provider/functions/getKubeconfig.d.ts +10 -0
  12. package/cmd/provider/functions/getKubeconfig.js +26 -0
  13. package/cmd/provider/functions/getKubeconfig.js.map +1 -0
  14. package/cmd/provider/functions/getRegions.d.ts +10 -0
  15. package/cmd/provider/functions/getRegions.js +16 -0
  16. package/cmd/provider/functions/getRegions.js.map +1 -0
  17. package/cmd/provider/functions/getServerClasses.d.ts +17 -0
  18. package/cmd/provider/functions/getServerClasses.js +24 -0
  19. package/cmd/provider/functions/getServerClasses.js.map +1 -0
  20. package/cmd/provider/index.d.ts +1 -0
  21. package/cmd/provider/index.js +53 -0
  22. package/cmd/provider/index.js.map +1 -0
  23. package/cmd/provider/provider.d.ts +20 -0
  24. package/cmd/provider/provider.js +257 -0
  25. package/cmd/provider/provider.js.map +1 -0
  26. package/cmd/provider/resources/cloudspace.d.ts +33 -0
  27. package/cmd/provider/resources/cloudspace.js +114 -0
  28. package/cmd/provider/resources/cloudspace.js.map +1 -0
  29. package/cmd/provider/resources/ondemandnodepool.d.ts +35 -0
  30. package/cmd/provider/resources/ondemandnodepool.js +100 -0
  31. package/cmd/provider/resources/ondemandnodepool.js.map +1 -0
  32. package/cmd/provider/resources/spotnodepool.d.ts +40 -0
  33. package/cmd/provider/resources/spotnodepool.js +141 -0
  34. package/cmd/provider/resources/spotnodepool.js.map +1 -0
  35. package/cmd/schema.json +492 -0
  36. package/package.json +7 -2
  37. package/cloudspace.ts +0 -29
  38. package/getCloudspace.ts +0 -23
  39. package/getKubeconfig.ts +0 -19
  40. package/getRegions.ts +0 -19
  41. package/getServerClasses.ts +0 -28
  42. package/index.ts +0 -10
  43. package/ondemandnodepool.ts +0 -33
  44. package/provider.ts +0 -11
  45. package/spotnodepool.ts +0 -37
  46. package/tsconfig.json +0 -15
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SpotNodePoolHandler = void 0;
4
+ const crypto_1 = require("crypto");
5
+ const RESOURCE = "spotnodepools";
6
+ function buildSpec(inputs) {
7
+ const spec = {
8
+ cloudSpace: inputs.cloudspaceName,
9
+ serverClass: inputs.serverClass,
10
+ bidPrice: inputs.bidPrice.toFixed(3),
11
+ customLabels: inputs.labels ?? {},
12
+ customAnnotations: inputs.annotations ?? {},
13
+ customTaints: inputs.taints ?? [],
14
+ };
15
+ // Rackspace API always requires spec.desired, even with autoscaling
16
+ if (inputs.autoscaling) {
17
+ spec.desired = inputs.desiredCount ?? inputs.autoscaling.minNodes;
18
+ spec.autoscaling = {
19
+ enabled: true,
20
+ minNodes: inputs.autoscaling.minNodes,
21
+ maxNodes: inputs.autoscaling.maxNodes,
22
+ };
23
+ }
24
+ else {
25
+ spec.desired = inputs.desiredCount ?? 1;
26
+ }
27
+ return spec;
28
+ }
29
+ function apiToOutputs(resource) {
30
+ const { metadata, spec, status } = resource;
31
+ const props = {
32
+ cloudspaceName: spec.cloudSpace,
33
+ serverClass: spec.serverClass,
34
+ bidPrice: parseFloat(spec.bidPrice),
35
+ labels: spec.customLabels ?? {},
36
+ annotations: spec.customAnnotations ?? {},
37
+ taints: spec.customTaints ?? [],
38
+ nodepoolId: metadata.name ?? "",
39
+ wonCount: status?.wonCount ?? 0,
40
+ bidStatus: status?.bidStatus ?? "",
41
+ };
42
+ if (spec.autoscaling?.enabled) {
43
+ props.autoscaling = {
44
+ minNodes: spec.autoscaling.minNodes,
45
+ maxNodes: spec.autoscaling.maxNodes,
46
+ };
47
+ }
48
+ else if (spec.desired !== undefined) {
49
+ props.desiredCount = spec.desired;
50
+ }
51
+ return props;
52
+ }
53
+ function deepEqual(a, b) {
54
+ return JSON.stringify(a) === JSON.stringify(b);
55
+ }
56
+ class SpotNodePoolHandler {
57
+ client;
58
+ namespace;
59
+ constructor(client, namespace) {
60
+ this.client = client;
61
+ this.namespace = namespace;
62
+ }
63
+ async create(inputs) {
64
+ const body = {
65
+ apiVersion: "ngpc.rxt.io/v1",
66
+ kind: "SpotNodePool",
67
+ metadata: {
68
+ name: (0, crypto_1.randomUUID)(),
69
+ namespace: this.namespace,
70
+ },
71
+ spec: buildSpec(inputs),
72
+ };
73
+ const resource = await this.client.create(RESOURCE, body);
74
+ const id = resource.metadata.name;
75
+ return { id, outs: JSON.parse(JSON.stringify(apiToOutputs(resource))) };
76
+ }
77
+ async read(id) {
78
+ const resource = await this.client.get(RESOURCE, id);
79
+ const props = apiToOutputs(resource);
80
+ return { id, props };
81
+ }
82
+ diff(olds, news) {
83
+ const replaces = [];
84
+ // Immutable fields
85
+ if (olds.cloudspaceName !== news.cloudspaceName)
86
+ replaces.push("cloudspaceName");
87
+ if (olds.serverClass !== news.serverClass)
88
+ replaces.push("serverClass");
89
+ // Mutable fields — detect any change
90
+ const mutableChanged = olds.bidPrice !== news.bidPrice ||
91
+ olds.desiredCount !== news.desiredCount ||
92
+ !deepEqual(olds.autoscaling, news.autoscaling) ||
93
+ !deepEqual(olds.labels, news.labels) ||
94
+ !deepEqual(olds.annotations, news.annotations) ||
95
+ !deepEqual(olds.taints, news.taints);
96
+ const changes = replaces.length > 0 || mutableChanged;
97
+ return {
98
+ changes,
99
+ replaces,
100
+ deleteBeforeReplace: replaces.length > 0,
101
+ };
102
+ }
103
+ async update(id, olds, news) {
104
+ // Fetch latest to get the current resourceVersion
105
+ const latest = await this.client.get(RESOURCE, id);
106
+ const updatedSpec = {
107
+ ...latest.spec,
108
+ bidPrice: news.bidPrice.toFixed(3),
109
+ customLabels: news.labels ?? {},
110
+ customAnnotations: news.annotations ?? {},
111
+ customTaints: news.taints ?? [],
112
+ };
113
+ // Rackspace API always requires spec.desired, even with autoscaling
114
+ if (news.autoscaling) {
115
+ updatedSpec.desired = news.desiredCount ?? news.autoscaling.minNodes;
116
+ updatedSpec.autoscaling = {
117
+ enabled: true,
118
+ minNodes: news.autoscaling.minNodes,
119
+ maxNodes: news.autoscaling.maxNodes,
120
+ };
121
+ }
122
+ else {
123
+ delete updatedSpec.autoscaling;
124
+ if (news.desiredCount !== undefined) {
125
+ updatedSpec.desired = news.desiredCount;
126
+ }
127
+ }
128
+ const body = {
129
+ ...latest,
130
+ spec: updatedSpec,
131
+ };
132
+ const updated = await this.client.update(RESOURCE, id, body);
133
+ const outs = apiToOutputs(updated);
134
+ return { outs };
135
+ }
136
+ async delete(id) {
137
+ await this.client.remove(RESOURCE, id);
138
+ }
139
+ }
140
+ exports.SpotNodePoolHandler = SpotNodePoolHandler;
141
+ //# sourceMappingURL=spotnodepool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spotnodepool.js","sourceRoot":"","sources":["../../resources/spotnodepool.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAGpC,MAAM,QAAQ,GAAG,eAAe,CAAC;AAajC,SAAS,SAAS,CAAC,MAA0B;IAC3C,MAAM,IAAI,GAAwB;QAChC,UAAU,EAAE,MAAM,CAAC,cAAc;QACjC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACpC,YAAY,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;QACjC,iBAAiB,EAAE,MAAM,CAAC,WAAW,IAAI,EAAE;QAC3C,YAAY,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;KAClC,CAAC;IA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": "Pulumi provider for Rackspace Spot cloud infrastructure.",
4
+ "version": "0.0.1",
5
+ "language": {},
6
+ "config": {
7
+ "variables": {
8
+ "token": {
9
+ "type": "string",
10
+ "description": "Rackspace Spot refresh token for authentication.",
11
+ "secret": true
12
+ }
13
+ }
14
+ },
15
+ "types": {
16
+ "rackspace-spot:index:Autoscaling": {
17
+ "description": "Autoscaling configuration for a node pool.",
18
+ "type": "object",
19
+ "properties": {
20
+ "minNodes": {
21
+ "type": "integer",
22
+ "description": "Minimum number of nodes."
23
+ },
24
+ "maxNodes": {
25
+ "type": "integer",
26
+ "description": "Maximum number of nodes."
27
+ }
28
+ },
29
+ "required": ["minNodes", "maxNodes"]
30
+ },
31
+ "rackspace-spot:index:Taint": {
32
+ "description": "A Kubernetes taint applied to nodes in the pool.",
33
+ "type": "object",
34
+ "properties": {
35
+ "key": {
36
+ "type": "string",
37
+ "description": "Taint key."
38
+ },
39
+ "value": {
40
+ "type": "string",
41
+ "description": "Taint value."
42
+ },
43
+ "effect": {
44
+ "type": "string",
45
+ "description": "Taint effect (e.g. NoSchedule, PreferNoSchedule, NoExecute)."
46
+ }
47
+ },
48
+ "required": ["key", "effect"]
49
+ }
50
+ },
51
+ "resources": {
52
+ "rackspace-spot:index:CloudSpace": {
53
+ "description": "A Rackspace Spot cloudspace (managed Kubernetes cluster).",
54
+ "inputProperties": {
55
+ "cloudspaceName": {
56
+ "type": "string",
57
+ "description": "Name of the cloudspace."
58
+ },
59
+ "region": {
60
+ "type": "string",
61
+ "description": "Region where the cloudspace is deployed."
62
+ },
63
+ "kubernetesVersion": {
64
+ "type": "string",
65
+ "description": "Kubernetes version for the cloudspace."
66
+ },
67
+ "cni": {
68
+ "type": "string",
69
+ "description": "Container Network Interface plugin."
70
+ },
71
+ "haControlPlane": {
72
+ "type": "boolean",
73
+ "description": "Whether to enable a highly available control plane."
74
+ },
75
+ "preemptionWebhookUrl": {
76
+ "type": "string",
77
+ "description": "URL for the preemption webhook."
78
+ }
79
+ },
80
+ "requiredInputs": ["cloudspaceName", "region"],
81
+ "properties": {
82
+ "cloudspaceName": {
83
+ "type": "string",
84
+ "description": "Name of the cloudspace."
85
+ },
86
+ "region": {
87
+ "type": "string",
88
+ "description": "Region where the cloudspace is deployed."
89
+ },
90
+ "kubernetesVersion": {
91
+ "type": "string",
92
+ "description": "Kubernetes version for the cloudspace."
93
+ },
94
+ "cni": {
95
+ "type": "string",
96
+ "description": "Container Network Interface plugin."
97
+ },
98
+ "haControlPlane": {
99
+ "type": "boolean",
100
+ "description": "Whether to enable a highly available control plane."
101
+ },
102
+ "preemptionWebhookUrl": {
103
+ "type": "string",
104
+ "description": "URL for the preemption webhook."
105
+ },
106
+ "apiServerEndpoint": {
107
+ "type": "string",
108
+ "description": "API server endpoint for the cloudspace."
109
+ },
110
+ "phase": {
111
+ "type": "string",
112
+ "description": "Current lifecycle phase of the cloudspace."
113
+ }
114
+ },
115
+ "required": ["cloudspaceName", "region", "apiServerEndpoint", "phase"]
116
+ },
117
+ "rackspace-spot:index:SpotNodePool": {
118
+ "description": "A spot-priced node pool attached to a cloudspace.",
119
+ "inputProperties": {
120
+ "cloudspaceName": {
121
+ "type": "string",
122
+ "description": "Name of the cloudspace this node pool belongs to."
123
+ },
124
+ "serverClass": {
125
+ "type": "string",
126
+ "description": "Server class for the node pool."
127
+ },
128
+ "bidPrice": {
129
+ "type": "number",
130
+ "description": "Bid price for spot nodes."
131
+ },
132
+ "desiredCount": {
133
+ "type": "integer",
134
+ "description": "Desired number of nodes."
135
+ },
136
+ "autoscaling": {
137
+ "$ref": "#/types/rackspace-spot:index:Autoscaling",
138
+ "description": "Autoscaling configuration."
139
+ },
140
+ "labels": {
141
+ "type": "object",
142
+ "additionalProperties": {
143
+ "type": "string"
144
+ },
145
+ "description": "Kubernetes labels to apply to nodes."
146
+ },
147
+ "annotations": {
148
+ "type": "object",
149
+ "additionalProperties": {
150
+ "type": "string"
151
+ },
152
+ "description": "Kubernetes annotations to apply to nodes."
153
+ },
154
+ "taints": {
155
+ "type": "array",
156
+ "items": {
157
+ "$ref": "#/types/rackspace-spot:index:Taint"
158
+ },
159
+ "description": "Kubernetes taints to apply to nodes."
160
+ }
161
+ },
162
+ "requiredInputs": ["cloudspaceName", "serverClass", "bidPrice"],
163
+ "properties": {
164
+ "cloudspaceName": {
165
+ "type": "string",
166
+ "description": "Name of the cloudspace this node pool belongs to."
167
+ },
168
+ "serverClass": {
169
+ "type": "string",
170
+ "description": "Server class for the node pool."
171
+ },
172
+ "bidPrice": {
173
+ "type": "number",
174
+ "description": "Bid price for spot nodes."
175
+ },
176
+ "desiredCount": {
177
+ "type": "integer",
178
+ "description": "Desired number of nodes."
179
+ },
180
+ "autoscaling": {
181
+ "$ref": "#/types/rackspace-spot:index:Autoscaling",
182
+ "description": "Autoscaling configuration."
183
+ },
184
+ "labels": {
185
+ "type": "object",
186
+ "additionalProperties": {
187
+ "type": "string"
188
+ },
189
+ "description": "Kubernetes labels to apply to nodes."
190
+ },
191
+ "annotations": {
192
+ "type": "object",
193
+ "additionalProperties": {
194
+ "type": "string"
195
+ },
196
+ "description": "Kubernetes annotations to apply to nodes."
197
+ },
198
+ "taints": {
199
+ "type": "array",
200
+ "items": {
201
+ "$ref": "#/types/rackspace-spot:index:Taint"
202
+ },
203
+ "description": "Kubernetes taints to apply to nodes."
204
+ },
205
+ "nodepoolId": {
206
+ "type": "string",
207
+ "description": "Unique identifier for the node pool."
208
+ },
209
+ "wonCount": {
210
+ "type": "integer",
211
+ "description": "Number of spot nodes currently won."
212
+ },
213
+ "bidStatus": {
214
+ "type": "string",
215
+ "description": "Current bid status."
216
+ }
217
+ },
218
+ "required": ["cloudspaceName", "serverClass", "bidPrice", "nodepoolId", "wonCount", "bidStatus"]
219
+ },
220
+ "rackspace-spot:index:OnDemandNodePool": {
221
+ "description": "An on-demand node pool attached to a cloudspace.",
222
+ "inputProperties": {
223
+ "cloudspaceName": {
224
+ "type": "string",
225
+ "description": "Name of the cloudspace this node pool belongs to."
226
+ },
227
+ "serverClass": {
228
+ "type": "string",
229
+ "description": "Server class for the node pool."
230
+ },
231
+ "desiredCount": {
232
+ "type": "integer",
233
+ "description": "Desired number of nodes."
234
+ },
235
+ "labels": {
236
+ "type": "object",
237
+ "additionalProperties": {
238
+ "type": "string"
239
+ },
240
+ "description": "Kubernetes labels to apply to nodes."
241
+ },
242
+ "annotations": {
243
+ "type": "object",
244
+ "additionalProperties": {
245
+ "type": "string"
246
+ },
247
+ "description": "Kubernetes annotations to apply to nodes."
248
+ },
249
+ "taints": {
250
+ "type": "array",
251
+ "items": {
252
+ "$ref": "#/types/rackspace-spot:index:Taint"
253
+ },
254
+ "description": "Kubernetes taints to apply to nodes."
255
+ }
256
+ },
257
+ "requiredInputs": ["cloudspaceName", "serverClass", "desiredCount"],
258
+ "properties": {
259
+ "cloudspaceName": {
260
+ "type": "string",
261
+ "description": "Name of the cloudspace this node pool belongs to."
262
+ },
263
+ "serverClass": {
264
+ "type": "string",
265
+ "description": "Server class for the node pool."
266
+ },
267
+ "desiredCount": {
268
+ "type": "integer",
269
+ "description": "Desired number of nodes."
270
+ },
271
+ "labels": {
272
+ "type": "object",
273
+ "additionalProperties": {
274
+ "type": "string"
275
+ },
276
+ "description": "Kubernetes labels to apply to nodes."
277
+ },
278
+ "annotations": {
279
+ "type": "object",
280
+ "additionalProperties": {
281
+ "type": "string"
282
+ },
283
+ "description": "Kubernetes annotations to apply to nodes."
284
+ },
285
+ "taints": {
286
+ "type": "array",
287
+ "items": {
288
+ "$ref": "#/types/rackspace-spot:index:Taint"
289
+ },
290
+ "description": "Kubernetes taints to apply to nodes."
291
+ },
292
+ "nodepoolId": {
293
+ "type": "string",
294
+ "description": "Unique identifier for the node pool."
295
+ },
296
+ "reservedCount": {
297
+ "type": "integer",
298
+ "description": "Number of on-demand nodes currently reserved."
299
+ },
300
+ "reservedStatus": {
301
+ "type": "string",
302
+ "description": "Current reservation status."
303
+ }
304
+ },
305
+ "required": ["cloudspaceName", "serverClass", "desiredCount", "nodepoolId", "reservedCount", "reservedStatus"]
306
+ }
307
+ },
308
+ "functions": {
309
+ "rackspace-spot:index:getCloudspace": {
310
+ "description": "Look up an existing cloudspace by name.",
311
+ "inputs": {
312
+ "description": "Inputs for getCloudspace.",
313
+ "properties": {
314
+ "name": {
315
+ "type": "string",
316
+ "description": "Name of the cloudspace to look up."
317
+ }
318
+ },
319
+ "required": ["name"],
320
+ "type": "object"
321
+ },
322
+ "outputs": {
323
+ "description": "Outputs from getCloudspace.",
324
+ "properties": {
325
+ "name": {
326
+ "type": "string",
327
+ "description": "Name of the cloudspace."
328
+ },
329
+ "region": {
330
+ "type": "string",
331
+ "description": "Region where the cloudspace is deployed."
332
+ },
333
+ "kubernetesVersion": {
334
+ "type": "string",
335
+ "description": "Kubernetes version."
336
+ },
337
+ "cni": {
338
+ "type": "string",
339
+ "description": "Container Network Interface plugin."
340
+ },
341
+ "haControlPlane": {
342
+ "type": "boolean",
343
+ "description": "Whether the control plane is highly available."
344
+ },
345
+ "apiServerEndpoint": {
346
+ "type": "string",
347
+ "description": "API server endpoint."
348
+ },
349
+ "phase": {
350
+ "type": "string",
351
+ "description": "Current lifecycle phase."
352
+ }
353
+ },
354
+ "required": ["name", "region", "kubernetesVersion", "cni", "haControlPlane", "apiServerEndpoint", "phase"],
355
+ "type": "object"
356
+ }
357
+ },
358
+ "rackspace-spot:index:getKubeconfig": {
359
+ "description": "Assemble a kubeconfig from an existing cloudspace.",
360
+ "inputs": {
361
+ "description": "Inputs for getKubeconfig.",
362
+ "properties": {
363
+ "cloudspaceName": {
364
+ "type": "string",
365
+ "description": "Name of the cloudspace to generate a kubeconfig for."
366
+ }
367
+ },
368
+ "required": ["cloudspaceName"],
369
+ "type": "object"
370
+ },
371
+ "outputs": {
372
+ "description": "Outputs from getKubeconfig.",
373
+ "properties": {
374
+ "raw": {
375
+ "type": "string",
376
+ "description": "Raw kubeconfig YAML/JSON string.",
377
+ "secret": true
378
+ },
379
+ "host": {
380
+ "type": "string",
381
+ "description": "API server host URL."
382
+ },
383
+ "clusterName": {
384
+ "type": "string",
385
+ "description": "Cluster name used in the kubeconfig."
386
+ }
387
+ },
388
+ "required": ["raw", "host", "clusterName"],
389
+ "type": "object"
390
+ }
391
+ },
392
+ "rackspace-spot:index:getRegions": {
393
+ "description": "List all available Rackspace Spot regions.",
394
+ "inputs": {
395
+ "description": "Inputs for getRegions (none required).",
396
+ "properties": {},
397
+ "type": "object"
398
+ },
399
+ "outputs": {
400
+ "description": "Outputs from getRegions.",
401
+ "properties": {
402
+ "regions": {
403
+ "type": "array",
404
+ "items": {
405
+ "type": "object",
406
+ "properties": {
407
+ "name": {
408
+ "type": "string",
409
+ "description": "Region name."
410
+ },
411
+ "country": {
412
+ "type": "string",
413
+ "description": "Country where the region is located."
414
+ },
415
+ "description": {
416
+ "type": "string",
417
+ "description": "Human-readable description of the region."
418
+ }
419
+ },
420
+ "required": ["name", "country", "description"]
421
+ },
422
+ "description": "List of available regions."
423
+ }
424
+ },
425
+ "required": ["regions"],
426
+ "type": "object"
427
+ }
428
+ },
429
+ "rackspace-spot:index:getServerClasses": {
430
+ "description": "List available server classes, optionally filtered by region.",
431
+ "inputs": {
432
+ "description": "Inputs for getServerClasses.",
433
+ "properties": {
434
+ "region": {
435
+ "type": "string",
436
+ "description": "Optional region to filter server classes by."
437
+ }
438
+ },
439
+ "type": "object"
440
+ },
441
+ "outputs": {
442
+ "description": "Outputs from getServerClasses.",
443
+ "properties": {
444
+ "serverClasses": {
445
+ "type": "array",
446
+ "items": {
447
+ "type": "object",
448
+ "properties": {
449
+ "name": {
450
+ "type": "string",
451
+ "description": "Server class name."
452
+ },
453
+ "region": {
454
+ "type": "string",
455
+ "description": "Region where this server class is available."
456
+ },
457
+ "category": {
458
+ "type": "string",
459
+ "description": "Category of the server class."
460
+ },
461
+ "cpu": {
462
+ "type": "string",
463
+ "description": "CPU specification."
464
+ },
465
+ "memory": {
466
+ "type": "string",
467
+ "description": "Memory specification."
468
+ },
469
+ "flavorType": {
470
+ "type": "string",
471
+ "description": "Flavor type of the server class."
472
+ },
473
+ "available": {
474
+ "type": "integer",
475
+ "description": "Number of available instances."
476
+ },
477
+ "capacity": {
478
+ "type": "integer",
479
+ "description": "Total capacity."
480
+ }
481
+ },
482
+ "required": ["name", "region", "category", "cpu", "memory", "flavorType", "available", "capacity"]
483
+ },
484
+ "description": "List of available server classes."
485
+ }
486
+ },
487
+ "required": ["serverClasses"],
488
+ "type": "object"
489
+ }
490
+ }
491
+ }
492
+ }
package/package.json CHANGED
@@ -1,14 +1,19 @@
1
1
  {
2
2
  "name": "@reyemtech/pulumi-rackspace-spot",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Pulumi provider for Rackspace Spot — cloudspaces, node pools, kubeconfig",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
7
+ "files": [
8
+ "bin/",
9
+ "cmd/",
10
+ "types/"
11
+ ],
7
12
  "bin": {
8
13
  "pulumi-resource-rackspace-spot": "cmd/pulumi-resource-rackspace-spot.js"
9
14
  },
10
15
  "scripts": {
11
- "build": "tsc && cp -r ../provider/bin cmd/provider",
16
+ "build": "tsc && rm -rf cmd/provider && cp -r ../provider/bin cmd/provider && cp ../provider/package.json cmd/package.json && cp ../provider/schema.json cmd/schema.json",
12
17
  "postinstall": "node cmd/install-plugin.js"
13
18
  },
14
19
  "pulumi": {