diff --git a/docs/account.html b/docs/account.html index b58afca4..4fa24599 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 25bb12a5..a1ac42e8 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 412f5bd0..ebab36a5 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 6ff3243a..638133ba 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 adc9ee6d..dcd15245 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 2c552a00..f432cc4a 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 12154700..2568c63b 100644 --- a/docs/bare-metal.js.html +++ b/docs/bare-metal.js.html @@ -75,12 +75,15 @@

Source: bare-metal.js

user_data: { type: 'string' }, label: { type: 'string' }, tag: { type: 'string' }, + activation_email: { type: 'boolean' }, + hostname: { type: 'string' }, reserved_ipv4: { type: 'string' }, os_id: { type: 'number' }, snapshot_id: { type: 'string' }, - application_id: { type: 'number' }, + app_id: { type: 'number' }, image_id: { type: 'string' }, - persistent_pxe: { type: 'boolean' } + persistent_pxe: { type: 'boolean' }, + tags: { type: 'array' } } } @@ -124,6 +127,7 @@

Source: bare-metal.js

user_data: { type: 'string' }, label: { type: 'string' }, tag: { type: 'string' }, + tags: { type: 'array' }, os_id: { type: 'string' }, app_id: { type: 'string' }, image_id: { type: 'string' }, @@ -410,13 +414,13 @@

Source: bare-metal.js


diff --git a/docs/bareMetal.html b/docs/bareMetal.html index 1d0356d0..11809573 100644 --- a/docs/bareMetal.html +++ b/docs/bareMetal.html @@ -254,7 +254,7 @@

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

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

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

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

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

Source:
@@ -789,7 +789,7 @@

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

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

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

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

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

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

rein
Source:
@@ -1501,7 +1501,7 @@

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

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

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

updateI
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/billing.html b/docs/billing.html index 85c133cc..cd0cc6b1 100644 --- a/docs/billing.html +++ b/docs/billing.html @@ -478,13 +478,13 @@

listInvoi
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/billing.js.html b/docs/billing.js.html index 6a7aa36b..c7d251c4 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/block-storage.js.html b/docs/block-storage.js.html index 3524969f..a9e7fc13 100644 --- a/docs/block-storage.js.html +++ b/docs/block-storage.js.html @@ -69,7 +69,8 @@

Source: block-storage.js

type: 'number', required: true }, - label: { type: 'string' } + label: { type: 'string' }, + block_type: { type: 'string' } } } @@ -190,13 +191,13 @@

Source: block-storage.js


- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/blockStorage.html b/docs/blockStorage.html index e93845a9..12889ce7 100644 --- a/docs/blockStorage.html +++ b/docs/blockStorage.html @@ -165,7 +165,7 @@

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

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

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

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

updateSt
Source:
@@ -745,13 +745,13 @@

updateSt
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/databases.html b/docs/databases.html new file mode 100644 index 00000000..ff365da7 --- /dev/null +++ b/docs/databases.html @@ -0,0 +1,3163 @@ + + + + + JSDoc: Namespace: databases + + + + + + + + + + +
+ +

Namespace: databases

+ + + + + + +
+ +
+ +

databases

+ + +
+ +
+
+ + +
Methods for interacting with the databases endpoints
+https://www.vultr.com/api/#tag/databases
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

createConnectionPool()

+ + + + + + +
+ Create a new connection pool within the Managed Database (PostgreSQL engine types only).
+https://www.vultr.com/api/#operation/create-connection-pool +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

createDatabase()

+ + + + + + +
+ Create a new Managed Database in your account.
+https://www.vultr.com/api/#operation/create-database +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

createDatabaseDb()

+ + + + + + +
+ Create a new logical database within the Managed Database (MySQL and PostgreSQL only).
+https://www.vultr.com/api/#operation/create-database-db +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

createDatabaseUser()

+ + + + + + +
+ Create a new database user within the Managed Database.
+https://www.vultr.com/api/#operation/create-database-user +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

databaseAddReadReplica()

+ + + + + + +
+ Create a read-only replica node for the Managed Database.
+https://www.vultr.com/api/#operation/database-add-read-replica +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

databaseDetachMigration()

+ + + + + + +
+ Detach a migration from the Managed Database.
+https://www.vultr.com/api/#operation/database-detach-migration +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

databaseFork()

+ + + + + + +
+ Fork a Managed Database to a new subscription from a backup.
+https://www.vultr.com/api/#operation/database-fork +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

databaseRestoreFromBackup()

+ + + + + + +
+ Create a new Managed Database from a backup.
+https://www.vultr.com/api/#operation/database-restore-from-backup +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

databaseStartMigration()

+ + + + + + +
+ Start a migration to the Managed Database.
+https://www.vultr.com/api/#operation/database-start-migration +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

deleteConnectionPool()

+ + + + + + +
+ Delete a connection pool within a Managed Database (PostgreSQL engine types only).
+https://www.vultr.com/api/#operation/delete-connection-pool +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

deleteDatabase()

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

deleteDatabaseDb()

+ + + + + + +
+ Delete a logical database within a Managed Database (MySQL and PostgreSQL only).
+https://www.vultr.com/api/#operation/delete-database-db +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

deleteDatabaseUser()

+ + + + + + +
+ Delete a database user within a Managed Database.
+https://www.vultr.com/api/#operation/delete-database-user +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

getBackupInformation()

+ + + + + + +
+ Get backup information for the Managed Database.
+https://www.vultr.com/api/#operation/get-backup-information +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

getConnectionPool()

+ + + + + + +
+ Get information about a Managed Database connection pool (PostgreSQL engine types only).
+https://www.vultr.com/api/#operation/get-connection-pool +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

getDatabase()

+ + + + + + +
+ Get information about a Managed Database.
+https://www.vultr.com/api/#operation/get-database +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

getDatabaseDb()

+ + + + + + +
+ Get information about a logical database within a Managed Database (MySQL and PostgreSQL only).
+https://www.vultr.com/api/#operation/get-database-db +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

getDatabaseUser()

+ + + + + + +
+ Get information about a Managed Database user.
+https://www.vultr.com/api/#operation/get-database-user +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listAdvancedOptions()

+ + + + + + +
+ List all configured and available advanced options for the Managed Database (PostgreSQL engine types only).
+https://www.vultr.com/api/#operation/list-advanced-options +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listAvailableVersions()

+ + + + + + +
+ List all available version upgrades within the Managed Database (PostgreSQL engine types only).
+https://www.vultr.com/api/#operation/list-available-versions +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listConnectionPools()

+ + + + + + +
+ List all connection pools within the Managed Database (PostgreSQL engine types only).
+https://www.vultr.com/api/#operation/list-connection-pools +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listDatabaseDbs()

+ + + + + + +
+ List all logical databases within the Managed Database (MySQL and PostgreSQL only).
+https://www.vultr.com/api/#operation/list-database-dbs +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listDatabaseUsers()

+ + + + + + +
+ List all database users within the Managed Database.
+https://www.vultr.com/api/#operation/list-database-users +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listDatabases()

+ + + + + + +
+ List all Managed Databases in your account.
+https://www.vultr.com/api/#operation/list-databases +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listMaintenanceUpdates()

+ + + + + + +
+ List all available version upgrades within the Managed Database.
+https://www.vultr.com/api/#operation/list-maintenance-updates +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

listPlans()

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

listServiceAlerts()

+ + + + + + +
+ List service alert messages for the Managed Database.
+https://www.vultr.com/api/#operation/list-service-alerts +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

startMaintenanceUpdates()

+ + + + + + +
+ Start maintenance updates for the Managed Database.
+https://www.vultr.com/api/#operation/start-maintenance-updates +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

startVersionUpgrade()

+ + + + + + +
+ Start a version upgrade for the Managed Database (PostgreSQL engine types only).
+https://www.vultr.com/api/#operation/start-version-upgrade +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

updateAdvancedOptions()

+ + + + + + +
+ Updates an advanced configuration option for the Managed Database (PostgreSQL engine types only).
+https://www.vultr.com/api/#operation/update-advanced-options +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

updateConnectionPool()

+ + + + + + +
+ Update connection-pool information within a Managed Database (PostgreSQL engine types only).
+https://www.vultr.com/api/#operation/update-connection-pool +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

updateDatabase()

+ + + + + + +
+ Update information for a Managed Database. +https://www.vultr.com/api/#operation/update-database +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

updateDatabaseUser()

+ + + + + + +
+ Update database user information within a Managed Database.
+https://www.vultr.com/api/#operation/update-database-user +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

viewMigrationStatus()

+ + + + + + +
+ View the status of a migration attached to the Managed Database.
+https://www.vultr.com/api/#operation/view-migration-status +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time) +
+ + + + + \ No newline at end of file diff --git a/docs/databases.js.html b/docs/databases.js.html new file mode 100644 index 00000000..f0569076 --- /dev/null +++ b/docs/databases.js.html @@ -0,0 +1,956 @@ + + + + + JSDoc: Source: databases.js + + + + + + + + + + +
+ +

Source: databases.js

