UsersApi
All URIs are relative to https://api.ionos.com/databases/postgresql
Method
HTTP request
Description
DELETE /clusters/{clusterId}/users/{username}
GET /clusters/{clusterId}/users/{username}
GET /clusters/{clusterId}/users
PATCH /clusters/{clusterId}/users/{username}
POST /clusters/{clusterId}/users
usersDelete
usersDelete(clusterId, username)
Delete user
Deletes a single user
Example
Copy // Import classes:
import com . ionoscloud . dbaaspostgres . ApiClient ;
import com . ionoscloud . dbaaspostgres . ApiException ;
import com . ionoscloud . dbaaspostgres . Configuration ;
import com . ionoscloud . dbaaspostgres . auth . * ;
import com . ionoscloud . dbaaspostgres . model . * ;
import com . ionoscloud . dbaaspostgres . api . UsersApi ;
public class Example {
public static void main ( String [] args) {
ApiClient defaultClient = Configuration . getDefaultApiClient ();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient . getAuthentication ( "basicAuth" );
basicAuthentication . setUsername ( "YOUR USERNAME" );
basicAuthentication . setPassword ( "YOUR PASSWORD" );
UsersApi apiInstance = new UsersApi(defaultClient) ;
String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e" ; // String | The unique ID of the cluster.
String username = "benjamin" ; // String | The authentication username.
try {
apiInstance . usersDelete (clusterId , username);
} catch ( ApiException e) {
System . err . println ( "Exception when calling UsersApi#usersDelete" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
The unique ID of the cluster.
The authentication username.
Return type
null (empty response body)
Content-Type : Not defined
usersGet
UserResource usersGet(clusterId, username)
Get user
Retrieves a single user
Example
Copy // Import classes:
import com . ionoscloud . dbaaspostgres . ApiClient ;
import com . ionoscloud . dbaaspostgres . ApiException ;
import com . ionoscloud . dbaaspostgres . Configuration ;
import com . ionoscloud . dbaaspostgres . auth . * ;
import com . ionoscloud . dbaaspostgres . model . * ;
import com . ionoscloud . dbaaspostgres . api . UsersApi ;
public class Example {
public static void main ( String [] args) {
ApiClient defaultClient = Configuration . getDefaultApiClient ();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient . getAuthentication ( "basicAuth" );
basicAuthentication . setUsername ( "YOUR USERNAME" );
basicAuthentication . setPassword ( "YOUR PASSWORD" );
UsersApi apiInstance = new UsersApi(defaultClient) ;
String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e" ; // String | The unique ID of the cluster.
String username = "benjamin" ; // String | The authentication username.
try {
UserResource result = apiInstance . usersGet (clusterId , username);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling UsersApi#usersGet" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
The unique ID of the cluster.
The authentication username.
Return type
UserResource
Content-Type : Not defined
usersList
UserList usersList(clusterId, limit, offset, system)
List users
Retrieves a list of users
Example
Copy // Import classes:
import com . ionoscloud . dbaaspostgres . ApiClient ;
import com . ionoscloud . dbaaspostgres . ApiException ;
import com . ionoscloud . dbaaspostgres . Configuration ;
import com . ionoscloud . dbaaspostgres . auth . * ;
import com . ionoscloud . dbaaspostgres . model . * ;
import com . ionoscloud . dbaaspostgres . api . UsersApi ;
public class Example {
public static void main ( String [] args) {
ApiClient defaultClient = Configuration . getDefaultApiClient ();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient . getAuthentication ( "basicAuth" );
basicAuthentication . setUsername ( "YOUR USERNAME" );
basicAuthentication . setPassword ( "YOUR PASSWORD" );
UsersApi apiInstance = new UsersApi(defaultClient) ;
String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e" ; // String | The unique ID of the cluster.
Integer limit = 100 ; // Integer | The maximum number of elements to return. Use together with 'offset' for pagination.
Integer offset = 0 ; // Integer | The first element to return. Use together with 'limit' for pagination.
Boolean system = true ; // Boolean | If set to 'true' all users, including system users are returned. System users cannot be deleted or updated.
try {
UserList result = apiInstance . usersList (clusterId , limit , offset , system);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling UsersApi#usersList" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
The unique ID of the cluster.
The maximum number of elements to return. Use together with 'offset' for pagination.
[optional] [default to 100]
The first element to return. Use together with 'limit' for pagination.
[optional] [default to 0]
If set to 'true' all users, including system users are returned. System users cannot be deleted or updated.
Return type
UserList
Content-Type : Not defined
usersPatch
UserResource usersPatch(clusterId, username, usersPatchRequest)
Patch user
Patches a single user. Only changing the password is supported. System users cannot be patched.
Example
Copy // Import classes:
import com . ionoscloud . dbaaspostgres . ApiClient ;
import com . ionoscloud . dbaaspostgres . ApiException ;
import com . ionoscloud . dbaaspostgres . Configuration ;
import com . ionoscloud . dbaaspostgres . auth . * ;
import com . ionoscloud . dbaaspostgres . model . * ;
import com . ionoscloud . dbaaspostgres . api . UsersApi ;
public class Example {
public static void main ( String [] args) {
ApiClient defaultClient = Configuration . getDefaultApiClient ();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient . getAuthentication ( "basicAuth" );
basicAuthentication . setUsername ( "YOUR USERNAME" );
basicAuthentication . setPassword ( "YOUR PASSWORD" );
UsersApi apiInstance = new UsersApi(defaultClient) ;
String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e" ; // String | The unique ID of the cluster.
String username = "benjamin" ; // String | The authentication username.
UsersPatchRequest usersPatchRequest = new UsersPatchRequest() ; // UsersPatchRequest | Patch containing all properties that should be updated
try {
UserResource result = apiInstance . usersPatch (clusterId , username , usersPatchRequest);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling UsersApi#usersPatch" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
The unique ID of the cluster.
The authentication username.
Patch containing all properties that should be updated
Return type
UserResource
Content-Type : application/json
usersPost
UserResource usersPost(clusterId, user)
Create a user
Create a new Postgres User
Example
Copy // Import classes:
import com . ionoscloud . dbaaspostgres . ApiClient ;
import com . ionoscloud . dbaaspostgres . ApiException ;
import com . ionoscloud . dbaaspostgres . Configuration ;
import com . ionoscloud . dbaaspostgres . auth . * ;
import com . ionoscloud . dbaaspostgres . model . * ;
import com . ionoscloud . dbaaspostgres . api . UsersApi ;
public class Example {
public static void main ( String [] args) {
ApiClient defaultClient = Configuration . getDefaultApiClient ();
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuthentication = (HttpBasicAuth) defaultClient . getAuthentication ( "basicAuth" );
basicAuthentication . setUsername ( "YOUR USERNAME" );
basicAuthentication . setPassword ( "YOUR PASSWORD" );
UsersApi apiInstance = new UsersApi(defaultClient) ;
String clusterId = "498ae72f-411f-11eb-9d07-046c59cc737e" ; // String | The unique ID of the cluster.
User user = new User() ; // User |
try {
UserResource result = apiInstance . usersPost (clusterId , user);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling UsersApi#usersPost" );
System . err . println ( "Status code: " + e . getCode ());
System . err . println ( "Reason: " + e . getResponseBody ());
System . err . println ( "Response headers: " + e . getResponseHeaders ());
e . printStackTrace ();
}
}
}
⚠️ Note : for the example above, you need to provide all parameters to the method call. Null values will resolve to the API defaults.
Parameters
The unique ID of the cluster.
Return type
UserResource
Content-Type : application/json