Go to main content

Remote Administration Daemon Client User's Guide

Exit Print View

Updated: November 2020
 
 

REST API Reference

Although all RAD modules support REST, from a client perspective only some of the modules will be accessed over REST. The tables in this section list some of the URIs for commonly-accessed RAD modules along with sample requests.

Table 1  REST APIs for Datalink Management – com.oracle.solaris.rad.dlmgr
Resource URI
Description
Sample Request
GET
 /api/com.oracle.solaris.rad.dlmgr/1.1?_rad_detail
List the details of all the interfaces available for datalink management.
curl -H 'Content-Type:application/json' -X GET
 https://radserver.example.com/api/com.oracle.solaris.rad.dlmgr/1.1?_rad_detail
 -b cookiejar
PUT
 /api/com.oracle.solaris.rad.dlmgr/1.1/Datalink/net0/_rad_method/getProperty
Get the details of the priority property from net0.
curl -H 'Content-Type:application/json' -X PUT
 https://radserver.example.com/api/com.oracle.solaris.rad.dlmgr/1.1/Datalink/net0/_rad_method/getProperty
 --data '{"properties":"priority"}' -b cookiejar
Table 2  REST APIs for Kernel Statistics – com.oracle.solaris.rad.kstat
Resource URI
Description
Sample Request
GET
 /api/com.oracle.solaris.rad.kstat/2.0?_rad_detail
List the details for all the interfaces available for kernel statistics.
curl -H 'Content-Type:application/json' -X GET
 https://radserver.example.com/api/com.oracle.solaris.rad.kstat/2.0?_rad_detail
 -b cookiejar
GET
 /api/com.oracle.solaris.rad.kstat/2.0/Kstat/misc,cpu_info0,cpu_info,{CPU number}?_rad_detail
Get the information for a particular CPU on a system.
curl -H 'Content-Type:application/json' -X GET
 https://radserver.example.com/api/com.oracle.solaris.rad.kstat/2.0/Kstat/misc,cpu_info0,cpu_info,0?_rad_detail
 -b cookiejar
GET
 /api/com.oracle.solaris.rad.kstat/2.0/Kstat/misc,vm,cpu,{CPU number}?_rad_detail
Get the VM statistics for a particular CPU on a system.
curl -H 'Content-Type:application/json' -X GET
 https://radserver.example.com/api/com.oracle.solaris.rad.kstat/2.0/Kstat/misc,vm,cpu,0?_rad_detail
 -b cookiejar
Table 3  REST APIs for SMF Management – com.oracle.solaris.rad.smf
Resource URI
Description
Sample Request
GET
  /api/com.oracle.solaris.rad.smf/1.0?_rad_detail
List the details of all the interfaces available for SMF management.
curl -H 'Content-Type:application/json' -X
  GET https://radserver.example.com/api/com.oracle.solaris.rad.smf/1.0?_rad_detail
  -b cookiejar
GET
 /api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache24/state
Get the status of the apache24 service.
curl -H 'Content-Type:application/json' -X
  GET https://radserver.example.com/api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache24/state
 -b cookiejar
PUT
 /api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache24/_rad_method/enable
Enable the apache24 service.
curl -H 'Content-Type:application/json' -X
  PUT https://radserver.example.com/api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache24/_rad_method/enable
  -b cookiejar  --data '{"temporary": true}'
PUT
 /api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache24/_rad_method/disable
Disable the apache24 service.
curl -H 'Content-Type:application/json' -X
  PUT https://radserver.example.com/api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache24/_rad_method/disable
 -b cookiejar  --data '{"temporary": true}'
Table 4  REST APIs for User Management – com.oracle.solaris.rad.usermgr
Resource URI
Description
Sample Request
PUT
 /api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/_rad_method/getUser
Get the information of a particular user on the system.
curl -H 'Content-Type:application/json' -X -b cookiejar
  PUT https://radserver.example.com/api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/_rad_method/getUser
 --data '{"username":"testuser"}'
GET
  /api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/shells?_rad_detail
Get the list of all the shells on the system.
curl -H 'Content-Type:application/json' -X-b cookiejar
  GET https://radserver.example.com/api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/shells?_rad_detail
PUT
  /api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/_rad_method/addUser
Add a user.
curl -H 'Content-Type:application/json' -X -b cookiejar 
  PUT https://radserver.example.com/api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/_rad_method/addUser
  --data '{"user":{"username":"tuser4", "userID": 9992, "groupID":
  10, "inactive": 0, "min": -1, "max": -1, "warn": -1},"password":"test123"}'
PUT
   https://radserver.example.com/api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/_rad_method/deleteUser
Delete a user.
curl -H 'Content-Type:application/json' -X -b cookiejar
  PUT https://radserver.example.com/api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/_rad_method/deleteUser
  --data '{"username":"tuser4"}'
Table 5  REST APIs for ZFS Management – com.oracle.solaris.rad.zfsmgr
Resource URI
Description
Sample Request
GET
 /api/com.oracle.solaris.rad.zfsmgr/1.0?_rad_detail
List the details of all the interfaces available for ZFS management.
curl -H 'Content-Type:application/json' -X GET
  https://radserver.example.com/api/com.oracle.solaris.rad.zfsmgr/1.0?_rad_detail
  -b cookiejar
PUT
 /api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsDataset/rpool/_rad_method/get_filesystems
List all the ZFS file systems in rpool.
curl -H 'Content-Type:application/json' -X PUT
 https://radserver.example.com/api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsDataset/rpool/_rad_method/get_filesystems
 --data '{"recursive":true}' -b cookiejar
PUT
 /api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsDataset/rpool/_rad_method/get_snapshots
List all the ZFS snapshots.
curl -H 'Content-Type:application/json' -X PUT
 https://radserver.example.com/api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsDataset/rpool/_rad_method/get_snapshots
 --data '{"recursive":true}' -b cookiejar
PUT
  /api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsUtil/_rad_method/valid_zfs_name
Check whether a specified string can be used as a ZFS name.
curl -H 'Content-Type:application/json' -X PUT
  https://radserver.example.com/api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsUtil/_rad_method/valid_zfs_name
  --data '{"name":"test@test"}' -b cookiejar
PUT
  https://radserver.example.com/api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsDataset/rpool/_rad_method/create_filesystem
Create a ZFS file system.
curl -H 'Content-Type:application/json' -X PUT -b cookiejar 
  https://radserver.example.com/api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsDataset/rpool/_rad_method/create_filesystem
  --data '{"name":"rpool/export/home/testuser/p2"}'
Table 6  REST APIs for Zone Management – com.oracle.solaris.rad.zonemgr
Resource URI
Description
Sample Request
GET
 /api/com.oracle.solaris.rad.zonemgr/1.6?_rad_detail
List the details of all the interfaces available for Zone management.
curl -H 'Content-Type:application/json' -X -b cookiejar
  GET https://radserver.example.com/api/com.oracle.solaris.rad.zonemgr/1.6?_rad_detail
GET
 /api/com.oracle.solaris.rad.zonemgr/1.6/Zone/{zone-name}?_rad_detail
Get the details of a zone.
curl -H 'Content-Type:application/json' -X -b cookiejar
  GET https://radserver.example.com/api/com.oracle.solaris.rad.zonemgr/1.6/Zone/testzone1?_rad_detail
GET
 /api/com.oracle.solaris.rad.zonemgr/1.6/ZoneInfo?_rad_detail
Get the details of the zone for which the interface is executing.
curl -H 'Content-Type:application/json' -X -b cookiejar
  GET https://radserver.example.com/api/com.oracle.solaris.rad.zonemgr/1.6/ZoneInfo?_rad_detail