OVHcloud gives our customers access to our API (Application Programming Interface). This has many great use cases; such as the ability to upgrade and configure products, automating basic tasks through scripting, integrating your applications, and more. In this article, we will be going over some basic functionality of the OVH US API and how to access it.
Topics
What is an API?
An API is a set of instructions that act as a go-between for two software programs and enables them to talk to one another. You've probably utilized an API before without even realizing it; any website that you've signed into using Facebook or Gmail utilizes their APIs to process the request.
APIs are essential for automating tedious tasks such as spinning up numerous instances with the same specifications. In the next section, we will go over some basic functionality of the API and how to access it.
Exploring the OVH US API
To begin, navigate to the OVH US API and click the Explore the OVH API button. This will bring you to the main API page with a list of all of the tasks you can perform from the API.
From here, in order to make changes log in by clicking the Login button in the top-right corner of the screen. This will bring you to a page where you will type your OVH US Manager credentials and set the validity of the authentication.
Now that we have access to the API, let's go over the commands.
GET - Retrieves information
POST - Creates or modifies resources
PUT - Creates or modifies resources but is idempotent
DELETE - Deletes resources
Now that we have a basic understanding of the commands, let's take a look at a few examples. In our first example, we will use the "GET" command to retrieve information. Click the /dedicated/server link followed by the GET /dedicated/server call and then the Execute button to retrieve our Dedicated Server name.
In our second example, we will use the "POST" command to perform an action. Click the POST /dedicated/server/{serviceName}/reboot call under the /dedicated/server section. Next, type in the server name that was retrieved from the GET /dedicated/server call and then click the Execute button to perform a hard reboot on the server.
In our final example, we will utilize the "DELETE" command to remove a Dedicated Server from our vRack. To do so, click the DELETE /dedicated/server/{serviceName}/vrack/{vrack} call, enter your server name and vRack ID into the relevant fields, and then click the Execute button to complete the action.
Conclusion
Having access to an API is a convenient way to give our customers the freedom to automate tasks, develop programs that can interact with the API, and manage their products in a simplified view. Having read this article you should now know how to access the OVH US API portal and have a basic familiarity with its primary commands.