From fb9706c1ccd831a02bc6eeac2a674074f264584b Mon Sep 17 00:00:00 2001 From: AFatalErrror <102540704+AFatalErrror@users.noreply.github.com> Date: Fri, 29 Sep 2023 12:47:45 -0700 Subject: [PATCH 1/3] Add new VPC2 endpoints --- src/api/vpc2.js | 70 +++++++++++++++++++++++++++++++++++++++++++ src/index.js | 5 +++- test/api/vpc2.test.js | 36 ++++++++++++++++++++++ 3 files changed, 110 insertions(+), 1 deletion(-) diff --git a/src/api/vpc2.js b/src/api/vpc2.js index e154172b..100fd9f5 100644 --- a/src/api/vpc2.js +++ b/src/api/vpc2.js @@ -107,3 +107,73 @@ exports.createVpc = { prefix_length: { type: 'number' } } } + +/** + * Get a list of nodes attached to a VPC 2.0 network.
+ * {@link https://www.vultr.com/api/#tag/VPC2/operation/list-vpc2-nodes} + * @function listVpcNodes + * @memberof vpc2 + * @instance + */ +exports.listVpcNodes = { + url: '/vpc2/{vpc-id}/nodes', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'vpc-id': { + type: 'string', + path: true, + required: true + }, + per_page: { type: 'number' }, + cursor: { type: 'string' } + } +} + +/** + * Attach nodes to a VPC 2.0 network
+ * {@link https://www.vultr.com/api/#tag/VPC2/operation/attach-vpc2-nodes} + * @function attachVpcNodes + * @memberof vpc2 + * @instance + */ +exports.attachVpcNodes = { + url: '/vpc2/{vpc-id}/nodes/attach', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'vpc-id': { + type: 'string', + path: true, + required: true + }, + nodes: { + type: 'array', + required: true + } + } +} + +/** + * Detach nodes from a VPC 2.0 network
+ * {@link https://www.vultr.com/api/#tag/VPC2/operation/detach-vpc2-nodes} + * @function detachVpcNodes + * @memberof vpc2 + * @instance + */ +exports.detachVpcNodes = { + url: '/vpc2/{vpc-id}/nodes/detach', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'vpc-id': { + type: 'string', + path: true, + required: true + }, + nodes: { + type: 'array', + required: true + } + } +} diff --git a/src/index.js b/src/index.js index c8dfa716..81acd34c 100644 --- a/src/index.js +++ b/src/index.js @@ -512,7 +512,10 @@ exports.initialize = (config) => { deleteVpc: createRequestFunction(vpc2.deleteVpc), updateVpc: createRequestFunction(vpc2.updateVpc), listVpcs: createRequestFunction(vpc2.listVpcs), - createVpc: createRequestFunction(vpc2.createVpc) + createVpc: createRequestFunction(vpc2.createVpc), + listVpcNodes: createRequestFunction(vpc2.listVpcNodes), + attachVpcNodes: createRequestFunction(vpc2.attachVpcNodes), + detachVpcNodes: createRequestFunction(vpc2.detachVpcNodes) } } } diff --git a/test/api/vpc2.test.js b/test/api/vpc2.test.js index 3e5eb212..e1027990 100644 --- a/test/api/vpc2.test.js +++ b/test/api/vpc2.test.js @@ -13,6 +13,23 @@ const mockParameters = { }, createVpc: { region: 'ewr' + }, + listVpcNodes: { + 'vpc-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + }, + attachVpcNodes: { + 'vpc-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', + nodes: [ + "a4021db4-c1d0-43ba-8b5c-7a4a35444167", + "12a43ca5-0025-40ef-9edb-3a475809a8c0" + ] + }, + detachVpcNodes: { + 'vpc-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', + nodes: [ + "a4021db4-c1d0-43ba-8b5c-7a4a35444167", + "12a43ca5-0025-40ef-9edb-3a475809a8c0" + ] } } @@ -51,6 +68,25 @@ const mockResponses = { description: 'Example VPC', ip_block: '10.99.0.0', prefix_length: 24 + }, + listVpcNodes: { + nodes: [ + { + "id": "cb676a46-66fd-4dfb-b839-443f2e6c0b60", + "ip_address": "10.1.96.3", + "mac_address": "98964710968448", + "description": "Example-Description", + "type": "vps", + "node_status": "active" + } + ], + "meta": { + "total": 1, + "links": { + "next": "", + "prev": "" + } + } } } From 18d9e2e963d5f61c5c64d79eada5e427da3b45b8 Mon Sep 17 00:00:00 2001 From: AFatalErrror <102540704+AFatalErrror@users.noreply.github.com> Date: Fri, 29 Sep 2023 12:51:55 -0700 Subject: [PATCH 2/3] Add hostname to bare metals reinstall API route --- src/api/bare-metal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/bare-metal.js b/src/api/bare-metal.js index 7e4f7512..802651b0 100644 --- a/src/api/bare-metal.js +++ b/src/api/bare-metal.js @@ -229,7 +229,8 @@ exports.reinstallInstance = { type: 'string', path: true, required: true - } + }, + hostname: { type: 'string' } } } From dba61d55f9106151f8d3290b19d3f5dfd90bae74 Mon Sep 17 00:00:00 2001 From: AFatalErrror <102540704+AFatalErrror@users.noreply.github.com> Date: Mon, 2 Oct 2023 14:06:48 -0700 Subject: [PATCH 3/3] Add support for Vultr Container Registry --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/coverage.yml | 2 +- .github/workflows/release.yml | 8 +- docs/account.html | 4 +- docs/account.js.html | 4 +- docs/applications.html | 4 +- docs/applications.js.html | 4 +- docs/backup.html | 4 +- docs/backups.js.html | 4 +- docs/bare-metal.js.html | 7 +- docs/bareMetal.html | 26 +- docs/billing.html | 4 +- docs/billing.js.html | 4 +- docs/block-storage.js.html | 4 +- docs/blockStorage.html | 4 +- docs/databases.html | 4 +- docs/databases.js.html | 4 +- docs/dns.html | 4 +- docs/dns.js.html | 4 +- docs/firewall.html | 4 +- docs/firewall.js.html | 4 +- docs/index.html | 4 +- docs/instances.html | 72 +- docs/instances.js.html | 8 +- docs/iso.html | 4 +- docs/iso.js.html | 4 +- docs/kubernetes.html | 4 +- docs/kubernetes.js.html | 4 +- docs/load-balancers.js.html | 4 +- docs/loadBalancers.html | 4 +- docs/object-storage.js.html | 4 +- docs/objectStorage.html | 4 +- docs/operating-systems.js.html | 4 +- docs/operatingSystems.html | 4 +- docs/plans.html | 4 +- docs/plans.js.html | 4 +- docs/regions.html | 4 +- docs/regions.js.html | 4 +- docs/registries.html | 1294 +++++++++++++++++++++++++ docs/registries.js.html | 273 ++++++ docs/reserved-ips.js.html | 4 +- docs/reservedIps.html | 4 +- docs/snapshots.html | 4 +- docs/snapshots.js.html | 4 +- docs/ssh-keys.js.html | 4 +- docs/sshKeys.html | 4 +- docs/startup-scripts.js.html | 4 +- docs/startupScripts.html | 4 +- docs/users.html | 4 +- docs/users.js.html | 4 +- docs/vpc2.html | 271 +++++- docs/vpc2.js.html | 74 +- docs/vpcs.html | 4 +- docs/vpcs.js.html | 4 +- src/api/registries.js | 222 +++++ src/index.js | 22 + src/util.js | 6 +- test/api/registries.test.js | 342 +++++++ test/api/vpc2.test.js | 56 +- test/util.js | 2 +- 60 files changed, 2678 insertions(+), 181 deletions(-) create mode 100644 docs/registries.html create mode 100644 docs/registries.js.html create mode 100644 src/api/registries.js create mode 100644 test/api/registries.test.js diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 879048a3..f40b3585 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0ad2432f..ad32e557 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup node uses: actions/setup-node@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b7eabd2..3229903e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,13 +28,13 @@ jobs: outputs: new_tag: ${{ steps.tagger.outputs.new_tag }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: '0' - name: Bump version and push tag id: tagger - uses: anothrNick/github-tag-action@1.36.0 + uses: anothrNick/github-tag-action@1.67.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} WITH_V: true @@ -45,7 +45,7 @@ jobs: needs: create-tag steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Create Release id: create_release @@ -64,7 +64,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/docs/account.html b/docs/account.html index 5b1f5e34..96ef733f 100644 --- a/docs/account.html +++ b/docs/account.html @@ -211,13 +211,13 @@

getAcco
diff --git a/docs/account.js.html b/docs/account.js.html index ff8c6def..58aa939a 100644 --- a/docs/account.js.html +++ b/docs/account.js.html @@ -54,13 +54,13 @@

Source: account.js


diff --git a/docs/applications.html b/docs/applications.html index 35176653..172d6d5a 100644 --- a/docs/applications.html +++ b/docs/applications.html @@ -211,13 +211,13 @@

listHome

Namespaces

+

Home

Namespaces


diff --git a/docs/applications.js.html b/docs/applications.js.html index 4b6b9813..57b37930 100644 --- a/docs/applications.js.html +++ b/docs/applications.js.html @@ -58,13 +58,13 @@

Source: applications.js


diff --git a/docs/backup.html b/docs/backup.html index bc8e7b24..da4106d9 100644 --- a/docs/backup.html +++ b/docs/backup.html @@ -300,13 +300,13 @@

listHome

Namespaces

+

Home

Namespaces


diff --git a/docs/backups.js.html b/docs/backups.js.html index 01d66c27..0475f495 100644 --- a/docs/backups.js.html +++ b/docs/backups.js.html @@ -79,13 +79,13 @@

Source: backups.js


diff --git a/docs/bare-metal.js.html b/docs/bare-metal.js.html index 321ec491..472bd2c5 100644 --- a/docs/bare-metal.js.html +++ b/docs/bare-metal.js.html @@ -257,7 +257,8 @@

Source: bare-metal.js

type: 'string', path: true, required: true - } + }, + hostname: { type: 'string' } } } @@ -483,13 +484,13 @@

