Automic Workload Automation

 View Only
  • 1.  Provision Automic User through REST API

    Posted Jul 23, 2019 02:25 PM
    Hi,

    I am on version 12.2 and am trying to use the REST API to provision an Automic user.

    I can successfully make a POST request to create the user and now the next step is to assign a User Group to that newly created user. From what I've been able to guess it appears that I would  make a POST request to the User Group and add the new user as a member.

    When I try to do that I get a generic Server 500 error. In the CP log I see:

    20190723/180045.357 - 33     U00045014 Exception 'javax.ws.rs.NotAllowedException: "RESTEASY003650: No resource method found for POST,

    return 405 with Allow header"' at 'org.jboss.resteasy.core.registry.SegmentNode.match():382'.\

    20190723/180045.364 - 33     U00045099 The server replied with following status: '500'


    JSON POST request example to add user to user group.

    {

      "data": {

        "usrg": {

          "metadata": {

            "version": "12.2.3"

          },

          "general_attributes": {

            "minimum_ae_version": "11.2",

            "child_flags": "00000000000000000000000000000000",

            "last_runtimes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",

            "name": "USRG.TEST1",

            "type": "USRG",

            "description": "All Unique Users",

            "versioning_id": " "

          },

          "user_group_attributes": {

            "privileges": "4397777925374"

          },

          "members": [{

            "USERNAME": "TEST990/ASMCOE"

          }],

          "authorizations": [{

            "auth_group": "1",

            "bitcode": "511",

            "filter_object_type": "*",

            "filter_object_name": "*",

            "filter_agent_name1": "*",

            "filter_agent_name2": "*",

            "filter_user_id1": "*",

            "filter_user_id2": "*",

            "filter_file_names1": "*",

            "filter_file_names2": "*",

            "line_number": "1"

          }, {

            "bitcode": "511",

            "filter_object_type": "USER",

            "line_number": "2"

          }, {

            "bitcode": "511",

            "filter_object_type": "USRG",

            "line_number": "3"

          }]

        }

      },

      "path": "_ADMINISTRATION/USER.GROUPS"

    }

    Has anyone done this before or can provide some direction?
    It would be odd if Automic supported creating a user, but not modifying it's permissions.

    As a side note, does anyone know where I can find a list of supported operations for the REST API? The Swagger docs don't list which objects can be created or modified. 

    Thank you,

    George



  • 2.  RE: Provision Automic User through REST API

    Posted Jul 24, 2019 02:10 AM
    To what REST endpoint did you fire the request? Are you sure, you did a POST?

    Right now, and possibly also in the future, the modification of an object is done by importing the JSON configuration of it. So export object to JSON, mutate JSON, import JSON to overwrite object. Possibly this is also the reason for the new V12.3 JSON mutation AE script elements.

    ------------------------------
    Swisscom & WorkflowCommander
    ------------------------------



  • 3.  RE: Provision Automic User through REST API

    Posted Jul 27, 2019 12:44 PM
    Hi Joel,

    Thanks for the reply. You were on the right track. I worked with support and found that my POST should be to end point /objects not /objects/<usergroupname>.
    It's working for me now.
    Thanks for your help,
    George


  • 4.  RE: Provision Automic User through REST API

    Broadcom Employee
    Posted Jan 10, 2020 05:29 PM

    Hi George,

    I also need to use REST API to user provisioning for AE (create an LDAP user and add it to a usergroup). Could you please share it for me?

    Thanks a lot,
    Kerem




  • 5.  RE: Provision Automic User through REST API
    Best Answer

    Posted Jan 10, 2020 05:41 PM

    Hi Kerem,

     

    Here are the notes I gave to the developer which she used to successfully create a user and add it to a group.

    Create user as LDAP user using AD user Joe Dirt (JDirt)

     

    POST https://ourrestserver:8088/ae/api/v1/100/objects/

    {

      "data": {

        "user": {

          "metadata": {

            "version": "12.2.3"

          },

          "general_attributes": {

            "minimum_ae_version": "11.2",

            "child_flags": "00000000000000000000000000000000",

            "last_runtimes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",

            "name": "JDIRT/ASMCOE",

            "type": "USER",

            "description": "Test User",

            "versioning_id": " "

          },

          "user_attributes": {

            "is_active": "1",

            "distinguished_name": "CN=Joe Dirt,CN=Users,DC=prod,DC=our,DC=com",

            "eh_refresh_interval": "90",

            "email1": "me@capgemini.com",

            "first_name": "Joe",

            "last_name": "Dirt",

            "is_ldap_user": "1",

            "ldap_uid": "/0zzzzzzcgs0Ol+Pxw==",

            "valid_from": "2000-01-01 00:00:00.0",

            "valid_to": "2000-01-01 00:00:00.0"

          },

          "authorizations": {

            "auth_group": "1",

            "filter_object_type": "*",

            "filter_object_name": "*",

            "filter_agent_name1": "*",

            "filter_agent_name2": "*",

            "filter_user_id1": "*",

            "filter_user_id2": "*",

            "filter_file_names1": "*",

            "filter_file_names2": "*",

            "line_number": "1"

          }

        }

      }

    }

     

    Add JDirt to user group USRG.GENERAL

    POST https://ourrestserver:8088/ae/api/v1/100/objects/

    {

      "data": {

        "usrg": {

          "metadata": {

            "version": "12.2.3"

          },

          "general_attributes": {

            "minimum_ae_version": "11.2",

            "child_flags": "00000000000000000000000000000000",

            "last_runtimes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",

            "name": "USRG.GENERAL",

            "type": "USRG",

            "description": "Administrator",

            "versioning_id": " "

          },

          "user_group_attributes": {

            "privileges": "4397777925374"

          },

          "members": [{

            "USERNAME": "JDIRT/ASMCOE"

          }],

          "authorizations": [{

            "auth_group": "1",

            "bitcode": "511",

            "filter_object_type": "*",

            "filter_object_name": "*",

            "filter_agent_name1": "*",

            "filter_agent_name2": "*",

            "filter_user_id1": "*",

            "filter_user_id2": "*",

            "filter_file_names1": "*",

            "filter_file_names2": "*",

            "line_number": "1"

          }, {

            "bitcode": "511",

            "filter_object_type": "USER",

            "line_number": "2"

          }, {

            "bitcode": "511",

            "filter_object_type": "USRG",

            "line_number": "3"

          }]

        }

      },

      "path": "_ADMINISTRATION/USER.GROUPS"

    }

     

    Then login to client 100 as JDIRT/ASMCOE

     

    Hope that is helpful,

    George

     






  • 6.  RE: Provision Automic User through REST API

    Broadcom Employee
    Posted Jan 10, 2020 06:31 PM
    Hi George,

    Thanks a lot for your quick answer. I will inform you after I try it.

    Regards,
    Kerem


  • 7.  RE: Provision Automic User through REST API

    Posted Feb 01, 2020 05:27 PM
    Hi George,

    It worked well, thanks a lot :)

    Kerem