# ionoscloud-dbaas-mongo
With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API.

MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas.

The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use.


This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.0
- Package version: 2.0.0-beta.1
- Generator version: 7.13.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Python 3.9+

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/ionos-cloud/sdk-python.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/ionos-cloud/sdk-python.git`)

Then import the package:
```python
import ionoscloud_dbaas_mongo
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import ionoscloud_dbaas_mongo
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import ionoscloud_dbaas_mongo
from ionoscloud_dbaas_mongo.rest import ApiException
from pprint import pprint
import os

# Defining the host is optional and defaults to https://api.ionos.com/databases/mongodb
# See configuration.py for a list of all supported configuration parameters.
configuration = ionoscloud_dbaas_mongo.Configuration(
    host = "https://api.ionos.com/databases/mongodb"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration = ionoscloud_dbaas_mongo.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'


# Enter a context with an instance of the API client
with ionoscloud_dbaas_mongo.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud_dbaas_mongo.ClustersApi(api_client)
    cluster_id = 'cluster_id_example' # str | The unique ID of the cluster.

    try:
        # Delete a Cluster
        api_response = api_instance.clusters_delete(cluster_id)
        print("The response of ClustersApi->clusters_delete:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ClustersApi->clusters_delete: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to *https://api.ionos.com/databases/mongodb*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ClustersApi* | [**clusters_delete**](docs/api/ClustersApi.md#clusters_delete) | **DELETE** /clusters/{clusterId} | Delete a Cluster
*ClustersApi* | [**clusters_find_by_id**](docs/api/ClustersApi.md#clusters_find_by_id) | **GET** /clusters/{clusterId} | Get a cluster by id
*ClustersApi* | [**clusters_get**](docs/api/ClustersApi.md#clusters_get) | **GET** /clusters | Get Clusters
*ClustersApi* | [**clusters_patch**](docs/api/ClustersApi.md#clusters_patch) | **PATCH** /clusters/{clusterId} | Patch a cluster
*ClustersApi* | [**clusters_post**](docs/api/ClustersApi.md#clusters_post) | **POST** /clusters | Create a Cluster
*ClustersApi* | [**clusters_versions_get**](docs/api/ClustersApi.md#clusters_versions_get) | **GET** /clusters/{clusterId}/versions | Get available MongoDB versions for this cluster
*LogsApi* | [**clusters_logs_get**](docs/api/LogsApi.md#clusters_logs_get) | **GET** /clusters/{clusterId}/logs | Get logs of your cluster
*MetadataApi* | [**infos_version_get**](docs/api/MetadataApi.md#infos_version_get) | **GET** /infos/version | Get API Version
*MetadataApi* | [**infos_versions_get**](docs/api/MetadataApi.md#infos_versions_get) | **GET** /infos/versions | Get All API Versions
*MetadataApi* | [**versions_get**](docs/api/MetadataApi.md#versions_get) | **GET** /versions | Get available MongoDB versions
*RestoresApi* | [**clusters_restore_post**](docs/api/RestoresApi.md#clusters_restore_post) | **POST** /clusters/{clusterId}/restore | In-place restore of a cluster
*SnapshotsApi* | [**clusters_snapshots_get**](docs/api/SnapshotsApi.md#clusters_snapshots_get) | **GET** /clusters/{clusterId}/snapshots | Get the snapshots of your cluster
*TemplatesApi* | [**templates_get**](docs/api/TemplatesApi.md#templates_get) | **GET** /templates | Get Templates
*UsersApi* | [**clusters_users_delete**](docs/api/UsersApi.md#clusters_users_delete) | **DELETE** /clusters/{clusterId}/users/{username} | Delete a MongoDB User by ID
*UsersApi* | [**clusters_users_find_by_id**](docs/api/UsersApi.md#clusters_users_find_by_id) | **GET** /clusters/{clusterId}/users/{username} | Get a MongoDB User by ID
*UsersApi* | [**clusters_users_get**](docs/api/UsersApi.md#clusters_users_get) | **GET** /clusters/{clusterId}/users | Get all Cluster Users
*UsersApi* | [**clusters_users_patch**](docs/api/UsersApi.md#clusters_users_patch) | **PATCH** /clusters/{clusterId}/users/{username} | Patch a MongoDB User by ID
*UsersApi* | [**clusters_users_post**](docs/api/UsersApi.md#clusters_users_post) | **POST** /clusters/{clusterId}/users | Create MongoDB User


## Documentation For Models

 - [APIVersion](docs/models/APIVersion.md)
 - [BackupProperties](docs/models/BackupProperties.md)
 - [BiConnectorProperties](docs/models/BiConnectorProperties.md)
 - [ClusterList](docs/models/ClusterList.md)
 - [ClusterLogs](docs/models/ClusterLogs.md)
 - [ClusterLogsInstancesInner](docs/models/ClusterLogsInstancesInner.md)
 - [ClusterLogsInstancesInnerMessagesInner](docs/models/ClusterLogsInstancesInnerMessagesInner.md)
 - [ClusterProperties](docs/models/ClusterProperties.md)
 - [ClusterResponse](docs/models/ClusterResponse.md)
 - [Connection](docs/models/Connection.md)
 - [CreateClusterProperties](docs/models/CreateClusterProperties.md)
 - [CreateClusterRequest](docs/models/CreateClusterRequest.md)
 - [CreateRestoreRequest](docs/models/CreateRestoreRequest.md)
 - [DayOfTheWeek](docs/models/DayOfTheWeek.md)
 - [ErrorMessage](docs/models/ErrorMessage.md)
 - [ErrorResponse](docs/models/ErrorResponse.md)
 - [Health](docs/models/Health.md)
 - [MaintenanceWindow](docs/models/MaintenanceWindow.md)
 - [Metadata](docs/models/Metadata.md)
 - [MongoDBVersionList](docs/models/MongoDBVersionList.md)
 - [MongoDBVersionListDataInner](docs/models/MongoDBVersionListDataInner.md)
 - [Pagination](docs/models/Pagination.md)
 - [PaginationLinks](docs/models/PaginationLinks.md)
 - [PatchClusterProperties](docs/models/PatchClusterProperties.md)
 - [PatchClusterRequest](docs/models/PatchClusterRequest.md)
 - [PatchUserProperties](docs/models/PatchUserProperties.md)
 - [PatchUserRequest](docs/models/PatchUserRequest.md)
 - [ResourceType](docs/models/ResourceType.md)
 - [SnapshotList](docs/models/SnapshotList.md)
 - [SnapshotProperties](docs/models/SnapshotProperties.md)
 - [SnapshotResponse](docs/models/SnapshotResponse.md)
 - [State](docs/models/State.md)
 - [StorageType](docs/models/StorageType.md)
 - [TemplateList](docs/models/TemplateList.md)
 - [TemplateProperties](docs/models/TemplateProperties.md)
 - [TemplateResponse](docs/models/TemplateResponse.md)
 - [User](docs/models/User.md)
 - [UserMetadata](docs/models/UserMetadata.md)
 - [UserProperties](docs/models/UserProperties.md)
 - [UserRoles](docs/models/UserRoles.md)
 - [UsersList](docs/models/UsersList.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="basicAuth"></a>
### basicAuth

- **Type**: HTTP basic authentication

<a id="tokenAuth"></a>
### tokenAuth

- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header


## Author