Source: bare-metal.js


diff --git a/docs/bareMetal.html b/docs/bareMetal.html index 11e8748f..465bd54f 100644 --- a/docs/bareMetal.html +++ b/docs/bareMetal.html @@ -165,7 +165,7 @@

a
Source:
@@ -432,7 +432,7 @@

Source:
@@ -610,7 +610,7 @@

Source:
@@ -699,7 +699,7 @@

g
Source:
@@ -967,7 +967,7 @@

ge
Source:
@@ -1056,7 +1056,7 @@

getI
Source:
@@ -1145,7 +1145,7 @@

haltInsta
Source:
@@ -1234,7 +1234,7 @@

haltInst
Source:
@@ -1323,7 +1323,7 @@

listI
Source:
@@ -1590,7 +1590,7 @@

reboot
Source:
@@ -1857,7 +1857,7 @@

startIn
Source:
@@ -1992,13 +1992,13 @@

updateI
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/billing.html b/docs/billing.html index 47669a82..74ed658c 100644 --- a/docs/billing.html +++ b/docs/billing.html @@ -478,13 +478,13 @@

listInvoi
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/billing.js.html b/docs/billing.js.html index 05fd3e6d..34e84306 100644 --- a/docs/billing.js.html +++ b/docs/billing.js.html @@ -107,13 +107,13 @@

Source: billing.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/block-storage.js.html b/docs/block-storage.js.html index 9cd188ac..5fd54a70 100644 --- a/docs/block-storage.js.html +++ b/docs/block-storage.js.html @@ -191,13 +191,13 @@

Source: block-storage.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/blockStorage.html b/docs/blockStorage.html index 50aa12e3..7cecfd19 100644 --- a/docs/blockStorage.html +++ b/docs/blockStorage.html @@ -745,13 +745,13 @@

updateSt
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/databases.html b/docs/databases.html index deb63302..6da5b359 100644 --- a/docs/databases.html +++ b/docs/databases.html @@ -3148,13 +3148,13 @@

vi
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/databases.js.html b/docs/databases.js.html index d076dd2d..5fd8d60b 100644 --- a/docs/databases.js.html +++ b/docs/databases.js.html @@ -940,13 +940,13 @@

