@fractal_cloud/sdk 1.0.0 → 1.1.0
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/README.md +162 -178
- package/dist/index.cjs +2689 -5
- package/dist/index.d.cts +1204 -1
- package/dist/index.d.mts +1204 -1
- package/dist/index.mjs +2515 -5
- package/package.json +15 -3
package/dist/index.mjs
CHANGED
|
@@ -473,7 +473,7 @@ let ServiceDeliveryModel$1 = /* @__PURE__ */ function(ServiceDeliveryModel) {
|
|
|
473
473
|
* if the string is valid.
|
|
474
474
|
*/
|
|
475
475
|
const isValidPascalCaseString = (value) => {
|
|
476
|
-
if (!/^[A-Z][a-zA-
|
|
476
|
+
if (!/^[A-Z][a-zA-Z0-9]*$/.test(value)) return [` Value '${value}' must be in PascalCase`];
|
|
477
477
|
return [];
|
|
478
478
|
};
|
|
479
479
|
/**
|
|
@@ -1145,7 +1145,7 @@ const CLIENT_SECRET_HEADER$1 = "X-ClientSecret";
|
|
|
1145
1145
|
const FRACTAL_API_URL$1 = "https://api.fractal.cloud";
|
|
1146
1146
|
const deployFractal = async (credentials, fractal) => {
|
|
1147
1147
|
const fractalUrl = `${FRACTAL_API_URL$1}/blueprints/${fractal.id.toString().replace(":", "/")}`;
|
|
1148
|
-
((await superagent.get(fractalUrl).set(CLIENT_ID_HEADER$1, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER$1, credentials.secret).send()).status === 200 ? superagent.put(fractalUrl) : superagent.post(fractalUrl)).set(CLIENT_ID_HEADER$1, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER$1, credentials.secret).send({
|
|
1148
|
+
((await superagent.get(fractalUrl).ok((res) => res.status === 200 || res.status === 404).set(CLIENT_ID_HEADER$1, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER$1, credentials.secret).send()).status === 200 ? superagent.put(fractalUrl) : superagent.post(fractalUrl)).set(CLIENT_ID_HEADER$1, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER$1, credentials.secret).send({
|
|
1149
1149
|
description: fractal.description,
|
|
1150
1150
|
isPrivate: fractal.isPrivate,
|
|
1151
1151
|
components: fractal.components.map((c) => ({
|
|
@@ -1213,7 +1213,8 @@ const DEFAULT_FRACTAL = {
|
|
|
1213
1213
|
const isValidFractal = (fractal) => {
|
|
1214
1214
|
const idErrors = addContextToErrors$4(fractal.id, isValidFractalId(fractal.id));
|
|
1215
1215
|
const componentsErrors = addContextToErrors$4(fractal.id, !fractal.components || fractal.components.length === 0 ? ["[Components] Components must not be empty"] : fractal.components.reduce((acc, x) => {
|
|
1216
|
-
acc.push(
|
|
1216
|
+
if ("provider" in x) acc.push(`[Component: ${x.id.toString()}] Live system components cannot be added to a Fractal blueprint. Use LiveSystem.withComponent() instead.`);
|
|
1217
|
+
else acc.push(...isValidBlueprintComponent(x));
|
|
1217
1218
|
return acc;
|
|
1218
1219
|
}, []));
|
|
1219
1220
|
return [...idErrors, ...componentsErrors];
|
|
@@ -1838,7 +1839,7 @@ const deployLiveSystem = async (credentials, liveSystem) => {
|
|
|
1838
1839
|
}
|
|
1839
1840
|
};
|
|
1840
1841
|
const liveSystemUrl = `${FRACTAL_API_URL}/livesystems/${liveSystem.id.toString()}`;
|
|
1841
|
-
((await superagent.get(liveSystemUrl).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret).send()).status === 200 ? superagent.put(liveSystemUrl) : superagent.post(`${FRACTAL_API_URL}/livesystems`)).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret).send(body).catch((e) => console.error(e.message, e.response.text));
|
|
1842
|
+
((await superagent.get(liveSystemUrl).ok((res) => res.status === 200 || res.status === 404).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret).send()).status === 200 ? superagent.put(liveSystemUrl) : superagent.post(`${FRACTAL_API_URL}/livesystems`)).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret).send(body).catch((e) => console.error(e.message, e.response.text));
|
|
1842
1843
|
};
|
|
1843
1844
|
const destroyLiveSystem = async (credentials, id) => {
|
|
1844
1845
|
await superagent.delete(`${FRACTAL_API_URL}/livesystems/${id.toString()}`).set(CLIENT_ID_HEADER, credentials.id.serviceAccountIdValue).set(CLIENT_SECRET_HEADER, credentials.secret);
|
|
@@ -2009,6 +2010,2515 @@ let LiveSystem$1;
|
|
|
2009
2010
|
_LiveSystem.getBuilder = getLiveSystemBuilder;
|
|
2010
2011
|
})(LiveSystem$1 || (LiveSystem$1 = {}));
|
|
2011
2012
|
|
|
2013
|
+
//#endregion
|
|
2014
|
+
//#region src/fractal/component/network_and_compute/iaas/virtual_network.ts
|
|
2015
|
+
const VIRTUAL_NETWORK_TYPE_NAME = "VirtualNetwork";
|
|
2016
|
+
const CIDR_BLOCK_PARAM$1 = "cidrBlock";
|
|
2017
|
+
function buildId$28(id) {
|
|
2018
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2019
|
+
}
|
|
2020
|
+
function buildVersion$28(major, minor, patch) {
|
|
2021
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2022
|
+
}
|
|
2023
|
+
function buildVirtualNetworkType() {
|
|
2024
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(VIRTUAL_NETWORK_TYPE_NAME).build()).build();
|
|
2025
|
+
}
|
|
2026
|
+
function pushParam$25(params, key, value) {
|
|
2027
|
+
params.push(key, value);
|
|
2028
|
+
}
|
|
2029
|
+
function makeVirtualNetworkNode(vpc, subnetNodes, sgs) {
|
|
2030
|
+
const vpcDep = { id: vpc.id };
|
|
2031
|
+
const wiredSubnets = subnetNodes.map((n) => ({
|
|
2032
|
+
...n.subnet,
|
|
2033
|
+
dependencies: [...n.subnet.dependencies, vpcDep]
|
|
2034
|
+
}));
|
|
2035
|
+
const wiredSgs = sgs.map((sg) => ({
|
|
2036
|
+
...sg,
|
|
2037
|
+
dependencies: [vpcDep]
|
|
2038
|
+
}));
|
|
2039
|
+
const allVMs = subnetNodes.flatMap((n) => n.virtualMachines);
|
|
2040
|
+
const allEcsSvcs = subnetNodes.flatMap((n) => n.workloads);
|
|
2041
|
+
return {
|
|
2042
|
+
vpc,
|
|
2043
|
+
subnets: wiredSubnets,
|
|
2044
|
+
securityGroups: wiredSgs,
|
|
2045
|
+
virtualMachines: allVMs,
|
|
2046
|
+
workloads: allEcsSvcs,
|
|
2047
|
+
components: [
|
|
2048
|
+
vpc,
|
|
2049
|
+
...wiredSubnets,
|
|
2050
|
+
...wiredSgs,
|
|
2051
|
+
...allVMs,
|
|
2052
|
+
...allEcsSvcs
|
|
2053
|
+
],
|
|
2054
|
+
withSubnets: (newSubnets) => makeVirtualNetworkNode(vpc, newSubnets, sgs),
|
|
2055
|
+
withSecurityGroups: (newSgs) => makeVirtualNetworkNode(vpc, subnetNodes, newSgs)
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
let VirtualNetwork;
|
|
2059
|
+
(function(_VirtualNetwork) {
|
|
2060
|
+
const getBuilder = _VirtualNetwork.getBuilder = () => {
|
|
2061
|
+
const params = getParametersInstance();
|
|
2062
|
+
const inner = getBlueprintComponentBuilder().withType(buildVirtualNetworkType()).withParameters(params);
|
|
2063
|
+
const subnetBuilders = [];
|
|
2064
|
+
const sgBuilders = [];
|
|
2065
|
+
const builder = {
|
|
2066
|
+
withId: (id) => {
|
|
2067
|
+
inner.withId(buildId$28(id));
|
|
2068
|
+
return builder;
|
|
2069
|
+
},
|
|
2070
|
+
withVersion: (major, minor, patch) => {
|
|
2071
|
+
inner.withVersion(buildVersion$28(major, minor, patch));
|
|
2072
|
+
return builder;
|
|
2073
|
+
},
|
|
2074
|
+
withDisplayName: (displayName) => {
|
|
2075
|
+
inner.withDisplayName(displayName);
|
|
2076
|
+
return builder;
|
|
2077
|
+
},
|
|
2078
|
+
withDescription: (description) => {
|
|
2079
|
+
inner.withDescription(description);
|
|
2080
|
+
return builder;
|
|
2081
|
+
},
|
|
2082
|
+
withCidrBlock: (value) => {
|
|
2083
|
+
pushParam$25(params, CIDR_BLOCK_PARAM$1, value);
|
|
2084
|
+
return builder;
|
|
2085
|
+
},
|
|
2086
|
+
withSubnet: (subnetBuilder) => {
|
|
2087
|
+
subnetBuilders.push(subnetBuilder);
|
|
2088
|
+
return builder;
|
|
2089
|
+
},
|
|
2090
|
+
withSecurityGroup: (sgBuilder) => {
|
|
2091
|
+
sgBuilders.push(sgBuilder);
|
|
2092
|
+
return builder;
|
|
2093
|
+
},
|
|
2094
|
+
withLinks: (links) => {
|
|
2095
|
+
inner.withLinks(links);
|
|
2096
|
+
return builder;
|
|
2097
|
+
},
|
|
2098
|
+
build: () => {
|
|
2099
|
+
const vpc = inner.build();
|
|
2100
|
+
const vpcDep = { id: vpc.id };
|
|
2101
|
+
const subnetResults = subnetBuilders.map((b) => b.build());
|
|
2102
|
+
const subnets = subnetResults.map((r) => ({
|
|
2103
|
+
...r.subnet,
|
|
2104
|
+
dependencies: [...r.subnet.dependencies, vpcDep]
|
|
2105
|
+
}));
|
|
2106
|
+
const virtualMachines = subnetResults.flatMap((r) => r.virtualMachines);
|
|
2107
|
+
const securityGroups = sgBuilders.map((b) => ({
|
|
2108
|
+
...b.build(),
|
|
2109
|
+
dependencies: [vpcDep]
|
|
2110
|
+
}));
|
|
2111
|
+
return {
|
|
2112
|
+
vpc,
|
|
2113
|
+
subnets,
|
|
2114
|
+
securityGroups,
|
|
2115
|
+
virtualMachines,
|
|
2116
|
+
components: [
|
|
2117
|
+
vpc,
|
|
2118
|
+
...subnets,
|
|
2119
|
+
...securityGroups,
|
|
2120
|
+
...virtualMachines
|
|
2121
|
+
]
|
|
2122
|
+
};
|
|
2123
|
+
}
|
|
2124
|
+
};
|
|
2125
|
+
return builder;
|
|
2126
|
+
};
|
|
2127
|
+
_VirtualNetwork.create = (config) => {
|
|
2128
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
|
|
2129
|
+
if (config.cidrBlock) b.withCidrBlock(config.cidrBlock);
|
|
2130
|
+
if (config.description) b.withDescription(config.description);
|
|
2131
|
+
return makeVirtualNetworkNode(b.build().vpc, [], []);
|
|
2132
|
+
};
|
|
2133
|
+
})(VirtualNetwork || (VirtualNetwork = {}));
|
|
2134
|
+
|
|
2135
|
+
//#endregion
|
|
2136
|
+
//#region src/fractal/component/network_and_compute/iaas/subnet.ts
|
|
2137
|
+
const SUBNET_TYPE_NAME = "Subnet";
|
|
2138
|
+
const CIDR_BLOCK_PARAM = "cidrBlock";
|
|
2139
|
+
function buildId$27(id) {
|
|
2140
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2141
|
+
}
|
|
2142
|
+
function buildVersion$27(major, minor, patch) {
|
|
2143
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2144
|
+
}
|
|
2145
|
+
function buildSubnetType() {
|
|
2146
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(SUBNET_TYPE_NAME).build()).build();
|
|
2147
|
+
}
|
|
2148
|
+
function pushParam$24(params, key, value) {
|
|
2149
|
+
params.push(key, value);
|
|
2150
|
+
}
|
|
2151
|
+
function makeSubnetNode(subnet, vms, workloadNodes) {
|
|
2152
|
+
const subnetDep = { id: subnet.id };
|
|
2153
|
+
const wiredVMs = vms.map((n) => ({
|
|
2154
|
+
...n.component,
|
|
2155
|
+
dependencies: [...n.component.dependencies, subnetDep]
|
|
2156
|
+
}));
|
|
2157
|
+
const wiredWorkloads = workloadNodes.map((w) => ({
|
|
2158
|
+
...w.component,
|
|
2159
|
+
dependencies: [...w.component.dependencies, subnetDep]
|
|
2160
|
+
}));
|
|
2161
|
+
return {
|
|
2162
|
+
subnet,
|
|
2163
|
+
virtualMachines: wiredVMs,
|
|
2164
|
+
workloads: wiredWorkloads,
|
|
2165
|
+
components: [
|
|
2166
|
+
subnet,
|
|
2167
|
+
...wiredVMs,
|
|
2168
|
+
...wiredWorkloads
|
|
2169
|
+
],
|
|
2170
|
+
withVirtualMachines: (newVMs) => makeSubnetNode(subnet, newVMs, workloadNodes),
|
|
2171
|
+
withWorkloads: (newWorkloads) => makeSubnetNode(subnet, vms, newWorkloads)
|
|
2172
|
+
};
|
|
2173
|
+
}
|
|
2174
|
+
let Subnet;
|
|
2175
|
+
(function(_Subnet) {
|
|
2176
|
+
const getBuilder = _Subnet.getBuilder = () => {
|
|
2177
|
+
const params = getParametersInstance();
|
|
2178
|
+
const inner = getBlueprintComponentBuilder().withType(buildSubnetType()).withParameters(params);
|
|
2179
|
+
const vmBuilders = [];
|
|
2180
|
+
const builder = {
|
|
2181
|
+
withId: (id) => {
|
|
2182
|
+
inner.withId(buildId$27(id));
|
|
2183
|
+
return builder;
|
|
2184
|
+
},
|
|
2185
|
+
withVersion: (major, minor, patch) => {
|
|
2186
|
+
inner.withVersion(buildVersion$27(major, minor, patch));
|
|
2187
|
+
return builder;
|
|
2188
|
+
},
|
|
2189
|
+
withDisplayName: (displayName) => {
|
|
2190
|
+
inner.withDisplayName(displayName);
|
|
2191
|
+
return builder;
|
|
2192
|
+
},
|
|
2193
|
+
withDescription: (description) => {
|
|
2194
|
+
inner.withDescription(description);
|
|
2195
|
+
return builder;
|
|
2196
|
+
},
|
|
2197
|
+
withCidrBlock: (value) => {
|
|
2198
|
+
pushParam$24(params, CIDR_BLOCK_PARAM, value);
|
|
2199
|
+
return builder;
|
|
2200
|
+
},
|
|
2201
|
+
withVirtualMachine: (vmBuilder) => {
|
|
2202
|
+
vmBuilders.push(vmBuilder);
|
|
2203
|
+
return builder;
|
|
2204
|
+
},
|
|
2205
|
+
withLinks: (links) => {
|
|
2206
|
+
inner.withLinks(links);
|
|
2207
|
+
return builder;
|
|
2208
|
+
},
|
|
2209
|
+
build: () => {
|
|
2210
|
+
const subnet = inner.build();
|
|
2211
|
+
const subnetDep = { id: subnet.id };
|
|
2212
|
+
const virtualMachines = vmBuilders.map((b) => ({
|
|
2213
|
+
...b.build(),
|
|
2214
|
+
dependencies: [subnetDep]
|
|
2215
|
+
}));
|
|
2216
|
+
return {
|
|
2217
|
+
subnet,
|
|
2218
|
+
virtualMachines,
|
|
2219
|
+
components: [subnet, ...virtualMachines]
|
|
2220
|
+
};
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2223
|
+
return builder;
|
|
2224
|
+
};
|
|
2225
|
+
_Subnet.create = (config) => {
|
|
2226
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
|
|
2227
|
+
if (config.cidrBlock) b.withCidrBlock(config.cidrBlock);
|
|
2228
|
+
if (config.description) b.withDescription(config.description);
|
|
2229
|
+
return makeSubnetNode(b.build().subnet, [], []);
|
|
2230
|
+
};
|
|
2231
|
+
})(Subnet || (Subnet = {}));
|
|
2232
|
+
|
|
2233
|
+
//#endregion
|
|
2234
|
+
//#region src/fractal/component/network_and_compute/iaas/security_group.ts
|
|
2235
|
+
const SECURITY_GROUP_TYPE_NAME = "SecurityGroup";
|
|
2236
|
+
const DESCRIPTION_PARAM = "description";
|
|
2237
|
+
const INGRESS_RULES_PARAM = "ingressRules";
|
|
2238
|
+
function buildId$26(id) {
|
|
2239
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2240
|
+
}
|
|
2241
|
+
function buildVersion$26(major, minor, patch) {
|
|
2242
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2243
|
+
}
|
|
2244
|
+
function buildSecurityGroupType() {
|
|
2245
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(SECURITY_GROUP_TYPE_NAME).build()).build();
|
|
2246
|
+
}
|
|
2247
|
+
function pushParam$23(params, key, value) {
|
|
2248
|
+
params.push(key, value);
|
|
2249
|
+
}
|
|
2250
|
+
let SecurityGroup;
|
|
2251
|
+
(function(_SecurityGroup) {
|
|
2252
|
+
const getBuilder = _SecurityGroup.getBuilder = () => {
|
|
2253
|
+
const params = getParametersInstance();
|
|
2254
|
+
const inner = getBlueprintComponentBuilder().withType(buildSecurityGroupType()).withParameters(params);
|
|
2255
|
+
const builder = {
|
|
2256
|
+
withId: (id) => {
|
|
2257
|
+
inner.withId(buildId$26(id));
|
|
2258
|
+
return builder;
|
|
2259
|
+
},
|
|
2260
|
+
withVersion: (major, minor, patch) => {
|
|
2261
|
+
inner.withVersion(buildVersion$26(major, minor, patch));
|
|
2262
|
+
return builder;
|
|
2263
|
+
},
|
|
2264
|
+
withDisplayName: (displayName) => {
|
|
2265
|
+
inner.withDisplayName(displayName);
|
|
2266
|
+
return builder;
|
|
2267
|
+
},
|
|
2268
|
+
withDescription: (description) => {
|
|
2269
|
+
inner.withDescription(description);
|
|
2270
|
+
pushParam$23(params, DESCRIPTION_PARAM, description);
|
|
2271
|
+
return builder;
|
|
2272
|
+
},
|
|
2273
|
+
withIngressRules: (rules) => {
|
|
2274
|
+
pushParam$23(params, INGRESS_RULES_PARAM, rules);
|
|
2275
|
+
return builder;
|
|
2276
|
+
},
|
|
2277
|
+
withLinks: (links) => {
|
|
2278
|
+
inner.withLinks(links);
|
|
2279
|
+
return builder;
|
|
2280
|
+
},
|
|
2281
|
+
build: () => inner.build()
|
|
2282
|
+
};
|
|
2283
|
+
return builder;
|
|
2284
|
+
};
|
|
2285
|
+
_SecurityGroup.create = (config) => {
|
|
2286
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withDescription(config.description);
|
|
2287
|
+
if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
|
|
2288
|
+
return b.build();
|
|
2289
|
+
};
|
|
2290
|
+
})(SecurityGroup || (SecurityGroup = {}));
|
|
2291
|
+
|
|
2292
|
+
//#endregion
|
|
2293
|
+
//#region src/fractal/component/network_and_compute/iaas/vm.ts
|
|
2294
|
+
const VIRTUAL_MACHINE_TYPE_NAME = "VirtualMachine";
|
|
2295
|
+
function buildId$25(id) {
|
|
2296
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2297
|
+
}
|
|
2298
|
+
function buildVersion$25(major, minor, patch) {
|
|
2299
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2300
|
+
}
|
|
2301
|
+
function buildVirtualMachineType() {
|
|
2302
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(VIRTUAL_MACHINE_TYPE_NAME).build()).build();
|
|
2303
|
+
}
|
|
2304
|
+
function buildLinkParams$1(link) {
|
|
2305
|
+
const params = getParametersInstance();
|
|
2306
|
+
params.push("fromPort", link.fromPort);
|
|
2307
|
+
if (link.toPort !== void 0) params.push("toPort", link.toPort);
|
|
2308
|
+
if (link.protocol) params.push("protocol", link.protocol);
|
|
2309
|
+
return params;
|
|
2310
|
+
}
|
|
2311
|
+
function makeVirtualMachineNode(component) {
|
|
2312
|
+
return {
|
|
2313
|
+
component,
|
|
2314
|
+
components: [component],
|
|
2315
|
+
withLinks: (links) => {
|
|
2316
|
+
const componentLinks = links.map((l) => getLinkBuilder().withId(l.target.component.id).withType(buildVirtualMachineType()).withParameters(buildLinkParams$1(l)).build());
|
|
2317
|
+
return makeVirtualMachineNode({
|
|
2318
|
+
...component,
|
|
2319
|
+
links: [...component.links, ...componentLinks]
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
};
|
|
2323
|
+
}
|
|
2324
|
+
let VirtualMachine;
|
|
2325
|
+
(function(_VirtualMachine) {
|
|
2326
|
+
const getBuilder = _VirtualMachine.getBuilder = () => {
|
|
2327
|
+
const inner = getBlueprintComponentBuilder().withType(buildVirtualMachineType()).withParameters(getParametersInstance());
|
|
2328
|
+
const builder = {
|
|
2329
|
+
withId: (id) => {
|
|
2330
|
+
inner.withId(buildId$25(id));
|
|
2331
|
+
return builder;
|
|
2332
|
+
},
|
|
2333
|
+
withVersion: (major, minor, patch) => {
|
|
2334
|
+
inner.withVersion(buildVersion$25(major, minor, patch));
|
|
2335
|
+
return builder;
|
|
2336
|
+
},
|
|
2337
|
+
withDisplayName: (displayName) => {
|
|
2338
|
+
inner.withDisplayName(displayName);
|
|
2339
|
+
return builder;
|
|
2340
|
+
},
|
|
2341
|
+
withDescription: (description) => {
|
|
2342
|
+
inner.withDescription(description);
|
|
2343
|
+
return builder;
|
|
2344
|
+
},
|
|
2345
|
+
withLinks: (links) => {
|
|
2346
|
+
inner.withLinks(links);
|
|
2347
|
+
return builder;
|
|
2348
|
+
},
|
|
2349
|
+
build: () => inner.build()
|
|
2350
|
+
};
|
|
2351
|
+
return builder;
|
|
2352
|
+
};
|
|
2353
|
+
_VirtualMachine.create = (config) => {
|
|
2354
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
|
|
2355
|
+
if (config.description) b.withDescription(config.description);
|
|
2356
|
+
return makeVirtualMachineNode(b.build());
|
|
2357
|
+
};
|
|
2358
|
+
})(VirtualMachine || (VirtualMachine = {}));
|
|
2359
|
+
|
|
2360
|
+
//#endregion
|
|
2361
|
+
//#region src/live_system/component/network_and_compute/iaas/vpc.ts
|
|
2362
|
+
const AWS_VPC_TYPE_NAME = "AwsVpc";
|
|
2363
|
+
const INSTANCE_TENANCY_PARAM = "instanceTenancy";
|
|
2364
|
+
const ENABLE_DNS_SUPPORT_PARAM = "enableDnsSupport";
|
|
2365
|
+
const ENABLE_DNS_HOSTNAMES_PARAM = "enableDnsHostnames";
|
|
2366
|
+
function buildId$24(id) {
|
|
2367
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2368
|
+
}
|
|
2369
|
+
function buildVersion$24(major, minor, patch) {
|
|
2370
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2371
|
+
}
|
|
2372
|
+
function buildAwsVpcType() {
|
|
2373
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AWS_VPC_TYPE_NAME).build()).build();
|
|
2374
|
+
}
|
|
2375
|
+
function pushParam$22(params, key, value) {
|
|
2376
|
+
params.push(key, value);
|
|
2377
|
+
}
|
|
2378
|
+
let AwsVpc;
|
|
2379
|
+
(function(_AwsVpc) {
|
|
2380
|
+
const getBuilder = _AwsVpc.getBuilder = () => {
|
|
2381
|
+
const params = getParametersInstance();
|
|
2382
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsVpcType()).withParameters(params).withProvider("AWS");
|
|
2383
|
+
const builder = {
|
|
2384
|
+
withId: (id) => {
|
|
2385
|
+
inner.withId(buildId$24(id));
|
|
2386
|
+
return builder;
|
|
2387
|
+
},
|
|
2388
|
+
withVersion: (major, minor, patch) => {
|
|
2389
|
+
inner.withVersion(buildVersion$24(major, minor, patch));
|
|
2390
|
+
return builder;
|
|
2391
|
+
},
|
|
2392
|
+
withDisplayName: (displayName) => {
|
|
2393
|
+
inner.withDisplayName(displayName);
|
|
2394
|
+
return builder;
|
|
2395
|
+
},
|
|
2396
|
+
withDescription: (description) => {
|
|
2397
|
+
inner.withDescription(description);
|
|
2398
|
+
return builder;
|
|
2399
|
+
},
|
|
2400
|
+
withCidrBlock: (value) => {
|
|
2401
|
+
pushParam$22(params, CIDR_BLOCK_PARAM$1, value);
|
|
2402
|
+
return builder;
|
|
2403
|
+
},
|
|
2404
|
+
withInstanceTenancy: (value) => {
|
|
2405
|
+
pushParam$22(params, INSTANCE_TENANCY_PARAM, value);
|
|
2406
|
+
return builder;
|
|
2407
|
+
},
|
|
2408
|
+
withEnableDnsSupport: (value) => {
|
|
2409
|
+
pushParam$22(params, ENABLE_DNS_SUPPORT_PARAM, value);
|
|
2410
|
+
return builder;
|
|
2411
|
+
},
|
|
2412
|
+
withEnableDnsHostnames: (value) => {
|
|
2413
|
+
pushParam$22(params, ENABLE_DNS_HOSTNAMES_PARAM, value);
|
|
2414
|
+
return builder;
|
|
2415
|
+
},
|
|
2416
|
+
build: () => inner.build()
|
|
2417
|
+
};
|
|
2418
|
+
return builder;
|
|
2419
|
+
};
|
|
2420
|
+
_AwsVpc.satisfy = (blueprint) => {
|
|
2421
|
+
const params = getParametersInstance();
|
|
2422
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsVpcType()).withParameters(params).withProvider("AWS").withId(buildId$24(blueprint.id.toString())).withVersion(buildVersion$24(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
2423
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
2424
|
+
const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
|
|
2425
|
+
if (cidrBlock !== null) pushParam$22(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
|
|
2426
|
+
const satisfiedBuilder = {
|
|
2427
|
+
withInstanceTenancy: (value) => {
|
|
2428
|
+
pushParam$22(params, INSTANCE_TENANCY_PARAM, value);
|
|
2429
|
+
return satisfiedBuilder;
|
|
2430
|
+
},
|
|
2431
|
+
withEnableDnsSupport: (value) => {
|
|
2432
|
+
pushParam$22(params, ENABLE_DNS_SUPPORT_PARAM, value);
|
|
2433
|
+
return satisfiedBuilder;
|
|
2434
|
+
},
|
|
2435
|
+
withEnableDnsHostnames: (value) => {
|
|
2436
|
+
pushParam$22(params, ENABLE_DNS_HOSTNAMES_PARAM, value);
|
|
2437
|
+
return satisfiedBuilder;
|
|
2438
|
+
},
|
|
2439
|
+
build: () => inner.build()
|
|
2440
|
+
};
|
|
2441
|
+
return satisfiedBuilder;
|
|
2442
|
+
};
|
|
2443
|
+
_AwsVpc.create = (config) => {
|
|
2444
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock);
|
|
2445
|
+
if (config.description) b.withDescription(config.description);
|
|
2446
|
+
if (config.instanceTenancy) b.withInstanceTenancy(config.instanceTenancy);
|
|
2447
|
+
if (config.enableDnsSupport !== void 0) b.withEnableDnsSupport(config.enableDnsSupport);
|
|
2448
|
+
if (config.enableDnsHostnames !== void 0) b.withEnableDnsHostnames(config.enableDnsHostnames);
|
|
2449
|
+
return b.build();
|
|
2450
|
+
};
|
|
2451
|
+
})(AwsVpc || (AwsVpc = {}));
|
|
2452
|
+
|
|
2453
|
+
//#endregion
|
|
2454
|
+
//#region src/live_system/component/network_and_compute/iaas/subnet.ts
|
|
2455
|
+
const AWS_SUBNET_TYPE_NAME = "AwsSubnet";
|
|
2456
|
+
const AVAILABILITY_ZONE_PARAM = "availabilityZone";
|
|
2457
|
+
function buildId$23(id) {
|
|
2458
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2459
|
+
}
|
|
2460
|
+
function buildVersion$23(major, minor, patch) {
|
|
2461
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2462
|
+
}
|
|
2463
|
+
function buildAwsSubnetType() {
|
|
2464
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AWS_SUBNET_TYPE_NAME).build()).build();
|
|
2465
|
+
}
|
|
2466
|
+
function pushParam$21(params, key, value) {
|
|
2467
|
+
params.push(key, value);
|
|
2468
|
+
}
|
|
2469
|
+
let AwsSubnet;
|
|
2470
|
+
(function(_AwsSubnet) {
|
|
2471
|
+
const getBuilder = _AwsSubnet.getBuilder = () => {
|
|
2472
|
+
const params = getParametersInstance();
|
|
2473
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsSubnetType()).withParameters(params).withProvider("AWS");
|
|
2474
|
+
const builder = {
|
|
2475
|
+
withId: (id) => {
|
|
2476
|
+
inner.withId(buildId$23(id));
|
|
2477
|
+
return builder;
|
|
2478
|
+
},
|
|
2479
|
+
withVersion: (major, minor, patch) => {
|
|
2480
|
+
inner.withVersion(buildVersion$23(major, minor, patch));
|
|
2481
|
+
return builder;
|
|
2482
|
+
},
|
|
2483
|
+
withDisplayName: (displayName) => {
|
|
2484
|
+
inner.withDisplayName(displayName);
|
|
2485
|
+
return builder;
|
|
2486
|
+
},
|
|
2487
|
+
withDescription: (description) => {
|
|
2488
|
+
inner.withDescription(description);
|
|
2489
|
+
return builder;
|
|
2490
|
+
},
|
|
2491
|
+
withCidrBlock: (value) => {
|
|
2492
|
+
pushParam$21(params, CIDR_BLOCK_PARAM, value);
|
|
2493
|
+
return builder;
|
|
2494
|
+
},
|
|
2495
|
+
withAvailabilityZone: (value) => {
|
|
2496
|
+
pushParam$21(params, AVAILABILITY_ZONE_PARAM, value);
|
|
2497
|
+
return builder;
|
|
2498
|
+
},
|
|
2499
|
+
build: () => inner.build()
|
|
2500
|
+
};
|
|
2501
|
+
return builder;
|
|
2502
|
+
};
|
|
2503
|
+
_AwsSubnet.satisfy = (blueprint) => {
|
|
2504
|
+
const params = getParametersInstance();
|
|
2505
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsSubnetType()).withParameters(params).withProvider("AWS").withId(buildId$23(blueprint.id.toString())).withVersion(buildVersion$23(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
2506
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
2507
|
+
const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
|
|
2508
|
+
if (cidrBlock !== null) pushParam$21(params, CIDR_BLOCK_PARAM, String(cidrBlock));
|
|
2509
|
+
const satisfiedBuilder = {
|
|
2510
|
+
withAvailabilityZone: (value) => {
|
|
2511
|
+
pushParam$21(params, AVAILABILITY_ZONE_PARAM, value);
|
|
2512
|
+
return satisfiedBuilder;
|
|
2513
|
+
},
|
|
2514
|
+
build: () => inner.build()
|
|
2515
|
+
};
|
|
2516
|
+
return satisfiedBuilder;
|
|
2517
|
+
};
|
|
2518
|
+
_AwsSubnet.create = (config) => {
|
|
2519
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withAvailabilityZone(config.availabilityZone);
|
|
2520
|
+
if (config.description) b.withDescription(config.description);
|
|
2521
|
+
return b.build();
|
|
2522
|
+
};
|
|
2523
|
+
})(AwsSubnet || (AwsSubnet = {}));
|
|
2524
|
+
|
|
2525
|
+
//#endregion
|
|
2526
|
+
//#region src/live_system/component/network_and_compute/iaas/security_group.ts
|
|
2527
|
+
const AWS_SG_TYPE_NAME = "AwsSecurityGroup";
|
|
2528
|
+
function buildId$22(id) {
|
|
2529
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2530
|
+
}
|
|
2531
|
+
function buildVersion$22(major, minor, patch) {
|
|
2532
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2533
|
+
}
|
|
2534
|
+
function buildAwsSgType() {
|
|
2535
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AWS_SG_TYPE_NAME).build()).build();
|
|
2536
|
+
}
|
|
2537
|
+
function pushParam$20(params, key, value) {
|
|
2538
|
+
params.push(key, value);
|
|
2539
|
+
}
|
|
2540
|
+
let AwsSecurityGroup;
|
|
2541
|
+
(function(_AwsSecurityGroup) {
|
|
2542
|
+
const getBuilder = _AwsSecurityGroup.getBuilder = () => {
|
|
2543
|
+
const params = getParametersInstance();
|
|
2544
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsSgType()).withParameters(params).withProvider("AWS");
|
|
2545
|
+
const builder = {
|
|
2546
|
+
withId: (id) => {
|
|
2547
|
+
inner.withId(buildId$22(id));
|
|
2548
|
+
return builder;
|
|
2549
|
+
},
|
|
2550
|
+
withVersion: (major, minor, patch) => {
|
|
2551
|
+
inner.withVersion(buildVersion$22(major, minor, patch));
|
|
2552
|
+
return builder;
|
|
2553
|
+
},
|
|
2554
|
+
withDisplayName: (displayName) => {
|
|
2555
|
+
inner.withDisplayName(displayName);
|
|
2556
|
+
return builder;
|
|
2557
|
+
},
|
|
2558
|
+
withDescription: (description) => {
|
|
2559
|
+
inner.withDescription(description);
|
|
2560
|
+
pushParam$20(params, DESCRIPTION_PARAM, description);
|
|
2561
|
+
return builder;
|
|
2562
|
+
},
|
|
2563
|
+
withIngressRules: (rules) => {
|
|
2564
|
+
pushParam$20(params, INGRESS_RULES_PARAM, rules);
|
|
2565
|
+
return builder;
|
|
2566
|
+
},
|
|
2567
|
+
build: () => inner.build()
|
|
2568
|
+
};
|
|
2569
|
+
return builder;
|
|
2570
|
+
};
|
|
2571
|
+
_AwsSecurityGroup.satisfy = (blueprint) => {
|
|
2572
|
+
const params = getParametersInstance();
|
|
2573
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsSgType()).withParameters(params).withProvider("AWS").withId(buildId$22(blueprint.id.toString())).withVersion(buildVersion$22(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
2574
|
+
const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
|
|
2575
|
+
if (description !== null) {
|
|
2576
|
+
inner.withDescription(String(description));
|
|
2577
|
+
pushParam$20(params, DESCRIPTION_PARAM, String(description));
|
|
2578
|
+
} else if (blueprint.description) inner.withDescription(blueprint.description);
|
|
2579
|
+
const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
|
|
2580
|
+
if (ingressRules !== null) pushParam$20(params, INGRESS_RULES_PARAM, ingressRules);
|
|
2581
|
+
return { build: () => inner.build() };
|
|
2582
|
+
};
|
|
2583
|
+
_AwsSecurityGroup.create = (config) => {
|
|
2584
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withDescription(config.description);
|
|
2585
|
+
if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
|
|
2586
|
+
return b.build();
|
|
2587
|
+
};
|
|
2588
|
+
})(AwsSecurityGroup || (AwsSecurityGroup = {}));
|
|
2589
|
+
|
|
2590
|
+
//#endregion
|
|
2591
|
+
//#region src/live_system/component/network_and_compute/iaas/ec2_instance.ts
|
|
2592
|
+
const EC2_TYPE_NAME = "EC2";
|
|
2593
|
+
const AMI_ID_PARAM = "amiId";
|
|
2594
|
+
const INSTANCE_TYPE_PARAM = "instanceType";
|
|
2595
|
+
const KEY_NAME_PARAM = "keyName";
|
|
2596
|
+
const USER_DATA_PARAM$1 = "userData";
|
|
2597
|
+
const IAM_INSTANCE_PROFILE_PARAM = "iamInstanceProfile";
|
|
2598
|
+
const ASSOCIATE_PUBLIC_IP_PARAM = "associatePublicIp";
|
|
2599
|
+
function buildId$21(id) {
|
|
2600
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2601
|
+
}
|
|
2602
|
+
function buildVersion$21(major, minor, patch) {
|
|
2603
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2604
|
+
}
|
|
2605
|
+
function buildEc2Type() {
|
|
2606
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(EC2_TYPE_NAME).build()).build();
|
|
2607
|
+
}
|
|
2608
|
+
function pushParam$19(params, key, value) {
|
|
2609
|
+
params.push(key, value);
|
|
2610
|
+
}
|
|
2611
|
+
let Ec2Instance;
|
|
2612
|
+
(function(_Ec2Instance) {
|
|
2613
|
+
const getBuilder = _Ec2Instance.getBuilder = () => {
|
|
2614
|
+
const params = getParametersInstance();
|
|
2615
|
+
const inner = getLiveSystemComponentBuilder().withType(buildEc2Type()).withParameters(params).withProvider("AWS");
|
|
2616
|
+
const builder = {
|
|
2617
|
+
withId: (id) => {
|
|
2618
|
+
inner.withId(buildId$21(id));
|
|
2619
|
+
return builder;
|
|
2620
|
+
},
|
|
2621
|
+
withVersion: (major, minor, patch) => {
|
|
2622
|
+
inner.withVersion(buildVersion$21(major, minor, patch));
|
|
2623
|
+
return builder;
|
|
2624
|
+
},
|
|
2625
|
+
withDisplayName: (displayName) => {
|
|
2626
|
+
inner.withDisplayName(displayName);
|
|
2627
|
+
return builder;
|
|
2628
|
+
},
|
|
2629
|
+
withDescription: (description) => {
|
|
2630
|
+
inner.withDescription(description);
|
|
2631
|
+
return builder;
|
|
2632
|
+
},
|
|
2633
|
+
withAmiId: (value) => {
|
|
2634
|
+
pushParam$19(params, AMI_ID_PARAM, value);
|
|
2635
|
+
return builder;
|
|
2636
|
+
},
|
|
2637
|
+
withInstanceType: (value) => {
|
|
2638
|
+
pushParam$19(params, INSTANCE_TYPE_PARAM, value);
|
|
2639
|
+
return builder;
|
|
2640
|
+
},
|
|
2641
|
+
withKeyName: (value) => {
|
|
2642
|
+
pushParam$19(params, KEY_NAME_PARAM, value);
|
|
2643
|
+
return builder;
|
|
2644
|
+
},
|
|
2645
|
+
withUserData: (value) => {
|
|
2646
|
+
pushParam$19(params, USER_DATA_PARAM$1, value);
|
|
2647
|
+
return builder;
|
|
2648
|
+
},
|
|
2649
|
+
withIamInstanceProfile: (value) => {
|
|
2650
|
+
pushParam$19(params, IAM_INSTANCE_PROFILE_PARAM, value);
|
|
2651
|
+
return builder;
|
|
2652
|
+
},
|
|
2653
|
+
withAssociatePublicIp: (value) => {
|
|
2654
|
+
pushParam$19(params, ASSOCIATE_PUBLIC_IP_PARAM, value);
|
|
2655
|
+
return builder;
|
|
2656
|
+
},
|
|
2657
|
+
build: () => inner.build()
|
|
2658
|
+
};
|
|
2659
|
+
return builder;
|
|
2660
|
+
};
|
|
2661
|
+
_Ec2Instance.satisfy = (blueprint) => {
|
|
2662
|
+
const params = getParametersInstance();
|
|
2663
|
+
const inner = getLiveSystemComponentBuilder().withType(buildEc2Type()).withParameters(params).withProvider("AWS").withId(buildId$21(blueprint.id.toString())).withVersion(buildVersion$21(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
2664
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
2665
|
+
const satisfiedBuilder = {
|
|
2666
|
+
withAmiId: (value) => {
|
|
2667
|
+
pushParam$19(params, AMI_ID_PARAM, value);
|
|
2668
|
+
return satisfiedBuilder;
|
|
2669
|
+
},
|
|
2670
|
+
withInstanceType: (value) => {
|
|
2671
|
+
pushParam$19(params, INSTANCE_TYPE_PARAM, value);
|
|
2672
|
+
return satisfiedBuilder;
|
|
2673
|
+
},
|
|
2674
|
+
withKeyName: (value) => {
|
|
2675
|
+
pushParam$19(params, KEY_NAME_PARAM, value);
|
|
2676
|
+
return satisfiedBuilder;
|
|
2677
|
+
},
|
|
2678
|
+
withUserData: (value) => {
|
|
2679
|
+
pushParam$19(params, USER_DATA_PARAM$1, value);
|
|
2680
|
+
return satisfiedBuilder;
|
|
2681
|
+
},
|
|
2682
|
+
withIamInstanceProfile: (value) => {
|
|
2683
|
+
pushParam$19(params, IAM_INSTANCE_PROFILE_PARAM, value);
|
|
2684
|
+
return satisfiedBuilder;
|
|
2685
|
+
},
|
|
2686
|
+
withAssociatePublicIp: (value) => {
|
|
2687
|
+
pushParam$19(params, ASSOCIATE_PUBLIC_IP_PARAM, value);
|
|
2688
|
+
return satisfiedBuilder;
|
|
2689
|
+
},
|
|
2690
|
+
build: () => inner.build()
|
|
2691
|
+
};
|
|
2692
|
+
return satisfiedBuilder;
|
|
2693
|
+
};
|
|
2694
|
+
_Ec2Instance.create = (config) => {
|
|
2695
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withAmiId(config.amiId).withInstanceType(config.instanceType);
|
|
2696
|
+
if (config.description) b.withDescription(config.description);
|
|
2697
|
+
if (config.keyName) b.withKeyName(config.keyName);
|
|
2698
|
+
if (config.userData) b.withUserData(config.userData);
|
|
2699
|
+
if (config.iamInstanceProfile) b.withIamInstanceProfile(config.iamInstanceProfile);
|
|
2700
|
+
if (config.associatePublicIp !== void 0) b.withAssociatePublicIp(config.associatePublicIp);
|
|
2701
|
+
return b.build();
|
|
2702
|
+
};
|
|
2703
|
+
})(Ec2Instance || (Ec2Instance = {}));
|
|
2704
|
+
|
|
2705
|
+
//#endregion
|
|
2706
|
+
//#region src/live_system/component/network_and_compute/iaas/azure_vnet.ts
|
|
2707
|
+
const AZURE_VNET_TYPE_NAME = "AzureVnet";
|
|
2708
|
+
const LOCATION_PARAM$3 = "location";
|
|
2709
|
+
const RESOURCE_GROUP_PARAM$3 = "resourceGroup";
|
|
2710
|
+
function buildId$20(id) {
|
|
2711
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2712
|
+
}
|
|
2713
|
+
function buildVersion$20(major, minor, patch) {
|
|
2714
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2715
|
+
}
|
|
2716
|
+
function buildAzureVnetType() {
|
|
2717
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_VNET_TYPE_NAME).build()).build();
|
|
2718
|
+
}
|
|
2719
|
+
function pushParam$18(params, key, value) {
|
|
2720
|
+
params.push(key, value);
|
|
2721
|
+
}
|
|
2722
|
+
let AzureVnet;
|
|
2723
|
+
(function(_AzureVnet) {
|
|
2724
|
+
const getBuilder = _AzureVnet.getBuilder = () => {
|
|
2725
|
+
const params = getParametersInstance();
|
|
2726
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAzureVnetType()).withParameters(params).withProvider("Azure");
|
|
2727
|
+
const builder = {
|
|
2728
|
+
withId: (id) => {
|
|
2729
|
+
inner.withId(buildId$20(id));
|
|
2730
|
+
return builder;
|
|
2731
|
+
},
|
|
2732
|
+
withVersion: (major, minor, patch) => {
|
|
2733
|
+
inner.withVersion(buildVersion$20(major, minor, patch));
|
|
2734
|
+
return builder;
|
|
2735
|
+
},
|
|
2736
|
+
withDisplayName: (displayName) => {
|
|
2737
|
+
inner.withDisplayName(displayName);
|
|
2738
|
+
return builder;
|
|
2739
|
+
},
|
|
2740
|
+
withDescription: (description) => {
|
|
2741
|
+
inner.withDescription(description);
|
|
2742
|
+
return builder;
|
|
2743
|
+
},
|
|
2744
|
+
withCidrBlock: (value) => {
|
|
2745
|
+
pushParam$18(params, CIDR_BLOCK_PARAM$1, value);
|
|
2746
|
+
return builder;
|
|
2747
|
+
},
|
|
2748
|
+
withLocation: (value) => {
|
|
2749
|
+
pushParam$18(params, LOCATION_PARAM$3, value);
|
|
2750
|
+
return builder;
|
|
2751
|
+
},
|
|
2752
|
+
withResourceGroup: (value) => {
|
|
2753
|
+
pushParam$18(params, RESOURCE_GROUP_PARAM$3, value);
|
|
2754
|
+
return builder;
|
|
2755
|
+
},
|
|
2756
|
+
build: () => inner.build()
|
|
2757
|
+
};
|
|
2758
|
+
return builder;
|
|
2759
|
+
};
|
|
2760
|
+
_AzureVnet.satisfy = (blueprint) => {
|
|
2761
|
+
const params = getParametersInstance();
|
|
2762
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAzureVnetType()).withParameters(params).withProvider("Azure").withId(buildId$20(blueprint.id.toString())).withVersion(buildVersion$20(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
2763
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
2764
|
+
const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
|
|
2765
|
+
if (cidrBlock !== null) pushParam$18(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
|
|
2766
|
+
const satisfiedBuilder = {
|
|
2767
|
+
withLocation: (value) => {
|
|
2768
|
+
pushParam$18(params, LOCATION_PARAM$3, value);
|
|
2769
|
+
return satisfiedBuilder;
|
|
2770
|
+
},
|
|
2771
|
+
withResourceGroup: (value) => {
|
|
2772
|
+
pushParam$18(params, RESOURCE_GROUP_PARAM$3, value);
|
|
2773
|
+
return satisfiedBuilder;
|
|
2774
|
+
},
|
|
2775
|
+
build: () => inner.build()
|
|
2776
|
+
};
|
|
2777
|
+
return satisfiedBuilder;
|
|
2778
|
+
};
|
|
2779
|
+
_AzureVnet.create = (config) => {
|
|
2780
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withLocation(config.location).withResourceGroup(config.resourceGroup);
|
|
2781
|
+
if (config.description) b.withDescription(config.description);
|
|
2782
|
+
return b.build();
|
|
2783
|
+
};
|
|
2784
|
+
})(AzureVnet || (AzureVnet = {}));
|
|
2785
|
+
|
|
2786
|
+
//#endregion
|
|
2787
|
+
//#region src/live_system/component/network_and_compute/iaas/azure_subnet.ts
|
|
2788
|
+
const AZURE_SUBNET_TYPE_NAME = "AzureSubnet";
|
|
2789
|
+
const RESOURCE_GROUP_PARAM$2 = "resourceGroup";
|
|
2790
|
+
function buildId$19(id) {
|
|
2791
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2792
|
+
}
|
|
2793
|
+
function buildVersion$19(major, minor, patch) {
|
|
2794
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2795
|
+
}
|
|
2796
|
+
function buildAzureSubnetType() {
|
|
2797
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_SUBNET_TYPE_NAME).build()).build();
|
|
2798
|
+
}
|
|
2799
|
+
function pushParam$17(params, key, value) {
|
|
2800
|
+
params.push(key, value);
|
|
2801
|
+
}
|
|
2802
|
+
let AzureSubnet;
|
|
2803
|
+
(function(_AzureSubnet) {
|
|
2804
|
+
const getBuilder = _AzureSubnet.getBuilder = () => {
|
|
2805
|
+
const params = getParametersInstance();
|
|
2806
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAzureSubnetType()).withParameters(params).withProvider("Azure");
|
|
2807
|
+
const builder = {
|
|
2808
|
+
withId: (id) => {
|
|
2809
|
+
inner.withId(buildId$19(id));
|
|
2810
|
+
return builder;
|
|
2811
|
+
},
|
|
2812
|
+
withVersion: (major, minor, patch) => {
|
|
2813
|
+
inner.withVersion(buildVersion$19(major, minor, patch));
|
|
2814
|
+
return builder;
|
|
2815
|
+
},
|
|
2816
|
+
withDisplayName: (displayName) => {
|
|
2817
|
+
inner.withDisplayName(displayName);
|
|
2818
|
+
return builder;
|
|
2819
|
+
},
|
|
2820
|
+
withDescription: (description) => {
|
|
2821
|
+
inner.withDescription(description);
|
|
2822
|
+
return builder;
|
|
2823
|
+
},
|
|
2824
|
+
withCidrBlock: (value) => {
|
|
2825
|
+
pushParam$17(params, CIDR_BLOCK_PARAM, value);
|
|
2826
|
+
return builder;
|
|
2827
|
+
},
|
|
2828
|
+
withResourceGroup: (value) => {
|
|
2829
|
+
pushParam$17(params, RESOURCE_GROUP_PARAM$2, value);
|
|
2830
|
+
return builder;
|
|
2831
|
+
},
|
|
2832
|
+
build: () => inner.build()
|
|
2833
|
+
};
|
|
2834
|
+
return builder;
|
|
2835
|
+
};
|
|
2836
|
+
_AzureSubnet.satisfy = (blueprint) => {
|
|
2837
|
+
const params = getParametersInstance();
|
|
2838
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAzureSubnetType()).withParameters(params).withProvider("Azure").withId(buildId$19(blueprint.id.toString())).withVersion(buildVersion$19(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
2839
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
2840
|
+
const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
|
|
2841
|
+
if (cidrBlock !== null) pushParam$17(params, CIDR_BLOCK_PARAM, String(cidrBlock));
|
|
2842
|
+
const satisfiedBuilder = {
|
|
2843
|
+
withResourceGroup: (value) => {
|
|
2844
|
+
pushParam$17(params, RESOURCE_GROUP_PARAM$2, value);
|
|
2845
|
+
return satisfiedBuilder;
|
|
2846
|
+
},
|
|
2847
|
+
build: () => inner.build()
|
|
2848
|
+
};
|
|
2849
|
+
return satisfiedBuilder;
|
|
2850
|
+
};
|
|
2851
|
+
_AzureSubnet.create = (config) => {
|
|
2852
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withResourceGroup(config.resourceGroup);
|
|
2853
|
+
if (config.description) b.withDescription(config.description);
|
|
2854
|
+
return b.build();
|
|
2855
|
+
};
|
|
2856
|
+
})(AzureSubnet || (AzureSubnet = {}));
|
|
2857
|
+
|
|
2858
|
+
//#endregion
|
|
2859
|
+
//#region src/live_system/component/network_and_compute/iaas/azure_nsg.ts
|
|
2860
|
+
const AZURE_NSG_TYPE_NAME = "AzureNsg";
|
|
2861
|
+
const LOCATION_PARAM$2 = "location";
|
|
2862
|
+
const RESOURCE_GROUP_PARAM$1 = "resourceGroup";
|
|
2863
|
+
function buildId$18(id) {
|
|
2864
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2865
|
+
}
|
|
2866
|
+
function buildVersion$18(major, minor, patch) {
|
|
2867
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2868
|
+
}
|
|
2869
|
+
function buildAzureNsgType() {
|
|
2870
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_NSG_TYPE_NAME).build()).build();
|
|
2871
|
+
}
|
|
2872
|
+
function pushParam$16(params, key, value) {
|
|
2873
|
+
params.push(key, value);
|
|
2874
|
+
}
|
|
2875
|
+
let AzureNsg;
|
|
2876
|
+
(function(_AzureNsg) {
|
|
2877
|
+
const getBuilder = _AzureNsg.getBuilder = () => {
|
|
2878
|
+
const params = getParametersInstance();
|
|
2879
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAzureNsgType()).withParameters(params).withProvider("Azure");
|
|
2880
|
+
const builder = {
|
|
2881
|
+
withId: (id) => {
|
|
2882
|
+
inner.withId(buildId$18(id));
|
|
2883
|
+
return builder;
|
|
2884
|
+
},
|
|
2885
|
+
withVersion: (major, minor, patch) => {
|
|
2886
|
+
inner.withVersion(buildVersion$18(major, minor, patch));
|
|
2887
|
+
return builder;
|
|
2888
|
+
},
|
|
2889
|
+
withDisplayName: (displayName) => {
|
|
2890
|
+
inner.withDisplayName(displayName);
|
|
2891
|
+
return builder;
|
|
2892
|
+
},
|
|
2893
|
+
withDescription: (description) => {
|
|
2894
|
+
inner.withDescription(description);
|
|
2895
|
+
pushParam$16(params, DESCRIPTION_PARAM, description);
|
|
2896
|
+
return builder;
|
|
2897
|
+
},
|
|
2898
|
+
withIngressRules: (rules) => {
|
|
2899
|
+
pushParam$16(params, INGRESS_RULES_PARAM, rules);
|
|
2900
|
+
return builder;
|
|
2901
|
+
},
|
|
2902
|
+
withLocation: (value) => {
|
|
2903
|
+
pushParam$16(params, LOCATION_PARAM$2, value);
|
|
2904
|
+
return builder;
|
|
2905
|
+
},
|
|
2906
|
+
withResourceGroup: (value) => {
|
|
2907
|
+
pushParam$16(params, RESOURCE_GROUP_PARAM$1, value);
|
|
2908
|
+
return builder;
|
|
2909
|
+
},
|
|
2910
|
+
build: () => inner.build()
|
|
2911
|
+
};
|
|
2912
|
+
return builder;
|
|
2913
|
+
};
|
|
2914
|
+
_AzureNsg.satisfy = (blueprint) => {
|
|
2915
|
+
const params = getParametersInstance();
|
|
2916
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAzureNsgType()).withParameters(params).withProvider("Azure").withId(buildId$18(blueprint.id.toString())).withVersion(buildVersion$18(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
2917
|
+
const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
|
|
2918
|
+
if (description !== null) {
|
|
2919
|
+
inner.withDescription(String(description));
|
|
2920
|
+
pushParam$16(params, DESCRIPTION_PARAM, String(description));
|
|
2921
|
+
} else if (blueprint.description) inner.withDescription(blueprint.description);
|
|
2922
|
+
const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
|
|
2923
|
+
if (ingressRules !== null) pushParam$16(params, INGRESS_RULES_PARAM, ingressRules);
|
|
2924
|
+
const satisfiedBuilder = {
|
|
2925
|
+
withLocation: (value) => {
|
|
2926
|
+
pushParam$16(params, LOCATION_PARAM$2, value);
|
|
2927
|
+
return satisfiedBuilder;
|
|
2928
|
+
},
|
|
2929
|
+
withResourceGroup: (value) => {
|
|
2930
|
+
pushParam$16(params, RESOURCE_GROUP_PARAM$1, value);
|
|
2931
|
+
return satisfiedBuilder;
|
|
2932
|
+
},
|
|
2933
|
+
build: () => inner.build()
|
|
2934
|
+
};
|
|
2935
|
+
return satisfiedBuilder;
|
|
2936
|
+
};
|
|
2937
|
+
_AzureNsg.create = (config) => {
|
|
2938
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withLocation(config.location).withResourceGroup(config.resourceGroup);
|
|
2939
|
+
if (config.description) b.withDescription(config.description);
|
|
2940
|
+
if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
|
|
2941
|
+
return b.build();
|
|
2942
|
+
};
|
|
2943
|
+
})(AzureNsg || (AzureNsg = {}));
|
|
2944
|
+
|
|
2945
|
+
//#endregion
|
|
2946
|
+
//#region src/live_system/component/network_and_compute/iaas/azure_vm.ts
|
|
2947
|
+
const AZURE_VM_TYPE_NAME = "AzureVm";
|
|
2948
|
+
const VM_SIZE_PARAM = "vmSize";
|
|
2949
|
+
const LOCATION_PARAM$1 = "location";
|
|
2950
|
+
const RESOURCE_GROUP_PARAM = "resourceGroup";
|
|
2951
|
+
const ADMIN_USERNAME_PARAM = "adminUsername";
|
|
2952
|
+
const IMAGE_PUBLISHER_PARAM = "imagePublisher";
|
|
2953
|
+
const IMAGE_OFFER_PARAM = "imageOffer";
|
|
2954
|
+
const IMAGE_SKU_PARAM = "imageSku";
|
|
2955
|
+
const SSH_PUBLIC_KEY_PARAM$1 = "sshPublicKey";
|
|
2956
|
+
const OS_DISK_SIZE_GB_PARAM = "osDiskSizeGb";
|
|
2957
|
+
function buildId$17(id) {
|
|
2958
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
2959
|
+
}
|
|
2960
|
+
function buildVersion$17(major, minor, patch) {
|
|
2961
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
2962
|
+
}
|
|
2963
|
+
function buildAzureVmType() {
|
|
2964
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(AZURE_VM_TYPE_NAME).build()).build();
|
|
2965
|
+
}
|
|
2966
|
+
function pushParam$15(params, key, value) {
|
|
2967
|
+
params.push(key, value);
|
|
2968
|
+
}
|
|
2969
|
+
let AzureVm;
|
|
2970
|
+
(function(_AzureVm) {
|
|
2971
|
+
const getBuilder = _AzureVm.getBuilder = () => {
|
|
2972
|
+
const params = getParametersInstance();
|
|
2973
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAzureVmType()).withParameters(params).withProvider("Azure");
|
|
2974
|
+
const builder = {
|
|
2975
|
+
withId: (id) => {
|
|
2976
|
+
inner.withId(buildId$17(id));
|
|
2977
|
+
return builder;
|
|
2978
|
+
},
|
|
2979
|
+
withVersion: (major, minor, patch) => {
|
|
2980
|
+
inner.withVersion(buildVersion$17(major, minor, patch));
|
|
2981
|
+
return builder;
|
|
2982
|
+
},
|
|
2983
|
+
withDisplayName: (displayName) => {
|
|
2984
|
+
inner.withDisplayName(displayName);
|
|
2985
|
+
return builder;
|
|
2986
|
+
},
|
|
2987
|
+
withDescription: (description) => {
|
|
2988
|
+
inner.withDescription(description);
|
|
2989
|
+
return builder;
|
|
2990
|
+
},
|
|
2991
|
+
withVmSize: (value) => {
|
|
2992
|
+
pushParam$15(params, VM_SIZE_PARAM, value);
|
|
2993
|
+
return builder;
|
|
2994
|
+
},
|
|
2995
|
+
withLocation: (value) => {
|
|
2996
|
+
pushParam$15(params, LOCATION_PARAM$1, value);
|
|
2997
|
+
return builder;
|
|
2998
|
+
},
|
|
2999
|
+
withResourceGroup: (value) => {
|
|
3000
|
+
pushParam$15(params, RESOURCE_GROUP_PARAM, value);
|
|
3001
|
+
return builder;
|
|
3002
|
+
},
|
|
3003
|
+
withAdminUsername: (value) => {
|
|
3004
|
+
pushParam$15(params, ADMIN_USERNAME_PARAM, value);
|
|
3005
|
+
return builder;
|
|
3006
|
+
},
|
|
3007
|
+
withImagePublisher: (value) => {
|
|
3008
|
+
pushParam$15(params, IMAGE_PUBLISHER_PARAM, value);
|
|
3009
|
+
return builder;
|
|
3010
|
+
},
|
|
3011
|
+
withImageOffer: (value) => {
|
|
3012
|
+
pushParam$15(params, IMAGE_OFFER_PARAM, value);
|
|
3013
|
+
return builder;
|
|
3014
|
+
},
|
|
3015
|
+
withImageSku: (value) => {
|
|
3016
|
+
pushParam$15(params, IMAGE_SKU_PARAM, value);
|
|
3017
|
+
return builder;
|
|
3018
|
+
},
|
|
3019
|
+
withSshPublicKey: (value) => {
|
|
3020
|
+
pushParam$15(params, SSH_PUBLIC_KEY_PARAM$1, value);
|
|
3021
|
+
return builder;
|
|
3022
|
+
},
|
|
3023
|
+
withOsDiskSizeGb: (value) => {
|
|
3024
|
+
pushParam$15(params, OS_DISK_SIZE_GB_PARAM, value);
|
|
3025
|
+
return builder;
|
|
3026
|
+
},
|
|
3027
|
+
build: () => inner.build()
|
|
3028
|
+
};
|
|
3029
|
+
return builder;
|
|
3030
|
+
};
|
|
3031
|
+
_AzureVm.satisfy = (blueprint) => {
|
|
3032
|
+
const params = getParametersInstance();
|
|
3033
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAzureVmType()).withParameters(params).withProvider("Azure").withId(buildId$17(blueprint.id.toString())).withVersion(buildVersion$17(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3034
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3035
|
+
const satisfiedBuilder = {
|
|
3036
|
+
withVmSize: (value) => {
|
|
3037
|
+
pushParam$15(params, VM_SIZE_PARAM, value);
|
|
3038
|
+
return satisfiedBuilder;
|
|
3039
|
+
},
|
|
3040
|
+
withLocation: (value) => {
|
|
3041
|
+
pushParam$15(params, LOCATION_PARAM$1, value);
|
|
3042
|
+
return satisfiedBuilder;
|
|
3043
|
+
},
|
|
3044
|
+
withResourceGroup: (value) => {
|
|
3045
|
+
pushParam$15(params, RESOURCE_GROUP_PARAM, value);
|
|
3046
|
+
return satisfiedBuilder;
|
|
3047
|
+
},
|
|
3048
|
+
withAdminUsername: (value) => {
|
|
3049
|
+
pushParam$15(params, ADMIN_USERNAME_PARAM, value);
|
|
3050
|
+
return satisfiedBuilder;
|
|
3051
|
+
},
|
|
3052
|
+
withImagePublisher: (value) => {
|
|
3053
|
+
pushParam$15(params, IMAGE_PUBLISHER_PARAM, value);
|
|
3054
|
+
return satisfiedBuilder;
|
|
3055
|
+
},
|
|
3056
|
+
withImageOffer: (value) => {
|
|
3057
|
+
pushParam$15(params, IMAGE_OFFER_PARAM, value);
|
|
3058
|
+
return satisfiedBuilder;
|
|
3059
|
+
},
|
|
3060
|
+
withImageSku: (value) => {
|
|
3061
|
+
pushParam$15(params, IMAGE_SKU_PARAM, value);
|
|
3062
|
+
return satisfiedBuilder;
|
|
3063
|
+
},
|
|
3064
|
+
withSshPublicKey: (value) => {
|
|
3065
|
+
pushParam$15(params, SSH_PUBLIC_KEY_PARAM$1, value);
|
|
3066
|
+
return satisfiedBuilder;
|
|
3067
|
+
},
|
|
3068
|
+
withOsDiskSizeGb: (value) => {
|
|
3069
|
+
pushParam$15(params, OS_DISK_SIZE_GB_PARAM, value);
|
|
3070
|
+
return satisfiedBuilder;
|
|
3071
|
+
},
|
|
3072
|
+
build: () => inner.build()
|
|
3073
|
+
};
|
|
3074
|
+
return satisfiedBuilder;
|
|
3075
|
+
};
|
|
3076
|
+
_AzureVm.create = (config) => {
|
|
3077
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withVmSize(config.vmSize).withLocation(config.location).withResourceGroup(config.resourceGroup).withAdminUsername(config.adminUsername).withImagePublisher(config.imagePublisher).withImageOffer(config.imageOffer).withImageSku(config.imageSku);
|
|
3078
|
+
if (config.description) b.withDescription(config.description);
|
|
3079
|
+
if (config.sshPublicKey) b.withSshPublicKey(config.sshPublicKey);
|
|
3080
|
+
if (config.osDiskSizeGb !== void 0) b.withOsDiskSizeGb(config.osDiskSizeGb);
|
|
3081
|
+
return b.build();
|
|
3082
|
+
};
|
|
3083
|
+
})(AzureVm || (AzureVm = {}));
|
|
3084
|
+
|
|
3085
|
+
//#endregion
|
|
3086
|
+
//#region src/live_system/component/network_and_compute/iaas/gcp_vpc.ts
|
|
3087
|
+
const GCP_VPC_TYPE_NAME = "GcpVpc";
|
|
3088
|
+
const AUTO_CREATE_SUBNETWORKS_PARAM = "autoCreateSubnetworks";
|
|
3089
|
+
const ROUTING_MODE_PARAM = "routingMode";
|
|
3090
|
+
function buildId$16(id) {
|
|
3091
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3092
|
+
}
|
|
3093
|
+
function buildVersion$16(major, minor, patch) {
|
|
3094
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3095
|
+
}
|
|
3096
|
+
function buildGcpVpcType() {
|
|
3097
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_VPC_TYPE_NAME).build()).build();
|
|
3098
|
+
}
|
|
3099
|
+
function pushParam$14(params, key, value) {
|
|
3100
|
+
params.push(key, value);
|
|
3101
|
+
}
|
|
3102
|
+
let GcpVpc;
|
|
3103
|
+
(function(_GcpVpc) {
|
|
3104
|
+
const getBuilder = _GcpVpc.getBuilder = () => {
|
|
3105
|
+
const params = getParametersInstance();
|
|
3106
|
+
const inner = getLiveSystemComponentBuilder().withType(buildGcpVpcType()).withParameters(params).withProvider("GCP");
|
|
3107
|
+
const builder = {
|
|
3108
|
+
withId: (id) => {
|
|
3109
|
+
inner.withId(buildId$16(id));
|
|
3110
|
+
return builder;
|
|
3111
|
+
},
|
|
3112
|
+
withVersion: (major, minor, patch) => {
|
|
3113
|
+
inner.withVersion(buildVersion$16(major, minor, patch));
|
|
3114
|
+
return builder;
|
|
3115
|
+
},
|
|
3116
|
+
withDisplayName: (displayName) => {
|
|
3117
|
+
inner.withDisplayName(displayName);
|
|
3118
|
+
return builder;
|
|
3119
|
+
},
|
|
3120
|
+
withDescription: (description) => {
|
|
3121
|
+
inner.withDescription(description);
|
|
3122
|
+
return builder;
|
|
3123
|
+
},
|
|
3124
|
+
withCidrBlock: (value) => {
|
|
3125
|
+
pushParam$14(params, CIDR_BLOCK_PARAM$1, value);
|
|
3126
|
+
return builder;
|
|
3127
|
+
},
|
|
3128
|
+
withAutoCreateSubnetworks: (value) => {
|
|
3129
|
+
pushParam$14(params, AUTO_CREATE_SUBNETWORKS_PARAM, value);
|
|
3130
|
+
return builder;
|
|
3131
|
+
},
|
|
3132
|
+
withRoutingMode: (value) => {
|
|
3133
|
+
pushParam$14(params, ROUTING_MODE_PARAM, value);
|
|
3134
|
+
return builder;
|
|
3135
|
+
},
|
|
3136
|
+
build: () => inner.build()
|
|
3137
|
+
};
|
|
3138
|
+
return builder;
|
|
3139
|
+
};
|
|
3140
|
+
_GcpVpc.satisfy = (blueprint) => {
|
|
3141
|
+
const params = getParametersInstance();
|
|
3142
|
+
const inner = getLiveSystemComponentBuilder().withType(buildGcpVpcType()).withParameters(params).withProvider("GCP").withId(buildId$16(blueprint.id.toString())).withVersion(buildVersion$16(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3143
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3144
|
+
const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
|
|
3145
|
+
if (cidrBlock !== null) pushParam$14(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
|
|
3146
|
+
const satisfiedBuilder = {
|
|
3147
|
+
withAutoCreateSubnetworks: (value) => {
|
|
3148
|
+
pushParam$14(params, AUTO_CREATE_SUBNETWORKS_PARAM, value);
|
|
3149
|
+
return satisfiedBuilder;
|
|
3150
|
+
},
|
|
3151
|
+
withRoutingMode: (value) => {
|
|
3152
|
+
pushParam$14(params, ROUTING_MODE_PARAM, value);
|
|
3153
|
+
return satisfiedBuilder;
|
|
3154
|
+
},
|
|
3155
|
+
build: () => inner.build()
|
|
3156
|
+
};
|
|
3157
|
+
return satisfiedBuilder;
|
|
3158
|
+
};
|
|
3159
|
+
_GcpVpc.create = (config) => {
|
|
3160
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock);
|
|
3161
|
+
if (config.description) b.withDescription(config.description);
|
|
3162
|
+
if (config.autoCreateSubnetworks !== void 0) b.withAutoCreateSubnetworks(config.autoCreateSubnetworks);
|
|
3163
|
+
if (config.routingMode) b.withRoutingMode(config.routingMode);
|
|
3164
|
+
return b.build();
|
|
3165
|
+
};
|
|
3166
|
+
})(GcpVpc || (GcpVpc = {}));
|
|
3167
|
+
|
|
3168
|
+
//#endregion
|
|
3169
|
+
//#region src/live_system/component/network_and_compute/iaas/gcp_subnet.ts
|
|
3170
|
+
const GCP_SUBNET_TYPE_NAME = "GcpSubnet";
|
|
3171
|
+
const REGION_PARAM = "region";
|
|
3172
|
+
const PRIVATE_IP_GOOGLE_ACCESS_PARAM = "privateIpGoogleAccess";
|
|
3173
|
+
function buildId$15(id) {
|
|
3174
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3175
|
+
}
|
|
3176
|
+
function buildVersion$15(major, minor, patch) {
|
|
3177
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3178
|
+
}
|
|
3179
|
+
function buildGcpSubnetType() {
|
|
3180
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_SUBNET_TYPE_NAME).build()).build();
|
|
3181
|
+
}
|
|
3182
|
+
function pushParam$13(params, key, value) {
|
|
3183
|
+
params.push(key, value);
|
|
3184
|
+
}
|
|
3185
|
+
let GcpSubnet;
|
|
3186
|
+
(function(_GcpSubnet) {
|
|
3187
|
+
const getBuilder = _GcpSubnet.getBuilder = () => {
|
|
3188
|
+
const params = getParametersInstance();
|
|
3189
|
+
const inner = getLiveSystemComponentBuilder().withType(buildGcpSubnetType()).withParameters(params).withProvider("GCP");
|
|
3190
|
+
const builder = {
|
|
3191
|
+
withId: (id) => {
|
|
3192
|
+
inner.withId(buildId$15(id));
|
|
3193
|
+
return builder;
|
|
3194
|
+
},
|
|
3195
|
+
withVersion: (major, minor, patch) => {
|
|
3196
|
+
inner.withVersion(buildVersion$15(major, minor, patch));
|
|
3197
|
+
return builder;
|
|
3198
|
+
},
|
|
3199
|
+
withDisplayName: (displayName) => {
|
|
3200
|
+
inner.withDisplayName(displayName);
|
|
3201
|
+
return builder;
|
|
3202
|
+
},
|
|
3203
|
+
withDescription: (description) => {
|
|
3204
|
+
inner.withDescription(description);
|
|
3205
|
+
return builder;
|
|
3206
|
+
},
|
|
3207
|
+
withCidrBlock: (value) => {
|
|
3208
|
+
pushParam$13(params, CIDR_BLOCK_PARAM, value);
|
|
3209
|
+
return builder;
|
|
3210
|
+
},
|
|
3211
|
+
withRegion: (value) => {
|
|
3212
|
+
pushParam$13(params, REGION_PARAM, value);
|
|
3213
|
+
return builder;
|
|
3214
|
+
},
|
|
3215
|
+
withPrivateIpGoogleAccess: (value) => {
|
|
3216
|
+
pushParam$13(params, PRIVATE_IP_GOOGLE_ACCESS_PARAM, value);
|
|
3217
|
+
return builder;
|
|
3218
|
+
},
|
|
3219
|
+
build: () => inner.build()
|
|
3220
|
+
};
|
|
3221
|
+
return builder;
|
|
3222
|
+
};
|
|
3223
|
+
_GcpSubnet.satisfy = (blueprint) => {
|
|
3224
|
+
const params = getParametersInstance();
|
|
3225
|
+
const inner = getLiveSystemComponentBuilder().withType(buildGcpSubnetType()).withParameters(params).withProvider("GCP").withId(buildId$15(blueprint.id.toString())).withVersion(buildVersion$15(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3226
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3227
|
+
const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
|
|
3228
|
+
if (cidrBlock !== null) pushParam$13(params, CIDR_BLOCK_PARAM, String(cidrBlock));
|
|
3229
|
+
const satisfiedBuilder = {
|
|
3230
|
+
withRegion: (value) => {
|
|
3231
|
+
pushParam$13(params, REGION_PARAM, value);
|
|
3232
|
+
return satisfiedBuilder;
|
|
3233
|
+
},
|
|
3234
|
+
withPrivateIpGoogleAccess: (value) => {
|
|
3235
|
+
pushParam$13(params, PRIVATE_IP_GOOGLE_ACCESS_PARAM, value);
|
|
3236
|
+
return satisfiedBuilder;
|
|
3237
|
+
},
|
|
3238
|
+
build: () => inner.build()
|
|
3239
|
+
};
|
|
3240
|
+
return satisfiedBuilder;
|
|
3241
|
+
};
|
|
3242
|
+
_GcpSubnet.create = (config) => {
|
|
3243
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withRegion(config.region);
|
|
3244
|
+
if (config.description) b.withDescription(config.description);
|
|
3245
|
+
if (config.privateIpGoogleAccess !== void 0) b.withPrivateIpGoogleAccess(config.privateIpGoogleAccess);
|
|
3246
|
+
return b.build();
|
|
3247
|
+
};
|
|
3248
|
+
})(GcpSubnet || (GcpSubnet = {}));
|
|
3249
|
+
|
|
3250
|
+
//#endregion
|
|
3251
|
+
//#region src/live_system/component/network_and_compute/iaas/gcp_firewall.ts
|
|
3252
|
+
const GCP_FIREWALL_TYPE_NAME = "GcpFirewall";
|
|
3253
|
+
function buildId$14(id) {
|
|
3254
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3255
|
+
}
|
|
3256
|
+
function buildVersion$14(major, minor, patch) {
|
|
3257
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3258
|
+
}
|
|
3259
|
+
function buildGcpFirewallType() {
|
|
3260
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_FIREWALL_TYPE_NAME).build()).build();
|
|
3261
|
+
}
|
|
3262
|
+
function pushParam$12(params, key, value) {
|
|
3263
|
+
params.push(key, value);
|
|
3264
|
+
}
|
|
3265
|
+
let GcpFirewall;
|
|
3266
|
+
(function(_GcpFirewall) {
|
|
3267
|
+
const getBuilder = _GcpFirewall.getBuilder = () => {
|
|
3268
|
+
const params = getParametersInstance();
|
|
3269
|
+
const inner = getLiveSystemComponentBuilder().withType(buildGcpFirewallType()).withParameters(params).withProvider("GCP");
|
|
3270
|
+
const builder = {
|
|
3271
|
+
withId: (id) => {
|
|
3272
|
+
inner.withId(buildId$14(id));
|
|
3273
|
+
return builder;
|
|
3274
|
+
},
|
|
3275
|
+
withVersion: (major, minor, patch) => {
|
|
3276
|
+
inner.withVersion(buildVersion$14(major, minor, patch));
|
|
3277
|
+
return builder;
|
|
3278
|
+
},
|
|
3279
|
+
withDisplayName: (displayName) => {
|
|
3280
|
+
inner.withDisplayName(displayName);
|
|
3281
|
+
return builder;
|
|
3282
|
+
},
|
|
3283
|
+
withDescription: (description) => {
|
|
3284
|
+
inner.withDescription(description);
|
|
3285
|
+
pushParam$12(params, DESCRIPTION_PARAM, description);
|
|
3286
|
+
return builder;
|
|
3287
|
+
},
|
|
3288
|
+
withIngressRules: (rules) => {
|
|
3289
|
+
pushParam$12(params, INGRESS_RULES_PARAM, rules);
|
|
3290
|
+
return builder;
|
|
3291
|
+
},
|
|
3292
|
+
build: () => inner.build()
|
|
3293
|
+
};
|
|
3294
|
+
return builder;
|
|
3295
|
+
};
|
|
3296
|
+
_GcpFirewall.satisfy = (blueprint) => {
|
|
3297
|
+
const params = getParametersInstance();
|
|
3298
|
+
const inner = getLiveSystemComponentBuilder().withType(buildGcpFirewallType()).withParameters(params).withProvider("GCP").withId(buildId$14(blueprint.id.toString())).withVersion(buildVersion$14(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3299
|
+
const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
|
|
3300
|
+
if (description !== null) {
|
|
3301
|
+
inner.withDescription(String(description));
|
|
3302
|
+
pushParam$12(params, DESCRIPTION_PARAM, String(description));
|
|
3303
|
+
} else if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3304
|
+
const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
|
|
3305
|
+
if (ingressRules !== null) pushParam$12(params, INGRESS_RULES_PARAM, ingressRules);
|
|
3306
|
+
return { build: () => inner.build() };
|
|
3307
|
+
};
|
|
3308
|
+
_GcpFirewall.create = (config) => {
|
|
3309
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
|
|
3310
|
+
if (config.description) b.withDescription(config.description);
|
|
3311
|
+
if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
|
|
3312
|
+
return b.build();
|
|
3313
|
+
};
|
|
3314
|
+
})(GcpFirewall || (GcpFirewall = {}));
|
|
3315
|
+
|
|
3316
|
+
//#endregion
|
|
3317
|
+
//#region src/live_system/component/network_and_compute/iaas/gcp_vm.ts
|
|
3318
|
+
const GCP_VM_TYPE_NAME = "GcpVm";
|
|
3319
|
+
const MACHINE_TYPE_PARAM = "machineType";
|
|
3320
|
+
const ZONE_PARAM = "zone";
|
|
3321
|
+
const IMAGE_PROJECT_PARAM = "imageProject";
|
|
3322
|
+
const IMAGE_FAMILY_PARAM = "imageFamily";
|
|
3323
|
+
const SERVICE_ACCOUNT_EMAIL_PARAM = "serviceAccountEmail";
|
|
3324
|
+
function buildId$13(id) {
|
|
3325
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3326
|
+
}
|
|
3327
|
+
function buildVersion$13(major, minor, patch) {
|
|
3328
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3329
|
+
}
|
|
3330
|
+
function buildGcpVmType() {
|
|
3331
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(GCP_VM_TYPE_NAME).build()).build();
|
|
3332
|
+
}
|
|
3333
|
+
function pushParam$11(params, key, value) {
|
|
3334
|
+
params.push(key, value);
|
|
3335
|
+
}
|
|
3336
|
+
let GcpVm;
|
|
3337
|
+
(function(_GcpVm) {
|
|
3338
|
+
const getBuilder = _GcpVm.getBuilder = () => {
|
|
3339
|
+
const params = getParametersInstance();
|
|
3340
|
+
const inner = getLiveSystemComponentBuilder().withType(buildGcpVmType()).withParameters(params).withProvider("GCP");
|
|
3341
|
+
const builder = {
|
|
3342
|
+
withId: (id) => {
|
|
3343
|
+
inner.withId(buildId$13(id));
|
|
3344
|
+
return builder;
|
|
3345
|
+
},
|
|
3346
|
+
withVersion: (major, minor, patch) => {
|
|
3347
|
+
inner.withVersion(buildVersion$13(major, minor, patch));
|
|
3348
|
+
return builder;
|
|
3349
|
+
},
|
|
3350
|
+
withDisplayName: (displayName) => {
|
|
3351
|
+
inner.withDisplayName(displayName);
|
|
3352
|
+
return builder;
|
|
3353
|
+
},
|
|
3354
|
+
withDescription: (description) => {
|
|
3355
|
+
inner.withDescription(description);
|
|
3356
|
+
return builder;
|
|
3357
|
+
},
|
|
3358
|
+
withMachineType: (value) => {
|
|
3359
|
+
pushParam$11(params, MACHINE_TYPE_PARAM, value);
|
|
3360
|
+
return builder;
|
|
3361
|
+
},
|
|
3362
|
+
withZone: (value) => {
|
|
3363
|
+
pushParam$11(params, ZONE_PARAM, value);
|
|
3364
|
+
return builder;
|
|
3365
|
+
},
|
|
3366
|
+
withImageProject: (value) => {
|
|
3367
|
+
pushParam$11(params, IMAGE_PROJECT_PARAM, value);
|
|
3368
|
+
return builder;
|
|
3369
|
+
},
|
|
3370
|
+
withImageFamily: (value) => {
|
|
3371
|
+
pushParam$11(params, IMAGE_FAMILY_PARAM, value);
|
|
3372
|
+
return builder;
|
|
3373
|
+
},
|
|
3374
|
+
withServiceAccountEmail: (value) => {
|
|
3375
|
+
pushParam$11(params, SERVICE_ACCOUNT_EMAIL_PARAM, value);
|
|
3376
|
+
return builder;
|
|
3377
|
+
},
|
|
3378
|
+
build: () => inner.build()
|
|
3379
|
+
};
|
|
3380
|
+
return builder;
|
|
3381
|
+
};
|
|
3382
|
+
_GcpVm.satisfy = (blueprint) => {
|
|
3383
|
+
const params = getParametersInstance();
|
|
3384
|
+
const inner = getLiveSystemComponentBuilder().withType(buildGcpVmType()).withParameters(params).withProvider("GCP").withId(buildId$13(blueprint.id.toString())).withVersion(buildVersion$13(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3385
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3386
|
+
const satisfiedBuilder = {
|
|
3387
|
+
withMachineType: (value) => {
|
|
3388
|
+
pushParam$11(params, MACHINE_TYPE_PARAM, value);
|
|
3389
|
+
return satisfiedBuilder;
|
|
3390
|
+
},
|
|
3391
|
+
withZone: (value) => {
|
|
3392
|
+
pushParam$11(params, ZONE_PARAM, value);
|
|
3393
|
+
return satisfiedBuilder;
|
|
3394
|
+
},
|
|
3395
|
+
withImageProject: (value) => {
|
|
3396
|
+
pushParam$11(params, IMAGE_PROJECT_PARAM, value);
|
|
3397
|
+
return satisfiedBuilder;
|
|
3398
|
+
},
|
|
3399
|
+
withImageFamily: (value) => {
|
|
3400
|
+
pushParam$11(params, IMAGE_FAMILY_PARAM, value);
|
|
3401
|
+
return satisfiedBuilder;
|
|
3402
|
+
},
|
|
3403
|
+
withServiceAccountEmail: (value) => {
|
|
3404
|
+
pushParam$11(params, SERVICE_ACCOUNT_EMAIL_PARAM, value);
|
|
3405
|
+
return satisfiedBuilder;
|
|
3406
|
+
},
|
|
3407
|
+
build: () => inner.build()
|
|
3408
|
+
};
|
|
3409
|
+
return satisfiedBuilder;
|
|
3410
|
+
};
|
|
3411
|
+
_GcpVm.create = (config) => {
|
|
3412
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withMachineType(config.machineType).withZone(config.zone).withImageProject(config.imageProject);
|
|
3413
|
+
if (config.description) b.withDescription(config.description);
|
|
3414
|
+
if (config.imageFamily) b.withImageFamily(config.imageFamily);
|
|
3415
|
+
if (config.serviceAccountEmail) b.withServiceAccountEmail(config.serviceAccountEmail);
|
|
3416
|
+
return b.build();
|
|
3417
|
+
};
|
|
3418
|
+
})(GcpVm || (GcpVm = {}));
|
|
3419
|
+
|
|
3420
|
+
//#endregion
|
|
3421
|
+
//#region src/live_system/component/network_and_compute/iaas/oci_vcn.ts
|
|
3422
|
+
const OCI_VCN_TYPE_NAME = "OciVcn";
|
|
3423
|
+
const COMPARTMENT_ID_PARAM$3 = "compartmentId";
|
|
3424
|
+
function buildId$12(id) {
|
|
3425
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3426
|
+
}
|
|
3427
|
+
function buildVersion$12(major, minor, patch) {
|
|
3428
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3429
|
+
}
|
|
3430
|
+
function buildOciVcnType() {
|
|
3431
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_VCN_TYPE_NAME).build()).build();
|
|
3432
|
+
}
|
|
3433
|
+
function pushParam$10(params, key, value) {
|
|
3434
|
+
params.push(key, value);
|
|
3435
|
+
}
|
|
3436
|
+
let OciVcn;
|
|
3437
|
+
(function(_OciVcn) {
|
|
3438
|
+
const getBuilder = _OciVcn.getBuilder = () => {
|
|
3439
|
+
const params = getParametersInstance();
|
|
3440
|
+
const inner = getLiveSystemComponentBuilder().withType(buildOciVcnType()).withParameters(params).withProvider("OCI");
|
|
3441
|
+
const builder = {
|
|
3442
|
+
withId: (id) => {
|
|
3443
|
+
inner.withId(buildId$12(id));
|
|
3444
|
+
return builder;
|
|
3445
|
+
},
|
|
3446
|
+
withVersion: (major, minor, patch) => {
|
|
3447
|
+
inner.withVersion(buildVersion$12(major, minor, patch));
|
|
3448
|
+
return builder;
|
|
3449
|
+
},
|
|
3450
|
+
withDisplayName: (displayName) => {
|
|
3451
|
+
inner.withDisplayName(displayName);
|
|
3452
|
+
return builder;
|
|
3453
|
+
},
|
|
3454
|
+
withDescription: (description) => {
|
|
3455
|
+
inner.withDescription(description);
|
|
3456
|
+
return builder;
|
|
3457
|
+
},
|
|
3458
|
+
withCidrBlock: (value) => {
|
|
3459
|
+
pushParam$10(params, CIDR_BLOCK_PARAM$1, value);
|
|
3460
|
+
return builder;
|
|
3461
|
+
},
|
|
3462
|
+
withCompartmentId: (value) => {
|
|
3463
|
+
pushParam$10(params, COMPARTMENT_ID_PARAM$3, value);
|
|
3464
|
+
return builder;
|
|
3465
|
+
},
|
|
3466
|
+
build: () => inner.build()
|
|
3467
|
+
};
|
|
3468
|
+
return builder;
|
|
3469
|
+
};
|
|
3470
|
+
_OciVcn.satisfy = (blueprint) => {
|
|
3471
|
+
const params = getParametersInstance();
|
|
3472
|
+
const inner = getLiveSystemComponentBuilder().withType(buildOciVcnType()).withParameters(params).withProvider("OCI").withId(buildId$12(blueprint.id.toString())).withVersion(buildVersion$12(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3473
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3474
|
+
const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
|
|
3475
|
+
if (cidrBlock !== null) pushParam$10(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
|
|
3476
|
+
const satisfiedBuilder = {
|
|
3477
|
+
withCompartmentId: (value) => {
|
|
3478
|
+
pushParam$10(params, COMPARTMENT_ID_PARAM$3, value);
|
|
3479
|
+
return satisfiedBuilder;
|
|
3480
|
+
},
|
|
3481
|
+
build: () => inner.build()
|
|
3482
|
+
};
|
|
3483
|
+
return satisfiedBuilder;
|
|
3484
|
+
};
|
|
3485
|
+
_OciVcn.create = (config) => {
|
|
3486
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withCompartmentId(config.compartmentId);
|
|
3487
|
+
if (config.description) b.withDescription(config.description);
|
|
3488
|
+
return b.build();
|
|
3489
|
+
};
|
|
3490
|
+
})(OciVcn || (OciVcn = {}));
|
|
3491
|
+
|
|
3492
|
+
//#endregion
|
|
3493
|
+
//#region src/live_system/component/network_and_compute/iaas/oci_subnet.ts
|
|
3494
|
+
const OCI_SUBNET_TYPE_NAME = "OciSubnet";
|
|
3495
|
+
const COMPARTMENT_ID_PARAM$2 = "compartmentId";
|
|
3496
|
+
const AVAILABILITY_DOMAIN_PARAM$1 = "availabilityDomain";
|
|
3497
|
+
const PROHIBIT_PUBLIC_IP_PARAM = "prohibitPublicIpOnVnic";
|
|
3498
|
+
function buildId$11(id) {
|
|
3499
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3500
|
+
}
|
|
3501
|
+
function buildVersion$11(major, minor, patch) {
|
|
3502
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3503
|
+
}
|
|
3504
|
+
function buildOciSubnetType() {
|
|
3505
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_SUBNET_TYPE_NAME).build()).build();
|
|
3506
|
+
}
|
|
3507
|
+
function pushParam$9(params, key, value) {
|
|
3508
|
+
params.push(key, value);
|
|
3509
|
+
}
|
|
3510
|
+
let OciSubnet;
|
|
3511
|
+
(function(_OciSubnet) {
|
|
3512
|
+
const getBuilder = _OciSubnet.getBuilder = () => {
|
|
3513
|
+
const params = getParametersInstance();
|
|
3514
|
+
const inner = getLiveSystemComponentBuilder().withType(buildOciSubnetType()).withParameters(params).withProvider("OCI");
|
|
3515
|
+
const builder = {
|
|
3516
|
+
withId: (id) => {
|
|
3517
|
+
inner.withId(buildId$11(id));
|
|
3518
|
+
return builder;
|
|
3519
|
+
},
|
|
3520
|
+
withVersion: (major, minor, patch) => {
|
|
3521
|
+
inner.withVersion(buildVersion$11(major, minor, patch));
|
|
3522
|
+
return builder;
|
|
3523
|
+
},
|
|
3524
|
+
withDisplayName: (displayName) => {
|
|
3525
|
+
inner.withDisplayName(displayName);
|
|
3526
|
+
return builder;
|
|
3527
|
+
},
|
|
3528
|
+
withDescription: (description) => {
|
|
3529
|
+
inner.withDescription(description);
|
|
3530
|
+
return builder;
|
|
3531
|
+
},
|
|
3532
|
+
withCidrBlock: (value) => {
|
|
3533
|
+
pushParam$9(params, CIDR_BLOCK_PARAM, value);
|
|
3534
|
+
return builder;
|
|
3535
|
+
},
|
|
3536
|
+
withCompartmentId: (value) => {
|
|
3537
|
+
pushParam$9(params, COMPARTMENT_ID_PARAM$2, value);
|
|
3538
|
+
return builder;
|
|
3539
|
+
},
|
|
3540
|
+
withAvailabilityDomain: (value) => {
|
|
3541
|
+
pushParam$9(params, AVAILABILITY_DOMAIN_PARAM$1, value);
|
|
3542
|
+
return builder;
|
|
3543
|
+
},
|
|
3544
|
+
withProhibitPublicIpOnVnic: (value) => {
|
|
3545
|
+
pushParam$9(params, PROHIBIT_PUBLIC_IP_PARAM, value);
|
|
3546
|
+
return builder;
|
|
3547
|
+
},
|
|
3548
|
+
build: () => inner.build()
|
|
3549
|
+
};
|
|
3550
|
+
return builder;
|
|
3551
|
+
};
|
|
3552
|
+
_OciSubnet.satisfy = (blueprint) => {
|
|
3553
|
+
const params = getParametersInstance();
|
|
3554
|
+
const inner = getLiveSystemComponentBuilder().withType(buildOciSubnetType()).withParameters(params).withProvider("OCI").withId(buildId$11(blueprint.id.toString())).withVersion(buildVersion$11(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3555
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3556
|
+
const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
|
|
3557
|
+
if (cidrBlock !== null) pushParam$9(params, CIDR_BLOCK_PARAM, String(cidrBlock));
|
|
3558
|
+
const satisfiedBuilder = {
|
|
3559
|
+
withCompartmentId: (value) => {
|
|
3560
|
+
pushParam$9(params, COMPARTMENT_ID_PARAM$2, value);
|
|
3561
|
+
return satisfiedBuilder;
|
|
3562
|
+
},
|
|
3563
|
+
withAvailabilityDomain: (value) => {
|
|
3564
|
+
pushParam$9(params, AVAILABILITY_DOMAIN_PARAM$1, value);
|
|
3565
|
+
return satisfiedBuilder;
|
|
3566
|
+
},
|
|
3567
|
+
withProhibitPublicIpOnVnic: (value) => {
|
|
3568
|
+
pushParam$9(params, PROHIBIT_PUBLIC_IP_PARAM, value);
|
|
3569
|
+
return satisfiedBuilder;
|
|
3570
|
+
},
|
|
3571
|
+
build: () => inner.build()
|
|
3572
|
+
};
|
|
3573
|
+
return satisfiedBuilder;
|
|
3574
|
+
};
|
|
3575
|
+
_OciSubnet.create = (config) => {
|
|
3576
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withCompartmentId(config.compartmentId);
|
|
3577
|
+
if (config.description) b.withDescription(config.description);
|
|
3578
|
+
if (config.availabilityDomain) b.withAvailabilityDomain(config.availabilityDomain);
|
|
3579
|
+
if (config.prohibitPublicIpOnVnic !== void 0) b.withProhibitPublicIpOnVnic(config.prohibitPublicIpOnVnic);
|
|
3580
|
+
return b.build();
|
|
3581
|
+
};
|
|
3582
|
+
})(OciSubnet || (OciSubnet = {}));
|
|
3583
|
+
|
|
3584
|
+
//#endregion
|
|
3585
|
+
//#region src/live_system/component/network_and_compute/iaas/oci_security_list.ts
|
|
3586
|
+
const OCI_SECURITY_LIST_TYPE_NAME = "OciSecurityList";
|
|
3587
|
+
const COMPARTMENT_ID_PARAM$1 = "compartmentId";
|
|
3588
|
+
function buildId$10(id) {
|
|
3589
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3590
|
+
}
|
|
3591
|
+
function buildVersion$10(major, minor, patch) {
|
|
3592
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3593
|
+
}
|
|
3594
|
+
function buildOciSecurityListType() {
|
|
3595
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_SECURITY_LIST_TYPE_NAME).build()).build();
|
|
3596
|
+
}
|
|
3597
|
+
function pushParam$8(params, key, value) {
|
|
3598
|
+
params.push(key, value);
|
|
3599
|
+
}
|
|
3600
|
+
let OciSecurityList;
|
|
3601
|
+
(function(_OciSecurityList) {
|
|
3602
|
+
const getBuilder = _OciSecurityList.getBuilder = () => {
|
|
3603
|
+
const params = getParametersInstance();
|
|
3604
|
+
const inner = getLiveSystemComponentBuilder().withType(buildOciSecurityListType()).withParameters(params).withProvider("OCI");
|
|
3605
|
+
const builder = {
|
|
3606
|
+
withId: (id) => {
|
|
3607
|
+
inner.withId(buildId$10(id));
|
|
3608
|
+
return builder;
|
|
3609
|
+
},
|
|
3610
|
+
withVersion: (major, minor, patch) => {
|
|
3611
|
+
inner.withVersion(buildVersion$10(major, minor, patch));
|
|
3612
|
+
return builder;
|
|
3613
|
+
},
|
|
3614
|
+
withDisplayName: (displayName) => {
|
|
3615
|
+
inner.withDisplayName(displayName);
|
|
3616
|
+
return builder;
|
|
3617
|
+
},
|
|
3618
|
+
withDescription: (description) => {
|
|
3619
|
+
inner.withDescription(description);
|
|
3620
|
+
pushParam$8(params, DESCRIPTION_PARAM, description);
|
|
3621
|
+
return builder;
|
|
3622
|
+
},
|
|
3623
|
+
withIngressRules: (rules) => {
|
|
3624
|
+
pushParam$8(params, INGRESS_RULES_PARAM, rules);
|
|
3625
|
+
return builder;
|
|
3626
|
+
},
|
|
3627
|
+
withCompartmentId: (value) => {
|
|
3628
|
+
pushParam$8(params, COMPARTMENT_ID_PARAM$1, value);
|
|
3629
|
+
return builder;
|
|
3630
|
+
},
|
|
3631
|
+
build: () => inner.build()
|
|
3632
|
+
};
|
|
3633
|
+
return builder;
|
|
3634
|
+
};
|
|
3635
|
+
_OciSecurityList.satisfy = (blueprint) => {
|
|
3636
|
+
const params = getParametersInstance();
|
|
3637
|
+
const inner = getLiveSystemComponentBuilder().withType(buildOciSecurityListType()).withParameters(params).withProvider("OCI").withId(buildId$10(blueprint.id.toString())).withVersion(buildVersion$10(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3638
|
+
const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
|
|
3639
|
+
if (description !== null) {
|
|
3640
|
+
inner.withDescription(String(description));
|
|
3641
|
+
pushParam$8(params, DESCRIPTION_PARAM, String(description));
|
|
3642
|
+
} else if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3643
|
+
const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
|
|
3644
|
+
if (ingressRules !== null) pushParam$8(params, INGRESS_RULES_PARAM, ingressRules);
|
|
3645
|
+
const satisfiedBuilder = {
|
|
3646
|
+
withCompartmentId: (value) => {
|
|
3647
|
+
pushParam$8(params, COMPARTMENT_ID_PARAM$1, value);
|
|
3648
|
+
return satisfiedBuilder;
|
|
3649
|
+
},
|
|
3650
|
+
build: () => inner.build()
|
|
3651
|
+
};
|
|
3652
|
+
return satisfiedBuilder;
|
|
3653
|
+
};
|
|
3654
|
+
_OciSecurityList.create = (config) => {
|
|
3655
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCompartmentId(config.compartmentId);
|
|
3656
|
+
if (config.description) b.withDescription(config.description);
|
|
3657
|
+
if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
|
|
3658
|
+
return b.build();
|
|
3659
|
+
};
|
|
3660
|
+
})(OciSecurityList || (OciSecurityList = {}));
|
|
3661
|
+
|
|
3662
|
+
//#endregion
|
|
3663
|
+
//#region src/live_system/component/network_and_compute/iaas/oci_instance.ts
|
|
3664
|
+
const OCI_INSTANCE_TYPE_NAME = "OciInstance";
|
|
3665
|
+
const COMPARTMENT_ID_PARAM = "compartmentId";
|
|
3666
|
+
const AVAILABILITY_DOMAIN_PARAM = "availabilityDomain";
|
|
3667
|
+
const SHAPE_PARAM = "shape";
|
|
3668
|
+
const IMAGE_ID_PARAM = "imageId";
|
|
3669
|
+
const OCPUS_PARAM = "ocpus";
|
|
3670
|
+
const MEMORY_IN_GBS_PARAM = "memoryInGbs";
|
|
3671
|
+
const SSH_PUBLIC_KEY_PARAM = "sshPublicKey";
|
|
3672
|
+
function buildId$9(id) {
|
|
3673
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3674
|
+
}
|
|
3675
|
+
function buildVersion$9(major, minor, patch) {
|
|
3676
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3677
|
+
}
|
|
3678
|
+
function buildOciInstanceType() {
|
|
3679
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(OCI_INSTANCE_TYPE_NAME).build()).build();
|
|
3680
|
+
}
|
|
3681
|
+
function pushParam$7(params, key, value) {
|
|
3682
|
+
params.push(key, value);
|
|
3683
|
+
}
|
|
3684
|
+
let OciInstance;
|
|
3685
|
+
(function(_OciInstance) {
|
|
3686
|
+
const getBuilder = _OciInstance.getBuilder = () => {
|
|
3687
|
+
const params = getParametersInstance();
|
|
3688
|
+
const inner = getLiveSystemComponentBuilder().withType(buildOciInstanceType()).withParameters(params).withProvider("OCI");
|
|
3689
|
+
const builder = {
|
|
3690
|
+
withId: (id) => {
|
|
3691
|
+
inner.withId(buildId$9(id));
|
|
3692
|
+
return builder;
|
|
3693
|
+
},
|
|
3694
|
+
withVersion: (major, minor, patch) => {
|
|
3695
|
+
inner.withVersion(buildVersion$9(major, minor, patch));
|
|
3696
|
+
return builder;
|
|
3697
|
+
},
|
|
3698
|
+
withDisplayName: (displayName) => {
|
|
3699
|
+
inner.withDisplayName(displayName);
|
|
3700
|
+
return builder;
|
|
3701
|
+
},
|
|
3702
|
+
withDescription: (description) => {
|
|
3703
|
+
inner.withDescription(description);
|
|
3704
|
+
return builder;
|
|
3705
|
+
},
|
|
3706
|
+
withCompartmentId: (value) => {
|
|
3707
|
+
pushParam$7(params, COMPARTMENT_ID_PARAM, value);
|
|
3708
|
+
return builder;
|
|
3709
|
+
},
|
|
3710
|
+
withAvailabilityDomain: (value) => {
|
|
3711
|
+
pushParam$7(params, AVAILABILITY_DOMAIN_PARAM, value);
|
|
3712
|
+
return builder;
|
|
3713
|
+
},
|
|
3714
|
+
withShape: (value) => {
|
|
3715
|
+
pushParam$7(params, SHAPE_PARAM, value);
|
|
3716
|
+
return builder;
|
|
3717
|
+
},
|
|
3718
|
+
withImageId: (value) => {
|
|
3719
|
+
pushParam$7(params, IMAGE_ID_PARAM, value);
|
|
3720
|
+
return builder;
|
|
3721
|
+
},
|
|
3722
|
+
withOcpus: (value) => {
|
|
3723
|
+
pushParam$7(params, OCPUS_PARAM, value);
|
|
3724
|
+
return builder;
|
|
3725
|
+
},
|
|
3726
|
+
withMemoryInGbs: (value) => {
|
|
3727
|
+
pushParam$7(params, MEMORY_IN_GBS_PARAM, value);
|
|
3728
|
+
return builder;
|
|
3729
|
+
},
|
|
3730
|
+
withSshPublicKey: (value) => {
|
|
3731
|
+
pushParam$7(params, SSH_PUBLIC_KEY_PARAM, value);
|
|
3732
|
+
return builder;
|
|
3733
|
+
},
|
|
3734
|
+
build: () => inner.build()
|
|
3735
|
+
};
|
|
3736
|
+
return builder;
|
|
3737
|
+
};
|
|
3738
|
+
_OciInstance.satisfy = (blueprint) => {
|
|
3739
|
+
const params = getParametersInstance();
|
|
3740
|
+
const inner = getLiveSystemComponentBuilder().withType(buildOciInstanceType()).withParameters(params).withProvider("OCI").withId(buildId$9(blueprint.id.toString())).withVersion(buildVersion$9(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3741
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3742
|
+
const satisfiedBuilder = {
|
|
3743
|
+
withCompartmentId: (value) => {
|
|
3744
|
+
pushParam$7(params, COMPARTMENT_ID_PARAM, value);
|
|
3745
|
+
return satisfiedBuilder;
|
|
3746
|
+
},
|
|
3747
|
+
withAvailabilityDomain: (value) => {
|
|
3748
|
+
pushParam$7(params, AVAILABILITY_DOMAIN_PARAM, value);
|
|
3749
|
+
return satisfiedBuilder;
|
|
3750
|
+
},
|
|
3751
|
+
withShape: (value) => {
|
|
3752
|
+
pushParam$7(params, SHAPE_PARAM, value);
|
|
3753
|
+
return satisfiedBuilder;
|
|
3754
|
+
},
|
|
3755
|
+
withImageId: (value) => {
|
|
3756
|
+
pushParam$7(params, IMAGE_ID_PARAM, value);
|
|
3757
|
+
return satisfiedBuilder;
|
|
3758
|
+
},
|
|
3759
|
+
withOcpus: (value) => {
|
|
3760
|
+
pushParam$7(params, OCPUS_PARAM, value);
|
|
3761
|
+
return satisfiedBuilder;
|
|
3762
|
+
},
|
|
3763
|
+
withMemoryInGbs: (value) => {
|
|
3764
|
+
pushParam$7(params, MEMORY_IN_GBS_PARAM, value);
|
|
3765
|
+
return satisfiedBuilder;
|
|
3766
|
+
},
|
|
3767
|
+
withSshPublicKey: (value) => {
|
|
3768
|
+
pushParam$7(params, SSH_PUBLIC_KEY_PARAM, value);
|
|
3769
|
+
return satisfiedBuilder;
|
|
3770
|
+
},
|
|
3771
|
+
build: () => inner.build()
|
|
3772
|
+
};
|
|
3773
|
+
return satisfiedBuilder;
|
|
3774
|
+
};
|
|
3775
|
+
_OciInstance.create = (config) => {
|
|
3776
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCompartmentId(config.compartmentId).withAvailabilityDomain(config.availabilityDomain).withShape(config.shape).withImageId(config.imageId);
|
|
3777
|
+
if (config.description) b.withDescription(config.description);
|
|
3778
|
+
if (config.ocpus !== void 0) b.withOcpus(config.ocpus);
|
|
3779
|
+
if (config.memoryInGbs !== void 0) b.withMemoryInGbs(config.memoryInGbs);
|
|
3780
|
+
if (config.sshPublicKey) b.withSshPublicKey(config.sshPublicKey);
|
|
3781
|
+
return b.build();
|
|
3782
|
+
};
|
|
3783
|
+
})(OciInstance || (OciInstance = {}));
|
|
3784
|
+
|
|
3785
|
+
//#endregion
|
|
3786
|
+
//#region src/live_system/component/network_and_compute/iaas/hetzner_network.ts
|
|
3787
|
+
const HETZNER_NETWORK_TYPE_NAME = "HetznerNetwork";
|
|
3788
|
+
function buildId$8(id) {
|
|
3789
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3790
|
+
}
|
|
3791
|
+
function buildVersion$8(major, minor, patch) {
|
|
3792
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3793
|
+
}
|
|
3794
|
+
function buildHetznerNetworkType() {
|
|
3795
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_NETWORK_TYPE_NAME).build()).build();
|
|
3796
|
+
}
|
|
3797
|
+
function pushParam$6(params, key, value) {
|
|
3798
|
+
params.push(key, value);
|
|
3799
|
+
}
|
|
3800
|
+
let HetznerNetwork;
|
|
3801
|
+
(function(_HetznerNetwork) {
|
|
3802
|
+
const getBuilder = _HetznerNetwork.getBuilder = () => {
|
|
3803
|
+
const params = getParametersInstance();
|
|
3804
|
+
const inner = getLiveSystemComponentBuilder().withType(buildHetznerNetworkType()).withParameters(params).withProvider("Hetzner");
|
|
3805
|
+
const builder = {
|
|
3806
|
+
withId: (id) => {
|
|
3807
|
+
inner.withId(buildId$8(id));
|
|
3808
|
+
return builder;
|
|
3809
|
+
},
|
|
3810
|
+
withVersion: (major, minor, patch) => {
|
|
3811
|
+
inner.withVersion(buildVersion$8(major, minor, patch));
|
|
3812
|
+
return builder;
|
|
3813
|
+
},
|
|
3814
|
+
withDisplayName: (displayName) => {
|
|
3815
|
+
inner.withDisplayName(displayName);
|
|
3816
|
+
return builder;
|
|
3817
|
+
},
|
|
3818
|
+
withDescription: (description) => {
|
|
3819
|
+
inner.withDescription(description);
|
|
3820
|
+
return builder;
|
|
3821
|
+
},
|
|
3822
|
+
withCidrBlock: (value) => {
|
|
3823
|
+
pushParam$6(params, CIDR_BLOCK_PARAM$1, value);
|
|
3824
|
+
return builder;
|
|
3825
|
+
},
|
|
3826
|
+
build: () => inner.build()
|
|
3827
|
+
};
|
|
3828
|
+
return builder;
|
|
3829
|
+
};
|
|
3830
|
+
_HetznerNetwork.satisfy = (blueprint) => {
|
|
3831
|
+
const params = getParametersInstance();
|
|
3832
|
+
const inner = getLiveSystemComponentBuilder().withType(buildHetznerNetworkType()).withParameters(params).withProvider("Hetzner").withId(buildId$8(blueprint.id.toString())).withVersion(buildVersion$8(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3833
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3834
|
+
const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM$1);
|
|
3835
|
+
if (cidrBlock !== null) pushParam$6(params, CIDR_BLOCK_PARAM$1, String(cidrBlock));
|
|
3836
|
+
return { build: () => inner.build() };
|
|
3837
|
+
};
|
|
3838
|
+
_HetznerNetwork.create = (config) => {
|
|
3839
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock);
|
|
3840
|
+
if (config.description) b.withDescription(config.description);
|
|
3841
|
+
return b.build();
|
|
3842
|
+
};
|
|
3843
|
+
})(HetznerNetwork || (HetznerNetwork = {}));
|
|
3844
|
+
|
|
3845
|
+
//#endregion
|
|
3846
|
+
//#region src/live_system/component/network_and_compute/iaas/hetzner_subnet.ts
|
|
3847
|
+
const HETZNER_SUBNET_TYPE_NAME = "HetznerSubnet";
|
|
3848
|
+
const NETWORK_ZONE_PARAM = "networkZone";
|
|
3849
|
+
const TYPE_PARAM = "type";
|
|
3850
|
+
function buildId$7(id) {
|
|
3851
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3852
|
+
}
|
|
3853
|
+
function buildVersion$7(major, minor, patch) {
|
|
3854
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3855
|
+
}
|
|
3856
|
+
function buildHetznerSubnetType() {
|
|
3857
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_SUBNET_TYPE_NAME).build()).build();
|
|
3858
|
+
}
|
|
3859
|
+
function pushParam$5(params, key, value) {
|
|
3860
|
+
params.push(key, value);
|
|
3861
|
+
}
|
|
3862
|
+
let HetznerSubnet;
|
|
3863
|
+
(function(_HetznerSubnet) {
|
|
3864
|
+
const getBuilder = _HetznerSubnet.getBuilder = () => {
|
|
3865
|
+
const params = getParametersInstance();
|
|
3866
|
+
const inner = getLiveSystemComponentBuilder().withType(buildHetznerSubnetType()).withParameters(params).withProvider("Hetzner");
|
|
3867
|
+
const builder = {
|
|
3868
|
+
withId: (id) => {
|
|
3869
|
+
inner.withId(buildId$7(id));
|
|
3870
|
+
return builder;
|
|
3871
|
+
},
|
|
3872
|
+
withVersion: (major, minor, patch) => {
|
|
3873
|
+
inner.withVersion(buildVersion$7(major, minor, patch));
|
|
3874
|
+
return builder;
|
|
3875
|
+
},
|
|
3876
|
+
withDisplayName: (displayName) => {
|
|
3877
|
+
inner.withDisplayName(displayName);
|
|
3878
|
+
return builder;
|
|
3879
|
+
},
|
|
3880
|
+
withDescription: (description) => {
|
|
3881
|
+
inner.withDescription(description);
|
|
3882
|
+
return builder;
|
|
3883
|
+
},
|
|
3884
|
+
withCidrBlock: (value) => {
|
|
3885
|
+
pushParam$5(params, CIDR_BLOCK_PARAM, value);
|
|
3886
|
+
return builder;
|
|
3887
|
+
},
|
|
3888
|
+
withNetworkZone: (value) => {
|
|
3889
|
+
pushParam$5(params, NETWORK_ZONE_PARAM, value);
|
|
3890
|
+
return builder;
|
|
3891
|
+
},
|
|
3892
|
+
withType: (value) => {
|
|
3893
|
+
pushParam$5(params, TYPE_PARAM, value);
|
|
3894
|
+
return builder;
|
|
3895
|
+
},
|
|
3896
|
+
build: () => inner.build()
|
|
3897
|
+
};
|
|
3898
|
+
return builder;
|
|
3899
|
+
};
|
|
3900
|
+
_HetznerSubnet.satisfy = (blueprint) => {
|
|
3901
|
+
const params = getParametersInstance();
|
|
3902
|
+
const inner = getLiveSystemComponentBuilder().withType(buildHetznerSubnetType()).withParameters(params).withProvider("Hetzner").withId(buildId$7(blueprint.id.toString())).withVersion(buildVersion$7(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3903
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3904
|
+
const cidrBlock = blueprint.parameters.getOptionalFieldByName(CIDR_BLOCK_PARAM);
|
|
3905
|
+
if (cidrBlock !== null) pushParam$5(params, CIDR_BLOCK_PARAM, String(cidrBlock));
|
|
3906
|
+
const satisfiedBuilder = {
|
|
3907
|
+
withNetworkZone: (value) => {
|
|
3908
|
+
pushParam$5(params, NETWORK_ZONE_PARAM, value);
|
|
3909
|
+
return satisfiedBuilder;
|
|
3910
|
+
},
|
|
3911
|
+
withType: (value) => {
|
|
3912
|
+
pushParam$5(params, TYPE_PARAM, value);
|
|
3913
|
+
return satisfiedBuilder;
|
|
3914
|
+
},
|
|
3915
|
+
build: () => inner.build()
|
|
3916
|
+
};
|
|
3917
|
+
return satisfiedBuilder;
|
|
3918
|
+
};
|
|
3919
|
+
_HetznerSubnet.create = (config) => {
|
|
3920
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withCidrBlock(config.cidrBlock).withNetworkZone(config.networkZone);
|
|
3921
|
+
if (config.description) b.withDescription(config.description);
|
|
3922
|
+
if (config.type) b.withType(config.type);
|
|
3923
|
+
return b.build();
|
|
3924
|
+
};
|
|
3925
|
+
})(HetznerSubnet || (HetznerSubnet = {}));
|
|
3926
|
+
|
|
3927
|
+
//#endregion
|
|
3928
|
+
//#region src/live_system/component/network_and_compute/iaas/hetzner_firewall.ts
|
|
3929
|
+
const HETZNER_FIREWALL_TYPE_NAME = "HetznerFirewall";
|
|
3930
|
+
function buildId$6(id) {
|
|
3931
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
3932
|
+
}
|
|
3933
|
+
function buildVersion$6(major, minor, patch) {
|
|
3934
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
3935
|
+
}
|
|
3936
|
+
function buildHetznerFirewallType() {
|
|
3937
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_FIREWALL_TYPE_NAME).build()).build();
|
|
3938
|
+
}
|
|
3939
|
+
function pushParam$4(params, key, value) {
|
|
3940
|
+
params.push(key, value);
|
|
3941
|
+
}
|
|
3942
|
+
let HetznerFirewall;
|
|
3943
|
+
(function(_HetznerFirewall) {
|
|
3944
|
+
const getBuilder = _HetznerFirewall.getBuilder = () => {
|
|
3945
|
+
const params = getParametersInstance();
|
|
3946
|
+
const inner = getLiveSystemComponentBuilder().withType(buildHetznerFirewallType()).withParameters(params).withProvider("Hetzner");
|
|
3947
|
+
const builder = {
|
|
3948
|
+
withId: (id) => {
|
|
3949
|
+
inner.withId(buildId$6(id));
|
|
3950
|
+
return builder;
|
|
3951
|
+
},
|
|
3952
|
+
withVersion: (major, minor, patch) => {
|
|
3953
|
+
inner.withVersion(buildVersion$6(major, minor, patch));
|
|
3954
|
+
return builder;
|
|
3955
|
+
},
|
|
3956
|
+
withDisplayName: (displayName) => {
|
|
3957
|
+
inner.withDisplayName(displayName);
|
|
3958
|
+
return builder;
|
|
3959
|
+
},
|
|
3960
|
+
withDescription: (description) => {
|
|
3961
|
+
inner.withDescription(description);
|
|
3962
|
+
pushParam$4(params, DESCRIPTION_PARAM, description);
|
|
3963
|
+
return builder;
|
|
3964
|
+
},
|
|
3965
|
+
withIngressRules: (rules) => {
|
|
3966
|
+
pushParam$4(params, INGRESS_RULES_PARAM, rules);
|
|
3967
|
+
return builder;
|
|
3968
|
+
},
|
|
3969
|
+
build: () => inner.build()
|
|
3970
|
+
};
|
|
3971
|
+
return builder;
|
|
3972
|
+
};
|
|
3973
|
+
_HetznerFirewall.satisfy = (blueprint) => {
|
|
3974
|
+
const params = getParametersInstance();
|
|
3975
|
+
const inner = getLiveSystemComponentBuilder().withType(buildHetznerFirewallType()).withParameters(params).withProvider("Hetzner").withId(buildId$6(blueprint.id.toString())).withVersion(buildVersion$6(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
3976
|
+
const description = blueprint.parameters.getOptionalFieldByName(DESCRIPTION_PARAM);
|
|
3977
|
+
if (description !== null) {
|
|
3978
|
+
inner.withDescription(String(description));
|
|
3979
|
+
pushParam$4(params, DESCRIPTION_PARAM, String(description));
|
|
3980
|
+
} else if (blueprint.description) inner.withDescription(blueprint.description);
|
|
3981
|
+
const ingressRules = blueprint.parameters.getOptionalFieldByName(INGRESS_RULES_PARAM);
|
|
3982
|
+
if (ingressRules !== null) pushParam$4(params, INGRESS_RULES_PARAM, ingressRules);
|
|
3983
|
+
return { build: () => inner.build() };
|
|
3984
|
+
};
|
|
3985
|
+
_HetznerFirewall.create = (config) => {
|
|
3986
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
|
|
3987
|
+
if (config.description) b.withDescription(config.description);
|
|
3988
|
+
if (config.ingressRules && config.ingressRules.length > 0) b.withIngressRules(config.ingressRules);
|
|
3989
|
+
return b.build();
|
|
3990
|
+
};
|
|
3991
|
+
})(HetznerFirewall || (HetznerFirewall = {}));
|
|
3992
|
+
|
|
3993
|
+
//#endregion
|
|
3994
|
+
//#region src/live_system/component/network_and_compute/iaas/hetzner_server.ts
|
|
3995
|
+
const HETZNER_SERVER_TYPE_NAME = "HetznerServer";
|
|
3996
|
+
const SERVER_TYPE_PARAM = "serverType";
|
|
3997
|
+
const LOCATION_PARAM = "location";
|
|
3998
|
+
const IMAGE_PARAM = "image";
|
|
3999
|
+
const SSH_KEYS_PARAM = "sshKeys";
|
|
4000
|
+
const USER_DATA_PARAM = "userData";
|
|
4001
|
+
function buildId$5(id) {
|
|
4002
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
4003
|
+
}
|
|
4004
|
+
function buildVersion$5(major, minor, patch) {
|
|
4005
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
4006
|
+
}
|
|
4007
|
+
function buildHetznerServerType() {
|
|
4008
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.IaaS).withName(PascalCaseString$1.getBuilder().withValue(HETZNER_SERVER_TYPE_NAME).build()).build();
|
|
4009
|
+
}
|
|
4010
|
+
function pushParam$3(params, key, value) {
|
|
4011
|
+
params.push(key, value);
|
|
4012
|
+
}
|
|
4013
|
+
let HetznerServer;
|
|
4014
|
+
(function(_HetznerServer) {
|
|
4015
|
+
const getBuilder = _HetznerServer.getBuilder = () => {
|
|
4016
|
+
const params = getParametersInstance();
|
|
4017
|
+
const inner = getLiveSystemComponentBuilder().withType(buildHetznerServerType()).withParameters(params).withProvider("Hetzner");
|
|
4018
|
+
const builder = {
|
|
4019
|
+
withId: (id) => {
|
|
4020
|
+
inner.withId(buildId$5(id));
|
|
4021
|
+
return builder;
|
|
4022
|
+
},
|
|
4023
|
+
withVersion: (major, minor, patch) => {
|
|
4024
|
+
inner.withVersion(buildVersion$5(major, minor, patch));
|
|
4025
|
+
return builder;
|
|
4026
|
+
},
|
|
4027
|
+
withDisplayName: (displayName) => {
|
|
4028
|
+
inner.withDisplayName(displayName);
|
|
4029
|
+
return builder;
|
|
4030
|
+
},
|
|
4031
|
+
withDescription: (description) => {
|
|
4032
|
+
inner.withDescription(description);
|
|
4033
|
+
return builder;
|
|
4034
|
+
},
|
|
4035
|
+
withServerType: (value) => {
|
|
4036
|
+
pushParam$3(params, SERVER_TYPE_PARAM, value);
|
|
4037
|
+
return builder;
|
|
4038
|
+
},
|
|
4039
|
+
withLocation: (value) => {
|
|
4040
|
+
pushParam$3(params, LOCATION_PARAM, value);
|
|
4041
|
+
return builder;
|
|
4042
|
+
},
|
|
4043
|
+
withImage: (value) => {
|
|
4044
|
+
pushParam$3(params, IMAGE_PARAM, value);
|
|
4045
|
+
return builder;
|
|
4046
|
+
},
|
|
4047
|
+
withSshKeys: (value) => {
|
|
4048
|
+
pushParam$3(params, SSH_KEYS_PARAM, value);
|
|
4049
|
+
return builder;
|
|
4050
|
+
},
|
|
4051
|
+
withUserData: (value) => {
|
|
4052
|
+
pushParam$3(params, USER_DATA_PARAM, value);
|
|
4053
|
+
return builder;
|
|
4054
|
+
},
|
|
4055
|
+
build: () => inner.build()
|
|
4056
|
+
};
|
|
4057
|
+
return builder;
|
|
4058
|
+
};
|
|
4059
|
+
_HetznerServer.satisfy = (blueprint) => {
|
|
4060
|
+
const params = getParametersInstance();
|
|
4061
|
+
const inner = getLiveSystemComponentBuilder().withType(buildHetznerServerType()).withParameters(params).withProvider("Hetzner").withId(buildId$5(blueprint.id.toString())).withVersion(buildVersion$5(blueprint.version.major, blueprint.version.minor, blueprint.version.patch)).withDisplayName(blueprint.displayName).withDependencies(blueprint.dependencies).withLinks(blueprint.links);
|
|
4062
|
+
if (blueprint.description) inner.withDescription(blueprint.description);
|
|
4063
|
+
const satisfiedBuilder = {
|
|
4064
|
+
withServerType: (value) => {
|
|
4065
|
+
pushParam$3(params, SERVER_TYPE_PARAM, value);
|
|
4066
|
+
return satisfiedBuilder;
|
|
4067
|
+
},
|
|
4068
|
+
withLocation: (value) => {
|
|
4069
|
+
pushParam$3(params, LOCATION_PARAM, value);
|
|
4070
|
+
return satisfiedBuilder;
|
|
4071
|
+
},
|
|
4072
|
+
withImage: (value) => {
|
|
4073
|
+
pushParam$3(params, IMAGE_PARAM, value);
|
|
4074
|
+
return satisfiedBuilder;
|
|
4075
|
+
},
|
|
4076
|
+
withSshKeys: (value) => {
|
|
4077
|
+
pushParam$3(params, SSH_KEYS_PARAM, value);
|
|
4078
|
+
return satisfiedBuilder;
|
|
4079
|
+
},
|
|
4080
|
+
withUserData: (value) => {
|
|
4081
|
+
pushParam$3(params, USER_DATA_PARAM, value);
|
|
4082
|
+
return satisfiedBuilder;
|
|
4083
|
+
},
|
|
4084
|
+
build: () => inner.build()
|
|
4085
|
+
};
|
|
4086
|
+
return satisfiedBuilder;
|
|
4087
|
+
};
|
|
4088
|
+
_HetznerServer.create = (config) => {
|
|
4089
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withServerType(config.serverType).withLocation(config.location).withImage(config.image);
|
|
4090
|
+
if (config.description) b.withDescription(config.description);
|
|
4091
|
+
if (config.sshKeys && config.sshKeys.length > 0) b.withSshKeys(config.sshKeys);
|
|
4092
|
+
if (config.userData) b.withUserData(config.userData);
|
|
4093
|
+
return b.build();
|
|
4094
|
+
};
|
|
4095
|
+
})(HetznerServer || (HetznerServer = {}));
|
|
4096
|
+
|
|
4097
|
+
//#endregion
|
|
4098
|
+
//#region src/fractal/component/network_and_compute/paas/container_platform.ts
|
|
4099
|
+
const CONTAINER_PLATFORM_TYPE_NAME = "ContainerPlatform";
|
|
4100
|
+
function buildId$4(id) {
|
|
4101
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
4102
|
+
}
|
|
4103
|
+
function buildVersion$4(major, minor, patch) {
|
|
4104
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
4105
|
+
}
|
|
4106
|
+
function buildContainerPlatformType() {
|
|
4107
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(CONTAINER_PLATFORM_TYPE_NAME).build()).build();
|
|
4108
|
+
}
|
|
4109
|
+
function makeContainerPlatformNode(platform, workloadNodes) {
|
|
4110
|
+
const platformDep = { id: platform.id };
|
|
4111
|
+
return {
|
|
4112
|
+
platform,
|
|
4113
|
+
workloads: workloadNodes.map((w) => ({
|
|
4114
|
+
...w,
|
|
4115
|
+
component: {
|
|
4116
|
+
...w.component,
|
|
4117
|
+
dependencies: [...w.component.dependencies, platformDep]
|
|
4118
|
+
}
|
|
4119
|
+
})),
|
|
4120
|
+
withWorkloads: (newWorkloads) => makeContainerPlatformNode(platform, newWorkloads)
|
|
4121
|
+
};
|
|
4122
|
+
}
|
|
4123
|
+
let ContainerPlatform;
|
|
4124
|
+
(function(_ContainerPlatform) {
|
|
4125
|
+
const getBuilder = _ContainerPlatform.getBuilder = () => {
|
|
4126
|
+
const params = getParametersInstance();
|
|
4127
|
+
const inner = getBlueprintComponentBuilder().withType(buildContainerPlatformType()).withParameters(params);
|
|
4128
|
+
const builder = {
|
|
4129
|
+
withId: (id) => {
|
|
4130
|
+
inner.withId(buildId$4(id));
|
|
4131
|
+
return builder;
|
|
4132
|
+
},
|
|
4133
|
+
withVersion: (major, minor, patch) => {
|
|
4134
|
+
inner.withVersion(buildVersion$4(major, minor, patch));
|
|
4135
|
+
return builder;
|
|
4136
|
+
},
|
|
4137
|
+
withDisplayName: (displayName) => {
|
|
4138
|
+
inner.withDisplayName(displayName);
|
|
4139
|
+
return builder;
|
|
4140
|
+
},
|
|
4141
|
+
withDescription: (description) => {
|
|
4142
|
+
inner.withDescription(description);
|
|
4143
|
+
return builder;
|
|
4144
|
+
},
|
|
4145
|
+
build: () => inner.build()
|
|
4146
|
+
};
|
|
4147
|
+
return builder;
|
|
4148
|
+
};
|
|
4149
|
+
_ContainerPlatform.create = (config) => {
|
|
4150
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
|
|
4151
|
+
if (config.description) b.withDescription(config.description);
|
|
4152
|
+
return makeContainerPlatformNode(b.build(), []);
|
|
4153
|
+
};
|
|
4154
|
+
})(ContainerPlatform || (ContainerPlatform = {}));
|
|
4155
|
+
|
|
4156
|
+
//#endregion
|
|
4157
|
+
//#region src/fractal/component/custom_workloads/caas/workload.ts
|
|
4158
|
+
const WORKLOAD_TYPE_NAME = "Workload";
|
|
4159
|
+
const CONTAINER_IMAGE_PARAM = "containerImage";
|
|
4160
|
+
const CONTAINER_PORT_PARAM = "containerPort";
|
|
4161
|
+
const CONTAINER_NAME_PARAM = "containerName";
|
|
4162
|
+
const CPU_PARAM = "cpu";
|
|
4163
|
+
const MEMORY_PARAM = "memory";
|
|
4164
|
+
const DESIRED_COUNT_PARAM = "desiredCount";
|
|
4165
|
+
function buildId$3(id) {
|
|
4166
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
4167
|
+
}
|
|
4168
|
+
function buildVersion$3(major, minor, patch) {
|
|
4169
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
4170
|
+
}
|
|
4171
|
+
function buildWorkloadType() {
|
|
4172
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.CustomWorkloads).withServiceDeliveryModel(ServiceDeliveryModel$1.CaaS).withName(PascalCaseString$1.getBuilder().withValue(WORKLOAD_TYPE_NAME).build()).build();
|
|
4173
|
+
}
|
|
4174
|
+
function pushParam$2(params, key, value) {
|
|
4175
|
+
params.push(key, value);
|
|
4176
|
+
}
|
|
4177
|
+
function buildLinkParams(fromPort, toPort, protocol) {
|
|
4178
|
+
const p = getParametersInstance();
|
|
4179
|
+
p.push("fromPort", fromPort);
|
|
4180
|
+
if (toPort !== void 0) p.push("toPort", toPort);
|
|
4181
|
+
if (protocol) p.push("protocol", protocol);
|
|
4182
|
+
return p;
|
|
4183
|
+
}
|
|
4184
|
+
function makeWorkloadNode(component) {
|
|
4185
|
+
return {
|
|
4186
|
+
component,
|
|
4187
|
+
components: [component],
|
|
4188
|
+
withLinks: (links) => {
|
|
4189
|
+
const portLinks = links.map((l) => getLinkBuilder().withId(l.target.component.id).withType(buildWorkloadType()).withParameters(buildLinkParams(l.fromPort, l.toPort, l.protocol)).build());
|
|
4190
|
+
return makeWorkloadNode({
|
|
4191
|
+
...component,
|
|
4192
|
+
links: [...component.links, ...portLinks]
|
|
4193
|
+
});
|
|
4194
|
+
},
|
|
4195
|
+
withSecurityGroups: (sgs) => {
|
|
4196
|
+
const sgLinks = sgs.map((sg) => getLinkBuilder().withId(sg.id).withType(sg.type).withParameters(getParametersInstance()).build());
|
|
4197
|
+
return makeWorkloadNode({
|
|
4198
|
+
...component,
|
|
4199
|
+
links: [...component.links, ...sgLinks]
|
|
4200
|
+
});
|
|
4201
|
+
}
|
|
4202
|
+
};
|
|
4203
|
+
}
|
|
4204
|
+
let Workload;
|
|
4205
|
+
(function(_Workload) {
|
|
4206
|
+
const getBuilder = _Workload.getBuilder = () => {
|
|
4207
|
+
const params = getParametersInstance();
|
|
4208
|
+
const inner = getBlueprintComponentBuilder().withType(buildWorkloadType()).withParameters(params);
|
|
4209
|
+
const builder = {
|
|
4210
|
+
withId: (id) => {
|
|
4211
|
+
inner.withId(buildId$3(id));
|
|
4212
|
+
return builder;
|
|
4213
|
+
},
|
|
4214
|
+
withVersion: (major, minor, patch) => {
|
|
4215
|
+
inner.withVersion(buildVersion$3(major, minor, patch));
|
|
4216
|
+
return builder;
|
|
4217
|
+
},
|
|
4218
|
+
withDisplayName: (displayName) => {
|
|
4219
|
+
inner.withDisplayName(displayName);
|
|
4220
|
+
return builder;
|
|
4221
|
+
},
|
|
4222
|
+
withDescription: (description) => {
|
|
4223
|
+
inner.withDescription(description);
|
|
4224
|
+
return builder;
|
|
4225
|
+
},
|
|
4226
|
+
withContainerImage: (image) => {
|
|
4227
|
+
pushParam$2(params, CONTAINER_IMAGE_PARAM, image);
|
|
4228
|
+
return builder;
|
|
4229
|
+
},
|
|
4230
|
+
withContainerPort: (port) => {
|
|
4231
|
+
pushParam$2(params, CONTAINER_PORT_PARAM, port);
|
|
4232
|
+
return builder;
|
|
4233
|
+
},
|
|
4234
|
+
withContainerName: (name) => {
|
|
4235
|
+
pushParam$2(params, CONTAINER_NAME_PARAM, name);
|
|
4236
|
+
return builder;
|
|
4237
|
+
},
|
|
4238
|
+
withCpu: (cpu) => {
|
|
4239
|
+
pushParam$2(params, CPU_PARAM, cpu);
|
|
4240
|
+
return builder;
|
|
4241
|
+
},
|
|
4242
|
+
withMemory: (memory) => {
|
|
4243
|
+
pushParam$2(params, MEMORY_PARAM, memory);
|
|
4244
|
+
return builder;
|
|
4245
|
+
},
|
|
4246
|
+
withDesiredCount: (count) => {
|
|
4247
|
+
pushParam$2(params, DESIRED_COUNT_PARAM, count);
|
|
4248
|
+
return builder;
|
|
4249
|
+
},
|
|
4250
|
+
build: () => inner.build()
|
|
4251
|
+
};
|
|
4252
|
+
return builder;
|
|
4253
|
+
};
|
|
4254
|
+
_Workload.create = (config) => {
|
|
4255
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withContainerImage(config.containerImage);
|
|
4256
|
+
if (config.description) b.withDescription(config.description);
|
|
4257
|
+
if (config.containerPort !== void 0) b.withContainerPort(config.containerPort);
|
|
4258
|
+
if (config.containerName) b.withContainerName(config.containerName);
|
|
4259
|
+
if (config.cpu) b.withCpu(config.cpu);
|
|
4260
|
+
if (config.memory) b.withMemory(config.memory);
|
|
4261
|
+
if (config.desiredCount !== void 0) b.withDesiredCount(config.desiredCount);
|
|
4262
|
+
return makeWorkloadNode(b.build());
|
|
4263
|
+
};
|
|
4264
|
+
})(Workload || (Workload = {}));
|
|
4265
|
+
|
|
4266
|
+
//#endregion
|
|
4267
|
+
//#region src/live_system/component/network_and_compute/paas/ecs_cluster.ts
|
|
4268
|
+
const ECS_CLUSTER_TYPE_NAME = "ECS";
|
|
4269
|
+
function buildId$2(id) {
|
|
4270
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
4271
|
+
}
|
|
4272
|
+
function buildVersion$2(major, minor, patch) {
|
|
4273
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
4274
|
+
}
|
|
4275
|
+
function buildAwsEcsClusterType() {
|
|
4276
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(ECS_CLUSTER_TYPE_NAME).build()).build();
|
|
4277
|
+
}
|
|
4278
|
+
let AwsEcsCluster;
|
|
4279
|
+
(function(_AwsEcsCluster) {
|
|
4280
|
+
const getBuilder = _AwsEcsCluster.getBuilder = () => {
|
|
4281
|
+
const params = getParametersInstance();
|
|
4282
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsClusterType()).withParameters(params).withProvider("AWS");
|
|
4283
|
+
const builder = {
|
|
4284
|
+
withId: (id) => {
|
|
4285
|
+
inner.withId(buildId$2(id));
|
|
4286
|
+
return builder;
|
|
4287
|
+
},
|
|
4288
|
+
withVersion: (major, minor, patch) => {
|
|
4289
|
+
inner.withVersion(buildVersion$2(major, minor, patch));
|
|
4290
|
+
return builder;
|
|
4291
|
+
},
|
|
4292
|
+
withDisplayName: (displayName) => {
|
|
4293
|
+
inner.withDisplayName(displayName);
|
|
4294
|
+
return builder;
|
|
4295
|
+
},
|
|
4296
|
+
withDescription: (description) => {
|
|
4297
|
+
inner.withDescription(description);
|
|
4298
|
+
return builder;
|
|
4299
|
+
},
|
|
4300
|
+
build: () => inner.build()
|
|
4301
|
+
};
|
|
4302
|
+
return builder;
|
|
4303
|
+
};
|
|
4304
|
+
_AwsEcsCluster.satisfy = (platform) => {
|
|
4305
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsClusterType()).withParameters(getParametersInstance()).withProvider("AWS").withId(buildId$2(platform.id.toString())).withVersion(buildVersion$2(platform.version.major, platform.version.minor, platform.version.patch)).withDisplayName(platform.displayName);
|
|
4306
|
+
if (platform.description) inner.withDescription(platform.description);
|
|
4307
|
+
return { build: () => inner.build() };
|
|
4308
|
+
};
|
|
4309
|
+
_AwsEcsCluster.create = (config) => {
|
|
4310
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
|
|
4311
|
+
if (config.description) b.withDescription(config.description);
|
|
4312
|
+
return b.build();
|
|
4313
|
+
};
|
|
4314
|
+
})(AwsEcsCluster || (AwsEcsCluster = {}));
|
|
4315
|
+
|
|
4316
|
+
//#endregion
|
|
4317
|
+
//#region src/live_system/component/network_and_compute/paas/ecs_task_definition.ts
|
|
4318
|
+
const ECS_TASK_DEF_TYPE_NAME = "ECSTaskDefinition";
|
|
4319
|
+
const NETWORK_MODE_PARAM = "networkMode";
|
|
4320
|
+
const EXECUTION_ROLE_ARN_PARAM = "executionRoleArn";
|
|
4321
|
+
const TASK_ROLE_ARN_PARAM = "taskRoleArn";
|
|
4322
|
+
function buildId$1(id) {
|
|
4323
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
4324
|
+
}
|
|
4325
|
+
function buildVersion$1(major, minor, patch) {
|
|
4326
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
4327
|
+
}
|
|
4328
|
+
function buildAwsEcsTaskDefType() {
|
|
4329
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(ECS_TASK_DEF_TYPE_NAME).build()).build();
|
|
4330
|
+
}
|
|
4331
|
+
function pushParam$1(params, key, value) {
|
|
4332
|
+
params.push(key, value);
|
|
4333
|
+
}
|
|
4334
|
+
let AwsEcsTaskDefinition;
|
|
4335
|
+
(function(_AwsEcsTaskDefinition) {
|
|
4336
|
+
const getBuilder = _AwsEcsTaskDefinition.getBuilder = () => {
|
|
4337
|
+
const params = getParametersInstance();
|
|
4338
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsTaskDefType()).withParameters(params).withProvider("AWS");
|
|
4339
|
+
const builder = {
|
|
4340
|
+
withId: (id) => {
|
|
4341
|
+
inner.withId(buildId$1(id));
|
|
4342
|
+
return builder;
|
|
4343
|
+
},
|
|
4344
|
+
withVersion: (major, minor, patch) => {
|
|
4345
|
+
inner.withVersion(buildVersion$1(major, minor, patch));
|
|
4346
|
+
return builder;
|
|
4347
|
+
},
|
|
4348
|
+
withDisplayName: (displayName) => {
|
|
4349
|
+
inner.withDisplayName(displayName);
|
|
4350
|
+
return builder;
|
|
4351
|
+
},
|
|
4352
|
+
withDescription: (description) => {
|
|
4353
|
+
inner.withDescription(description);
|
|
4354
|
+
return builder;
|
|
4355
|
+
},
|
|
4356
|
+
withContainerImage: (image) => {
|
|
4357
|
+
pushParam$1(params, CONTAINER_IMAGE_PARAM, image);
|
|
4358
|
+
return builder;
|
|
4359
|
+
},
|
|
4360
|
+
withContainerPort: (port) => {
|
|
4361
|
+
pushParam$1(params, CONTAINER_PORT_PARAM, port);
|
|
4362
|
+
return builder;
|
|
4363
|
+
},
|
|
4364
|
+
withContainerName: (name) => {
|
|
4365
|
+
pushParam$1(params, CONTAINER_NAME_PARAM, name);
|
|
4366
|
+
return builder;
|
|
4367
|
+
},
|
|
4368
|
+
withCpu: (cpu) => {
|
|
4369
|
+
pushParam$1(params, CPU_PARAM, cpu);
|
|
4370
|
+
return builder;
|
|
4371
|
+
},
|
|
4372
|
+
withMemory: (memory) => {
|
|
4373
|
+
pushParam$1(params, MEMORY_PARAM, memory);
|
|
4374
|
+
return builder;
|
|
4375
|
+
},
|
|
4376
|
+
withNetworkMode: (mode) => {
|
|
4377
|
+
pushParam$1(params, NETWORK_MODE_PARAM, mode);
|
|
4378
|
+
return builder;
|
|
4379
|
+
},
|
|
4380
|
+
withExecutionRoleArn: (arn) => {
|
|
4381
|
+
pushParam$1(params, EXECUTION_ROLE_ARN_PARAM, arn);
|
|
4382
|
+
return builder;
|
|
4383
|
+
},
|
|
4384
|
+
withTaskRoleArn: (arn) => {
|
|
4385
|
+
pushParam$1(params, TASK_ROLE_ARN_PARAM, arn);
|
|
4386
|
+
return builder;
|
|
4387
|
+
},
|
|
4388
|
+
build: () => inner.build()
|
|
4389
|
+
};
|
|
4390
|
+
return builder;
|
|
4391
|
+
};
|
|
4392
|
+
_AwsEcsTaskDefinition.satisfy = (workload) => {
|
|
4393
|
+
const params = getParametersInstance();
|
|
4394
|
+
const taskId = `${workload.id.toString()}-task`;
|
|
4395
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsTaskDefType()).withParameters(params).withProvider("AWS").withId(buildId$1(taskId)).withVersion(buildVersion$1(workload.version.major, workload.version.minor, workload.version.patch)).withDisplayName(workload.displayName);
|
|
4396
|
+
if (workload.description) inner.withDescription(workload.description);
|
|
4397
|
+
for (const key of [
|
|
4398
|
+
CONTAINER_IMAGE_PARAM,
|
|
4399
|
+
CONTAINER_PORT_PARAM,
|
|
4400
|
+
CONTAINER_NAME_PARAM,
|
|
4401
|
+
CPU_PARAM,
|
|
4402
|
+
MEMORY_PARAM
|
|
4403
|
+
]) {
|
|
4404
|
+
const v = workload.parameters.getOptionalFieldByName(key);
|
|
4405
|
+
if (v !== null) pushParam$1(params, key, v);
|
|
4406
|
+
}
|
|
4407
|
+
const satisfiedBuilder = {
|
|
4408
|
+
withNetworkMode: (mode) => {
|
|
4409
|
+
pushParam$1(params, NETWORK_MODE_PARAM, mode);
|
|
4410
|
+
return satisfiedBuilder;
|
|
4411
|
+
},
|
|
4412
|
+
withExecutionRoleArn: (arn) => {
|
|
4413
|
+
pushParam$1(params, EXECUTION_ROLE_ARN_PARAM, arn);
|
|
4414
|
+
return satisfiedBuilder;
|
|
4415
|
+
},
|
|
4416
|
+
withTaskRoleArn: (arn) => {
|
|
4417
|
+
pushParam$1(params, TASK_ROLE_ARN_PARAM, arn);
|
|
4418
|
+
return satisfiedBuilder;
|
|
4419
|
+
},
|
|
4420
|
+
build: () => inner.build()
|
|
4421
|
+
};
|
|
4422
|
+
return satisfiedBuilder;
|
|
4423
|
+
};
|
|
4424
|
+
_AwsEcsTaskDefinition.create = (config) => {
|
|
4425
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName).withContainerImage(config.containerImage);
|
|
4426
|
+
if (config.description) b.withDescription(config.description);
|
|
4427
|
+
if (config.containerPort !== void 0) b.withContainerPort(config.containerPort);
|
|
4428
|
+
if (config.containerName) b.withContainerName(config.containerName);
|
|
4429
|
+
if (config.cpu) b.withCpu(config.cpu);
|
|
4430
|
+
if (config.memory) b.withMemory(config.memory);
|
|
4431
|
+
if (config.networkMode) b.withNetworkMode(config.networkMode);
|
|
4432
|
+
if (config.executionRoleArn) b.withExecutionRoleArn(config.executionRoleArn);
|
|
4433
|
+
if (config.taskRoleArn) b.withTaskRoleArn(config.taskRoleArn);
|
|
4434
|
+
return b.build();
|
|
4435
|
+
};
|
|
4436
|
+
})(AwsEcsTaskDefinition || (AwsEcsTaskDefinition = {}));
|
|
4437
|
+
|
|
4438
|
+
//#endregion
|
|
4439
|
+
//#region src/live_system/component/network_and_compute/paas/ecs_service.ts
|
|
4440
|
+
const ECS_SERVICE_TYPE_NAME = "ECSService";
|
|
4441
|
+
const LAUNCH_TYPE_PARAM = "launchType";
|
|
4442
|
+
const ASSIGN_PUBLIC_IP_PARAM = "assignPublicIp";
|
|
4443
|
+
function buildId(id) {
|
|
4444
|
+
return getComponentIdBuilder().withValue(KebabCaseString$1.getBuilder().withValue(id).build()).build();
|
|
4445
|
+
}
|
|
4446
|
+
function buildVersion(major, minor, patch) {
|
|
4447
|
+
return getVersionBuilder().withMajor(major).withMinor(minor).withPatch(patch).build();
|
|
4448
|
+
}
|
|
4449
|
+
function buildAwsEcsServiceType() {
|
|
4450
|
+
return getBlueprintComponentTypeBuilder().withInfrastructureDomain(InfrastructureDomain$1.NetworkAndCompute).withServiceDeliveryModel(ServiceDeliveryModel$1.PaaS).withName(PascalCaseString$1.getBuilder().withValue(ECS_SERVICE_TYPE_NAME).build()).build();
|
|
4451
|
+
}
|
|
4452
|
+
function pushParam(params, key, value) {
|
|
4453
|
+
params.push(key, value);
|
|
4454
|
+
}
|
|
4455
|
+
let AwsEcsService;
|
|
4456
|
+
(function(_AwsEcsService) {
|
|
4457
|
+
const getBuilder = _AwsEcsService.getBuilder = () => {
|
|
4458
|
+
const params = getParametersInstance();
|
|
4459
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsServiceType()).withParameters(params).withProvider("AWS");
|
|
4460
|
+
const builder = {
|
|
4461
|
+
withId: (id) => {
|
|
4462
|
+
inner.withId(buildId(id));
|
|
4463
|
+
return builder;
|
|
4464
|
+
},
|
|
4465
|
+
withVersion: (major, minor, patch) => {
|
|
4466
|
+
inner.withVersion(buildVersion(major, minor, patch));
|
|
4467
|
+
return builder;
|
|
4468
|
+
},
|
|
4469
|
+
withDisplayName: (displayName) => {
|
|
4470
|
+
inner.withDisplayName(displayName);
|
|
4471
|
+
return builder;
|
|
4472
|
+
},
|
|
4473
|
+
withDescription: (description) => {
|
|
4474
|
+
inner.withDescription(description);
|
|
4475
|
+
return builder;
|
|
4476
|
+
},
|
|
4477
|
+
withDesiredCount: (count) => {
|
|
4478
|
+
pushParam(params, DESIRED_COUNT_PARAM, count);
|
|
4479
|
+
return builder;
|
|
4480
|
+
},
|
|
4481
|
+
withLaunchType: (type) => {
|
|
4482
|
+
pushParam(params, LAUNCH_TYPE_PARAM, type);
|
|
4483
|
+
return builder;
|
|
4484
|
+
},
|
|
4485
|
+
withAssignPublicIp: (assign) => {
|
|
4486
|
+
pushParam(params, ASSIGN_PUBLIC_IP_PARAM, assign);
|
|
4487
|
+
return builder;
|
|
4488
|
+
},
|
|
4489
|
+
build: () => inner.build()
|
|
4490
|
+
};
|
|
4491
|
+
return builder;
|
|
4492
|
+
};
|
|
4493
|
+
_AwsEcsService.satisfy = (workload) => {
|
|
4494
|
+
const params = getParametersInstance();
|
|
4495
|
+
const inner = getLiveSystemComponentBuilder().withType(buildAwsEcsServiceType()).withParameters(params).withProvider("AWS").withId(buildId(workload.id.toString())).withVersion(buildVersion(workload.version.major, workload.version.minor, workload.version.patch)).withDisplayName(workload.displayName).withDependencies(workload.dependencies).withLinks(workload.links);
|
|
4496
|
+
if (workload.description) inner.withDescription(workload.description);
|
|
4497
|
+
const desiredCount = workload.parameters.getOptionalFieldByName(DESIRED_COUNT_PARAM);
|
|
4498
|
+
if (desiredCount !== null) pushParam(params, DESIRED_COUNT_PARAM, desiredCount);
|
|
4499
|
+
const satisfiedBuilder = {
|
|
4500
|
+
withLaunchType: (type) => {
|
|
4501
|
+
pushParam(params, LAUNCH_TYPE_PARAM, type);
|
|
4502
|
+
return satisfiedBuilder;
|
|
4503
|
+
},
|
|
4504
|
+
withAssignPublicIp: (assign) => {
|
|
4505
|
+
pushParam(params, ASSIGN_PUBLIC_IP_PARAM, assign);
|
|
4506
|
+
return satisfiedBuilder;
|
|
4507
|
+
},
|
|
4508
|
+
build: () => inner.build()
|
|
4509
|
+
};
|
|
4510
|
+
return satisfiedBuilder;
|
|
4511
|
+
};
|
|
4512
|
+
_AwsEcsService.create = (config) => {
|
|
4513
|
+
const b = getBuilder().withId(config.id).withVersion(config.version.major, config.version.minor, config.version.patch).withDisplayName(config.displayName);
|
|
4514
|
+
if (config.description) b.withDescription(config.description);
|
|
4515
|
+
if (config.desiredCount !== void 0) b.withDesiredCount(config.desiredCount);
|
|
4516
|
+
if (config.launchType) b.withLaunchType(config.launchType);
|
|
4517
|
+
if (config.assignPublicIp !== void 0) b.withAssignPublicIp(config.assignPublicIp);
|
|
4518
|
+
return b.build();
|
|
4519
|
+
};
|
|
4520
|
+
})(AwsEcsService || (AwsEcsService = {}));
|
|
4521
|
+
|
|
2012
4522
|
//#endregion
|
|
2013
4523
|
//#region src/index.ts
|
|
2014
4524
|
const BoundedContext = BoundedContext$1;
|
|
@@ -2026,4 +4536,4 @@ const Environment = Environment$1;
|
|
|
2026
4536
|
const LiveSystem = LiveSystem$1;
|
|
2027
4537
|
|
|
2028
4538
|
//#endregion
|
|
2029
|
-
export { BoundedContext, Environment, Fractal, InfrastructureDomain, KebabCaseString, LiveSystem, OwnerId, OwnerType, PascalCaseString, ServiceAccountCredentials, ServiceAccountId, ServiceDeliveryModel, Version };
|
|
4539
|
+
export { AwsEcsCluster, AwsEcsService, AwsEcsTaskDefinition, AwsSecurityGroup, AwsSubnet, AwsVpc, AzureNsg, AzureSubnet, AzureVm, AzureVnet, BoundedContext, ContainerPlatform, Ec2Instance, Environment, Fractal, GcpFirewall, GcpSubnet, GcpVm, GcpVpc, HetznerFirewall, HetznerNetwork, HetznerServer, HetznerSubnet, InfrastructureDomain, KebabCaseString, LiveSystem, OciInstance, OciSecurityList, OciSubnet, OciVcn, OwnerId, OwnerType, PascalCaseString, SecurityGroup, ServiceAccountCredentials, ServiceAccountId, ServiceDeliveryModel, Subnet, Version, VirtualMachine, VirtualNetwork, Workload };
|