logo

Roxy-WI REST API

About the REST API

The REST API allows developers to work with Roxy-WI: to start, stop and restart the services; to add, to edit and to delete ACLs, etc. The API uses JSON requests and JSON responses. All request to the API require you to pass an access token in the header. The instructions on generating the token can be found below.

How to get the list of all available endpoints

To get the list of all available endpoints perform the following command:

Will give you:

Authentication

You need an authorization token in order to use the API. To get a token, make the following request:

You will get a new token:

The validity period of the token depends on the settings of the group.

Starting/Stoping/Restartint HAProxy services

To stop a HAProxy service make the following request:

You should get the following response

To start or restart the service just change the word "stop" in the URI above to the name of the necessary action (start or restart)

Adding ACL to a section

To add an ACL to a section: make the following request:

The possible values of the "if" parameter include:

  • host_starts
  • host_ends
  • path_starts
  • path_ends
  • path_ends
  • src_ip

The possible values of the "then" parameter include:

  • use_backend
  • redirect
  • allow
  • deny
  • return
  • set-header

AThe possible values of the "action" parameter:

  • save
  • test
  • restart
  • reload

How to delete ACL from a section

To delete an ACL from a section make the following request:

All parameters except "action" must be the same as in the request for adding an ACL.

The possible values of the "action" parameter are:

  • save
  • test
  • restart
  • reload

Was this article helpful?

Yes, thanks!
Not really
Go back