Source: databases.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/dns.html b/docs/dns.html index 2c99a883..8a67404d 100644 --- a/docs/dns.html +++ b/docs/dns.html @@ -1280,13 +1280,13 @@

updateSo
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/dns.js.html b/docs/dns.js.html index c3bf7198..a17c87af 100644 --- a/docs/dns.js.html +++ b/docs/dns.js.html @@ -339,13 +339,13 @@

Source: dns.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/firewall.html b/docs/firewall.html index a650b920..f8a4e45e 100644 --- a/docs/firewall.html +++ b/docs/firewall.html @@ -923,13 +923,13 @@

updateGrou
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/firewall.js.html b/docs/firewall.js.html index 1d91b68a..a04f7a32 100644 --- a/docs/firewall.js.html +++ b/docs/firewall.js.html @@ -245,13 +245,13 @@

Source: firewall.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/index.html b/docs/index.html index 95083659..8fb3cd52 100644 --- a/docs/index.html +++ b/docs/index.html @@ -95,13 +95,13 @@

Authors


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/instances.html b/docs/instances.html index e40ca774..2d75140f 100644 --- a/docs/instances.html +++ b/docs/instances.html @@ -165,7 +165,7 @@

at
Source:
@@ -254,7 +254,7 @@

a
Source:
@@ -343,7 +343,7 @@

at
Source:
@@ -521,7 +521,7 @@

cre
Source:
@@ -610,7 +610,7 @@

Source:
@@ -699,7 +699,7 @@

Source:
@@ -788,7 +788,7 @@

deleteI
Source:
@@ -877,7 +877,7 @@

Source:
@@ -966,7 +966,7 @@

dele
Source:
@@ -1055,7 +1055,7 @@

Source:
@@ -1144,7 +1144,7 @@

Source:
@@ -1233,7 +1233,7 @@

Source:
@@ -1322,7 +1322,7 @@

Source:
@@ -1411,7 +1411,7 @@

getInstanc
Source:
@@ -1500,7 +1500,7 @@

Source:
@@ -1589,7 +1589,7 @@

g
Source:
@@ -1678,7 +1678,7 @@

Source:
@@ -1767,7 +1767,7 @@

g
Source:
@@ -1857,7 +1857,7 @@

g
Source:
@@ -1946,7 +1946,7 @@

ge
Source:
@@ -2035,7 +2035,7 @@

haltInsta
Source:
@@ -2124,7 +2124,7 @@

haltInst
Source:
@@ -2213,7 +2213,7 @@

<
Source:
@@ -2302,7 +2302,7 @@

Source:
@@ -2391,7 +2391,7 @@

listI
Source:
@@ -2480,7 +2480,7 @@

listI
Source:
@@ -2658,7 +2658,7 @@

rebootI
Source:
@@ -2747,7 +2747,7 @@

reboot
Source:
@@ -2836,7 +2836,7 @@

restor
Source:
@@ -2925,7 +2925,7 @@

Source:
@@ -3014,7 +3014,7 @@

Source:
@@ -3103,7 +3103,7 @@

startIns
Source:
@@ -3192,7 +3192,7 @@

startIn
Source:
@@ -3281,7 +3281,7 @@

updateI
Source:
@@ -3327,13 +3327,13 @@

updateI
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/instances.js.html b/docs/instances.js.html index 0985fb69..6f3ad011 100644 --- a/docs/instances.js.html +++ b/docs/instances.js.html @@ -79,6 +79,7 @@

Source: instances.js

script_id: { type: 'string' }, snapshot_id: { type: 'string' }, enable_ipv6: { type: 'boolean' }, + disable_public_ipv4: { type: 'boolean' }, attach_vpc: { type: 'array' }, attach_vpc2: { type: 'array' }, label: { type: 'string' }, @@ -302,7 +303,8 @@

Source: instances.js

type: 'string', path: true, required: true - } + }, + date_range: { type: 'number' } } } @@ -866,13 +868,13 @@

Source: instances.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/iso.html b/docs/iso.html index f28de83c..1d8ba014 100644 --- a/docs/iso.html +++ b/docs/iso.html @@ -567,13 +567,13 @@

listPub
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/iso.js.html b/docs/iso.js.html index afed74b4..0656f587 100644 --- a/docs/iso.js.html +++ b/docs/iso.js.html @@ -129,13 +129,13 @@

Source: iso.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/kubernetes.html b/docs/kubernetes.html index adee14f4..5e126507 100644 --- a/docs/kubernetes.html +++ b/docs/kubernetes.html @@ -1724,13 +1724,13 @@

upgrades
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/kubernetes.js.html b/docs/kubernetes.js.html index bd5b04cc..16d43de2 100644 --- a/docs/kubernetes.js.html +++ b/docs/kubernetes.js.html @@ -482,13 +482,13 @@

Source: kubernetes.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/load-balancers.js.html b/docs/load-balancers.js.html index 4760f912..dbf6cc47 100644 --- a/docs/load-balancers.js.html +++ b/docs/load-balancers.js.html @@ -318,13 +318,13 @@

Source: load-balancers.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/loadBalancers.html b/docs/loadBalancers.html index af828dd5..15cb994c 100644 --- a/docs/loadBalancers.html +++ b/docs/loadBalancers.html @@ -1101,13 +1101,13 @@

upd
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/object-storage.js.html b/docs/object-storage.js.html index 747b8da1..471695ee 100644 --- a/docs/object-storage.js.html +++ b/docs/object-storage.js.html @@ -179,13 +179,13 @@

Source: object-storage.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/objectStorage.html b/docs/objectStorage.html index a2217d22..ae84c8d6 100644 --- a/docs/objectStorage.html +++ b/docs/objectStorage.html @@ -656,13 +656,13 @@

up
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/operating-systems.js.html b/docs/operating-systems.js.html index 9eda1131..ebcf3e3e 100644 --- a/docs/operating-systems.js.html +++ b/docs/operating-systems.js.html @@ -58,13 +58,13 @@

Source: operating-systems.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/operatingSystems.html b/docs/operatingSystems.html index 758fbc45..87252453 100644 --- a/docs/operatingSystems.html +++ b/docs/operatingSystems.html @@ -211,13 +211,13 @@

