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 6 REST APIs for Authentication –
com.oracle.solaris.rad.authentication
|
|
|
POST
/api/com.oracle.solaris.
rad.authentication/1.0/Session/
|
Authenticate a RAD session.
|
curl -X POST -c cookie.txt -b cookie.txt '
--header 'Content-Type:application/json'
--data '{"username":"testuser","password":"testpassword",
"scheme":"pam","timeout":-1, "preserve":true}'
localhost/api/com.oracle.solaris.rad.authentication/1.0/Session/
--unix-socket /system/volatile/rad/radsocket-http
|
GET
/api/com.oracle.solaris.
rad.authentication/1.0/Session/{Session-Id}?_rad_detail
|
Get the details of a particular session.
|
curl -X GET -c cookie.txt -b cookie.txt
--header 'Content-Type:application/json' localhost/api/com.oracle.solaris.rad.authentication/1.0/Session/2048?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http
|
|
Table 7 REST APIs for Datalink Management –
com.oracle.solaris.rad.dlmgr
|
|
|
GET
/api/com.oracle.solaris.rad.dlmgr/1.0?_rad_detail
|
List the details of all the interfaces available for datalink
management.
|
curl -H 'Content-Type:application/json' -X GET
localhost/api/com.oracle.solaris.rad.dlmgr/1.0?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
PUT
/api/com.oracle.solaris.rad.dlmgr/1.0/Datalink/net0/_rad_method/getProperty
|
Get the details of the priority property from
net0.
|
curl -H 'Content-Type:application/json' -X PUT
localhost/api/com.oracle.solaris.rad.dlmgr/1.0/Datalink/net0/_rad_method/getProperty
--unix-socket /system/volatile/rad/radsocket-http
--data '{"properties":"priority"}' -b cookie.txt
|
|
Table 8 REST APIs for Kernel Statistics –
com.oracle.solaris.rad.kstat
|
|
|
GET
/api/com.oracle.solaris.rad.kstat/1.0?_rad_detail
|
List the details for all the interfaces available for kernel
statistics.
|
curl -H 'Content-Type:application/json' -X GET
localhost/api/com.oracle.solaris.rad.kstat/1.0?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
GET
/api/com.oracle.solaris.rad.kstat/1.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
localhost/api/com.oracle.solaris.rad.kstat/1.0/Kstat/misc,cpu_info0,cpu_info,0?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
GET
/api/com.oracle.solaris.rad.kstat/1.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
localhost/api/com.oracle.solaris.rad.kstat/1.0/Kstat/misc,vm,cpu,0?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
|
Table 9 REST APIs for SMF Management –
com.oracle.solaris.rad.smf
|
|
|
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
localhost/api/com.oracle.solaris.rad.smf/1.0?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
GET
/api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache22/state
|
Get the status of the apache22 service.
|
curl -H 'Content-Type:application/json' -X GET
localhost/api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache22/state
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
PUT
/api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache22/_rad_method/enable
|
Enable the apache22 service.
|
curl -H 'Content-Type:application/json' -X PUT
localhost/api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache22/_rad_method/enable
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
--data '{"temporary": true}'
|
PUT
/api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache22/_rad_method/disable
|
Disable the apache22 service.
|
curl -H 'Content-Type:application/json' -X PUT
localhost/api/com.oracle.solaris.rad.smf/1.0/Instance/network%2Fhttp,apache22/_rad_method/disable
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
--data '{"temporary": true}'
|
|
Table 10 REST APIs User Management –
com.oracle.solaris.rad.usermgr
|
|
|
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 PUT
localhost/api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/_rad_method/getUser
--data '{"username":"testuser"}' --unix-socket
/system/volatile/rad/radsocket-http -b cookie.txt
|
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 GET
localhost/api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/shells?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
PUT
/api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/_rad_method/addUser
|
Add a user.
|
curl -H 'Content-Type:application/json' -X PUT
localhost/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"}'
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
PUT
localhost/api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/_rad_method/deleteUser
|
Delete a user.
|
curl -H 'Content-Type:application/json' -X PUT
localhost/api/com.oracle.solaris.rad.usermgr/1.0/UserMgr/_rad_method/deleteUser
--data '{"username":"tuser4"}'
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
|
Table 11 REST APIs for ZFS Management –
com.oracle.solaris.rad.zfsmgr
|
|
|
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
localhost/api/com.oracle.solaris.rad.zfsmgr/1.0?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
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
localhost/api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsDataset/rpool/_rad_method/get_filesystems
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
--data '{"recursive":true}'
|
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
localhost/api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsDataset/rpool/_rad_method/get_snapshots
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
--data '{"recursive":true}'
|
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
localhost/api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsUtil/_rad_method/valid_zfs_name
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
--data '{"name":"test@test"}'
|
PUT
localhost/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
localhost/api/com.oracle.solaris.rad.zfsmgr/1.0/ZfsDataset/rpool/_rad_method/create_filesystem
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
--data '{"name":"rpool/export/home/testuser/p2"}'
|
|
Table 12 REST APIs for Zone Management –
com.oracle.solais.rad.zonemgr
|
|
|
GET
/api/com.oracle.solaris.rad.zonemgr/1.2?_rad_detail
|
List the details of all the interfaces available for Zone
management.
|
curl -H 'Content-Type:application/json' -X GET
localhost/api/com.oracle.solaris.rad.zonemgr/1.2?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
GET
/api/com.oracle.solaris.rad.zonemgr/1.2/Zone/{zone-name}?_rad_detail
|
Get the details of a zone.
|
curl -H 'Content-Type:application/json' -X GET
localhost/api/com.oracle.solaris.rad.zonemgr/1.2/Zone/testzone1?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
GET
/api/com.oracle.solaris.rad.zonemgr/1.0/ZoneInfo?_rad_detail
|
Get the details of the zone for which the interface is
executing.
|
curl H 'Content-Type:application/json' -X GET
localhost/api/com.oracle.solaris.rad.zonemgr/1.0/ZoneInfo?_rad_detail
--unix-socket /system/volatile/rad/radsocket-http -b cookie.txt
|
|