APIPythonOpen-Source Solutions

  • 1.  Creating User as a Admin with all the privileges via REST API

    Posted 10-17-2016 12:08:00 PM

    I am able to create a Delphix User as "Owner" role via REST API. I need to know how to set the full privileges via REST API. Please find the below screen shot for the user  as "Owner" created via REST API shows blank for privileges.



    https://d2r1vs3d9006ap.cloudfront.net/s3_images/1498182/RackMultipart20161017-72631-me8j74-Profiles_inline.PNG?1476709644" src="https://higherlogicdownload.s3.amazonaws.com/DELPHIX/UploadedImages/dc10691834b247fa989e7199e321caeb_RackMultipart20161017-72631-me8j74-Profiles_inline.PNG">
    #DemoEnvironment


  • 2.  RE: Creating User as a Admin with all the privileges via REST API
    Best Answer

    Posted 10-17-2016 12:22:00 PM
    Hey Ramesh. Delphix is an RBAC authorization system. So, you need to add a user to a role (group) to give them privileges.  Look here to learn about authorizations:

    http://<DEIP>/api/#authorization


  • 3.  RE: Creating User as a Admin with all the privileges via REST API

    Posted 10-17-2016 12:40:00 PM

    We are already doing the Authorization. The above screen shot is taken even after running the below API. What else we need to do to via REST API.

    POST /resources/json/delphix/authorization

    {

        "type": "Authorization",

        "role": "ROLE-1",

        "target": "<user_reference_number>",

        "user": "<user_reference_number>"

    }



  • 4.  RE: Creating User as a Admin with all the privileges via REST API

    Posted 10-17-2016 12:45:00 PM
    Is it a JS-only user? If so, you will not see anything for privileges.


  • 5.  RE: Creating User as a Admin with all the privileges via REST API

    Posted 10-17-2016 01:04:00 PM
    It is not a JS stream.


  • 6.  RE: Creating User as a Admin with all the privileges via REST API

    Posted 10-17-2016 04:03:00 PM
    What is the response if you get  the authorization or list the authorizations for that user? What version of Delphix are you on?


  • 7.  RE: Creating User as a Admin with all the privileges via REST API

    Posted 10-17-2016 04:04:00 PM
    Can you show me the profile tab of that user?


  • 8.  RE: Creating User as a Admin with all the privileges via REST API

    Posted 10-18-2016 01:29:00 PM

    POST /resources/json/delphix/user

    {
    "type": "User",
    "name": "tdm_user7",
    "credential": {
    "type": "PasswordCredential",
    "password": "tdm_user7"
    }


    POST /resources/json/delphix/authorization

    {
    "type": "Authorization",
    "role": "ROLE-1",
    "target": "USER-53",
    "user": "USER-53"
    }

    Authorization Response

    {
       "status": "OK",
       "result": "",
       "job": null,
       "action": "ACTION-131993"
    }

    Get Action response..

    {
    "status": "OK",
    "result": {
    "type": "AuditEvent",
    "reference": "ACTION-131996",
    "namespace": null,
    "title": "AUTH_GRANT",
    "details": "Grant authorization for role \"OWNER\" on object \"tdm_user7\" to user \"tdm_user7\".",
    "startTime": "2016-10-18T13:50:13.187Z",
    "endTime": "2016-10-18T13:50:13.250Z",
    "user": "USER-42",
    "report": null,
    "failureDescription": null,
    "failureAction": null,
    "failureMessageCode": null,
    "successful": true
    },
    "job": null,
    "action": null
    }





  • 9.  RE: Creating User as a Admin with all the privileges via REST API

    Posted 10-19-2016 12:28:00 PM
    Hi Ramesh,

    The commands you listed only give the user the OWNER role on itself (which is already given by default to a new user).  For admin privileges, you need to grant the user the OWNER permission on the DOMAIN object (the root object):
    POST /resources/json/delphix/authorization
    {
      "type": "Authorization",
      "role": "ROLE-1",
      "target": "DOMAIN",
      "user": "USER-53"
    }
    Hope that helps!