listImages<
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/plans.html b/docs/plans.html index c102fe54..5779cb08 100644 --- a/docs/plans.html +++ b/docs/plans.html @@ -300,13 +300,13 @@

listPlans
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/plans.js.html b/docs/plans.js.html index e0da18a9..e1010496 100644 --- a/docs/plans.js.html +++ b/docs/plans.js.html @@ -74,13 +74,13 @@

Source: plans.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/regions.html b/docs/regions.html index ece1c517..17d311b3 100644 --- a/docs/regions.html +++ b/docs/regions.html @@ -300,13 +300,13 @@

listRegion
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/regions.js.html b/docs/regions.js.html index dbe5d908..3b93b2db 100644 --- a/docs/regions.js.html +++ b/docs/regions.js.html @@ -77,13 +77,13 @@

Source: regions.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/registries.html b/docs/registries.html new file mode 100644 index 00000000..a32705d0 --- /dev/null +++ b/docs/registries.html @@ -0,0 +1,1294 @@ + + + + + JSDoc: Namespace: registries + + + + + + + + + + +
+ +

Namespace: registries

+ + + + + + +
+ +
+ +

registries

+ + +
+ +
+
+ + +
Methods for interacting with the container registry endpoints
+https://www.vultr.com/api/#tag/Container-Registry
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

createRegistries()

+ + + + + + +
+ Create a new Container Registry Subscription.
+https://www.vultr.com/api/#tag/Container-Registry/operation/create-registry +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

createRegistryDockerCredentials()

+ + + + + + +
+ Create a fresh set of Docker Credentials for this Container Registry Subscription.
+https://www.vultr.com/api/#tag/Container-Registry/operation/create-registry-docker-credentials +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

createRegistryDockerCredentialsKubernetes()

+ + + + + + +
+ Create a fresh set of Docker Credentials for this Container Registry Subscription and return them in a Kubernetes friendly YAML format.
+https://www.vultr.com/api/#tag/Container-Registry/operation/create-registry-kubernetes-docker-credentials +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

deleteRegistry()

+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

deleteRepository()

+ + + + + + +
+ Deletes a Repository from a Container Registry Subscription.
+https://www.vultr.com/api/#tag/Container-Registry/operation/delete-repository +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listRegistries()

+ + + + + + +
+ List All Container Registry Subscriptions for this account.
+https://www.vultr.com/api/#tag/Container-Registry/operation/list-registries +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listRegistryPlans()

+ + + + + + +
+ List All Plans to help choose which one is the best fit for your Container Registry.
+https://www.vultr.com/api/#tag/Container-Registry/operation/list-registry-plans +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listRegistryRegions()

+ + + + + + +
+ List All Regions where a Container Registry can be deployed.
+https://www.vultr.com/api/#tag/Container-Registry/operation/list-registry-regions +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listRepositories()

+ + + + + + +
+ List All Repositories in a Container Registry Subscription.
+https://www.vultr.com/api/#tag/Container-Registry/operation/list-registry-repositories +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

readRegistry()

+ + + + + + +
+ Get a single Container Registry Subscription.
+https://www.vultr.com/api/#tag/Container-Registry/operation/read-registry +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

readRepository()

+ + + + + + +
+ Get a single Repository in a Container Registry Subscription.
+https://www.vultr.com/api/#tag/Container-Registry/operation/read-registry-repository +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

updateRegistry()

+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

updateRepository()

+ + + + + + +
+ Update a Repository in a Container Registry Subscription.
+https://www.vultr.com/api/#tag/Container-Registry/operation/update-repository +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/docs/registries.js.html b/docs/registries.js.html new file mode 100644 index 00000000..f4504ac9 --- /dev/null +++ b/docs/registries.js.html @@ -0,0 +1,273 @@ + + + + + JSDoc: Source: registries.js + + + + + + + + + + +
+ +

Source: registries.js

