@scaleway/sdk 2.45.0 → 2.47.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/dist/api/account/index.gen.d.ts +6 -0
- package/dist/api/applesilicon/index.gen.d.ts +5 -0
- package/dist/api/baremetal/index.gen.d.ts +5 -0
- package/dist/api/baremetal/v1/api.gen.cjs +3 -1
- package/dist/api/baremetal/v1/api.gen.js +3 -1
- package/dist/api/baremetal/v1/index.gen.d.ts +1 -1
- package/dist/api/baremetal/v1/marshalling.gen.cjs +61 -1
- package/dist/api/baremetal/v1/marshalling.gen.js +61 -1
- package/dist/api/baremetal/v1/types.gen.d.ts +120 -1
- package/dist/api/billing/index.gen.d.ts +6 -0
- package/dist/api/block/index.gen.d.ts +5 -0
- package/dist/api/cockpit/index.gen.d.ts +6 -0
- package/dist/api/cockpit/v1/types.gen.d.ts +1 -1
- package/dist/api/container/index.gen.d.ts +5 -0
- package/dist/api/container/v1beta1/api.gen.cjs +0 -23
- package/dist/api/container/v1beta1/api.gen.d.ts +1 -9
- package/dist/api/container/v1beta1/api.gen.js +1 -24
- package/dist/api/container/v1beta1/index.gen.d.ts +1 -1
- package/dist/api/container/v1beta1/types.gen.d.ts +0 -12
- package/dist/api/dedibox/index.gen.d.ts +5 -0
- package/dist/api/document_db/index.gen.d.ts +5 -0
- package/dist/api/domain/index.gen.d.ts +5 -0
- package/dist/api/edge_services/index.gen.d.ts +5 -0
- package/dist/api/edge_services/v1alpha1/api.gen.cjs +599 -0
- package/dist/api/edge_services/v1alpha1/api.gen.js +599 -0
- package/dist/api/edge_services/v1alpha1/content.gen.cjs +8 -0
- package/dist/api/edge_services/v1alpha1/content.gen.js +8 -0
- package/dist/api/edge_services/v1alpha1/index.gen.cjs +7 -0
- package/dist/api/edge_services/v1alpha1/index.gen.js +7 -0
- package/dist/api/edge_services/v1alpha1/marshalling.gen.cjs +434 -0
- package/dist/api/edge_services/v1alpha1/marshalling.gen.js +434 -0
- package/dist/api/flexibleip/index.gen.d.ts +5 -0
- package/dist/api/function/index.gen.d.ts +5 -0
- package/dist/api/function/v1beta1/api.gen.cjs +0 -23
- package/dist/api/function/v1beta1/api.gen.d.ts +1 -9
- package/dist/api/function/v1beta1/api.gen.js +1 -24
- package/dist/api/function/v1beta1/index.gen.d.ts +1 -1
- package/dist/api/function/v1beta1/types.gen.d.ts +0 -12
- package/dist/api/iam/index.gen.d.ts +5 -0
- package/dist/api/iam/v1alpha1/api.gen.cjs +1 -1
- package/dist/api/iam/v1alpha1/api.gen.d.ts +1 -1
- package/dist/api/iam/v1alpha1/api.gen.js +1 -1
- package/dist/api/iam/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +17 -3
- package/dist/api/iam/v1alpha1/marshalling.gen.js +17 -3
- package/dist/api/iam/v1alpha1/types.gen.d.ts +27 -3
- package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +12 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +11 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +12 -0
- package/dist/api/index.d.ts +65 -35
- package/dist/api/index.gen.d.ts +43 -0
- package/dist/api/inference/index.gen.d.ts +5 -0
- package/dist/api/inference/v1beta1/api.gen.cjs +306 -0
- package/dist/api/inference/v1beta1/api.gen.js +306 -0
- package/dist/api/inference/v1beta1/content.gen.cjs +8 -0
- package/dist/api/inference/v1beta1/content.gen.js +8 -0
- package/dist/api/inference/v1beta1/index.gen.cjs +8 -0
- package/dist/api/inference/v1beta1/index.gen.js +8 -0
- package/dist/api/inference/v1beta1/marshalling.gen.cjs +273 -0
- package/dist/api/inference/v1beta1/marshalling.gen.js +273 -0
- package/dist/api/inference/v1beta1/validation-rules.gen.cjs +56 -0
- package/dist/api/inference/v1beta1/validation-rules.gen.js +56 -0
- package/dist/api/instance/index.gen.d.ts +5 -0
- package/dist/api/instance/v1/marshalling.gen.cjs +1 -0
- package/dist/api/instance/v1/marshalling.gen.js +1 -0
- package/dist/api/instance/v1/types.gen.d.ts +22 -8
- package/dist/api/instance/v1/types.private.gen.d.ts +2 -2
- package/dist/api/iot/index.gen.d.ts +5 -0
- package/dist/api/ipam/index.gen.d.ts +5 -0
- package/dist/api/ipam/v1/api.gen.cjs +67 -2
- package/dist/api/ipam/v1/api.gen.d.ts +38 -3
- package/dist/api/ipam/v1/api.gen.js +68 -3
- package/dist/api/ipam/v1/index.gen.d.ts +1 -1
- package/dist/api/ipam/v1/marshalling.gen.cjs +18 -0
- package/dist/api/ipam/v1/marshalling.gen.d.ts +4 -1
- package/dist/api/ipam/v1/marshalling.gen.js +18 -0
- package/dist/api/ipam/v1/types.gen.d.ts +59 -5
- package/dist/api/ipfs/index.gen.d.ts +5 -0
- package/dist/api/jobs/index.gen.d.ts +5 -0
- package/dist/api/k8s/index.gen.d.ts +5 -0
- package/dist/api/k8s/v1/api.gen.cjs +17 -0
- package/dist/api/k8s/v1/api.gen.d.ts +10 -1
- package/dist/api/k8s/v1/api.gen.js +17 -0
- package/dist/api/k8s/v1/index.gen.d.ts +1 -1
- package/dist/api/k8s/v1/types.gen.d.ts +13 -0
- package/dist/api/k8s/v1/validation-rules.gen.cjs +65 -0
- package/dist/api/k8s/v1/validation-rules.gen.d.ts +62 -0
- package/dist/api/k8s/v1/validation-rules.gen.js +66 -1
- package/dist/api/key_manager/index.gen.d.ts +5 -0
- package/dist/api/key_manager/v1alpha1/api.gen.cjs +31 -0
- package/dist/api/key_manager/v1alpha1/api.gen.d.ts +17 -1
- package/dist/api/key_manager/v1alpha1/api.gen.js +32 -1
- package/dist/api/key_manager/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/key_manager/v1alpha1/marshalling.gen.cjs +7 -0
- package/dist/api/key_manager/v1alpha1/marshalling.gen.d.ts +2 -1
- package/dist/api/key_manager/v1alpha1/marshalling.gen.js +7 -0
- package/dist/api/key_manager/v1alpha1/types.gen.d.ts +33 -0
- package/dist/api/lb/index.gen.d.ts +5 -0
- package/dist/api/llm_inference/index.gen.d.ts +5 -0
- package/dist/api/marketplace/index.gen.d.ts +5 -0
- package/dist/api/mnq/index.gen.cjs +4 -0
- package/dist/api/mnq/index.gen.d.ts +5 -0
- package/dist/api/mnq/index.gen.js +4 -0
- package/dist/api/qaas/index.gen.d.ts +5 -0
- package/dist/api/qaas/v1alpha1/api.gen.cjs +527 -0
- package/dist/api/qaas/v1alpha1/api.gen.d.ts +256 -0
- package/dist/api/qaas/v1alpha1/api.gen.js +527 -0
- package/dist/api/qaas/v1alpha1/content.gen.cjs +19 -0
- package/dist/api/qaas/v1alpha1/content.gen.d.ts +7 -0
- package/dist/api/qaas/v1alpha1/content.gen.js +19 -0
- package/dist/api/qaas/v1alpha1/index.gen.cjs +10 -0
- package/dist/api/qaas/v1alpha1/index.gen.d.ts +4 -0
- package/dist/api/qaas/v1alpha1/index.gen.js +10 -0
- package/dist/api/qaas/v1alpha1/marshalling.gen.cjs +320 -0
- package/dist/api/qaas/v1alpha1/marshalling.gen.d.ts +22 -0
- package/dist/api/qaas/v1alpha1/marshalling.gen.js +320 -0
- package/dist/api/qaas/v1alpha1/types.gen.d.ts +470 -0
- package/dist/api/qaas/v1alpha1/validation-rules.gen.cjs +14 -0
- package/dist/api/qaas/v1alpha1/validation-rules.gen.d.ts +10 -0
- package/dist/api/qaas/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/rdb/index.gen.d.ts +5 -0
- package/dist/api/redis/index.gen.d.ts +5 -0
- package/dist/api/registry/index.gen.d.ts +5 -0
- package/dist/api/secret/index.gen.d.ts +6 -0
- package/dist/api/serverless_sqldb/index.gen.d.ts +5 -0
- package/dist/api/tem/index.gen.cjs +4 -0
- package/dist/api/tem/index.gen.d.ts +5 -0
- package/dist/api/tem/index.gen.js +4 -0
- package/dist/api/tem/v1alpha1/api.gen.cjs +32 -0
- package/dist/api/tem/v1alpha1/api.gen.d.ts +17 -1
- package/dist/api/tem/v1alpha1/api.gen.js +33 -1
- package/dist/api/tem/v1alpha1/content.gen.cjs +4 -1
- package/dist/api/tem/v1alpha1/content.gen.js +4 -1
- package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +36 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +3 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +36 -0
- package/dist/api/tem/v1alpha1/types.gen.d.ts +52 -1
- package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +11 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +10 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.js +11 -0
- package/dist/api/test/index.gen.d.ts +5 -0
- package/dist/api/vpc/index.gen.d.ts +6 -0
- package/dist/api/vpc/v2/marshalling.gen.cjs +1 -0
- package/dist/api/vpc/v2/marshalling.gen.js +1 -0
- package/dist/api/vpc/v2/types.gen.d.ts +3 -0
- package/dist/api/vpcgw/index.gen.d.ts +5 -0
- package/dist/api/webhosting/index.gen.cjs +6 -0
- package/dist/api/webhosting/index.gen.d.ts +6 -0
- package/dist/api/webhosting/index.gen.js +6 -0
- package/dist/api/webhosting/v1/api.gen.cjs +620 -0
- package/dist/api/webhosting/v1/api.gen.d.ts +326 -0
- package/dist/api/webhosting/v1/api.gen.js +620 -0
- package/dist/api/webhosting/v1/content.gen.cjs +14 -0
- package/dist/api/webhosting/v1/content.gen.d.ts +5 -0
- package/dist/api/webhosting/v1/content.gen.js +14 -0
- package/dist/api/webhosting/v1/index.gen.cjs +15 -0
- package/dist/api/webhosting/v1/index.gen.d.ts +4 -0
- package/dist/api/webhosting/v1/index.gen.js +15 -0
- package/dist/api/webhosting/v1/marshalling.gen.cjs +391 -0
- package/dist/api/webhosting/v1/marshalling.gen.d.ts +29 -0
- package/dist/api/webhosting/v1/marshalling.gen.js +391 -0
- package/dist/api/webhosting/v1/types.gen.d.ts +698 -0
- package/dist/api/webhosting/v1/validation-rules.gen.cjs +82 -0
- package/dist/api/webhosting/v1/validation-rules.gen.d.ts +72 -0
- package/dist/api/webhosting/v1/validation-rules.gen.js +82 -0
- package/dist/index.cjs +92 -70
- package/dist/index.js +92 -70
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
- package/dist/api/account/index.d.ts +0 -2
- package/dist/api/applesilicon/index.d.ts +0 -1
- package/dist/api/baremetal/index.d.ts +0 -1
- package/dist/api/billing/index.d.ts +0 -2
- package/dist/api/block/index.d.ts +0 -1
- package/dist/api/cockpit/index.d.ts +0 -2
- package/dist/api/container/index.d.ts +0 -1
- package/dist/api/dedibox/index.d.ts +0 -1
- package/dist/api/document_db/index.d.ts +0 -1
- package/dist/api/domain/index.d.ts +0 -1
- package/dist/api/edge_services/index.d.ts +0 -1
- package/dist/api/flexibleip/index.d.ts +0 -1
- package/dist/api/function/index.d.ts +0 -1
- package/dist/api/iam/index.d.ts +0 -1
- package/dist/api/instance/index.d.ts +0 -1
- package/dist/api/iot/index.d.ts +0 -1
- package/dist/api/ipam/index.d.ts +0 -1
- package/dist/api/ipfs/index.d.ts +0 -1
- package/dist/api/jobs/index.d.ts +0 -1
- package/dist/api/k8s/index.d.ts +0 -1
- package/dist/api/key_manager/index.d.ts +0 -1
- package/dist/api/lb/index.d.ts +0 -1
- package/dist/api/llm_inference/index.d.ts +0 -1
- package/dist/api/marketplace/index.d.ts +0 -1
- package/dist/api/mnq/index.d.ts +0 -1
- package/dist/api/rdb/index.d.ts +0 -1
- package/dist/api/redis/index.d.ts +0 -1
- package/dist/api/registry/index.d.ts +0 -1
- package/dist/api/secret/index.d.ts +0 -2
- package/dist/api/serverless_sqldb/index.d.ts +0 -1
- package/dist/api/tem/index.d.ts +0 -1
- package/dist/api/test/index.d.ts +0 -1
- package/dist/api/vpc/index.d.ts +0 -2
- package/dist/api/vpcgw/index.d.ts +0 -1
- package/dist/api/webhosting/index.d.ts +0 -1
- /package/dist/api/account/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/account/{index.js → index.gen.js} +0 -0
- /package/dist/api/applesilicon/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/applesilicon/{index.js → index.gen.js} +0 -0
- /package/dist/api/baremetal/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/baremetal/{index.js → index.gen.js} +0 -0
- /package/dist/api/billing/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/billing/{index.js → index.gen.js} +0 -0
- /package/dist/api/block/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/block/{index.js → index.gen.js} +0 -0
- /package/dist/api/cockpit/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/cockpit/{index.js → index.gen.js} +0 -0
- /package/dist/api/container/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/container/{index.js → index.gen.js} +0 -0
- /package/dist/api/dedibox/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/dedibox/{index.js → index.gen.js} +0 -0
- /package/dist/api/document_db/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/document_db/{index.js → index.gen.js} +0 -0
- /package/dist/api/domain/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/domain/{index.js → index.gen.js} +0 -0
- /package/dist/api/{flexibleip/index.cjs → edge_services/index.gen.cjs} +0 -0
- /package/dist/api/{flexibleip/index.js → edge_services/index.gen.js} +0 -0
- /package/dist/api/{iam/index.cjs → flexibleip/index.gen.cjs} +0 -0
- /package/dist/api/{iam/index.js → flexibleip/index.gen.js} +0 -0
- /package/dist/api/function/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/function/{index.js → index.gen.js} +0 -0
- /package/dist/api/{ipfs/index.cjs → iam/index.gen.cjs} +0 -0
- /package/dist/api/{ipfs/index.js → iam/index.gen.js} +0 -0
- /package/dist/api/{llm_inference/index.cjs → inference/index.gen.cjs} +0 -0
- /package/dist/api/{llm_inference/index.js → inference/index.gen.js} +0 -0
- /package/dist/api/instance/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/instance/{index.js → index.gen.js} +0 -0
- /package/dist/api/iot/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/iot/{index.js → index.gen.js} +0 -0
- /package/dist/api/ipam/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/ipam/{index.js → index.gen.js} +0 -0
- /package/dist/api/{jobs/index.cjs → ipfs/index.gen.cjs} +0 -0
- /package/dist/api/{jobs/index.js → ipfs/index.gen.js} +0 -0
- /package/dist/api/{key_manager/index.cjs → jobs/index.gen.cjs} +0 -0
- /package/dist/api/{key_manager/index.js → jobs/index.gen.js} +0 -0
- /package/dist/api/k8s/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/k8s/{index.js → index.gen.js} +0 -0
- /package/dist/api/{serverless_sqldb/index.cjs → key_manager/index.gen.cjs} +0 -0
- /package/dist/api/{serverless_sqldb/index.js → key_manager/index.gen.js} +0 -0
- /package/dist/api/lb/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/lb/{index.js → index.gen.js} +0 -0
- /package/dist/api/{mnq/index.cjs → llm_inference/index.gen.cjs} +0 -0
- /package/dist/api/{mnq/index.js → llm_inference/index.gen.js} +0 -0
- /package/dist/api/marketplace/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/marketplace/{index.js → index.gen.js} +0 -0
- /package/dist/api/{tem/index.cjs → qaas/index.gen.cjs} +0 -0
- /package/dist/api/{tem/index.js → qaas/index.gen.js} +0 -0
- /package/dist/api/rdb/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/rdb/{index.js → index.gen.js} +0 -0
- /package/dist/api/redis/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/redis/{index.js → index.gen.js} +0 -0
- /package/dist/api/registry/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/registry/{index.js → index.gen.js} +0 -0
- /package/dist/api/secret/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/secret/{index.js → index.gen.js} +0 -0
- /package/dist/api/{webhosting/index.cjs → serverless_sqldb/index.gen.cjs} +0 -0
- /package/dist/api/{webhosting/index.js → serverless_sqldb/index.gen.js} +0 -0
- /package/dist/api/test/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/test/{index.js → index.gen.js} +0 -0
- /package/dist/api/vpc/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/vpc/{index.js → index.gen.js} +0 -0
- /package/dist/api/vpcgw/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/vpcgw/{index.js → index.gen.js} +0 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import randomName from "@scaleway/random-name";
|
|
2
|
+
import { isJSONObject } from "../../../helpers/json.js";
|
|
3
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
4
|
+
import "../../../vendor/base64/index.js";
|
|
5
|
+
const unmarshalEndpointPrivateNetworkDetails = (data) => {
|
|
6
|
+
if (!isJSONObject(data)) {
|
|
7
|
+
throw new TypeError(
|
|
8
|
+
`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
privateNetworkId: data.private_network_id
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const unmarshalEndpointPublicAccessDetails = (data) => {
|
|
16
|
+
if (!isJSONObject(data)) {
|
|
17
|
+
throw new TypeError(
|
|
18
|
+
`Unmarshalling the type 'EndpointPublicAccessDetails' failed as data isn't a dictionary.`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return {};
|
|
22
|
+
};
|
|
23
|
+
const unmarshalEndpoint = (data) => {
|
|
24
|
+
if (!isJSONObject(data)) {
|
|
25
|
+
throw new TypeError(
|
|
26
|
+
`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
disableAuth: data.disable_auth,
|
|
31
|
+
id: data.id,
|
|
32
|
+
privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
|
|
33
|
+
publicAccess: data.public_access ? unmarshalEndpointPublicAccessDetails(data.public_access) : void 0,
|
|
34
|
+
url: data.url
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const unmarshalDeployment = (data) => {
|
|
38
|
+
if (!isJSONObject(data)) {
|
|
39
|
+
throw new TypeError(
|
|
40
|
+
`Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
createdAt: unmarshalDate(data.created_at),
|
|
45
|
+
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
|
|
46
|
+
errorMessage: data.error_message,
|
|
47
|
+
id: data.id,
|
|
48
|
+
maxSize: data.max_size,
|
|
49
|
+
minSize: data.min_size,
|
|
50
|
+
modelId: data.model_id,
|
|
51
|
+
modelName: data.model_name,
|
|
52
|
+
name: data.name,
|
|
53
|
+
nodeType: data.node_type,
|
|
54
|
+
projectId: data.project_id,
|
|
55
|
+
region: data.region,
|
|
56
|
+
size: data.size,
|
|
57
|
+
status: data.status,
|
|
58
|
+
tags: data.tags,
|
|
59
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
const unmarshalModelS3Model = (data) => {
|
|
63
|
+
if (!isJSONObject(data)) {
|
|
64
|
+
throw new TypeError(
|
|
65
|
+
`Unmarshalling the type 'ModelS3Model' failed as data isn't a dictionary.`
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
nodeType: data.node_type,
|
|
70
|
+
pythonDependencies: data.python_dependencies,
|
|
71
|
+
s3Url: data.s3_url,
|
|
72
|
+
tritonServerVersion: data.triton_server_version
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const unmarshalModel = (data) => {
|
|
76
|
+
if (!isJSONObject(data)) {
|
|
77
|
+
throw new TypeError(
|
|
78
|
+
`Unmarshalling the type 'Model' failed as data isn't a dictionary.`
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
compatibleNodeTypes: data.compatible_node_types,
|
|
83
|
+
createdAt: unmarshalDate(data.created_at),
|
|
84
|
+
description: data.description,
|
|
85
|
+
hasEula: data.has_eula,
|
|
86
|
+
id: data.id,
|
|
87
|
+
isPublic: data.is_public,
|
|
88
|
+
name: data.name,
|
|
89
|
+
projectId: data.project_id,
|
|
90
|
+
provider: data.provider,
|
|
91
|
+
quantizationLevel: data.quantization_level,
|
|
92
|
+
region: data.region,
|
|
93
|
+
s3Model: data.s3_model ? unmarshalModelS3Model(data.s3_model) : void 0,
|
|
94
|
+
tags: data.tags,
|
|
95
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
const unmarshalACLRule = (data) => {
|
|
99
|
+
if (!isJSONObject(data)) {
|
|
100
|
+
throw new TypeError(
|
|
101
|
+
`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
description: data.description,
|
|
106
|
+
id: data.id,
|
|
107
|
+
ip: data.ip
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
const unmarshalAddDeploymentACLRulesResponse = (data) => {
|
|
111
|
+
if (!isJSONObject(data)) {
|
|
112
|
+
throw new TypeError(
|
|
113
|
+
`Unmarshalling the type 'AddDeploymentACLRulesResponse' failed as data isn't a dictionary.`
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
const unmarshalEula = (data) => {
|
|
121
|
+
if (!isJSONObject(data)) {
|
|
122
|
+
throw new TypeError(
|
|
123
|
+
`Unmarshalling the type 'Eula' failed as data isn't a dictionary.`
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
content: data.content
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
const unmarshalListDeploymentACLRulesResponse = (data) => {
|
|
131
|
+
if (!isJSONObject(data)) {
|
|
132
|
+
throw new TypeError(
|
|
133
|
+
`Unmarshalling the type 'ListDeploymentACLRulesResponse' failed as data isn't a dictionary.`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule),
|
|
138
|
+
totalCount: data.total_count
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
const unmarshalListDeploymentsResponse = (data) => {
|
|
142
|
+
if (!isJSONObject(data)) {
|
|
143
|
+
throw new TypeError(
|
|
144
|
+
`Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
|
|
149
|
+
totalCount: data.total_count
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
const unmarshalListModelsResponse = (data) => {
|
|
153
|
+
if (!isJSONObject(data)) {
|
|
154
|
+
throw new TypeError(
|
|
155
|
+
`Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
models: unmarshalArrayOfObject(data.models, unmarshalModel),
|
|
160
|
+
totalCount: data.total_count
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
const unmarshalNodeType = (data) => {
|
|
164
|
+
if (!isJSONObject(data)) {
|
|
165
|
+
throw new TypeError(
|
|
166
|
+
`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
beta: data.beta,
|
|
171
|
+
createdAt: unmarshalDate(data.created_at),
|
|
172
|
+
description: data.description,
|
|
173
|
+
disabled: data.disabled,
|
|
174
|
+
gpus: data.gpus,
|
|
175
|
+
memory: data.memory,
|
|
176
|
+
name: data.name,
|
|
177
|
+
region: data.region,
|
|
178
|
+
stockStatus: data.stock_status,
|
|
179
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
180
|
+
vcpus: data.vcpus,
|
|
181
|
+
vram: data.vram
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
const unmarshalListNodeTypesResponse = (data) => {
|
|
185
|
+
if (!isJSONObject(data)) {
|
|
186
|
+
throw new TypeError(
|
|
187
|
+
`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
192
|
+
totalCount: data.total_count
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
const unmarshalSetDeploymentACLRulesResponse = (data) => {
|
|
196
|
+
if (!isJSONObject(data)) {
|
|
197
|
+
throw new TypeError(
|
|
198
|
+
`Unmarshalling the type 'SetDeploymentACLRulesResponse' failed as data isn't a dictionary.`
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
const marshalACLRuleRequest = (request, defaults) => ({
|
|
206
|
+
description: request.description,
|
|
207
|
+
ip: request.ip
|
|
208
|
+
});
|
|
209
|
+
const marshalAddDeploymentACLRulesRequest = (request, defaults) => ({
|
|
210
|
+
acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0
|
|
211
|
+
});
|
|
212
|
+
const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({
|
|
213
|
+
private_network_id: request.privateNetworkId
|
|
214
|
+
});
|
|
215
|
+
const marshalEndpointSpecPublic = (request, defaults) => ({});
|
|
216
|
+
const marshalEndpointSpec = (request, defaults) => ({
|
|
217
|
+
disable_auth: request.disableAuth,
|
|
218
|
+
...resolveOneOf([
|
|
219
|
+
{
|
|
220
|
+
param: "public",
|
|
221
|
+
value: request.public !== void 0 ? marshalEndpointSpecPublic(request.public) : void 0
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
param: "private_network",
|
|
225
|
+
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0
|
|
226
|
+
}
|
|
227
|
+
])
|
|
228
|
+
});
|
|
229
|
+
const marshalCreateDeploymentRequest = (request, defaults) => ({
|
|
230
|
+
accept_eula: request.acceptEula,
|
|
231
|
+
endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt)),
|
|
232
|
+
max_size: request.maxSize,
|
|
233
|
+
min_size: request.minSize,
|
|
234
|
+
model_name: request.modelName,
|
|
235
|
+
name: request.name || randomName("inference"),
|
|
236
|
+
node_type: request.nodeType,
|
|
237
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
238
|
+
tags: request.tags
|
|
239
|
+
});
|
|
240
|
+
const marshalCreateEndpointRequest = (request, defaults) => ({
|
|
241
|
+
deployment_id: request.deploymentId,
|
|
242
|
+
endpoint: marshalEndpointSpec(request.endpoint)
|
|
243
|
+
});
|
|
244
|
+
const marshalSetDeploymentACLRulesRequest = (request, defaults) => ({
|
|
245
|
+
acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0
|
|
246
|
+
});
|
|
247
|
+
const marshalUpdateDeploymentRequest = (request, defaults) => ({
|
|
248
|
+
max_size: request.maxSize,
|
|
249
|
+
min_size: request.minSize,
|
|
250
|
+
name: request.name,
|
|
251
|
+
tags: request.tags
|
|
252
|
+
});
|
|
253
|
+
const marshalUpdateEndpointRequest = (request, defaults) => ({
|
|
254
|
+
disable_auth: request.disableAuth
|
|
255
|
+
});
|
|
256
|
+
export {
|
|
257
|
+
marshalAddDeploymentACLRulesRequest,
|
|
258
|
+
marshalCreateDeploymentRequest,
|
|
259
|
+
marshalCreateEndpointRequest,
|
|
260
|
+
marshalSetDeploymentACLRulesRequest,
|
|
261
|
+
marshalUpdateDeploymentRequest,
|
|
262
|
+
marshalUpdateEndpointRequest,
|
|
263
|
+
unmarshalAddDeploymentACLRulesResponse,
|
|
264
|
+
unmarshalDeployment,
|
|
265
|
+
unmarshalEndpoint,
|
|
266
|
+
unmarshalEula,
|
|
267
|
+
unmarshalListDeploymentACLRulesResponse,
|
|
268
|
+
unmarshalListDeploymentsResponse,
|
|
269
|
+
unmarshalListModelsResponse,
|
|
270
|
+
unmarshalListNodeTypesResponse,
|
|
271
|
+
unmarshalModel,
|
|
272
|
+
unmarshalSetDeploymentACLRulesResponse
|
|
273
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const CreateDeploymentRequest = {
|
|
4
|
+
maxSize: {
|
|
5
|
+
greaterThanOrEqual: 1,
|
|
6
|
+
lessThanOrEqual: 50
|
|
7
|
+
},
|
|
8
|
+
minSize: {
|
|
9
|
+
greaterThanOrEqual: 1,
|
|
10
|
+
lessThanOrEqual: 50
|
|
11
|
+
},
|
|
12
|
+
modelName: {
|
|
13
|
+
maxLength: 255,
|
|
14
|
+
minLength: 0,
|
|
15
|
+
pattern: /^[\w-_]+\/[\w-_.]+(:[\w]+)?$/
|
|
16
|
+
},
|
|
17
|
+
name: {
|
|
18
|
+
maxLength: 255,
|
|
19
|
+
minLength: 1,
|
|
20
|
+
pattern: /^[A-Za-z0-9-_]+$/
|
|
21
|
+
},
|
|
22
|
+
nodeType: {
|
|
23
|
+
maxLength: 64,
|
|
24
|
+
minLength: 1
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const ListDeploymentsRequest = {
|
|
28
|
+
name: {
|
|
29
|
+
maxLength: 255,
|
|
30
|
+
minLength: 1
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const ListModelsRequest = {
|
|
34
|
+
name: {
|
|
35
|
+
maxLength: 255,
|
|
36
|
+
minLength: 1
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const UpdateDeploymentRequest = {
|
|
40
|
+
maxSize: {
|
|
41
|
+
greaterThanOrEqual: 1,
|
|
42
|
+
lessThanOrEqual: 50
|
|
43
|
+
},
|
|
44
|
+
minSize: {
|
|
45
|
+
greaterThanOrEqual: 1,
|
|
46
|
+
lessThanOrEqual: 50
|
|
47
|
+
},
|
|
48
|
+
name: {
|
|
49
|
+
maxLength: 255,
|
|
50
|
+
minLength: 1
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.CreateDeploymentRequest = CreateDeploymentRequest;
|
|
54
|
+
exports.ListDeploymentsRequest = ListDeploymentsRequest;
|
|
55
|
+
exports.ListModelsRequest = ListModelsRequest;
|
|
56
|
+
exports.UpdateDeploymentRequest = UpdateDeploymentRequest;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const CreateDeploymentRequest = {
|
|
2
|
+
maxSize: {
|
|
3
|
+
greaterThanOrEqual: 1,
|
|
4
|
+
lessThanOrEqual: 50
|
|
5
|
+
},
|
|
6
|
+
minSize: {
|
|
7
|
+
greaterThanOrEqual: 1,
|
|
8
|
+
lessThanOrEqual: 50
|
|
9
|
+
},
|
|
10
|
+
modelName: {
|
|
11
|
+
maxLength: 255,
|
|
12
|
+
minLength: 0,
|
|
13
|
+
pattern: /^[\w-_]+\/[\w-_.]+(:[\w]+)?$/
|
|
14
|
+
},
|
|
15
|
+
name: {
|
|
16
|
+
maxLength: 255,
|
|
17
|
+
minLength: 1,
|
|
18
|
+
pattern: /^[A-Za-z0-9-_]+$/
|
|
19
|
+
},
|
|
20
|
+
nodeType: {
|
|
21
|
+
maxLength: 64,
|
|
22
|
+
minLength: 1
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const ListDeploymentsRequest = {
|
|
26
|
+
name: {
|
|
27
|
+
maxLength: 255,
|
|
28
|
+
minLength: 1
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const ListModelsRequest = {
|
|
32
|
+
name: {
|
|
33
|
+
maxLength: 255,
|
|
34
|
+
minLength: 1
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const UpdateDeploymentRequest = {
|
|
38
|
+
maxSize: {
|
|
39
|
+
greaterThanOrEqual: 1,
|
|
40
|
+
lessThanOrEqual: 50
|
|
41
|
+
},
|
|
42
|
+
minSize: {
|
|
43
|
+
greaterThanOrEqual: 1,
|
|
44
|
+
lessThanOrEqual: 50
|
|
45
|
+
},
|
|
46
|
+
name: {
|
|
47
|
+
maxLength: 255,
|
|
48
|
+
minLength: 1
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
CreateDeploymentRequest,
|
|
53
|
+
ListDeploymentsRequest,
|
|
54
|
+
ListModelsRequest,
|
|
55
|
+
UpdateDeploymentRequest
|
|
56
|
+
};
|
|
@@ -867,6 +867,7 @@ const unmarshalServerType = (data) => {
|
|
|
867
867
|
altNames: data.alt_names,
|
|
868
868
|
arch: data.arch,
|
|
869
869
|
baremetal: data.baremetal,
|
|
870
|
+
blockBandwidth: data.block_bandwidth,
|
|
870
871
|
capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : void 0,
|
|
871
872
|
gpu: data.gpu,
|
|
872
873
|
hourlyPrice: data.hourly_price,
|
|
@@ -865,6 +865,7 @@ const unmarshalServerType = (data) => {
|
|
|
865
865
|
altNames: data.alt_names,
|
|
866
866
|
arch: data.arch,
|
|
867
867
|
baremetal: data.baremetal,
|
|
868
|
+
blockBandwidth: data.block_bandwidth,
|
|
868
869
|
capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : void 0,
|
|
869
870
|
gpu: data.gpu,
|
|
870
871
|
hourlyPrice: data.hourly_price,
|
|
@@ -282,8 +282,11 @@ export interface Server {
|
|
|
282
282
|
creationDate?: Date;
|
|
283
283
|
/** True if a dynamic IPv4 is required. */
|
|
284
284
|
dynamicIpRequired: boolean;
|
|
285
|
-
/**
|
|
286
|
-
|
|
285
|
+
/**
|
|
286
|
+
* @deprecated True to configure the instance so it uses the routed IP mode.
|
|
287
|
+
* Use of `routed_ip_enabled` as `False` is deprecated.
|
|
288
|
+
*/
|
|
289
|
+
routedIpEnabled?: boolean;
|
|
287
290
|
/**
|
|
288
291
|
* @deprecated True if IPv6 is enabled (deprecated and always `False` when
|
|
289
292
|
* `routed_ip_enabled` is `True`).
|
|
@@ -566,6 +569,11 @@ export interface ServerType {
|
|
|
566
569
|
capabilities?: ServerTypeCapabilities;
|
|
567
570
|
/** Maximum available scratch storage. */
|
|
568
571
|
scratchStorageMaxSize?: number;
|
|
572
|
+
/**
|
|
573
|
+
* The maximum bandwidth allocated to block storage access (in bytes per
|
|
574
|
+
* second).
|
|
575
|
+
*/
|
|
576
|
+
blockBandwidth?: number;
|
|
569
577
|
}
|
|
570
578
|
export interface VolumeType {
|
|
571
579
|
displayName: string;
|
|
@@ -718,7 +726,10 @@ export type CreateIpRequest = {
|
|
|
718
726
|
tags?: string[];
|
|
719
727
|
/** UUID of the Instance you want to attach the IP to. */
|
|
720
728
|
server?: string;
|
|
721
|
-
/**
|
|
729
|
+
/**
|
|
730
|
+
* IP type to reserve (either 'routed_ipv4' or 'routed_ipv6', use of 'nat' is
|
|
731
|
+
* deprecated).
|
|
732
|
+
*/
|
|
722
733
|
type?: IpType;
|
|
723
734
|
};
|
|
724
735
|
export interface CreateIpResponse {
|
|
@@ -855,7 +866,10 @@ export type CreateServerRequest = {
|
|
|
855
866
|
name?: string;
|
|
856
867
|
/** Define if a dynamic IPv4 is required for the Instance. */
|
|
857
868
|
dynamicIpRequired?: boolean;
|
|
858
|
-
/**
|
|
869
|
+
/**
|
|
870
|
+
* @deprecated If true, configure the Instance so it uses the new routed IP
|
|
871
|
+
* mode.
|
|
872
|
+
*/
|
|
859
873
|
routedIpEnabled?: boolean;
|
|
860
874
|
/** Define the Instance commercial type (i.e. GP1-S). */
|
|
861
875
|
commercialType: string;
|
|
@@ -1251,8 +1265,8 @@ export type ListIpsRequest = {
|
|
|
1251
1265
|
/** A positive integer to choose the page to return. */
|
|
1252
1266
|
page?: number;
|
|
1253
1267
|
/**
|
|
1254
|
-
* Filter on the IP Mobility IP type (whose value should be either
|
|
1255
|
-
* 'routed_ipv4' or '
|
|
1268
|
+
* Filter on the IP Mobility IP type (whose value should be either
|
|
1269
|
+
* 'routed_ipv4', 'routed_ipv6' or 'nat').
|
|
1256
1270
|
*/
|
|
1257
1271
|
type?: string;
|
|
1258
1272
|
};
|
|
@@ -1779,8 +1793,8 @@ export type UpdateServerRequest = {
|
|
|
1779
1793
|
bootscript?: string;
|
|
1780
1794
|
dynamicIpRequired?: boolean;
|
|
1781
1795
|
/**
|
|
1782
|
-
* True to configure the instance so it uses the new routed IP
|
|
1783
|
-
* is set to True you cannot set it back to False).
|
|
1796
|
+
* @deprecated True to configure the instance so it uses the new routed IP
|
|
1797
|
+
* mode (once this is set to True you cannot set it back to False).
|
|
1784
1798
|
*/
|
|
1785
1799
|
routedIpEnabled?: boolean;
|
|
1786
1800
|
/** A list of reserved IP IDs to attach to the Instance. */
|
|
@@ -83,8 +83,8 @@ export type SetServerRequest = {
|
|
|
83
83
|
/** True if a dynamic IPv4 is required. */
|
|
84
84
|
dynamicIpRequired: boolean;
|
|
85
85
|
/**
|
|
86
|
-
* True to configure the instance so it uses the new routed IP
|
|
87
|
-
* is set to True you cannot set it back to False).
|
|
86
|
+
* @deprecated True to configure the instance so it uses the new routed IP
|
|
87
|
+
* mode (once this is set to True you cannot set it back to False).
|
|
88
88
|
*/
|
|
89
89
|
routedIpEnabled?: boolean;
|
|
90
90
|
/**
|
|
@@ -12,8 +12,8 @@ class API extends api.API {
|
|
|
12
12
|
/** Lists the available regions of the API. */
|
|
13
13
|
static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"];
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* only be
|
|
15
|
+
* Reserve a new IP. Reserve a new IP from the specified source. Currently IPs
|
|
16
|
+
* can only be reserved from a Private Network.
|
|
17
17
|
*
|
|
18
18
|
* @param request - The request {@link BookIPRequest}
|
|
19
19
|
* @returns A Promise of IP
|
|
@@ -123,5 +123,70 @@ class API extends api.API {
|
|
|
123
123
|
* @returns A Promise of ListIPsResponse
|
|
124
124
|
*/
|
|
125
125
|
listIPs = (request = {}) => resourcePaginator.enrichForPagination("ips", this.pageOfListIPs, request);
|
|
126
|
+
/**
|
|
127
|
+
* Attach IP to custom resource. Attach an existing reserved IP from a Private
|
|
128
|
+
* Network subnet to a custom, named resource via its MAC address. An example
|
|
129
|
+
* of a custom resource is a virtual machine hosted on an Elastic Metal
|
|
130
|
+
* server. Do not use this method for attaching IP addresses to standard
|
|
131
|
+
* Scaleway resources as it will fail - see the relevant product API for an
|
|
132
|
+
* equivalent method.
|
|
133
|
+
*
|
|
134
|
+
* @param request - The request {@link AttachIPRequest}
|
|
135
|
+
* @returns A Promise of IP
|
|
136
|
+
*/
|
|
137
|
+
attachIP = (request) => this.client.fetch(
|
|
138
|
+
{
|
|
139
|
+
body: JSON.stringify(
|
|
140
|
+
marshalling_gen.marshalAttachIPRequest(request, this.client.settings)
|
|
141
|
+
),
|
|
142
|
+
headers: jsonContentHeaders,
|
|
143
|
+
method: "POST",
|
|
144
|
+
path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}/attach`
|
|
145
|
+
},
|
|
146
|
+
marshalling_gen.unmarshalIP
|
|
147
|
+
);
|
|
148
|
+
/**
|
|
149
|
+
* Detach IP from a custom resource. Detach a private IP from a custom
|
|
150
|
+
* resource. An example of a custom resource is a virtual machine hosted on an
|
|
151
|
+
* Elastic Metal server. Do not use this method for detaching IP addresses
|
|
152
|
+
* from standard Scaleway resources (e.g. Instances, Load Balancers) as it
|
|
153
|
+
* will fail - see the relevant product API for an equivalent method.
|
|
154
|
+
*
|
|
155
|
+
* @param request - The request {@link DetachIPRequest}
|
|
156
|
+
* @returns A Promise of IP
|
|
157
|
+
*/
|
|
158
|
+
detachIP = (request) => this.client.fetch(
|
|
159
|
+
{
|
|
160
|
+
body: JSON.stringify(
|
|
161
|
+
marshalling_gen.marshalDetachIPRequest(request, this.client.settings)
|
|
162
|
+
),
|
|
163
|
+
headers: jsonContentHeaders,
|
|
164
|
+
method: "POST",
|
|
165
|
+
path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}/detach`
|
|
166
|
+
},
|
|
167
|
+
marshalling_gen.unmarshalIP
|
|
168
|
+
);
|
|
169
|
+
/**
|
|
170
|
+
* Move IP to a custom resource. Move an existing reserved private IP from one
|
|
171
|
+
* custom resource (e.g. a virtual machine hosted on an Elastic Metal server)
|
|
172
|
+
* to another custom resource. This will detach it from the first resource,
|
|
173
|
+
* and attach it to the second. Do not use this method for moving IP addresses
|
|
174
|
+
* between standard Scaleway resources (e.g. Instances, Load Balancers) as it
|
|
175
|
+
* will fail - see the relevant product API for an equivalent method.
|
|
176
|
+
*
|
|
177
|
+
* @param request - The request {@link MoveIPRequest}
|
|
178
|
+
* @returns A Promise of IP
|
|
179
|
+
*/
|
|
180
|
+
moveIP = (request) => this.client.fetch(
|
|
181
|
+
{
|
|
182
|
+
body: JSON.stringify(
|
|
183
|
+
marshalling_gen.marshalMoveIPRequest(request, this.client.settings)
|
|
184
|
+
),
|
|
185
|
+
headers: jsonContentHeaders,
|
|
186
|
+
method: "POST",
|
|
187
|
+
path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}/move`
|
|
188
|
+
},
|
|
189
|
+
marshalling_gen.unmarshalIP
|
|
190
|
+
);
|
|
126
191
|
}
|
|
127
192
|
exports.API = API;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '../../../bridge';
|
|
2
2
|
import type { Region } from '../../../bridge';
|
|
3
|
-
import type { BookIPRequest, GetIPRequest, IP, ListIPsRequest, ListIPsResponse, ReleaseIPRequest, ReleaseIPSetRequest, UpdateIPRequest } from './types.gen';
|
|
3
|
+
import type { AttachIPRequest, BookIPRequest, DetachIPRequest, GetIPRequest, IP, ListIPsRequest, ListIPsResponse, MoveIPRequest, ReleaseIPRequest, ReleaseIPSetRequest, UpdateIPRequest } from './types.gen';
|
|
4
4
|
/**
|
|
5
5
|
* IPAM API.
|
|
6
6
|
*
|
|
@@ -11,8 +11,8 @@ export declare class API extends ParentAPI {
|
|
|
11
11
|
/** Lists the available regions of the API. */
|
|
12
12
|
static readonly LOCALITIES: Region[];
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* only be
|
|
14
|
+
* Reserve a new IP. Reserve a new IP from the specified source. Currently IPs
|
|
15
|
+
* can only be reserved from a Private Network.
|
|
16
16
|
*
|
|
17
17
|
* @param request - The request {@link BookIPRequest}
|
|
18
18
|
* @returns A Promise of IP
|
|
@@ -55,4 +55,39 @@ export declare class API extends ParentAPI {
|
|
|
55
55
|
all: () => Promise<IP[]>;
|
|
56
56
|
[Symbol.asyncIterator]: () => AsyncGenerator<IP[], void, void>;
|
|
57
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Attach IP to custom resource. Attach an existing reserved IP from a Private
|
|
60
|
+
* Network subnet to a custom, named resource via its MAC address. An example
|
|
61
|
+
* of a custom resource is a virtual machine hosted on an Elastic Metal
|
|
62
|
+
* server. Do not use this method for attaching IP addresses to standard
|
|
63
|
+
* Scaleway resources as it will fail - see the relevant product API for an
|
|
64
|
+
* equivalent method.
|
|
65
|
+
*
|
|
66
|
+
* @param request - The request {@link AttachIPRequest}
|
|
67
|
+
* @returns A Promise of IP
|
|
68
|
+
*/
|
|
69
|
+
attachIP: (request: Readonly<AttachIPRequest>) => Promise<IP>;
|
|
70
|
+
/**
|
|
71
|
+
* Detach IP from a custom resource. Detach a private IP from a custom
|
|
72
|
+
* resource. An example of a custom resource is a virtual machine hosted on an
|
|
73
|
+
* Elastic Metal server. Do not use this method for detaching IP addresses
|
|
74
|
+
* from standard Scaleway resources (e.g. Instances, Load Balancers) as it
|
|
75
|
+
* will fail - see the relevant product API for an equivalent method.
|
|
76
|
+
*
|
|
77
|
+
* @param request - The request {@link DetachIPRequest}
|
|
78
|
+
* @returns A Promise of IP
|
|
79
|
+
*/
|
|
80
|
+
detachIP: (request: Readonly<DetachIPRequest>) => Promise<IP>;
|
|
81
|
+
/**
|
|
82
|
+
* Move IP to a custom resource. Move an existing reserved private IP from one
|
|
83
|
+
* custom resource (e.g. a virtual machine hosted on an Elastic Metal server)
|
|
84
|
+
* to another custom resource. This will detach it from the first resource,
|
|
85
|
+
* and attach it to the second. Do not use this method for moving IP addresses
|
|
86
|
+
* between standard Scaleway resources (e.g. Instances, Load Balancers) as it
|
|
87
|
+
* will fail - see the relevant product API for an equivalent method.
|
|
88
|
+
*
|
|
89
|
+
* @param request - The request {@link MoveIPRequest}
|
|
90
|
+
* @returns A Promise of IP
|
|
91
|
+
*/
|
|
92
|
+
moveIP: (request: Readonly<MoveIPRequest>) => Promise<IP>;
|
|
58
93
|
}
|