UsersApi
All URIs are relative to https://api.ionos.com/databases/mongodb
Method HTTP request Description DELETE /clusters/{clusterId}/users/{username}
Delete a MongoDB User by ID
GET /clusters/{clusterId}/users/{username}
GET /clusters/{clusterId}/users
PATCH /clusters/{clusterId}/users/{username}
Patch a MongoDB User by ID
POST /clusters/{clusterId}/users
clustersUsersDelete
User clustersUsersDelete(clusterId, username)
Delete a MongoDB User by ID
Deletes a MongoDB user specified by its ID.
Example
Copy // Import classes:
import com . ionoscloud . dbaasmongo . ApiClient ;
import com . ionoscloud . dbaasmongo . ApiException ;
import com . ionoscloud . dbaasmongo . Configuration ;
import com . ionoscloud . dbaasmongo . auth . * ;
import com . ionoscloud . dbaasmongo . model . * ;
import com . ionoscloud . dbaasmongo . 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 = "clusterId_example" ; // String | The unique ID of the cluster.
String username = "username_example" ; // String | The authentication username.
try {
User result = apiInstance . clustersUsersDelete (clusterId , username);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling UsersApi#clustersUsersDelete" );
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
Name Type Description Notes The unique ID of the cluster.
The authentication username.
Return type
User
Content-Type : Not defined
clustersUsersFindById
User clustersUsersFindById(clusterId, username)
Get a MongoDB User by ID
Retrieves the MongoDB user identified by the username.
Example
Copy // Import classes:
import com . ionoscloud . dbaasmongo . ApiClient ;
import com . ionoscloud . dbaasmongo . ApiException ;
import com . ionoscloud . dbaasmongo . Configuration ;
import com . ionoscloud . dbaasmongo . auth . * ;
import com . ionoscloud . dbaasmongo . model . * ;
import com . ionoscloud . dbaasmongo . 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 = "clusterId_example" ; // String | The unique ID of the cluster.
String username = "username_example" ; // String | The authentication username.
try {
User result = apiInstance . clustersUsersFindById (clusterId , username);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling UsersApi#clustersUsersFindById" );
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
Name Type Description Notes The unique ID of the cluster.
The authentication username.
Return type
User
Content-Type : Not defined
clustersUsersGet
UsersList clustersUsersGet(clusterId, limit, offset)
Get all Cluster Users
Retrieves a list of MongoDB users.
Example
Copy // Import classes:
import com . ionoscloud . dbaasmongo . ApiClient ;
import com . ionoscloud . dbaasmongo . ApiException ;
import com . ionoscloud . dbaasmongo . Configuration ;
import com . ionoscloud . dbaasmongo . auth . * ;
import com . ionoscloud . dbaasmongo . model . * ;
import com . ionoscloud . dbaasmongo . 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 = "clusterId_example" ; // 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.
try {
UsersList result = apiInstance . clustersUsersGet (clusterId , limit , offset);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling UsersApi#clustersUsersGet" );
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
Name Type Description Notes 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]
Return type
UsersList
Content-Type : Not defined
clustersUsersPatch
User clustersUsersPatch(clusterId, username, patchUserRequest)
Patch a MongoDB User by ID
Patches a MongoDB user specified by its ID.
Example
Copy // Import classes:
import com . ionoscloud . dbaasmongo . ApiClient ;
import com . ionoscloud . dbaasmongo . ApiException ;
import com . ionoscloud . dbaasmongo . Configuration ;
import com . ionoscloud . dbaasmongo . auth . * ;
import com . ionoscloud . dbaasmongo . model . * ;
import com . ionoscloud . dbaasmongo . 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 = "clusterId_example" ; // String | The unique ID of the cluster.
String username = "username_example" ; // String | The authentication username.
PatchUserRequest patchUserRequest = new PatchUserRequest(); // PatchUserRequest | Part of the MongoDB user which should be modified.
try {
User result = apiInstance . clustersUsersPatch (clusterId , username , patchUserRequest);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling UsersApi#clustersUsersPatch" );
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
Name Type Description Notes The unique ID of the cluster.
The authentication username.
Part of the MongoDB user which should be modified.
Return type
User
Content-Type : application/json
clustersUsersPost
User clustersUsersPost(clusterId, user)
Create MongoDB User
Creates a MongoDB user.
Example
Copy // Import classes:
import com . ionoscloud . dbaasmongo . ApiClient ;
import com . ionoscloud . dbaasmongo . ApiException ;
import com . ionoscloud . dbaasmongo . Configuration ;
import com . ionoscloud . dbaasmongo . auth . * ;
import com . ionoscloud . dbaasmongo . model . * ;
import com . ionoscloud . dbaasmongo . 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 = "clusterId_example" ; // String | The unique ID of the cluster.
User user = new User() ; // User | The user to be created.
try {
User result = apiInstance . clustersUsersPost (clusterId , user);
System . out . println (result);
} catch ( ApiException e) {
System . err . println ( "Exception when calling UsersApi#clustersUsersPost" );
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
Name Type Description Notes The unique ID of the cluster.
Return type
User
Content-Type : application/json