+ + + + + + +
+
+
/**
+ * Methods for interacting with the container registry endpoints<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry}
+ * @namespace registries
+ */
+
+/**
+ * List All Container Registry Subscriptions for this account.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/list-registries}
+ * @function listRegistries
+ * @memberof registries
+ * @instance
+ */
+exports.listRegistries = {
+  url: '/registries',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+    per_page: { type: 'string' },
+    cursor: { type: 'string' }
+  }
+}
+
+/**
+ * Create a new Container Registry Subscription.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/create-registry}
+ * @function createRegistries
+ * @memberof registries
+ * @instance
+ */
+exports.createRegistry = {
+  url: '/registry',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+    name: { type: 'string', required: true },
+    public: { type: 'boolean', required: true },
+    region: { type: 'string', required: true },
+    plan: { type: 'string', required: true }
+  }
+}
+
+/**
+ * Get a single Container Registry Subscription.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/read-registry}
+ * @function readRegistry
+ * @memberof registries
+ * @instance
+ */
+exports.readRegistry = {
+  url: '/registry/{registry-id}',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+    'registry-id': { type: 'string', required: true, path: true }
+  }
+}
+
+/**
+ * Update Container Registry.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/update-registry}
+ * @function updateRegistry
+ * @memberof registries
+ * @instance
+ */
+exports.updateRegistry = {
+  url: '/registry/{registry-id}',
+  requestType: 'PUT',
+  apiKeyRequired: true,
+  parameters: {
+    'registry-id': { type: 'string', required: true, path: true },
+    public: { type: 'boolean' },
+    plan: { type: 'string' }
+  }
+}
+
+/**
+ * Deletes a Container Registry Subscription.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/delete-registry}
+ * @function deleteRegistry
+ * @memberof registries
+ * @instance
+ */
+exports.deleteRegistry = {
+  url: '/registry/{registry-id}',
+  requestType: 'DELETE',
+  apiKeyRequired: true,
+  parameters: {
+    'registry-id': { type: 'string', required: true, path: true }
+  }
+}
+
+/**
+ * List All Repositories in a Container Registry Subscription.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/list-registry-repositories}
+ * @function listRepositories
+ * @memberof registries
+ * @instance
+ */
+exports.listRepositories = {
+  url: '/registry/{registry-id}/repositories',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+    'registry-id': { type: 'string', required: true, path: true }
+  }
+}
+
+/**
+ * Get a single Repository in a Container Registry Subscription.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/read-registry-repository}
+ * @function readRepository
+ * @memberof registries
+ * @instance
+ */
+exports.readRepository = {
+  url: '/registry/{registry-id}/repository/{repository-image}',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+    'registry-id': { type: 'string', required: true, path: true },
+    'repository-image': { type: 'string', required: true, path: true }
+  }
+}
+
+/**
+ * Update a Repository in a Container Registry Subscription.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/update-repository}
+ * @function updateRepository
+ * @memberof registries
+ * @instance
+ */
+exports.updateRepository = {
+  url: '/registry/{registry-id}/repository/{repository-image}',
+  requestType: 'PUT',
+  apiKeyRequired: true,
+  parameters: {
+    'registry-id': { type: 'string', required: true, path: true },
+    'repository-image': { type: 'string', required: true, path: true },
+    description: { type: 'string' }
+  }
+}
+
+/**
+ * Deletes a Repository from a Container Registry Subscription.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/delete-repository}
+ * @function deleteRepository
+ * @memberof registries
+ * @instance
+ */
+exports.deleteRepository = {
+  url: '/registry/{registry-id}/repository/{repository-image}',
+  requestType: 'DELETE',
+  apiKeyRequired: true,
+  parameters: {
+    'registry-id': { type: 'string', required: true, path: true },
+    'repository-image': { type: 'string', required: true, path: true }
+  }
+}
+
+/**
+ * Create a fresh set of Docker Credentials for this Container Registry Subscription.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/create-registry-docker-credentials}
+ * @function createRegistryDockerCredentials
+ * @memberof registries
+ * @instance
+ */
+exports.createRegistryDockerCredentials = {
+  url: '/registry/{registry-id}/docker-credentials',
+  requestType: 'OPTIONS',
+  apiKeyRequired: true,
+  parameters: {
+    'registry-id': { type: 'string', required: true, path: true },
+    expiry_seconds: { type: 'number' },
+    read_write: { type: 'boolean' }
+  }
+}
+
+/**
+ * Create a fresh set of Docker Credentials for this Container Registry Subscription and return them in a Kubernetes friendly YAML format.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/create-registry-kubernetes-docker-credentials}
+ * @function createRegistryDockerCredentialsKubernetes
+ * @memberof registries
+ * @instance
+ */
+exports.createRegistryDockerCredentialsKubernetes = {
+  url: '/registry/{registry-id}/docker-credentials/kubernetes',
+  requestType: 'OPTIONS',
+  apiKeyRequired: true,
+  parameters: {
+    'registry-id': { type: 'string', required: true, path: true },
+    expiry_seconds: { type: 'number' },
+    read_write: { type: 'boolean' },
+    base64_encode: { type: 'boolean' }
+  }
+}
+
+/**
+ * List All Regions where a Container Registry can be deployed.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/list-registry-regions}
+ * @function listRegistryRegions
+ * @memberof registries
+ * @instance
+ */
+exports.listRegistryRegions = {
+  url: '/registry/region/list',
+  requestType: 'GET',
+  apiKeyRequired: true
+}
+
+/**
+ * List All Plans to help choose which one is the best fit for your Container Registry.<br>
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/list-registry-plans}
+ * @function listRegistryPlans
+ * @memberof registries
+ * @instance
+ */
+exports.listRegistryPlans = {
+  url: '/registry/plan/list',
+  requestType: 'GET',
+  apiKeyRequired: true
+}
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time) +
+ + + + + diff --git a/docs/reserved-ips.js.html b/docs/reserved-ips.js.html index 8014c2f6..8a02a8aa 100644 --- a/docs/reserved-ips.js.html +++ b/docs/reserved-ips.js.html @@ -210,13 +210,13 @@

Source: reserved-ips.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/reservedIps.html b/docs/reservedIps.html index 44605255..d447dfb4 100644 --- a/docs/reservedIps.html +++ b/docs/reservedIps.html @@ -834,13 +834,13 @@

updat
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/snapshots.html b/docs/snapshots.html index d564c666..4d2f28a2 100644 --- a/docs/snapshots.html +++ b/docs/snapshots.html @@ -656,13 +656,13 @@

updateS
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/snapshots.js.html b/docs/snapshots.js.html index 9b79cd20..2c95a1fd 100644 --- a/docs/snapshots.js.html +++ b/docs/snapshots.js.html @@ -163,13 +163,13 @@

Source: snapshots.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/ssh-keys.js.html b/docs/ssh-keys.js.html index cf6734ae..0ce1a3bc 100644 --- a/docs/ssh-keys.js.html +++ b/docs/ssh-keys.js.html @@ -137,13 +137,13 @@

Source: ssh-keys.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/sshKeys.html b/docs/sshKeys.html index 6fe15c03..02ef6220 100644 --- a/docs/sshKeys.html +++ b/docs/sshKeys.html @@ -567,13 +567,13 @@

updateSsh
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/startup-scripts.js.html b/docs/startup-scripts.js.html index d0c014ff..b6773ff1 100644 --- a/docs/startup-scripts.js.html +++ b/docs/startup-scripts.js.html @@ -145,13 +145,13 @@

Source: startup-scripts.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/startupScripts.html b/docs/startupScripts.html index baebfb19..6ec8312a 100644 --- a/docs/startupScripts.html +++ b/docs/startupScripts.html @@ -567,13 +567,13 @@

up
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/users.html b/docs/users.html index dd70d971..5cf2e7eb 100644 --- a/docs/users.html +++ b/docs/users.html @@ -567,13 +567,13 @@

updateUser<
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/users.js.html b/docs/users.js.html index 99a06236..bdd74dad 100644 --- a/docs/users.js.html +++ b/docs/users.js.html @@ -152,13 +152,13 @@

Source: users.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/vpc2.html b/docs/vpc2.html index 6db5f5c3..88bf9e51 100644 --- a/docs/vpc2.html +++ b/docs/vpc2.html @@ -106,6 +106,95 @@

vpc2

Methods

+ + + + + + +

attachVpcNodes()

+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -284,6 +373,95 @@

deleteVpcdetachVpcNodes()

+ + + + + + +
+ Detach nodes from a VPC 2.0 network
+https://www.vultr.com/api/#tag/VPC2/operation/detach-vpc2-nodes +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -373,6 +551,95 @@

