Premiers pas avec les bases de données Public Cloud via API (EN)

Find out how to order and manage your Public Cloud managed database service using the OVHcloud API

Last updated September 3rd, 2021

Objective

Public Cloud managed databases allow you to focus on building and deploying cloud applications while OVHcloud takes care of the database infrastructure and maintenance.

This guide explains how to order a MongoDB instance of a Public Cloud managed database service using the OVHcloud API.

Requirements

Instructions

Step 1: Gather the set of required parameters

In order to create a database service, you will need to specify at minimum:

  • an engine, and its version (e.g. "MongoDB v4.4")
  • the plan (e.g. "business")
  • the nodes of the cluster (e.g. "3 nodes with 4 cores, 15 GiB memory, 100 GiB disk")

List the capabilities

The capabilities endpoint lists the allowed values for the engine, plan, and flavor the service knows about.

The call returns an object listing allowed values for:

  • the various engines, with the various versions for each engine
  • the plans
  • and the flavors

Get the availability

The availability endpoint lists what combination of parameters the service allows. For example, a MongoDB Essential plan currently allows clusters with a single node, whereas Business services allow clusters of 3 to 8 nodes. You should decide what set of parameters among that list best fit your needs.

The call returns an array listing the available set of parameters. Each entry in this array lists (among other data): an engine, a version, a plan, a flavor, a region, if it supports public or private networking, a minimum number of nodes and a maximum number of nodes.

Step 2: Create a MongoDB database service

By creating a cluster, you will be billed accordingly.

Use this endpoint to create a new database cluster:

  • description: A human-readable description for the service you wish to create
  • plan: the desired plan for the service
  • version: the MongoDB version you want to use
  • nodesPattern: specify the flavor and region, and the number of nodes you want to use
  • nodeslist: Leave this parameter undefined. It is another way to specify the list of nodes your cluster uses. As of today, multi-region and flavor-heterogeneous clusters are not supported. Hence it is easier to use nodesPattern to specify a number of same-region, same-flavor nodes.

If you want to use public networking, you're all set. If you want to use private networking, you'll also want to specify:

  • networkId: The ID of the vRack you want to use
  • subnetId: The ID of the vRack subnet you want your cluster to be attached to

The call returns an object describing the cluster you asked for. Initially, its status property will be CREATING. Take note of the id property of the newly-created cluster for the next step.

Step 3: Wait for your database service to be ready

The cluster will take a few minutes to become fully usable. You can check its status using:

The call returns an object describing the cluster. Its status property will transition to READY when the cluster becomes available.

Step 4: Authorize the IP addresses or blocks you want to access your cluster from

For security reasons the default network configuration doesn't allow any incoming connections. It is thus critical you authorize the suitable IP addresses in order to successfully access your database.

Declare the IP address blocks allowed to connect to your cluster with:

  • description is a human-readable description or label for the IP block
  • ip is a string representing an IP block or network, using the syntax aaa.bbb.ccc.ddd/xy -- If you want to specify a single IP address, use aaa.bbb.ccc.ddd/32

You can add multiple allowed IP blocks.

Step 5: Reset the primary user password

At this point you don't know your cluster primary user's password. List your cluster's users with:

Note the id of your admin user. Reset its password with:

Note the new password of the user to later be able to connect to the cluster.

That password won't ever be available later on: OVHcloud never stores users' passwords.

Step 6: Start using the cluster

You’ll find the cluster connection information in your Control Panel; you can now start using the cluster!

Go further

MongoDB capabilities

Managing a MongoDB service from the OVHcloud Control Panel

Configuring vRack for Public Cloud

Visit our dedicated Discord channel: https://discord.gg/PwPqWUpN8G. Ask questions, provide feedback and interact directly with the team that builds our databases services.

Join our community of users on https://community.ovh.com/.


Cette documentation vous a-t-elle été utile ?

N’hésitez pas à nous proposer des suggestions d’amélioration afin de faire évoluer cette documentation.

Images, contenu, structure… N’hésitez pas à nous dire pourquoi afin de la faire évoluer ensemble !

Vos demandes d’assistance ne seront pas traitées par ce formulaire. Pour cela, utilisez le formulaire "Créer un ticket" .

Merci beaucoup pour votre aide ! Vos retours seront étudiés au plus vite par nos équipes..


Ces guides pourraient également vous intéresser...

OVHcloud Community

Accedez à votre espace communautaire. Posez des questions, recherchez des informations, publiez du contenu et interagissez avec d’autres membres d'OVHcloud Community.

Echanger sur OVHcloud Community

Conformément à la Directive 2006/112/CE modifiée, à partir du 01/01/2015, les prix TTC sont susceptibles de varier selon le pays de résidence du client
(par défaut les prix TTC affichés incluent la TVA française en vigueur).