+ + + + + + +
+
+
/**
+ * Methods for interacting with the databases endpoints<br>
+ * {@link https://www.vultr.com/api/#tag/databases}
+ * @namespace databases
+ */
+
+/**
+ * List Managed Database Plans.<br>
+ * {@link https://www.vultr.com/api/#operation/list-database-plans}
+ * @function listPlans
+ * @memberof databases
+ * @instance
+ */
+exports.listPlans = {
+  url: '/databases/plans',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  engine: { type: 'string' },
+	  nodes: { type: 'number' },
+	  region: { type: 'string' }
+  }
+}
+
+/**
+ * List all Managed Databases in your account.<br>
+ * {@link https://www.vultr.com/api/#operation/list-databases}
+ * @function listDatabases
+ * @memberof databases
+ * @instance
+ */
+exports.listDatabases = {
+  url: '/databases',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  label: { type: 'string' },
+	  tag: { type: 'string' },
+	  region: { type: 'string' }
+  }
+}
+
+/**
+ * Create a new Managed Database in your account.<br>
+ * {@link https://www.vultr.com/api/#operation/create-database}
+ * @function createDatabase
+ * @memberof databases
+ * @instance
+ */
+exports.createDatabase = {
+  url: '/databases',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+	  database_engine: {
+      type: 'string',
+      required: true
+	  },
+	  database_engine_version: {
+      type: 'string',
+      required: true
+	  },
+	  region: {
+      type: 'string',
+      required: true
+	  },
+	  plan: {
+      type: 'string',
+      required: true
+	  },
+	  label: {
+      type: 'string',
+      required: true
+	  },
+	  tag: { type: 'string' },
+	  maintenance_dow: { type: 'string' },
+	  maintenance_time: { type: 'string' },
+	  trusted_ips: { type: 'array' },
+	  mysql_sql_modes: { type: 'array' },
+	  mysql_require_primary_key: { type: 'boolean' },
+	  mysql_slow_query_log: { type: 'boolean' },
+	  mysql_long_query_time: { type: 'number' },
+	  redis_eviction_policy: { type: 'string' }
+  }
+}
+
+/**
+ * Get information about a Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/get-database}
+ * @function getDatabase
+ * @memberof databases
+ * @instance
+ */
+exports.getDatabase = {
+  url: '/databases/{database-id}',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+* Update information for a Managed Database.
+* {@link https://www.vultr.com/api/#operation/update-database}
+* @function updateDatabase
+* @memberof databases
+* @instance
+*/
+exports.updateDatabase = {
+  url: '/databases/{database-id}',
+  requestType: 'PUT',
+  apiKeyRequired: true,
+  parameters: {
+	 'database-id': {
+	   type: 'string',
+	   path: true,
+	   required: true
+	 },
+	 region: { type: 'string' },
+	 plan: { type: 'string' },
+	 label: { type: 'string' },
+	 tag: { type: 'string' },
+	 maintenance_dow: { type: 'string' },
+	 maintenance_time: { type: 'string' },
+	 cluster_time_zone: { type: 'string' },
+	 trusted_ips: { type: 'array' },
+	 mysql_sql_modes: { type: 'array' },
+	 mysql_require_primary_key: { type: 'boolean' },
+	 mysql_slow_query_log: { type: 'boolean' },
+	 mysql_long_query_time: { type: 'number' },
+	 redis_eviction_policy: { type: 'string' }
+  }
+}
+
+/**
+ * Delete a Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/delete-database}
+ * @function deleteDatabase
+ * @memberof databases
+ * @instance
+ */
+exports.deleteDatabase = {
+  url: '/databases/{database-id}',
+  requestType: 'DELETE',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * List all database users within the Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/list-database-users}
+ * @function listDatabaseUsers
+ * @memberof databases
+ * @instance
+ */
+exports.listDatabaseUsers = {
+  url: '/databases/{database-id}/users',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Create a new database user within the Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/create-database-user}
+ * @function createDatabaseUser
+ * @memberof databases
+ * @instance
+ */
+exports.createDatabaseUser = {
+  url: '/databases/{database-id}/users',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  username: {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  password: { type: 'string' },
+	  encryption: { type: 'string' }
+  }
+}
+
+/**
+ * Get information about a Managed Database user.<br>
+ * {@link https://www.vultr.com/api/#operation/get-database-user}
+ * @function getDatabaseUser
+ * @memberof databases
+ * @instance
+ */
+exports.getDatabaseUser = {
+  url: '/databases/{database-id}/users/{username}',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  username: {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Update database user information within a Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/update-database-user}
+ * @function updateDatabaseUser
+ * @memberof databases
+ * @instance
+ */
+exports.updateDatabaseUser = {
+  url: '/databases/{database-id}/users/{username}',
+  requestType: 'PUT',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  username: {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  password: {
+      type: 'string',
+      required: true
+	  }
+  }
+}
+
+/**
+ * Delete a database user within a Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/delete-database-user}
+ * @function deleteDatabaseUser
+ * @memberof databases
+ * @instance
+ */
+exports.deleteDatabaseUser = {
+  url: '/databases/{database-id}/users/{username}',
+  requestType: 'DELETE',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  username: {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * List all logical databases within the Managed Database (MySQL and PostgreSQL only).<br>
+ * {@link https://www.vultr.com/api/#operation/list-database-dbs}
+ * @function listDatabaseDbs
+ * @memberof databases
+ * @instance
+ */
+exports.listDatabaseDbs = {
+  url: '/databases/{database-id}/dbs',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Create a new logical database within the Managed Database (MySQL and PostgreSQL only).<br>
+ * {@link https://www.vultr.com/api/#operation/create-database-db}
+ * @function createDatabaseDb
+ * @memberof databases
+ * @instance
+ */
+exports.createDatabaseDb = {
+  url: '/databases/{database-id}/dbs',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  name: {
+	    type: 'string',
+      required: true
+	  }
+  }
+}
+
+/**
+ * Get information about a logical database within a Managed Database (MySQL and PostgreSQL only).<br>
+ * {@link https://www.vultr.com/api/#operation/get-database-db}
+ * @function getDatabaseDb
+ * @memberof databases
+ * @instance
+ */
+exports.getDatabaseDb = {
+  url: '/databases/{database-id}/dbs/{db-name}',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  'db-name': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Delete a logical database within a Managed Database (MySQL and PostgreSQL only).<br>
+ * {@link https://www.vultr.com/api/#operation/delete-database-db}
+ * @function deleteDatabaseDb
+ * @memberof databases
+ * @instance
+ */
+exports.deleteDatabaseDb = {
+  url: '/databases/{database-id}/dbs/{db-name}',
+  requestType: 'DELETE',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  'db-name': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * List all available version upgrades within the Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/list-maintenance-updates}
+ * @function listMaintenanceUpdates
+ * @memberof databases
+ * @instance
+ */
+exports.listMaintenanceUpdates = {
+  url: '/databases/{database-id}/maintenance',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Start maintenance updates for the Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/start-maintenance-updates}
+ * @function startMaintenanceUpdates
+ * @memberof databases
+ * @instance
+ */
+exports.startMaintenanceUpdates = {
+  url: '/databases/{database-id}/maintenance',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * List service alert messages for the Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/list-service-alerts}
+ * @function listServiceAlerts
+ * @memberof databases
+ * @instance
+ */
+exports.listServiceAlerts = {
+  url: '/databases/{database-id}/alerts',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  period: {
+      type: 'string',
+      required: true
+	  }
+  }
+}
+
+/**
+ * View the status of a migration attached to the Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/view-migration-status}
+ * @function viewMigrationStatus
+ * @memberof databases
+ * @instance
+ */
+exports.viewMigrationStatus = {
+  url: '/databases/{database-id}/migration',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Start a migration to the Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/database-start-migration}
+ * @function databaseStartMigration
+ * @memberof databases
+ * @instance
+ */
+exports.databaseStartMigration = {
+  url: '/databases/{database-id}/migration',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  host: {
+      type: 'string',
+      required: true
+	  },
+	  port: {
+      type: 'number',
+      required: true
+	  },
+	  username: {
+      type: 'string',
+      required: true
+	  },
+	  password: {
+      type: 'string',
+      required: true
+	  },
+	  database: {
+      type: 'string'
+	  },
+	  ignored_databases: {
+      type: 'string'
+	  },
+	  ssl: {
+      type: 'boolean',
+      required: true
+	  }
+  }
+}
+
+/**
+ * Detach a migration from the Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/database-detach-migration}
+ * @function databaseDetachMigration
+ * @memberof databases
+ * @instance
+ */
+exports.databaseDetachMigration = {
+  url: '/databases/{database-id}/migration',
+  requestType: 'DELETE',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Create a read-only replica node for the Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/database-add-read-replica}
+ * @function databaseAddReadReplica
+ * @memberof databases
+ * @instance
+ */
+exports.databaseAddReadReplica = {
+  url: '/databases/{database-id}/read-replica',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  region: {
+      type: 'string',
+      required: true
+	  },
+	  label: {
+      type: 'string',
+      required: true
+	  }
+  }
+}
+
+/**
+ * Get backup information for the Managed Database.<br>
+ * {@link https://www.vultr.com/api/#operation/get-backup-information}
+ * @function getBackupInformation
+ * @memberof databases
+ * @instance
+ */
+exports.getBackupInformation = {
+  url: '/databases/{database-id}/backups',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Create a new Managed Database from a backup.<br>
+ * {@link https://www.vultr.com/api/#operation/database-restore-from-backup}
+ * @function databaseRestoreFromBackup
+ * @memberof databases
+ * @instance
+ */
+exports.databaseRestoreFromBackup = {
+  url: '/databases/{database-id}/restore',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  label: {
+      type: 'string',
+      required: true
+	  },
+	  type: { type: 'string' },
+	  date: { type: 'string' },
+	  time: { type: 'string' }
+  }
+}
+
+/**
+ * Fork a Managed Database to a new subscription from a backup.<br>
+ * {@link https://www.vultr.com/api/#operation/database-fork}
+ * @function databaseFork
+ * @memberof databases
+ * @instance
+ */
+exports.databaseFork = {
+  url: '/databases/{database-id}/fork',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  label: {
+      type: 'string',
+      required: true
+	  },
+	  region: {
+      type: 'string',
+      required: true
+	  },
+	  plan: {
+      type: 'string',
+      required: true
+	  },
+	  type: { type: 'string' },
+	  date: { type: 'string' },
+	  time: { type: 'string' }
+  }
+}
+
+/**
+ * List all connection pools within the Managed Database (PostgreSQL engine types only).<br>
+ * {@link https://www.vultr.com/api/#operation/list-connection-pools}
+ * @function listConnectionPools
+ * @memberof databases
+ * @instance
+ */
+exports.listConnectionPools = {
+  url: '/databases/{database-id}/connection-pools',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Create a new connection pool within the Managed Database (PostgreSQL engine types only).<br>
+ * {@link https://www.vultr.com/api/#operation/create-connection-pool}
+ * @function createConnectionPool
+ * @memberof databases
+ * @instance
+ */
+exports.createConnectionPool = {
+  url: '/databases/{database-id}/connection-pools',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  name: {
+	    type: 'string',
+      required: true
+	  },
+	  database: {
+	    type: 'string',
+      required: true
+	  },
+	  username: {
+	    type: 'string',
+      required: true
+	  },
+	  mode: {
+	    type: 'string',
+      required: true
+	  },
+	  size: {
+	    type: 'number',
+      required: true
+	  }
+  }
+}
+
+/**
+ * Get information about a Managed Database connection pool (PostgreSQL engine types only).<br>
+ * {@link https://www.vultr.com/api/#operation/get-connection-pool}
+ * @function getConnectionPool
+ * @memberof databases
+ * @instance
+ */
+exports.getConnectionPool = {
+  url: '/databases/{database-id}/connection-pools/{pool-name}',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  'pool-name': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Update connection-pool information within a Managed Database (PostgreSQL engine types only).<br>
+ * {@link https://www.vultr.com/api/#operation/update-connection-pool}
+ * @function updateConnectionPool
+ * @memberof databases
+ * @instance
+ */
+exports.updateConnectionPool = {
+  url: '/databases/{database-id}/connection-pools/{pool-name}',
+  requestType: 'PUT',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  'pool-name': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  database: { type: 'string' },
+	  username: { type: 'string' },
+	  mode: { type: 'string' },
+	  size: { type: 'number' }
+  }
+}
+
+/**
+ * Delete a connection pool within a Managed Database (PostgreSQL engine types only).<br>
+ * {@link https://www.vultr.com/api/#operation/delete-connection-pool}
+ * @function deleteConnectionPool
+ * @memberof databases
+ * @instance
+ */
+exports.deleteConnectionPool = {
+  url: '/databases/{database-id}/connection-pools/{pool-name}',
+  requestType: 'DELETE',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  'pool-name': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * List all configured and available advanced options for the Managed Database (PostgreSQL engine types only).<br>
+ * {@link https://www.vultr.com/api/#operation/list-advanced-options}
+ * @function listAdvancedOptions
+ * @memberof databases
+ * @instance
+ */
+exports.listAdvancedOptions = {
+  url: '/databases/{database-id}/advanced-options',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Updates an advanced configuration option for the Managed Database (PostgreSQL engine types only).<br>
+ * {@link https://www.vultr.com/api/#operation/update-advanced-options}
+ * @function updateAdvancedOptions
+ * @memberof databases
+ * @instance
+ */
+exports.updateAdvancedOptions = {
+  url: '/databases/{database-id}/advanced-options',
+  requestType: 'PUT',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  autovacuum_analyze_scale_factor: { type: 'float' },
+	  autovacuum_analyze_threshold: { type: 'number' },
+	  autovacuum_freeze_max_age: { type: 'number' },
+	  autovacuum_max_workers: { type: 'number' },
+	  autovacuum_naptime: { type: 'number' },
+	  autovacuum_vacuum_cost_delay: { type: 'number' },
+	  autovacuum_vacuum_cost_limit: { type: 'number' },
+	  autovacuum_vacuum_scale_factor: { type: 'number' },
+	  autovacuum_vacuum_threshold: { type: 'number' },
+	  bgwriter_delay: { type: 'number' },
+	  bgwriter_flush_after: { type: 'number' },
+	  bgwriter_lru_maxpages: { type: 'number' },
+	  bgwriter_lru_multiplier: { type: 'number' },
+	  deadlock_timeout: { type: 'number' },
+	  default_toast_compression: { type: 'string' },
+	  idle_in_transaction_session_timeout: { type: 'number' },
+	  jit: { type: 'boolean' },
+	  log_autovacuum_min_duration: { type: 'number' },
+	  log_error_verbosity: { type: 'string' },
+	  log_line_prefix: { type: 'string' },
+	  log_min_duration_statement: { type: 'number' },
+	  max_files_per_process: { type: 'number' },
+	  max_locks_per_transaction: { type: 'number' },
+	  max_logical_replication_workers: { type: 'number' },
+	  max_parallel_workers: { type: 'number' },
+	  max_parallel_workers_per_gather: { type: 'number' },
+	  max_pred_locks_per_transaction: { type: 'number' },
+	  max_prepared_transactions: { type: 'number' },
+	  max_replication_slots: { type: 'number' },
+	  max_stack_depth: { type: 'number' },
+	  max_standby_archive_delay: { type: 'number' },
+	  max_standby_streaming_delay: { type: 'number' },
+	  max_wal_senders: { type: 'number' },
+	  max_worker_processes: { type: 'number' },
+	  'pg_partman_bgw.interval': { type: 'number' },
+	  'pg_partman_bgw.role': { type: 'string' },
+	  'pg_stat_statements.track': { type: 'string' },
+	  temp_file_limit: { type: 'number' },
+	  track_activity_query_size: { type: 'number' },
+	  track_commit_timestamp: { type: 'string' },
+	  track_functions: { type: 'string' },
+	  track_io_timing: { type: 'string' },
+	  wal_sender_timeout: { type: 'number' },
+	  wal_writer_delay: { type: 'number' }
+  }
+}
+
+/**
+ * List all available version upgrades within the Managed Database (PostgreSQL engine types only).<br>
+ * {@link https://www.vultr.com/api/#operation/list-available-versions}
+ * @function listAvailableVersions
+ * @memberof databases
+ * @instance
+ */
+exports.listAvailableVersions = {
+  url: '/databases/{database-id}/version-upgrade',
+  requestType: 'GET',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  }
+  }
+}
+
+/**
+ * Start a version upgrade for the Managed Database (PostgreSQL engine types only).<br>
+ * {@link https://www.vultr.com/api/#operation/start-version-upgrade}
+ * @function startVersionUpgrade
+ * @memberof databases
+ * @instance
+ */
+exports.startVersionUpgrade = {
+  url: '/databases/{database-id}/version-upgrade',
+  requestType: 'POST',
+  apiKeyRequired: true,
+  parameters: {
+	  'database-id': {
+	    type: 'string',
+      path: true,
+      required: true
+	  },
+	  version: {
+      type: 'string',
+	  	required: true
+	  }
+  }
+}
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time) +
+ + + + + diff --git a/docs/dns.html b/docs/dns.html index 357f8b65..fd76ab00 100644 --- a/docs/dns.html +++ b/docs/dns.html @@ -1280,13 +1280,13 @@

updateSo
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/dns.js.html b/docs/dns.js.html index daff6d9b..e5da476e 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/firewall.html b/docs/firewall.html index e0cf8402..49ddcd1e 100644 --- a/docs/firewall.html +++ b/docs/firewall.html @@ -923,13 +923,13 @@

updateGrou
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/firewall.js.html b/docs/firewall.js.html index d0c2dd0c..1c814aff 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/index.html b/docs/index.html index 89198cc5..e4658695 100644 --- a/docs/index.html +++ b/docs/index.html @@ -95,13 +95,13 @@

Authors


- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/instances.html b/docs/instances.html index 5a578986..8e3ea62c 100644 --- a/docs/instances.html +++ b/docs/instances.html @@ -165,7 +165,7 @@

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

updateI
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/instances.js.html b/docs/instances.js.html index b019359d..808f9ca2 100644 --- a/docs/instances.js.html +++ b/docs/instances.js.html @@ -90,6 +90,7 @@

Source: instances.js

activation_email: { type: 'boolean' }, hostname: { type: 'string' }, tag: { type: 'string' }, + tags: { type: 'array' }, firewall_group_id: { type: 'string' }, reserved_ipv4: { type: 'string' }, enable_vpc: { type: 'boolean' } @@ -141,6 +142,7 @@

Source: instances.js

os_id: { type: 'string' }, user_data: { type: 'string' }, tag: { type: 'string' }, + tags: { type: 'array' }, label: { type: 'string' }, plan: { type: 'string' }, ddos_protection: { type: 'boolean' }, @@ -795,13 +797,13 @@

Source: instances.js


- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/iso.html b/docs/iso.html index 52d5c8e7..d36e0ef4 100644 --- a/docs/iso.html +++ b/docs/iso.html @@ -567,13 +567,13 @@

listPub
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/iso.js.html b/docs/iso.js.html index d7f0ac88..ad7e8ac2 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/kubernetes.html b/docs/kubernetes.html index 824d83bb..dcafaaa1 100644 --- a/docs/kubernetes.html +++ b/docs/kubernetes.html @@ -1724,13 +1724,13 @@

upgrades
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/kubernetes.js.html b/docs/kubernetes.js.html index 49b05d27..69470a4f 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/load-balancers.js.html b/docs/load-balancers.js.html index 20abd37a..72793183 100644 --- a/docs/load-balancers.js.html +++ b/docs/load-balancers.js.html @@ -66,10 +66,12 @@

Source: load-balancers.js

required: true }, balancing_algorithm: { type: 'string' }, - ssl_redirect: { type: 'string' }, - proxy_protocol: { type: 'string' }, + ssl_redirect: { type: 'boolean' }, + http2: { type: 'boolean' }, + nodes: { type: 'number' }, + proxy_protocol: { type: 'boolean' }, health_check: { type: 'object' }, - forwarding_rules: { type: 'object' }, + forwarding_rules: { type: 'array' }, sticky_session: { type: 'object' }, ssl: { type: 'object' }, label: { type: 'string' }, @@ -118,10 +120,12 @@

Source: load-balancers.js

}, ssl: { type: 'object' }, sticky_session: { type: 'object' }, - forwarding_rules: { type: 'object' }, + forwarding_rules: { type: 'array' }, health_check: { type: 'object' }, - proxy_protocol: { type: 'string' }, - ssl_redirect: { type: 'string' }, + proxy_protocol: { type: 'boolean' }, + ssl_redirect: { type: 'boolean' }, + http2: { type: 'boolean' }, + nodes: { type: 'number' }, balancing_algorithm: { type: 'string' }, instances: { type: 'array' }, label: { type: 'string' }, @@ -314,13 +318,13 @@

Source: load-balancers.js


- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/loadBalancers.html b/docs/loadBalancers.html index 1ac60c0c..8f3ee627 100644 --- a/docs/loadBalancers.html +++ b/docs/loadBalancers.html @@ -165,7 +165,7 @@

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

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

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

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

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

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

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

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

upd
Source:
@@ -1101,13 +1101,13 @@

upd
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/object-storage.js.html b/docs/object-storage.js.html index 5d098696..32524378 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/objectStorage.html b/docs/objectStorage.html index 3529ff9e..d66cc844 100644 --- a/docs/objectStorage.html +++ b/docs/objectStorage.html @@ -656,13 +656,13 @@

up
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/operating-systems.js.html b/docs/operating-systems.js.html index a4df9a2c..ab786286 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/operatingSystems.html b/docs/operatingSystems.html index 71589b66..a589a55e 100644 --- a/docs/operatingSystems.html +++ b/docs/operatingSystems.html @@ -211,13 +211,13 @@

listImages<
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/plans.html b/docs/plans.html index 40d179e5..17d3ed5d 100644 --- a/docs/plans.html +++ b/docs/plans.html @@ -300,13 +300,13 @@

listPlans
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/plans.js.html b/docs/plans.js.html index 1b784214..723aa8b6 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/regions.html b/docs/regions.html index a4252334..d9be242b 100644 --- a/docs/regions.html +++ b/docs/regions.html @@ -300,13 +300,13 @@

listRegion
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/regions.js.html b/docs/regions.js.html index 968c0426..a863455a 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/reserved-ips.js.html b/docs/reserved-ips.js.html index a710f043..33dd060a 100644 --- a/docs/reserved-ips.js.html +++ b/docs/reserved-ips.js.html @@ -72,6 +72,30 @@

Source: reserved-ips.js

} } +/** + * Update information on a Reserved IP.<br> + * {@link https://www.vultr.com/api/#operation/patch-reserved-ips-reserved-ip} + * @function updateReservedIp + * @memberof reservedIps + * @instance + */ +exports.updateReservedIp = { + url: '/reserved-ips/{reserved-ip}', + requestType: 'PATCH', + apiKeyRequired: true, + parameters: { + 'reserved-ip': { + type: 'string', + path: true, + required: true + }, + label: { + type: 'string', + required: true + } + } +} + /** * List all reserved IP addresses.<br> * {@link https://www.vultr.com/api/#operation/list-reserved-ips} @@ -186,13 +210,13 @@

Source: reserved-ips.js


- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/reservedIps.html b/docs/reservedIps.html index 386dad98..8f0dad57 100644 --- a/docs/reservedIps.html +++ b/docs/reservedIps.html @@ -165,7 +165,7 @@

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

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

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

detac
Source:
@@ -691,6 +691,95 @@

listRe + + + + + + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

updateReservedIp()

+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -745,13 +834,13 @@

listRe
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/snapshots.html b/docs/snapshots.html index 9c4532f7..bfa35db7 100644 --- a/docs/snapshots.html +++ b/docs/snapshots.html @@ -656,13 +656,13 @@

updateS
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/snapshots.js.html b/docs/snapshots.js.html index 42bb23f7..cba5377f 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/ssh-keys.js.html b/docs/ssh-keys.js.html index 298c9ae3..36ca7408 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/sshKeys.html b/docs/sshKeys.html index 57b25f45..f2d83a50 100644 --- a/docs/sshKeys.html +++ b/docs/sshKeys.html @@ -567,13 +567,13 @@

updateSsh
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/startup-scripts.js.html b/docs/startup-scripts.js.html index b2bc65b4..a6f01773 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/startupScripts.html b/docs/startupScripts.html index c84f7ac7..61d4304e 100644 --- a/docs/startupScripts.html +++ b/docs/startupScripts.html @@ -567,13 +567,13 @@

up
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/users.html b/docs/users.html index 94d08541..355b231c 100644 --- a/docs/users.html +++ b/docs/users.html @@ -567,13 +567,13 @@

updateUser<
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/users.js.html b/docs/users.js.html index 8345fef2..cef9951c 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/vpcs.html b/docs/vpcs.html index b3bc4907..b1654adb 100644 --- a/docs/vpcs.html +++ b/docs/vpcs.html @@ -567,13 +567,13 @@

updateVpc
- Documentation generated by JSDoc 4.0.2 on Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/docs/vpcs.js.html b/docs/vpcs.js.html index 4ce9f5e4..807124fe 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 Thu Jun 22 2023 16:38:02 GMT-0700 (Pacific Daylight Time) + Documentation generated by JSDoc 4.0.2 on Wed Jul 05 2023 20:36:54 GMT-0700 (Pacific Daylight Time)
diff --git a/package-lock.json b/package-lock.json index e9e04b2a..8b60af49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@vultr/vultr-node", - "version": "2.4.0", + "version": "2.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@vultr/vultr-node", - "version": "2.4.0", + "version": "2.5.0", "license": "MIT", "dependencies": { "node-fetch": "^2.6.0", diff --git a/package.json b/package.json index ebc238e6..9d6d222f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@vultr/vultr-node", "private": false, - "version": "2.4.0", + "version": "2.5.0", "description": "Node module to communicate with the Vultr API", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/api/bare-metal.js b/src/api/bare-metal.js index afd84a29..006b8219 100644 --- a/src/api/bare-metal.js +++ b/src/api/bare-metal.js @@ -47,12 +47,15 @@ exports.createInstance = { user_data: { type: 'string' }, label: { type: 'string' }, tag: { type: 'string' }, + activation_email: { type: 'boolean' }, + hostname: { type: 'string' }, reserved_ipv4: { type: 'string' }, os_id: { type: 'number' }, snapshot_id: { type: 'string' }, - application_id: { type: 'number' }, + app_id: { type: 'number' }, image_id: { type: 'string' }, - persistent_pxe: { type: 'boolean' } + persistent_pxe: { type: 'boolean' }, + tags: { type: 'array' } } } @@ -96,6 +99,7 @@ exports.updateInstance = { user_data: { type: 'string' }, label: { type: 'string' }, tag: { type: 'string' }, + tags: { type: 'array' }, os_id: { type: 'string' }, app_id: { type: 'string' }, image_id: { type: 'string' }, diff --git a/src/api/block-storage.js b/src/api/block-storage.js index d2d4bfad..81f9a040 100644 --- a/src/api/block-storage.js +++ b/src/api/block-storage.js @@ -41,7 +41,8 @@ exports.createStorage = { type: 'number', required: true }, - label: { type: 'string' } + label: { type: 'string' }, + block_type: { type: 'string' } } } diff --git a/src/api/databases.js b/src/api/databases.js new file mode 100644 index 00000000..7aec55e6 --- /dev/null +++ b/src/api/databases.js @@ -0,0 +1,904 @@ +/** + * Methods for interacting with the databases endpoints
+ * {@link https://www.vultr.com/api/#tag/databases} + * @namespace databases + */ + +/** + * List Managed Database Plans.
+ * {@link https://www.vultr.com/api/#operation/list-database-plans} + * @function listPlans + * @memberof databases + * @instance + */ +exports.listPlans = { + url: '/databases/plans', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + engine: { type: 'string' }, + nodes: { type: 'number' }, + region: { type: 'string' } + } +} + +/** + * List all Managed Databases in your account.
+ * {@link https://www.vultr.com/api/#operation/list-databases} + * @function listDatabases + * @memberof databases + * @instance + */ +exports.listDatabases = { + url: '/databases', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + label: { type: 'string' }, + tag: { type: 'string' }, + region: { type: 'string' } + } +} + +/** + * Create a new Managed Database in your account.
+ * {@link https://www.vultr.com/api/#operation/create-database} + * @function createDatabase + * @memberof databases + * @instance + */ +exports.createDatabase = { + url: '/databases', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + database_engine: { + type: 'string', + required: true + }, + database_engine_version: { + type: 'string', + required: true + }, + region: { + type: 'string', + required: true + }, + plan: { + type: 'string', + required: true + }, + label: { + type: 'string', + required: true + }, + tag: { type: 'string' }, + maintenance_dow: { type: 'string' }, + maintenance_time: { type: 'string' }, + trusted_ips: { type: 'array' }, + mysql_sql_modes: { type: 'array' }, + mysql_require_primary_key: { type: 'boolean' }, + mysql_slow_query_log: { type: 'boolean' }, + mysql_long_query_time: { type: 'number' }, + redis_eviction_policy: { type: 'string' } + } +} + +/** + * Get information about a Managed Database.
+ * {@link https://www.vultr.com/api/#operation/get-database} + * @function getDatabase + * @memberof databases + * @instance + */ +exports.getDatabase = { + url: '/databases/{database-id}', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Update information for a Managed Database. + * {@link https://www.vultr.com/api/#operation/update-database} + * @function updateDatabase + * @memberof databases + * @instance + */ +exports.updateDatabase = { + url: '/databases/{database-id}', + requestType: 'PUT', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + region: { type: 'string' }, + plan: { type: 'string' }, + label: { type: 'string' }, + tag: { type: 'string' }, + maintenance_dow: { type: 'string' }, + maintenance_time: { type: 'string' }, + cluster_time_zone: { type: 'string' }, + trusted_ips: { type: 'array' }, + mysql_sql_modes: { type: 'array' }, + mysql_require_primary_key: { type: 'boolean' }, + mysql_slow_query_log: { type: 'boolean' }, + mysql_long_query_time: { type: 'number' }, + redis_eviction_policy: { type: 'string' } + } +} + +/** + * Delete a Managed Database.
+ * {@link https://www.vultr.com/api/#operation/delete-database} + * @function deleteDatabase + * @memberof databases + * @instance + */ +exports.deleteDatabase = { + url: '/databases/{database-id}', + requestType: 'DELETE', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * List all database users within the Managed Database.
+ * {@link https://www.vultr.com/api/#operation/list-database-users} + * @function listDatabaseUsers + * @memberof databases + * @instance + */ +exports.listDatabaseUsers = { + url: '/databases/{database-id}/users', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Create a new database user within the Managed Database.
+ * {@link https://www.vultr.com/api/#operation/create-database-user} + * @function createDatabaseUser + * @memberof databases + * @instance + */ +exports.createDatabaseUser = { + url: '/databases/{database-id}/users', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + username: { + type: 'string', + required: true + }, + password: { type: 'string' }, + encryption: { type: 'string' } + } +} + +/** + * Get information about a Managed Database user.
+ * {@link https://www.vultr.com/api/#operation/get-database-user} + * @function getDatabaseUser + * @memberof databases + * @instance + */ +exports.getDatabaseUser = { + url: '/databases/{database-id}/users/{username}', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + username: { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Update database user information within a Managed Database.
+ * {@link https://www.vultr.com/api/#operation/update-database-user} + * @function updateDatabaseUser + * @memberof databases + * @instance + */ +exports.updateDatabaseUser = { + url: '/databases/{database-id}/users/{username}', + requestType: 'PUT', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + username: { + type: 'string', + path: true, + required: true + }, + password: { + type: 'string', + required: true + } + } +} + +/** + * Delete a database user within a Managed Database.
+ * {@link https://www.vultr.com/api/#operation/delete-database-user} + * @function deleteDatabaseUser + * @memberof databases + * @instance + */ +exports.deleteDatabaseUser = { + url: '/databases/{database-id}/users/{username}', + requestType: 'DELETE', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + username: { + type: 'string', + path: true, + required: true + } + } +} + +/** + * List all logical databases within the Managed Database (MySQL and PostgreSQL only).
+ * {@link https://www.vultr.com/api/#operation/list-database-dbs} + * @function listDatabaseDbs + * @memberof databases + * @instance + */ +exports.listDatabaseDbs = { + url: '/databases/{database-id}/dbs', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Create a new logical database within the Managed Database (MySQL and PostgreSQL only).
+ * {@link https://www.vultr.com/api/#operation/create-database-db} + * @function createDatabaseDb + * @memberof databases + * @instance + */ +exports.createDatabaseDb = { + url: '/databases/{database-id}/dbs', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + name: { + type: 'string', + required: true + } + } +} + +/** + * Get information about a logical database within a Managed Database (MySQL and PostgreSQL only).
+ * {@link https://www.vultr.com/api/#operation/get-database-db} + * @function getDatabaseDb + * @memberof databases + * @instance + */ +exports.getDatabaseDb = { + url: '/databases/{database-id}/dbs/{db-name}', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + 'db-name': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Delete a logical database within a Managed Database (MySQL and PostgreSQL only).
+ * {@link https://www.vultr.com/api/#operation/delete-database-db} + * @function deleteDatabaseDb + * @memberof databases + * @instance + */ +exports.deleteDatabaseDb = { + url: '/databases/{database-id}/dbs/{db-name}', + requestType: 'DELETE', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + 'db-name': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * List all available version upgrades within the Managed Database.
+ * {@link https://www.vultr.com/api/#operation/list-maintenance-updates} + * @function listMaintenanceUpdates + * @memberof databases + * @instance + */ +exports.listMaintenanceUpdates = { + url: '/databases/{database-id}/maintenance', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Start maintenance updates for the Managed Database.
+ * {@link https://www.vultr.com/api/#operation/start-maintenance-updates} + * @function startMaintenanceUpdates + * @memberof databases + * @instance + */ +exports.startMaintenanceUpdates = { + url: '/databases/{database-id}/maintenance', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * List service alert messages for the Managed Database.
+ * {@link https://www.vultr.com/api/#operation/list-service-alerts} + * @function listServiceAlerts + * @memberof databases + * @instance + */ +exports.listServiceAlerts = { + url: '/databases/{database-id}/alerts', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + period: { + type: 'string', + required: true + } + } +} + +/** + * View the status of a migration attached to the Managed Database.
+ * {@link https://www.vultr.com/api/#operation/view-migration-status} + * @function viewMigrationStatus + * @memberof databases + * @instance + */ +exports.viewMigrationStatus = { + url: '/databases/{database-id}/migration', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Start a migration to the Managed Database.
+ * {@link https://www.vultr.com/api/#operation/database-start-migration} + * @function databaseStartMigration + * @memberof databases + * @instance + */ +exports.databaseStartMigration = { + url: '/databases/{database-id}/migration', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + host: { + type: 'string', + required: true + }, + port: { + type: 'number', + required: true + }, + username: { + type: 'string', + required: true + }, + password: { + type: 'string', + required: true + }, + database: { + type: 'string' + }, + ignored_databases: { + type: 'string' + }, + ssl: { + type: 'boolean', + required: true + } + } +} + +/** + * Detach a migration from the Managed Database.
+ * {@link https://www.vultr.com/api/#operation/database-detach-migration} + * @function databaseDetachMigration + * @memberof databases + * @instance + */ +exports.databaseDetachMigration = { + url: '/databases/{database-id}/migration', + requestType: 'DELETE', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Create a read-only replica node for the Managed Database.
+ * {@link https://www.vultr.com/api/#operation/database-add-read-replica} + * @function databaseAddReadReplica + * @memberof databases + * @instance + */ +exports.databaseAddReadReplica = { + url: '/databases/{database-id}/read-replica', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + region: { + type: 'string', + required: true + }, + label: { + type: 'string', + required: true + } + } +} + +/** + * Get backup information for the Managed Database.
+ * {@link https://www.vultr.com/api/#operation/get-backup-information} + * @function getBackupInformation + * @memberof databases + * @instance + */ +exports.getBackupInformation = { + url: '/databases/{database-id}/backups', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Create a new Managed Database from a backup.
+ * {@link https://www.vultr.com/api/#operation/database-restore-from-backup} + * @function databaseRestoreFromBackup + * @memberof databases + * @instance + */ +exports.databaseRestoreFromBackup = { + url: '/databases/{database-id}/restore', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + label: { + type: 'string', + required: true + }, + type: { type: 'string' }, + date: { type: 'string' }, + time: { type: 'string' } + } +} + +/** + * Fork a Managed Database to a new subscription from a backup.
+ * {@link https://www.vultr.com/api/#operation/database-fork} + * @function databaseFork + * @memberof databases + * @instance + */ +exports.databaseFork = { + url: '/databases/{database-id}/fork', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + label: { + type: 'string', + required: true + }, + region: { + type: 'string', + required: true + }, + plan: { + type: 'string', + required: true + }, + type: { type: 'string' }, + date: { type: 'string' }, + time: { type: 'string' } + } +} + +/** + * List all connection pools within the Managed Database (PostgreSQL engine types only).
+ * {@link https://www.vultr.com/api/#operation/list-connection-pools} + * @function listConnectionPools + * @memberof databases + * @instance + */ +exports.listConnectionPools = { + url: '/databases/{database-id}/connection-pools', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Create a new connection pool within the Managed Database (PostgreSQL engine types only).
+ * {@link https://www.vultr.com/api/#operation/create-connection-pool} + * @function createConnectionPool + * @memberof databases + * @instance + */ +exports.createConnectionPool = { + url: '/databases/{database-id}/connection-pools', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + name: { + type: 'string', + required: true + }, + database: { + type: 'string', + required: true + }, + username: { + type: 'string', + required: true + }, + mode: { + type: 'string', + required: true + }, + size: { + type: 'number', + required: true + } + } +} + +/** + * Get information about a Managed Database connection pool (PostgreSQL engine types only).
+ * {@link https://www.vultr.com/api/#operation/get-connection-pool} + * @function getConnectionPool + * @memberof databases + * @instance + */ +exports.getConnectionPool = { + url: '/databases/{database-id}/connection-pools/{pool-name}', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + 'pool-name': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Update connection-pool information within a Managed Database (PostgreSQL engine types only).
+ * {@link https://www.vultr.com/api/#operation/update-connection-pool} + * @function updateConnectionPool + * @memberof databases + * @instance + */ +exports.updateConnectionPool = { + url: '/databases/{database-id}/connection-pools/{pool-name}', + requestType: 'PUT', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + 'pool-name': { + type: 'string', + path: true, + required: true + }, + database: { type: 'string' }, + username: { type: 'string' }, + mode: { type: 'string' }, + size: { type: 'number' } + } +} + +/** + * Delete a connection pool within a Managed Database (PostgreSQL engine types only).
+ * {@link https://www.vultr.com/api/#operation/delete-connection-pool} + * @function deleteConnectionPool + * @memberof databases + * @instance + */ +exports.deleteConnectionPool = { + url: '/databases/{database-id}/connection-pools/{pool-name}', + requestType: 'DELETE', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + 'pool-name': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * List all configured and available advanced options for the Managed Database (PostgreSQL engine types only).
+ * {@link https://www.vultr.com/api/#operation/list-advanced-options} + * @function listAdvancedOptions + * @memberof databases + * @instance + */ +exports.listAdvancedOptions = { + url: '/databases/{database-id}/advanced-options', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Updates an advanced configuration option for the Managed Database (PostgreSQL engine types only).
+ * {@link https://www.vultr.com/api/#operation/update-advanced-options} + * @function updateAdvancedOptions + * @memberof databases + * @instance + */ +exports.updateAdvancedOptions = { + url: '/databases/{database-id}/advanced-options', + requestType: 'PUT', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + autovacuum_analyze_scale_factor: { type: 'float' }, + autovacuum_analyze_threshold: { type: 'number' }, + autovacuum_freeze_max_age: { type: 'number' }, + autovacuum_max_workers: { type: 'number' }, + autovacuum_naptime: { type: 'number' }, + autovacuum_vacuum_cost_delay: { type: 'number' }, + autovacuum_vacuum_cost_limit: { type: 'number' }, + autovacuum_vacuum_scale_factor: { type: 'number' }, + autovacuum_vacuum_threshold: { type: 'number' }, + bgwriter_delay: { type: 'number' }, + bgwriter_flush_after: { type: 'number' }, + bgwriter_lru_maxpages: { type: 'number' }, + bgwriter_lru_multiplier: { type: 'number' }, + deadlock_timeout: { type: 'number' }, + default_toast_compression: { type: 'string' }, + idle_in_transaction_session_timeout: { type: 'number' }, + jit: { type: 'boolean' }, + log_autovacuum_min_duration: { type: 'number' }, + log_error_verbosity: { type: 'string' }, + log_line_prefix: { type: 'string' }, + log_min_duration_statement: { type: 'number' }, + max_files_per_process: { type: 'number' }, + max_locks_per_transaction: { type: 'number' }, + max_logical_replication_workers: { type: 'number' }, + max_parallel_workers: { type: 'number' }, + max_parallel_workers_per_gather: { type: 'number' }, + max_pred_locks_per_transaction: { type: 'number' }, + max_prepared_transactions: { type: 'number' }, + max_replication_slots: { type: 'number' }, + max_stack_depth: { type: 'number' }, + max_standby_archive_delay: { type: 'number' }, + max_standby_streaming_delay: { type: 'number' }, + max_wal_senders: { type: 'number' }, + max_worker_processes: { type: 'number' }, + 'pg_partman_bgw.interval': { type: 'number' }, + 'pg_partman_bgw.role': { type: 'string' }, + 'pg_stat_statements.track': { type: 'string' }, + temp_file_limit: { type: 'number' }, + track_activity_query_size: { type: 'number' }, + track_commit_timestamp: { type: 'string' }, + track_functions: { type: 'string' }, + track_io_timing: { type: 'string' }, + wal_sender_timeout: { type: 'number' }, + wal_writer_delay: { type: 'number' } + } +} + +/** + * List all available version upgrades within the Managed Database (PostgreSQL engine types only).
+ * {@link https://www.vultr.com/api/#operation/list-available-versions} + * @function listAvailableVersions + * @memberof databases + * @instance + */ +exports.listAvailableVersions = { + url: '/databases/{database-id}/version-upgrade', + requestType: 'GET', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + } + } +} + +/** + * Start a version upgrade for the Managed Database (PostgreSQL engine types only).
+ * {@link https://www.vultr.com/api/#operation/start-version-upgrade} + * @function startVersionUpgrade + * @memberof databases + * @instance + */ +exports.startVersionUpgrade = { + url: '/databases/{database-id}/version-upgrade', + requestType: 'POST', + apiKeyRequired: true, + parameters: { + 'database-id': { + type: 'string', + path: true, + required: true + }, + version: { + type: 'string', + required: true + } + } +} diff --git a/src/api/instances.js b/src/api/instances.js index c54b733e..78bf7346 100644 --- a/src/api/instances.js +++ b/src/api/instances.js @@ -62,6 +62,7 @@ exports.createInstance = { activation_email: { type: 'boolean' }, hostname: { type: 'string' }, tag: { type: 'string' }, + tags: { type: 'array' }, firewall_group_id: { type: 'string' }, reserved_ipv4: { type: 'string' }, enable_vpc: { type: 'boolean' } @@ -113,6 +114,7 @@ exports.updateInstance = { os_id: { type: 'string' }, user_data: { type: 'string' }, tag: { type: 'string' }, + tags: { type: 'array' }, label: { type: 'string' }, plan: { type: 'string' }, ddos_protection: { type: 'boolean' }, diff --git a/src/api/load-balancers.js b/src/api/load-balancers.js index 1a1f95bc..b830c397 100644 --- a/src/api/load-balancers.js +++ b/src/api/load-balancers.js @@ -38,10 +38,12 @@ exports.createLoadBalancer = { required: true }, balancing_algorithm: { type: 'string' }, - ssl_redirect: { type: 'string' }, - proxy_protocol: { type: 'string' }, + ssl_redirect: { type: 'boolean' }, + http2: { type: 'boolean' }, + nodes: { type: 'number' }, + proxy_protocol: { type: 'boolean' }, health_check: { type: 'object' }, - forwarding_rules: { type: 'object' }, + forwarding_rules: { type: 'array' }, sticky_session: { type: 'object' }, ssl: { type: 'object' }, label: { type: 'string' }, @@ -90,10 +92,12 @@ exports.updateLoadBalancer = { }, ssl: { type: 'object' }, sticky_session: { type: 'object' }, - forwarding_rules: { type: 'object' }, + forwarding_rules: { type: 'array' }, health_check: { type: 'object' }, - proxy_protocol: { type: 'string' }, - ssl_redirect: { type: 'string' }, + proxy_protocol: { type: 'boolean' }, + ssl_redirect: { type: 'boolean' }, + http2: { type: 'boolean' }, + nodes: { type: 'number' }, balancing_algorithm: { type: 'string' }, instances: { type: 'array' }, label: { type: 'string' }, diff --git a/src/api/reserved-ips.js b/src/api/reserved-ips.js index 9cbbc4db..7a95d95c 100644 --- a/src/api/reserved-ips.js +++ b/src/api/reserved-ips.js @@ -44,6 +44,30 @@ exports.deleteReservedIp = { } } +/** + * Update information on a Reserved IP.
+ * {@link https://www.vultr.com/api/#operation/patch-reserved-ips-reserved-ip} + * @function updateReservedIp + * @memberof reservedIps + * @instance + */ +exports.updateReservedIp = { + url: '/reserved-ips/{reserved-ip}', + requestType: 'PATCH', + apiKeyRequired: true, + parameters: { + 'reserved-ip': { + type: 'string', + path: true, + required: true + }, + label: { + type: 'string', + required: true + } + } +} + /** * List all reserved IP addresses.
* {@link https://www.vultr.com/api/#operation/list-reserved-ips} diff --git a/src/index.js b/src/index.js index 8a25e505..6464a3b0 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,7 @@ exports.initialize = (config) => { const bareMetal = require('./api/bare-metal') const billing = require('./api/billing') const blockStorage = require('./api/block-storage') + const databases = require('./api/databases') const dns = require('./api/dns') const firewall = require('./api/firewall') const instances = require('./api/instances') @@ -57,7 +58,7 @@ exports.initialize = (config) => { const endpointParameter = endpoint.parameters[parameter] const userParameter = parameters[parameter] - if (endpointParameter.required && !userParameter) { + if (endpointParameter.required && typeof userParameter === 'undefined') { // Parameters for the request are required, but none were passed in throw new Error(`Missing parameter: ${parameter}`) } else if (userParameter || userParameter === '') { @@ -170,6 +171,66 @@ exports.initialize = (config) => { attachStorage: createRequestFunction(blockStorage.attachStorage), detachStorage: createRequestFunction(blockStorage.detachStorage) }, + databases: { + listPlans: createRequestFunction(databases.listPlans), + listDatabases: createRequestFunction(databases.listDatabases), + createDatabase: createRequestFunction(databases.createDatabase), + getDatabase: createRequestFunction(databases.getDatabase), + updateDatabase: createRequestFunction(databases.updateDatabase), + deleteDatabase: createRequestFunction(databases.deleteDatabase), + listDatabaseUsers: createRequestFunction(databases.listDatabaseUsers), + createDatabaseUser: createRequestFunction(databases.createDatabaseUser), + getDatabaseUser: createRequestFunction(databases.getDatabaseUser), + updateDatabaseUser: createRequestFunction(databases.updateDatabaseUser), + deleteDatabaseUser: createRequestFunction(databases.deleteDatabaseUser), + listDatabaseDbs: createRequestFunction(databases.listDatabaseDbs), + createDatabaseDb: createRequestFunction(databases.createDatabaseDb), + getDatabaseDb: createRequestFunction(databases.getDatabaseDb), + deleteDatabaseDb: createRequestFunction(databases.deleteDatabaseDb), + listMaintenanceUpdates: createRequestFunction( + databases.listMaintenanceUpdates + ), + startMaintenanceUpdates: createRequestFunction( + databases.startMaintenanceUpdates + ), + listServiceAlerts: createRequestFunction(databases.listServiceAlerts), + viewMigrationStatus: createRequestFunction(databases.viewMigrationStatus), + databaseStartMigration: createRequestFunction( + databases.databaseStartMigration + ), + databaseDetachMigration: createRequestFunction( + databases.databaseDetachMigration + ), + databaseAddReadReplica: createRequestFunction( + databases.databaseAddReadReplica + ), + getBackupInformation: createRequestFunction( + databases.getBackupInformation + ), + databaseRestoreFromBackup: createRequestFunction( + databases.databaseRestoreFromBackup + ), + databaseFork: createRequestFunction(databases.databaseFork), + listConnectionPools: createRequestFunction(databases.listConnectionPools), + createConnectionPool: createRequestFunction( + databases.createConnectionPool + ), + getConnectionPool: createRequestFunction(databases.getConnectionPool), + updateConnectionPool: createRequestFunction( + databases.updateConnectionPool + ), + deleteConnectionPool: createRequestFunction( + databases.deleteConnectionPool + ), + listAdvancedOptions: createRequestFunction(databases.listAdvancedOptions), + updateAdvancedOptions: createRequestFunction( + databases.updateAdvancedOptions + ), + listAvailableVersions: createRequestFunction( + databases.listAvailableVersions + ), + startVersionUpgrade: createRequestFunction(databases.startVersionUpgrade) + }, dns: { listDomains: createRequestFunction(dns.listDomains), createDomain: createRequestFunction(dns.createDomain), @@ -333,9 +394,7 @@ exports.initialize = (config) => { getKubernetesVersions: createRequestFunction( kubernetes.getKubernetesVersions ), - upgrades: createRequestFunction( - kubernetes.upgrades - ), + upgrades: createRequestFunction(kubernetes.upgrades), getKubernetesAvailableUpgrades: createRequestFunction( kubernetes.getKubernetesAvailableUpgrades ) @@ -375,6 +434,7 @@ exports.initialize = (config) => { reservedIps: { getReservedIp: createRequestFunction(reservedIps.getReservedIp), deleteReservedIp: createRequestFunction(reservedIps.deleteReservedIp), + updateReservedIp: createRequestFunction(reservedIps.updateReservedIp), listReservedIps: createRequestFunction(reservedIps.listReservedIps), createReservedIp: createRequestFunction(reservedIps.createReservedIp), attachReservedIp: createRequestFunction(reservedIps.attachReservedIp), diff --git a/test/api/bare-metal.test.js b/test/api/bare-metal.test.js index 888d0261..de9680b7 100644 --- a/test/api/bare-metal.test.js +++ b/test/api/bare-metal.test.js @@ -90,7 +90,7 @@ const mockResponses = { } }, createInstance: { - baremetal: { + bare_metal: { id: 'cb676a46-66fd-4dfb-b839-443f2e6c0b60', os: 'Application', ram: '32768 MB', @@ -106,11 +106,13 @@ const mockResponses = { v6_network: '', v6_main_ip: '', v6_network_size: 0, - label: 'api bm', + label: 'Example Bare Metal', mac_address: 2199756823533, - tag: '', + tag: 'Example Tag', + tags: ['Another tag'], os_id: 186, app_id: 3, + image_id: '', features: ['ipv6'] } }, @@ -159,6 +161,7 @@ const mockResponses = { mac_address: 2199756823533, label: 'api bm', tag: '', + tags: ['Another tag'], os_id: 186, app_id: 3, features: ['ipv6'] diff --git a/test/api/block-storage.test.js b/test/api/block-storage.test.js index 35c4d44d..6c89d894 100644 --- a/test/api/block-storage.test.js +++ b/test/api/block-storage.test.js @@ -54,7 +54,9 @@ const mockResponses = { size_gb: 50, region: 'ewr', attached_to_instance: 0, - label: 'my label' + label: 'my label', + mount_id: 'ewr-example112233', + block_type: 'high_perf' } }, getStorage: { diff --git a/test/api/databases.test.js b/test/api/databases.test.js new file mode 100644 index 00000000..7eb1f19d --- /dev/null +++ b/test/api/databases.test.js @@ -0,0 +1,667 @@ +const util = require('../util') + +const mockParameters = { + createDatabase: { + database_engine: 'mysql', + database_engine_version: '8', + region: 'ewr', + plan: 'vultr-dbaas-hobbyist-cc-1-25-1', + label: 'Example Managed Database' + }, + getDatabase: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + updateDatabase: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + plan: 'vultr-dbaas-startup-cc-1-55-2', + label: 'Example Managed Database' + }, + deleteDatabase: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + listDatabaseUsers: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + createDatabaseUser: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + username: 'some_new_user', + password: 'some_secure_password', + encryption: 'caching_sha2_password' + }, + getDatabaseUser: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + username: 'some_username' + }, + updateDatabaseUser: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + username: 'some_username', + password: 'some_new_password_here' + }, + deleteDatabaseUser: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + username: 'some_username' + }, + listDatabaseDbs: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + createDatabaseDb: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + name: 'new_db_name' + }, + getDatabaseDb: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + 'db-name': 'new_db_name' + }, + deleteDatabaseDb: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + 'db-name': 'new_db_name' + }, + listMaintenanceUpdates: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + startMaintenanceUpdates: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + listServiceAlerts: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + period: 'day' + }, + viewMigrationStatus: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + databaseStartMigration: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + host: 'some_host', + port: 3306, + username: 'some_username', + password: 'some_password', + database: 'some_database', + ignored_databases: '', + ssl: true + }, + databaseDetachMigration: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + databaseAddReadReplica: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + region: 'ewr', + label: 'new_read_replica_label' + }, + getBackupInformation: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + databaseRestoreFromBackup: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + label: 'new_restore_label', + type: 'pitr', + date: '2023-02-06', + time: '08:00:00' + }, + databaseFork: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + label: 'new_fork_label', + region: 'sea', + plan: 'vultr-dbaas-startup-cc-2-80-4', + type: 'pitr', + date: '2023-02-06', + time: '08:00:00' + }, + listConnectionPools: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + createConnectionPool: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + name: 'new_connection_pool', + database: 'some_database', + username: 'some_user', + mode: 'transaction', + size: 5 + }, + getConnectionPool: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + 'pool-name': 'new_connection_pool' + }, + updateConnectionPool: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + 'pool-name': 'new_connection_pool', + mode: 'session' + }, + deleteConnectionPool: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + 'pool-name': 'new_connection_pool' + }, + listAdvancedOptions: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + updateAdvancedOptions: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + jit: false, + temp_file_limit: 10000, + track_io_timing: 'off' + }, + listAvailableVersions: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5' + }, + startVersionUpgrade: { + 'database-id': '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + version: '15' + } +} + +const mockResponses = { + listPlans: { + plans: [ + { + id: 'vultr-dbaas-hobbyist-cc-1-25-1', + number_of_nodes: 1, + type: 'vc2', + vcpu_count: 1, + ram: 1024, + disk: 25, + monthly_cost: 15, + supported_engines: { + mysql: true, + pg: true, + redis: false + }, + max_connections: { + mysql: 75, + pg: 22 + }, + locations: ['DEV', 'ICN', 'SEA'] + } + ] + }, + listDatabases: { + databases: [ + { + id: '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + date_created: '2022-05-09 10:13:31', + plan: 'vultr-dbaas-hobbyist-cc-1-25-1', + plan_disk: 25, + plan_ram: 1024, + plan_vcpus: 1, + plan_replicas: 0, + region: 'EWR', + status: 'Running', + label: 'some label', + tag: 'some tag', + database_engine: 'mysql', + database_engine_version: 8, + dbname: 'defaultdb', + host: 'HOSTNAME_GOES_HERE', + user: 'vultradmin', + password: 'PASSWORD_GOES_HERE', + port: 16751, + maintenance_dow: 'sunday', + maintenance_time: '06:00:00', + latest_backup: '2022-11-02 12:58:18"', + trusted_ips: ['...'], + mysql_sql_modes: [ + 'ANSI', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'NO_ENGINE_SUBSTITUTION', + 'NO_ZERO_DATE', + 'NO_ZERO_IN_DATE', + 'STRICT_ALL_TABLES' + ], + mysql_require_primary_key: true, + mysql_slow_query_log: false, + cluster_time_zone: 'America/New_York', + read_replicas: ['...'] + } + ], + meta: { + total: 1 + } + }, + createDatabase: { + database: { + id: '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + date_created: '2022-05-09 10:13:31', + plan: 'vultr-dbaas-hobbyist-cc-1-25-1', + plan_disk: 25, + plan_ram: 1024, + plan_vcpus: 1, + plan_replicas: 0, + region: 'EWR', + status: 'Running', + label: 'some label', + tag: 'some tag', + database_engine: 'mysql', + database_engine_version: 8, + dbname: 'defaultdb', + host: 'HOSTNAME_GOES_HERE', + user: 'vultradmin', + password: 'PASSWORD_GOES_HERE', + port: 16751, + maintenance_dow: 'sunday', + maintenance_time: '06:00:00', + latest_backup: '2022-11-02 12:58:18"', + trusted_ips: ['...'], + mysql_sql_modes: [ + 'ANSI', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'NO_ENGINE_SUBSTITUTION', + 'NO_ZERO_DATE', + 'NO_ZERO_IN_DATE', + 'STRICT_ALL_TABLES' + ], + mysql_require_primary_key: true, + mysql_slow_query_log: false, + cluster_time_zone: 'America/New_York', + read_replicas: ['...'] + } + }, + getDatabase: { + database: { + id: '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + date_created: '2022-05-09 10:13:31', + plan: 'vultr-dbaas-hobbyist-cc-1-25-1', + plan_disk: 25, + plan_ram: 1024, + plan_vcpus: 1, + plan_replicas: 0, + region: 'EWR', + status: 'Running', + label: 'some label', + tag: 'some tag', + database_engine: 'mysql', + database_engine_version: 8, + dbname: 'defaultdb', + host: 'HOSTNAME_GOES_HERE', + user: 'vultradmin', + password: 'PASSWORD_GOES_HERE', + port: 16751, + maintenance_dow: 'sunday', + maintenance_time: '06:00:00', + latest_backup: '2022-11-02 12:58:18"', + trusted_ips: ['...'], + mysql_sql_modes: [ + 'ANSI', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'NO_ENGINE_SUBSTITUTION', + 'NO_ZERO_DATE', + 'NO_ZERO_IN_DATE', + 'STRICT_ALL_TABLES' + ], + mysql_require_primary_key: true, + mysql_slow_query_log: false, + cluster_time_zone: 'America/New_York', + read_replicas: ['...'] + } + }, + updateDatabase: { + database: { + id: '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + date_created: '2022-05-09 10:13:31', + plan: 'vultr-dbaas-hobbyist-cc-1-25-1', + plan_disk: 25, + plan_ram: 1024, + plan_vcpus: 1, + plan_replicas: 0, + region: 'EWR', + status: 'Running', + label: 'some label', + tag: 'some tag', + database_engine: 'mysql', + database_engine_version: 8, + dbname: 'defaultdb', + host: 'HOSTNAME_GOES_HERE', + user: 'vultradmin', + password: 'PASSWORD_GOES_HERE', + port: 16751, + maintenance_dow: 'sunday', + maintenance_time: '06:00:00', + latest_backup: '2022-11-02 12:58:18"', + trusted_ips: ['...'], + mysql_sql_modes: [ + 'ANSI', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'NO_ENGINE_SUBSTITUTION', + 'NO_ZERO_DATE', + 'NO_ZERO_IN_DATE', + 'STRICT_ALL_TABLES' + ], + mysql_require_primary_key: true, + mysql_slow_query_log: false, + cluster_time_zone: 'America/New_York', + read_replicas: ['...'] + } + }, + listDatabaseUsers: { + users: [ + { + username: 'vultradmin', + password: 'PASSWORD_GOES_HERE', + encryption: 'Default (MySQL 8+)' + }, + { + username: 'ANOTHER_USER_HERE', + password: 'PASSWORD_GOES_HERE', + encryption: 'Legacy (MySQL 5.x)' + } + ], + meta: { + total: 2 + } + }, + createDatabaseUser: { + user: { + username: 'some_new_user', + password: 'some_secure_password', + encryption: 'Default (MySQL 8+)' + } + }, + getDatabaseUser: { + user: { + username: 'some_username', + password: 'some_secure_password', + encryption: 'Default (MySQL 8+)' + } + }, + updateDatabaseUser: { + user: { + username: 'some_username', + password: 'some_secure_password', + encryption: 'Default (MySQL 8+)' + } + }, + listDatabaseDbs: { + dbs: [ + { + name: 'defaultdb' + }, + { + name: 'another_db' + } + ], + meta: { + total: 2 + } + }, + createDatabaseDb: { + db: { + name: 'new_db_name' + } + }, + getDatabaseDb: { + db: { + name: 'some_db_name' + } + }, + listMaintenanceUpdates: { + available_updates: ['update_description_here', 'another_description_here'] + }, + startMaintenanceUpdates: { + message: + 'Maintenance updates initialized. Please note the maintenance consists of switching to a new server that will host the service and all pending updates will be applied. This will cause a short service interruption.' + }, + listServiceAlerts: { + alerts: [ + { + timestamp: '2023-02-10 12:40:19', + message_type: 'RESOURCE USAGE DISK', + description: + 'Disk usage is critically high for a database service, service is not performing normally.', + recommendation: + 'We recommend you review your application or upgrade to the next plan size.', + resource_type: 'disk' + }, + { + timestamp: '2023-02-09 15:41:20', + message_type: 'MAINTENANCE SCHEDULED', + description: + 'Mandatory maintenance has been scheduled for a database service.', + maintenance_scheduled: '2023-02-12 01:00:00 (UTC)' + } + ] + }, + viewMigrationStatus: { + migration: { + status: 'complete', + method: 'replication', + credentials: { + host: 'some_host', + port: 3306, + username: 'some_username', + password: 'some_password', + database: 'some_database', + ignored_databases: '', + ssl: true + } + } + }, + databaseStartMigration: { + migration: { + status: 'pending', + credentials: { + host: 'some_host', + port: 3306, + username: 'some_username', + password: 'some_password', + database: 'some_database', + ignored_databases: '', + ssl: true + } + } + }, + databaseAddReadReplica: { + database: { + id: '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + date_created: '2022-05-09 10:13:31', + plan: 'vultr-dbaas-hobbyist-cc-1-25-1', + plan_disk: 25, + plan_ram: 1024, + plan_vcpus: 1, + plan_replicas: 0, + region: 'EWR', + status: 'Running', + label: 'new_read_replica_label', + tag: 'some tag', + database_engine: 'mysql', + database_engine_version: 8, + dbname: 'defaultdb', + host: 'HOSTNAME_GOES_HERE', + user: 'vultradmin', + password: 'PASSWORD_GOES_HERE', + port: 16751, + maintenance_dow: 'sunday', + maintenance_time: '06:00:00', + latest_backup: '2022-11-02 12:58:18"', + trusted_ips: ['...'], + mysql_sql_modes: [ + 'ANSI', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'NO_ENGINE_SUBSTITUTION', + 'NO_ZERO_DATE', + 'NO_ZERO_IN_DATE', + 'STRICT_ALL_TABLES' + ], + mysql_require_primary_key: true, + mysql_slow_query_log: false, + cluster_time_zone: 'America/New_York' + } + }, + getBackupInformation: { + latest_backup: { + date: '2023-02-07', + time: '20:51:05' + }, + oldest_backup: { + date: '2023-02-05', + time: '20:51:07' + } + }, + databaseRestoreFromBackup: { + database: { + id: '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + date_created: '2022-05-09 10:13:31', + plan: 'vultr-dbaas-hobbyist-cc-1-25-1', + plan_disk: 25, + plan_ram: 1024, + plan_vcpus: 1, + plan_replicas: 0, + region: 'EWR', + status: 'Running', + label: 'new_restore_label', + tag: 'some tag', + database_engine: 'mysql', + database_engine_version: 8, + dbname: 'defaultdb', + host: 'HOSTNAME_GOES_HERE', + user: 'vultradmin', + password: 'PASSWORD_GOES_HERE', + port: 16751, + maintenance_dow: 'sunday', + maintenance_time: '06:00:00', + latest_backup: '2022-11-02 12:58:18"', + trusted_ips: ['...'], + mysql_sql_modes: [ + 'ANSI', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'NO_ENGINE_SUBSTITUTION', + 'NO_ZERO_DATE', + 'NO_ZERO_IN_DATE', + 'STRICT_ALL_TABLES' + ], + mysql_require_primary_key: true, + mysql_slow_query_log: false, + cluster_time_zone: 'America/New_York' + } + }, + databaseFork: { + database: { + id: '999c4ed0-f2e4-4f2a-a951-de358ceb9ab5', + date_created: '2022-05-09 10:13:31', + plan: 'vultr-dbaas-startup-cc-2-80-4', + plan_disk: 80, + plan_ram: 4096, + plan_vcpus: 2, + plan_replicas: 0, + region: 'SEA', + status: 'Running', + label: 'new_fork_label', + tag: 'some tag', + database_engine: 'mysql', + database_engine_version: 8, + dbname: 'defaultdb', + host: 'HOSTNAME_GOES_HERE', + user: 'vultradmin', + password: 'PASSWORD_GOES_HERE', + port: 16751, + maintenance_dow: 'sunday', + maintenance_time: '06:00:00', + latest_backup: '2022-11-02 12:58:18"', + trusted_ips: ['...'], + mysql_sql_modes: [ + 'ANSI', + 'ERROR_FOR_DIVISION_BY_ZERO', + 'NO_ENGINE_SUBSTITUTION', + 'NO_ZERO_DATE', + 'NO_ZERO_IN_DATE', + 'STRICT_ALL_TABLES' + ], + mysql_require_primary_key: true, + mysql_slow_query_log: false, + cluster_time_zone: 'America/New_York' + } + }, + listConnectionPools: { + connections: { + used: 12, + available: 10, + max: 22 + }, + connection_pools: [ + { + name: 'first_pool_name', + database: 'some_db_name', + username: 'some_username', + mode: 'transaction', + size: 5 + }, + { + name: 'second_pool_name', + database: 'another_db_name', + username: 'another_username', + mode: 'session', + size: 7 + } + ], + meta: { + total: 2 + } + }, + createConnectionPool: { + connection_pool: { + name: 'new_connection_pool', + database: 'some_database', + username: 'some_user', + mode: 'transaction', + size: 5 + } + }, + getConnectionPool: { + connection_pool: { + name: 'some_connection_pool', + database: 'some_database', + username: 'some_user', + mode: 'transaction', + size: 5 + } + }, + updateConnectionPool: { + mode: 'session' + }, + listAdvancedOptions: { + configured_options: { + jit: false, + temp_file_limit: 10000, + track_io_timing: 'off' + }, + available_options: [ + { + name: 'autovacuum_analyze_scale_factor', + type: 'float', + min_value: 0, + max_value: 1 + }, + { + name: 'autovacuum_analyze_threshold', + type: 'int', + min_value: 0, + max_value: 2147483647 + } + ] + }, + updateAdvancedOptions: { + configured_options: { + jit: false, + temp_file_limit: 10000, + track_io_timing: 'off' + }, + available_options: [ + { + name: 'autovacuum_analyze_scale_factor', + type: 'float', + min_value: 0, + max_value: 1 + }, + { + name: 'autovacuum_analyze_threshold', + type: 'int', + min_value: 0, + max_value: 2147483647 + } + ] + }, + listAvailableVersions: { + available_versions: ['12', '13', '14', '15'] + }, + startVersionUpgrade: { + message: 'Version upgrade successfully initialized.' + } +} + +util.createTestSuite('databases', mockParameters, mockResponses) diff --git a/test/api/instances.test.js b/test/api/instances.test.js index d9997e98..08aec32e 100644 --- a/test/api/instances.test.js +++ b/test/api/instances.test.js @@ -170,7 +170,8 @@ const mockResponses = { os_id: 362, app_id: 0, firewall_group_id: '', - features: ['ddos_protection', 'ipv6', 'auto_backups'] + features: ['ddos_protection', 'ipv6', 'auto_backups'], + tags: ['a tag', 'another'] } ] }, @@ -231,7 +232,8 @@ const mockResponses = { os_id: 387, app_id: 0, firewall_group_id: '', - features: ['ddos_protection', 'ipv6', 'auto_backups'] + features: ['ddos_protection', 'ipv6', 'auto_backups'], + tags: ['a tag', 'another'] } }, reinstallInstance: { diff --git a/test/api/kubernetes.test.js b/test/api/kubernetes.test.js index 9cfeae16..d398a2fd 100644 --- a/test/api/kubernetes.test.js +++ b/test/api/kubernetes.test.js @@ -74,7 +74,7 @@ const mockParameters = { }, upgrades: { 'vke-id': '455dcd32-e621-48ee-a10e-0cb5f754e13e', - 'upgrade_version': "v1.22.8+3" + upgrade_version: 'v1.22.8+3' }, getKubernetesAvailableUpgrades: { 'vke-id': '455dcd32-e621-48ee-a10e-0cb5f754e13e' @@ -438,7 +438,7 @@ const mockResponses = { versions: ['v1.20.0+1'] }, getKubernetesAvailableUpgrades: { - available_upgrades: ["v1.22.8+3","v1.21.11+3"] + available_upgrades: ['v1.22.8+3', 'v1.21.11+3'] } } diff --git a/test/api/load-balancers.test.js b/test/api/load-balancers.test.js index 16567a5b..375a58b0 100644 --- a/test/api/load-balancers.test.js +++ b/test/api/load-balancers.test.js @@ -116,6 +116,8 @@ const mockResponses = { healthy_threshold: 3 }, has_ssl: false, + http2: false, + nodes: 1, forwarding_rules: [ { id: '73d85156c2c3129d', diff --git a/test/api/reserved-ips.test.js b/test/api/reserved-ips.test.js index 0f7a4b53..793459b9 100644 --- a/test/api/reserved-ips.test.js +++ b/test/api/reserved-ips.test.js @@ -7,6 +7,10 @@ const mockParameters = { deleteReservedIp: { 'reserved-ip': 'cb676a46-66fd-4dfb-b839-443f2e6c0b604' }, + updateReservedIp: { + 'reserved-ip': 'cb676a46-66fd-4dfb-b839-443f2e6c0b604', + label: 'Example Label' + }, createReservedIp: { region: 'ewr', ip_type: 'v4' @@ -75,6 +79,17 @@ const mockResponses = { instance_id: 'cb676a46-66fd-4dfb-b839-443f2e6c0b60' } }, + updateReservedIp: { + reserved_ip: { + id: 'string', + region: 'string', + ip_type: 'string', + subnet: 'string', + subnet_size: 0, + label: 'Example Label', + instance_id: 'string' + } + }, convertInstanceIpToReservedIp: { reserved_ip: { id: 'cb676a46-66fd-4dfb-b839-443f2e6c0b60',