getVpclistVpcNodes()

+ + + + + + +
+ Get a list of nodes attached to a VPC 2.0 network.
+https://www.vultr.com/api/#tag/VPC2/operation/list-vpc2-nodes +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -567,13 +834,13 @@

updateVpc
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/vpc2.js.html b/docs/vpc2.js.html index 42b94b73..3fc73a9e 100644 --- a/docs/vpc2.js.html +++ b/docs/vpc2.js.html @@ -135,6 +135,76 @@

Source: vpc2.js

prefix_length: { type: 'number' } } } + +/** + * Get a list of nodes attached to a VPC 2.0 network.<br> + * {@link https://www.vultr.com/api/#tag/VPC2/operation/list-vpc2-nodes} + * @function listVpcNodes + * @memberof vpc2 + * @instance + */ +exports.listVpcNodes = { + url: '/vpc2/{vpc-id}/nodes', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'vpc-id': { + type: 'string', + path: true, + required: true + }, + per_page: { type: 'number' }, + cursor: { type: 'string' } + } +} + +/** + * Attach nodes to a VPC 2.0 network<br> + * {@link https://www.vultr.com/api/#tag/VPC2/operation/attach-vpc2-nodes} + * @function attachVpcNodes + * @memberof vpc2 + * @instance + */ +exports.attachVpcNodes = { + url: '/vpc2/{vpc-id}/nodes/attach', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'vpc-id': { + type: 'string', + path: true, + required: true + }, + nodes: { + type: 'array', + required: true + } + } +} + +/** + * Detach nodes from a VPC 2.0 network<br> + * {@link https://www.vultr.com/api/#tag/VPC2/operation/detach-vpc2-nodes} + * @function detachVpcNodes + * @memberof vpc2 + * @instance + */ +exports.detachVpcNodes = { + url: '/vpc2/{vpc-id}/nodes/detach', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'vpc-id': { + type: 'string', + path: true, + required: true + }, + nodes: { + type: 'array', + required: true + } + } +} @@ -145,13 +215,13 @@

Source: vpc2.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/vpcs.html b/docs/vpcs.html index fa3c3341..d2a31d2f 100644 --- a/docs/vpcs.html +++ b/docs/vpcs.html @@ -567,13 +567,13 @@

updateVpc
- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/vpcs.js.html b/docs/vpcs.js.html index b936514f..e5f5bede 100644 --- a/docs/vpcs.js.html +++ b/docs/vpcs.js.html @@ -144,13 +144,13 @@

Source: vpcs.js


