Skip to main content

 CI DBaaS Mongo Python Gitter Quality Gate Status Bugs Maintainability Rating Reliability Rating Security Rating Vulnerabilities Release Release Date PyPI version

Alt text

Python API client for 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.

Overview

The IONOS Cloud SDK for Python provides you with access to the IONOS Cloud Dbaas Postgres API. The client library supports both simple and complex requests. It is designed for developers who are building applications in Python. All API operations are performed over SSL and authenticated using your IONOS Cloud portal credentials. The API can be accessed within an instance running in IONOS Cloud or directly over the Internet from any application that can send an HTTPS request and receive an HTTPS response.

Installation & Usage

Requirements:

  • Python >= 3.5

pip install

Since this package is hosted on Pypi you can install it by using:

pip install ionoscloud-dbaas-mongo

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

pip install git+https://github.com/ionos-cloud/sdk-python-dbaas-mongo.git

Note: you may need to run pip with root permission: sudo pip install git+https://github.com/ionos-cloud/sdk-python-dbaas-mongo.git

Then import the package:

import ionoscloud_dbaas_mongo

Setuptools

Install via Setuptools.

python setup.py install --user

or sudo python setup.py install to install the package for all users

Then import the package:

import ionoscloud_dbaas_mongo

NOTE: The Python SDK does not support Python 2. It only supports Python >= 3.5.

Authentication

The username and password or the authentication token can be manually specified when initializing the SDK client:

configuration = ionoscloud_dbaas_mongo.Configuration(
                username='YOUR_USERNAME',
                password='YOUR_PASSWORD',
                token='YOUR_TOKEN'
                )
client = ionoscloud_dbaas_mongo.ApiClient(configuration)

Environment variables can also be used. This is an example of how one would do that:

import os

configuration = ionoscloud_dbaas_mongo.Configuration(
                username=os.environ.get('IONOS_USERNAME'),
                password=os.environ.get('IONOS_PASSWORD'),
                token=os.environ.get('IONOS_TOKEN')
                )
client = ionoscloud_dbaas_mongo.ApiClient(configuration)

Warning: Make sure to follow the Information Security Best Practices when using credentials within your code or storing them in a file.

HTTP proxies

You can use http proxies by setting the following environment variables:

  • IONOS_HTTP_PROXY - proxy URL
  • IONOS_HTTP_PROXY_HEADERS - proxy headers

Changing the base URL

Base URL for the HTTP operation can be changed in the following way:

import os

configuration = ionoscloud_dbaas_mongo.Configuration(
                username=os.environ.get('IONOS_USERNAME'),
                password=os.environ.get('IONOS_PASSWORD'),
                host=os.environ.get('IONOS_API_URL'),
                server_index=None,
                )
client = ionoscloud_dbaas_mongo.ApiClient(configuration)

Certificate pinning:

You can enable certificate pinning if you want to bypass the normal certificate checking procedure, by doing the following:

Set env variable IONOS_PINNED_CERT=<insert_sha256_public_fingerprint_here>

You can get the sha256 fingerprint most easily from the browser by inspecting the certificate.

Documentation for API Endpoints

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

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

Documentation For Models

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

API models list

[Back to API list] [Back to Model list]

Metadata

Release files for ionoscloud-dbaas-mongo 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ionoscloud-dbaas-mongo 1.2.2
File Size Uploaded
ionoscloud-dbaas-mongo-1.2.2.tar.gz 51.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ionoscloud-dbaas-mongo 1.2.2
File Interpreter ABI Platform
ionoscloud_dbaas_mongo-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 170.1 kB

Release files / ionoscloud-dbaas-mongo-1.2.2.tar.gz

Download URL ionoscloud-dbaas-mongo-1.2.2.tar.gz
Size 51.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1f0ce39b29465c9cb1fd9575a201e6834d108ce7c59b41e5027d87d5be028f2a
BLAKE2b-256 checksum
How to use checksums
273b122b8a71b0c44f6c294d9af857869770f04c7f19c4f41ec678f1ae7e6066
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / ionoscloud_dbaas_mongo-1.2.2-py3-none-any.whl

Download URL ionoscloud_dbaas_mongo-1.2.2-py3-none-any.whl
Size 118.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4230f72f855ebef1c22e70d6efcd2bbf916cfefd268a4d880ea8de6cb2ff1dd7
BLAKE2b-256 checksum
How to use checksums
9cc83eb10e389c2bedca44ab93fa0900b94136da08ca76bba7c24555ae77b05b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page