The NitrAPI: Nitrado's programming interface for ordering, managing and controlling services

Like all Nitrado products, the Nitrado Public Cloud can be easily managed with the Nitrado Web Interface. For hobbyists, modders, and professional developers there's also another way: The Nitrado API (short NitrAPI) allows the control of arbitrary services automatically, for instance for ordering, cancelling, or embedding information into your own website.

In the last article about the Nitrado Public Cloud, the web interface was introduced. The web interface offers useful features for beginners and advanced administrators alike. Today's article covers the interface that is used by Nitrado itself to manage all of its services - and that can be used by customers for their own services in the same fashion.

The NitrAPI briefly explained

"NitrAPI" stands for Nitrado Application Programming Interface. It is used by Nitrado to manage all of our hosted services. As an example, the web interface introduced in the last article is simply an application that uses the NitrAPI to display data and send commands to the servers. For instance, when a user clicks on a button for restarting the server, the web interface sends the appropriate command to the NitrAPI, which then executes the actual restart.

Nitrapi

Because Nitrado grants free access to the NitrAPI to everyone, hobbyists and professionals can create applications for their individual needs that mimic features of the web interface, or even order new servers when needed.

Open Source Libraries for Easy Use

The NitrAPI is an HTTP REST API authenticated via OAuth2, and therefore can be used with ease from a variety of different programming languages. To make usage even more convenient for developers, Nitrado provides libraries for different programming languages on its GitHub profile for everyone to dive in and use. Currently, there are already implementations available for PHP, Swift, and Java. Additionally, the release of a JavaScript library is planned for the near future.

That these libraries are published on GitHub also means that Nitrado gladly accepts feedback and pull requests from developers, that would like to contribute to the further development of these libraries.

For everyone who wants to build their very own library, a detailed documentation of all public interfaces is available at https://doc.nitrado.net.

Usage Examples

Now which tasks can be realized with help of the NitrAPI? To make the options a bit more comprehensive, here are three examples for different use cases:

Automatic upgrades and downgrades for Cloud Servers

Most server applications are not evenly utilized at all times. Usually, clear usage patterns can be established, for example, increased load during after hours, the weekend, or at certain events. For these times of high load, significant computing power is necessary, which is not utilized during the rest of the time and therefore results in unnecessary costs.

The NitrAPI allows it to automatically add and remove resources to and from Cloud Servers. That means it's possible to develop a script that monitors a server's utilization and automatically books additional resources when needed. This feature is used best with Nitrado's "Cloud Server Dynamic", which allows subsequent downgrades without additional cost.

Display of Services inside a JavaScript Widget

Many server owners also run a website that contains additional information about their servers. The problem: The connection info for those servers has to be maintained manually and can, therefore, be out of date. Using the NitrAPI, this information can be displayed automatically, as shown here:

This is a live view of a test user's services, created with less than 30 lines of JavaScript code.

Modding

Since the NitrAPI can be used with almost any programming language, it can also be used within almost any game modification. For instance, many communities use a game server as well as accompanying voice server - and maybe uninvited guests aren't wanted on either of them. In this case, the game server, as well as the voice server, have to be protected separately.

Since it's also possible to use features of voice servers like TeamSpeak and Mumble through the NitrAPI, a game modification could be employed to automatically grant access to the voice server to players who join the server (and therefore know its password or can be found on the whitelist). For Mumble this would be possible by automatically creating a new server user, and with TeamSpeak, a "Privilege Token" could be generated and displayed to the player, which they can use to move freely on the voice server. That means: Whoever has access to the game server also has access to the voice server, and the management of two different protection mechanisms is a thing of the past.

Other, arbitrary commands can be embedded into games in a similar fashion. For demonstration purposes we have published a simple Minecraft plugin on our GitHub profile. It is able to forward a number of commands from the game's in-game console to the NitrAPI, notably for creating and restoring backups of the game world from within the game.

Conclusion

The NitrAPI is a publicly available interface that allows developers to create custom applications for their Nitrado services and to automate processes. Nitrado is already looking forward to suggestions and requests for the extension of this interface, to support hobby developers and professionals with all features they need for the implementation of their projects.

Stay Tuned!

Until the launch of the Nitrado Cloud Server next month, we will regularly publish additional info in detailed articles. In the next article two applications are introduced, which are also based on the NitrAPI: The Nitrado apps for Android and iOS, which can be used to conveniently manage Cloud Servers and other services.

Jun 27th, 08:08 pm
11002
0
Sascha Siska
Your reaction

0

0

1

1

0

0

0
Comments
  
No comments yet

Testserver
Connect with us




ESL premium certified
Nitrado.net game servers are ESL certified, and therefore, the first choice for ESL clan wars.
ESL PROTECTION CHECK