- Documentation generated by JSDoc 4.0.2 on Tue Aug 01 2023 12:12:11 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Mon Oct 02 2023 14:04:16 GMT-0700 (Pacific Daylight Time)
diff --git a/src/api/registries.js b/src/api/registries.js new file mode 100644 index 00000000..028d7dfe --- /dev/null +++ b/src/api/registries.js @@ -0,0 +1,222 @@ +/** + * Methods for interacting with the container registry endpoints
+ * {@link https://www.vultr.com/api/#tag/Container-Registry} + * @namespace registries + */ + +/** + * List All Container Registry Subscriptions for this account.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/list-registries} + * @function listRegistries + * @memberof registries + * @instance + */ +exports.listRegistries = { + url: '/registries', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + per_page: { type: 'string' }, + cursor: { type: 'string' } + } +} + +/** + * Create a new Container Registry Subscription.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/create-registry} + * @function createRegistries + * @memberof registries + * @instance + */ +exports.createRegistry = { + url: '/registry', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + name: { type: 'string', required: true }, + public: { type: 'boolean', required: true }, + region: { type: 'string', required: true }, + plan: { type: 'string', required: true } + } +} + +/** + * Get a single Container Registry Subscription.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/read-registry} + * @function readRegistry + * @memberof registries + * @instance + */ +exports.readRegistry = { + url: '/registry/{registry-id}', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'registry-id': { type: 'string', required: true, path: true } + } +} + +/** + * Update Container Registry.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/update-registry} + * @function updateRegistry + * @memberof registries + * @instance + */ +exports.updateRegistry = { + url: '/registry/{registry-id}', + requestType: 'PUT', + apiKeyRequired: true, + parameters: { + 'registry-id': { type: 'string', required: true, path: true }, + public: { type: 'boolean' }, + plan: { type: 'string' } + } +} + +/** + * Deletes a Container Registry Subscription.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/delete-registry} + * @function deleteRegistry + * @memberof registries + * @instance + */ +exports.deleteRegistry = { + url: '/registry/{registry-id}', + requestType: 'DELETE', + apiKeyRequired: true, + parameters: { + 'registry-id': { type: 'string', required: true, path: true } + } +} + +/** + * List All Repositories in a Container Registry Subscription.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/list-registry-repositories} + * @function listRepositories + * @memberof registries + * @instance + */ +exports.listRepositories = { + url: '/registry/{registry-id}/repositories', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'registry-id': { type: 'string', required: true, path: true } + } +} + +/** + * Get a single Repository in a Container Registry Subscription.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/read-registry-repository} + * @function readRepository + * @memberof registries + * @instance + */ +exports.readRepository = { + url: '/registry/{registry-id}/repository/{repository-image}', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'registry-id': { type: 'string', required: true, path: true }, + 'repository-image': { type: 'string', required: true, path: true } + } +} + +/** + * Update a Repository in a Container Registry Subscription.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/update-repository} + * @function updateRepository + * @memberof registries + * @instance + */ +exports.updateRepository = { + url: '/registry/{registry-id}/repository/{repository-image}', + requestType: 'PUT', + apiKeyRequired: true, + parameters: { + 'registry-id': { type: 'string', required: true, path: true }, + 'repository-image': { type: 'string', required: true, path: true }, + description: { type: 'string' } + } +} + +/** + * Deletes a Repository from a Container Registry Subscription.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/delete-repository} + * @function deleteRepository + * @memberof registries + * @instance + */ +exports.deleteRepository = { + url: '/registry/{registry-id}/repository/{repository-image}', + requestType: 'DELETE', + apiKeyRequired: true, + parameters: { + 'registry-id': { type: 'string', required: true, path: true }, + 'repository-image': { type: 'string', required: true, path: true } + } +} + +/** + * Create a fresh set of Docker Credentials for this Container Registry Subscription.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/create-registry-docker-credentials} + * @function createRegistryDockerCredentials + * @memberof registries + * @instance + */ +exports.createRegistryDockerCredentials = { + url: '/registry/{registry-id}/docker-credentials', + requestType: 'OPTIONS', + apiKeyRequired: true, + parameters: { + 'registry-id': { type: 'string', required: true, path: true }, + expiry_seconds: { type: 'number' }, + read_write: { type: 'boolean' } + } +} + +/** + * Create a fresh set of Docker Credentials for this Container Registry Subscription and return them in a Kubernetes friendly YAML format.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/create-registry-kubernetes-docker-credentials} + * @function createRegistryDockerCredentialsKubernetes + * @memberof registries + * @instance + */ +exports.createRegistryDockerCredentialsKubernetes = { + url: '/registry/{registry-id}/docker-credentials/kubernetes', + requestType: 'OPTIONS', + apiKeyRequired: true, + parameters: { + 'registry-id': { type: 'string', required: true, path: true }, + expiry_seconds: { type: 'number' }, + read_write: { type: 'boolean' }, + base64_encode: { type: 'boolean' } + } +} + +/** + * List All Regions where a Container Registry can be deployed.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/list-registry-regions} + * @function listRegistryRegions + * @memberof registries + * @instance + */ +exports.listRegistryRegions = { + url: '/registry/region/list', + requestType: 'GET', + apiKeyRequired: true +} + +/** + * List All Plans to help choose which one is the best fit for your Container Registry.
+ * {@link https://www.vultr.com/api/#tag/Container-Registry/operation/list-registry-plans} + * @function listRegistryPlans + * @memberof registries + * @instance + */ +exports.listRegistryPlans = { + url: '/registry/plan/list', + requestType: 'GET', + apiKeyRequired: true +} diff --git a/src/index.js b/src/index.js index 81acd34c..fa42411a 100644 --- a/src/index.js +++ b/src/index.js @@ -17,6 +17,7 @@ exports.initialize = (config) => { const operatingSystems = require('./api/operating-systems') const plans = require('./api/plans') const regions = require('./api/regions') + const registries = require('./api/registries') const reservedIps = require('./api/reserved-ips') const snapshots = require('./api/snapshots') const sshKeys = require('./api/ssh-keys') @@ -449,6 +450,27 @@ exports.initialize = (config) => { regions.listAvailableComputeInRegion ) }, + registries: { + listRegistries: createRequestFunction(registries.listRegistries), + createRegistry: createRequestFunction(registries.createRegistry), + readRegistry: createRequestFunction(registries.readRegistry), + updateRegistry: createRequestFunction(registries.updateRegistry), + deleteRegistry: createRequestFunction(registries.deleteRegistry), + listRepositories: createRequestFunction(registries.listRepositories), + readRepository: createRequestFunction(registries.readRepository), + updateRepository: createRequestFunction(registries.updateRepository), + deleteRepository: createRequestFunction(registries.deleteRepository), + createRegistryDockerCredentials: createRequestFunction( + registries.createRegistryDockerCredentials + ), + createRegistryDockerCredentialsKubernetes: createRequestFunction( + registries.createRegistryDockerCredentialsKubernetes + ), + listRegistryRegions: createRequestFunction( + registries.listRegistryRegions + ), + listRegistryPlans: createRequestFunction(registries.listRegistryPlans) + }, reservedIps: { getReservedIp: createRequestFunction(reservedIps.getReservedIp), deleteReservedIp: createRequestFunction(reservedIps.deleteReservedIp), diff --git a/src/util.js b/src/util.js index 3d56c5c0..cab5d24e 100644 --- a/src/util.js +++ b/src/util.js @@ -29,7 +29,11 @@ exports.makeApiRequest = (config, endpoint, userParameters) => { options.body = JSON.stringify(userParameters) options.headers['Content-Type'] = 'application/json' } else { - if (requestType === 'GET' || requestType === 'DELETE') { + if ( + requestType === 'GET' || + requestType === 'DELETE' || + requestType === 'OPTIONS' + ) { // GET and DELETE requests may have path parameters as well as query parameters const queryParams = Object.keys(userParameters) .filter((key) => !parameters[key].path) diff --git a/test/api/registries.test.js b/test/api/registries.test.js new file mode 100644 index 00000000..2f966ace --- /dev/null +++ b/test/api/registries.test.js @@ -0,0 +1,342 @@ +const util = require('../util') + +const mockParameters = { + createRegistry: { + name: 'charizard', + public: false, + region: 'sjc', + plan: 'business' + }, + readRegistry: { + 'registry-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + }, + updateRegistry: { + 'registry-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + }, + deleteRegistry: { + 'registry-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + }, + listRepositories: { + 'registry-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + }, + readRepository: { + 'registry-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', + 'repository-image': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + }, + updateRepository: { + 'registry-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', + 'repository-image': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + }, + deleteRepository: { + 'registry-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', + 'repository-image': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + }, + createRegistryDockerCredentials: { + 'registry-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + }, + createRegistryDockerCredentialsKubernetes: { + 'registry-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + } +} + +const mockResponses = { + listRegistries: { + registries: [ + { + id: 'string', + name: 'string', + urn: 'string', + storage: { + used: { + bytes: null, + mb: null, + gb: null, + tb: null, + updated_at: 'string' + }, + allowed: { + bytes: null, + mb: null, + gb: null, + tb: null, + updated_at: 'string' + } + }, + date_created: 'string', + public: true, + root_user: { + id: 0, + username: 'string', + password: 'string', + root: true, + added_at: 'string', + updated_at: 'string' + }, + metadata: { + region: { + id: 0, + name: 'string', + urn: 'string', + base_url: 'string', + public: true, + added_at: 'string', + updated_at: 'string', + data_center: {} + }, + subscription: { + billing: { + monthly_price: null, + pending_charges: null + } + } + } + } + ], + meta: { + total: 0, + links: { + next: 'string', + prev: 'string' + } + } + }, + createRegistry: { + id: 'string', + name: 'string', + urn: 'string', + storage: { + used: { + bytes: null, + mb: null, + gb: null, + tb: null, + updated_at: 'string' + }, + allowed: { + bytes: null, + mb: null, + gb: null, + tb: null, + updated_at: 'string' + } + }, + date_created: 'string', + public: true, + root_user: { + id: 0, + username: 'string', + password: 'string', + root: true, + added_at: 'string', + updated_at: 'string' + }, + metadata: { + region: { + id: 0, + name: 'string', + urn: 'string', + base_url: 'string', + public: true, + added_at: 'string', + updated_at: 'string', + data_center: {} + }, + subscription: { + billing: { + monthly_price: null, + pending_charges: null + } + } + } + }, + readRegistry: { + id: 'string', + name: 'string', + urn: 'string', + storage: { + used: { + bytes: null, + mb: null, + gb: null, + tb: null, + updated_at: 'string' + }, + allowed: { + bytes: null, + mb: null, + gb: null, + tb: null, + updated_at: 'string' + } + }, + date_created: 'string', + public: true, + root_user: { + id: 0, + username: 'string', + password: 'string', + root: true, + added_at: 'string', + updated_at: 'string' + }, + metadata: { + region: { + id: 0, + name: 'string', + urn: 'string', + base_url: 'string', + public: true, + added_at: 'string', + updated_at: 'string', + data_center: {} + }, + subscription: { + billing: { + monthly_price: null, + pending_charges: null + } + } + } + }, + updateRegistry: { + id: 'string', + name: 'string', + urn: 'string', + storage: { + used: { + bytes: null, + mb: null, + gb: null, + tb: null, + updated_at: 'string' + }, + allowed: { + bytes: null, + mb: null, + gb: null, + tb: null, + updated_at: 'string' + } + }, + date_created: 'string', + public: true, + root_user: { + id: 0, + username: 'string', + password: 'string', + root: true, + added_at: 'string', + updated_at: 'string' + }, + metadata: { + region: { + id: 0, + name: 'string', + urn: 'string', + base_url: 'string', + public: true, + added_at: 'string', + updated_at: 'string', + data_center: {} + }, + subscription: { + billing: { + monthly_price: null, + pending_charges: null + } + } + } + }, + listRepositories: { + repositories: [ + { + name: 'string', + image: 'string', + description: 'string', + added_at: 'string', + updated_at: 'string', + pull_count: 0, + artifact_count: 0 + } + ], + meta: { + total: 0, + links: { + next: 'string', + prev: 'string' + } + } + }, + readRepository: { + name: 'string', + image: 'string', + description: 'string', + added_at: 'string', + updated_at: 'string', + pull_count: 0, + artifact_count: 0 + }, + updateRepository: { + name: 'string', + image: 'string', + description: 'string', + added_at: 'string', + updated_at: 'string', + pull_count: 0, + artifact_count: 0 + }, + createRegistryDockerCredentials: { + auths: { + '{registry-region-name}.vultrcr.com': { + auth: 'string' + } + } + }, + listRegistryRegions: { + regions: [ + { + id: 0, + name: 'string', + urn: 'string', + base_url: 'string', + public: true, + added_at: 'string', + updated_at: 'string', + data_center: {} + } + ], + meta: { + total: 0, + links: { + next: 'string', + prev: 'string' + } + } + }, + listRegistryPlans: { + plans: { + start_up: { + vanity_name: 'string', + max_storage_mb: 0, + monthly_price: 0 + }, + business: { + vanity_name: 'string', + max_storage_mb: 0, + monthly_price: 0 + }, + premium: { + vanity_name: 'string', + max_storage_mb: 0, + monthly_price: 0 + }, + enterprise: { + vanity_name: 'string', + max_storage_mb: 0, + monthly_price: 0 + } + } + } +} + +util.createTestSuite('registries', mockParameters, mockResponses) diff --git a/test/api/vpc2.test.js b/test/api/vpc2.test.js index e1027990..63929583 100644 --- a/test/api/vpc2.test.js +++ b/test/api/vpc2.test.js @@ -15,21 +15,21 @@ const mockParameters = { region: 'ewr' }, listVpcNodes: { - 'vpc-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' + 'vpc-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' }, attachVpcNodes: { - 'vpc-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', - nodes: [ - "a4021db4-c1d0-43ba-8b5c-7a4a35444167", - "12a43ca5-0025-40ef-9edb-3a475809a8c0" - ] + 'vpc-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', + nodes: [ + 'a4021db4-c1d0-43ba-8b5c-7a4a35444167', + '12a43ca5-0025-40ef-9edb-3a475809a8c0' + ] }, detachVpcNodes: { - 'vpc-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', - nodes: [ - "a4021db4-c1d0-43ba-8b5c-7a4a35444167", - "12a43ca5-0025-40ef-9edb-3a475809a8c0" - ] + 'vpc-id': 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', + nodes: [ + 'a4021db4-c1d0-43ba-8b5c-7a4a35444167', + '12a43ca5-0025-40ef-9edb-3a475809a8c0' + ] } } @@ -70,23 +70,23 @@ const mockResponses = { prefix_length: 24 }, listVpcNodes: { - nodes: [ - { - "id": "cb676a46-66fd-4dfb-b839-443f2e6c0b60", - "ip_address": "10.1.96.3", - "mac_address": "98964710968448", - "description": "Example-Description", - "type": "vps", - "node_status": "active" - } - ], - "meta": { - "total": 1, - "links": { - "next": "", - "prev": "" - } - } + nodes: [ + { + id: 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', + ip_address: '10.1.96.3', + mac_address: '98964710968448', + description: 'Example-Description', + type: 'vps', + node_status: 'active' + } + ], + meta: { + total: 1, + links: { + next: '', + prev: '' + } + } } } diff --git a/test/util.js b/test/util.js index 19e73786..f1e073e1 100644 --- a/test/util.js +++ b/test/util.js @@ -8,7 +8,7 @@ exports.createTestSuite = (specificationFile, mockParameters, mockResponse) => { const apiModule = specificationFile.replace(/-([a-z])/g, function (str) { return str[1].toUpperCase() }) - const validRequestTypes = ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'] + const validRequestTypes = ['GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'OPTIONS'] jest.mock('node-fetch', () => jest.fn())