All URIs are relative to https://api.ionos.com/databases/postgresql
Method
HTTP request
Description
users_delete
users_delete(cluster_id, username)
Delete user
Deletes a single user
Example
from__future__import print_functionimport timeimport ionoscloud_dbaas_postgresfrom ionoscloud_dbaas_postgres.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/databases/postgresqlconfiguration = ionoscloud_dbaas_postgres.Configuration( host ='https://api.ionos.com/databases/postgresql',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud_dbaas_postgres.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud_dbaas_postgres.UsersApi(api_client) cluster_id ='498ae72f-411f-11eb-9d07-046c59cc737e'# str | The unique ID of the cluster. username ='benjamin'# str | The authentication username.try:# Delete user api_instance.users_delete(cluster_id, username)except ApiException as e:print('Exception when calling UsersApi.users_delete: %s\n'% e)
Parameters
Return type
void (empty response body)
Authorization
basicAuth, tokenAuth
HTTP request headers
Content-Type: Not defined
Accept: application/json
users_get
UserResource users_get(cluster_id, username)
Get user
Retrieves a single user
Example
from__future__import print_functionimport timeimport ionoscloud_dbaas_postgresfrom ionoscloud_dbaas_postgres.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/databases/postgresqlconfiguration = ionoscloud_dbaas_postgres.Configuration( host ='https://api.ionos.com/databases/postgresql',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud_dbaas_postgres.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud_dbaas_postgres.UsersApi(api_client) cluster_id ='498ae72f-411f-11eb-9d07-046c59cc737e'# str | The unique ID of the cluster. username ='benjamin'# str | The authentication username.try:# Get user api_response = api_instance.users_get(cluster_id, username)print(api_response)except ApiException as e:print('Exception when calling UsersApi.users_get: %s\n'% e)
from__future__import print_functionimport timeimport ionoscloud_dbaas_postgresfrom ionoscloud_dbaas_postgres.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/databases/postgresqlconfiguration = ionoscloud_dbaas_postgres.Configuration( host ='https://api.ionos.com/databases/postgresql',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud_dbaas_postgres.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud_dbaas_postgres.UsersApi(api_client) cluster_id ='498ae72f-411f-11eb-9d07-046c59cc737e'# str | The unique ID of the cluster.try:# List users api_response = api_instance.users_list(cluster_id)print(api_response)except ApiException as e:print('Exception when calling UsersApi.users_list: %s\n'% e)
Patches a single user. Only changing the password is supported. System users cannot be patched.
Example
from__future__import print_functionimport timeimport ionoscloud_dbaas_postgresfrom ionoscloud_dbaas_postgres.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/databases/postgresqlconfiguration = ionoscloud_dbaas_postgres.Configuration( host ='https://api.ionos.com/databases/postgresql',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud_dbaas_postgres.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud_dbaas_postgres.UsersApi(api_client) cluster_id ='498ae72f-411f-11eb-9d07-046c59cc737e'# str | The unique ID of the cluster. username ='benjamin'# str | The authentication username. users_patch_request = ionoscloud_dbaas_postgres.UsersPatchRequest() # UsersPatchRequest | Patch containing all properties that should be updated
try:# Patch user api_response = api_instance.users_patch(cluster_id, username, users_patch_request)print(api_response)except ApiException as e:print('Exception when calling UsersApi.users_patch: %s\n'% e)
from__future__import print_functionimport timeimport ionoscloud_dbaas_postgresfrom ionoscloud_dbaas_postgres.rest import ApiException# Defining the host is optional and defaults to https://api.ionos.com/databases/postgresqlconfiguration = ionoscloud_dbaas_postgres.Configuration( host ='https://api.ionos.com/databases/postgresql',)# Example of configuring HTTP Basic Authorizationconfiguration.username ='YOUR_USERNAME'configuration.password ='YOUR_PASSWORD'with ionoscloud_dbaas_postgres.ApiClient(configuration)as api_client:# Create an instance of the API class api_instance = ionoscloud_dbaas_postgres.UsersApi(api_client) cluster_id ='498ae72f-411f-11eb-9d07-046c59cc737e'# str | The unique ID of the cluster. user = ionoscloud_dbaas_postgres.User()# User | try:# Create a user api_response = api_instance.users_post(cluster_id, user)print(api_response)except ApiException as e:print('Exception when calling UsersApi.users_post: %s\n'% e)