Pentaho+ API commands for Directory Service and User Administration
Following are the Pentaho API commands that can be used in terminal for various operations
- Command for displaying all folders and files under Pentaho+ user console home folder:
curl -u admin:password -X GET http://localhost:8080/pentaho/api/repo/files/:home/tree?showHidden=true
- Command for displaying all folders and files under Pentaho+ user console public folder:
curl -u admin:password -X GET http://localhost:8080/pentaho/api/repo/files/:public/tree?showHidden=true
- Command for displaying specific folders and files Pentaho+ user console:
curl -u admin:password -X GET http://localhost:8080/pentaho/api/repo/files/pathofthefile/tree?showHidden=true
- Command for Creating a new file:
curl -u admin:password -X PUT http://localhost:8080/pentaho/api/repo/files/:home:pentaho:tenthplanet:stark:ex.xml
- Command for Creating a new folder:
curl -u admin:password -X PUT http://localhost:8080/pentaho/api/repo/files/:home:pentaho:tenthplanet:flash/createDir
- Command for Deleting file/folder:
curl -u admin:password -X PUT -d'folderid/fileid' http://localhost:8080/pentaho/api/repo/files/delete
- Command for diplaying ACL of Folders:
curl -u admin:password -X GET http://localhost:8080/pentaho/api/repo/files/:home:pentaho:tenthplanet:flash/acl
- Command for diplaying ACL of Files:
curl -u admin:password -X GET http://localhost:8080/pentaho/api/repo/files/:home:pentaho:tenthplanet:flash:ex.xml/acl
- Command for updating ACL of Folders:
curl -u admin:password -H "Accept: application/xml" -H "Content-Type: application/xml" -X PUT -d'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><repositoryFileAclDto><entriesInheriting>false</entriesInheriting><id>49393b98-b232-4d9c-8524-7911d9ce7b1c</id><owner>admin</owner><ownerType>0</ownerType></repositoryFileAclDto>' http://localhost:8080/pentaho/api/repo/files/:home:pentaho:tenthplanet:flash/acl
- Command for updating ACL of Files:
curl -u admin:password -H "Accept: application/xml" -H "Content-Type: application/xml" -X PUT -d'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><repositoryFileAclDto><entriesInheriting>false</entriesInheriting><id>3d8470a0-3ffb-4fbc-82a2-74ebce0a322e</id><owner>admin</owner><ownerType>0</ownerType></repositoryFileAclDto>' http://localhost:8080/pentaho/api/repo/files/:home:pentaho:tenthplanet:flash:ex.xml/acl
- Command for creating users:
curl -u admin:password -H "Accept: application/xml" -H "Content-Type: application/xml" -X PUT -d'<user><userName>john</userName><password>password</password></user>' http://localhost:8080/pentaho/api/userroledao/createUser
- Command for Deleting users:
curl -u admin:password -X PUT http://localhost:8080/pentaho/api/userroledao/deleteUsers?userNames=john
- Command for Creating roles:
curl -u admin:password -X PUT http://localhost:8080/pentaho/api/userroledao/createRole?roleName=report
- Command for Deleting roles:
curl -u admin:password -X PUT http://localhost:8080/pentaho/api/userroledao/deleteRoles?roleNames=report
- Command for Assigning roles to users:
curl -u admin:password -X PUT http://localhost:8080/pentaho/api/userroledao/assignRoleToUser?userName=john"&"roleNames=report
- Command for Removing roles of a users:
curl -u admin:password -X PUT http://localhost:8080/pentaho/api/userroledao/removeRoleFromUser?userName=john"&"roleNames=report