Comment on page
UsersApi
All URIs are relative to https://api.ionos.com/databases/postgresql
Method | HTTP request | Description |
---|---|---|
DELETE /clusters/{clusterId}/users/{username} | Delete user | |
GET /clusters/{clusterId}/users/{username} | Get user | |
GET /clusters/{clusterId}/users | List users | |
PATCH /clusters/{clusterId}/users/{username} | Patch user | |
POST /clusters/{clusterId}/users | Create a user |
usersDelete(clusterId, username)
Delete user
Deletes a single user
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.UsersApi(config);
// Delete user
api_instance
.usersDelete({
clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e,
username: benjamin
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
clusterId | string | The unique ID of the cluster. | [default to undefined] |
username | string | The authentication username. | [default to undefined] |
nil (empty response body)
basicAuth, tokenAuth
- Content-Type: Not defined
- Accept: application/json
usersGet(clusterId, username)
Get user
Retrieves a single user
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.UsersApi(config);
// Get user
api_instance
.usersGet({
clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e,
username: benjamin
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
clusterId | string | The unique ID of the cluster. | [default to undefined] |
username | string | The authentication username. | [default to undefined] |
basicAuth, tokenAuth
- Content-Type: Not defined
- Accept: application/json
usersList(clusterId, opts)
List users
Retrieves a list of users
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.UsersApi(config);
// List users
api_instance
.usersList({
clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e,
limit: 100,
offset: 200,
system: true,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
clusterId | string | The unique ID of the cluster. | [default to undefined] |
limit | number | The maximum number of elements to return. Use together with 'offset' for pagination. | [optional][default to 100] |
offset | number | The first element to return. Use together with 'limit' for pagination. | [optional][default to 0] |
system | boolean | If set to 'true' all users, including system users are returned. System users cannot be deleted or updated. | [optional][default to undefined] |
basicAuth, tokenAuth
- Content-Type: Not defined
- Accept: application/json
usersPatch(clusterId, username, usersPatchRequest)
Patch user
Patches a single user. Only changing the password is supported. System users cannot be patched.
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.UsersApi(config);
// Patch user
api_instance
.usersPatch({
clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e,
username: benjamin,
usersPatchRequest: usersPatchRequest_example
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
clusterId | string | The unique ID of the cluster. | [default to undefined] |
username | string | The authentication username. | [default to undefined] |
usersPatchRequest | Patch containing all properties that should be updated | |
basicAuth, tokenAuth
- Content-Type: application/json
- Accept: application/json
usersPost(clusterId, user)
Create a user
Create a new Postgres User
const ionoscloud = require('@ionos-cloud/sdk-nodejs-dbaas-postgres');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.UsersApi(config);
// Create a user
api_instance
.usersPost({
clusterId: 498ae72f-411f-11eb-9d07-046c59cc737e,
user: user_example
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));
Name | Type | Description | Notes |
---|---|---|---|
clusterId | string | The unique ID of the cluster. | [default to undefined] |
user | | |
basicAuth, tokenAuth
- Content-Type: application/json
- Accept: application/json
Last modified 4mo ago