REST API access: Difference between revisions

From Scalelogic Wiki
Jump to navigation Jump to search
Da-F (talk | contribs)
No edit summary
m Pa-P moved page REST access to REST API access
Line 1: Line 1:
This functionality is available in: '''System Settings > Administration > REST API access'''
Using this function, you can manage the system remotely using the Representational State Transfer (REST). For authentication HTTP Basic authentication (BA) is used.
 
 
 
Options to set:
 
*'''Port'''
 
The default port is '''82'''. You cannot indicate ports already in use.
 
*'''Username'''
 
Authentication user name. Default is “'''admin'''”.
 
*'''Password'''
 
Password used for authentication.
 
*'''Confirm password'''
 
Please retype your new password.
 




Below examples of requests using curl command:


Using this function, you can manage the system remotely using the Representational State Transfer (REST). For authentication HTTP Basic authentication (BA) is used.


Options to set:


*'''Port''' - which as default is set to 82. You cannot indicate ports already in use.
- for GET request:
*'''Username''' - is an authentication username. The default is “admin”.
*'''Password''' - which is used for authentication.
*'''Password confirmation''' - means retype your new password.


curl -X GET -u '''admin:mypassword''' -i -k -H "Content-type: application/json"  https://'''ip_address:port'''/api/v3/product


<br/>- for PUT request:


Below are examples of requests using the curl command:
curl -X PUT -u '''admin:password''' -i -k -H "Content-Type: application/json" -d '{"ip_address": "121.123.123.123", "enabled": true, "port": 1, "protocol": "udp"}' https://'''ip_address:port'''/api/v3/services/remote-logging


*for GET request:
<pre>curl -X GET -u username:password -i -k -H "Content-type: application/json" https://ip_address:port/api/v3/product</pre>
*for PUT request:
<pre>curl -X PUT -u username:password -i -k -H "Content-type: application/json" -d '{"ip_address": "121.123.123.123", "enabled": true, "port": 1, "protocol": "udp"}' https://ip_address:port/api/v3/services/remote-logging</pre>
*for POST request:<br/>'''Note!''' In the example below, LDAP must be enabled in the system. Otherwise, an error occurs.
<pre>curl -X POST -u username:password -i -k -H "Content-type: application/json" -d '{"name": "username", "password": "password", "backend_name": "LDAP"}' https://ip_address:port/api/v3/users</pre>
[[Category:Help topics]]
[[Category:Help topics]]

Revision as of 07:41, 12 May 2023

Using this function, you can manage the system remotely using the Representational State Transfer (REST). For authentication HTTP Basic authentication (BA) is used.


Options to set:

  • Port

The default port is 82. You cannot indicate ports already in use.

  • Username

Authentication user name. Default is “admin”.

  • Password

Password used for authentication.

  • Confirm password

Please retype your new password.


Below examples of requests using curl command:


- for GET request:

curl -X GET -u admin:mypassword -i -k -H "Content-type: application/json"  https://ip_address:port/api/v3/product


- for PUT request:

curl -X PUT -u admin:password -i -k -H "Content-Type: application/json" -d '{"ip_address": "121.123.123.123", "enabled": true, "port": 1, "protocol": "udp"}' https://ip_address:port/api/v3/services/remote-logging