VMware Aria Automation Orchestrator

 View Only
  • 1.  Aria Automation get username

    Posted May 23, 2025 10:17 AM

    Hello,

    I'm a new user of VMware Automation (8.18). I have spent hours searching for how to get the username of the user requesting a deployment during the request.

    I would like to get the username to auto-fill an input with the SSH key of the user. I managed to get the SSH key, but I can't figure out how to pass the username to the action in the form or how to get the username in the Action.

    Here is what I'm trying to do:

    formatVersion: 1
    inputs:
      sshKey:
        type: string
        title: Clé SSH
      $dynamicDefault: /data/vro-actions/com.xxxx/getSSHKeyPS?usernameInput=XXXXXXX
        readOnly: false
        minLength: 32
        maxLength: 9999

    Any ideas on how I can achieve this?



  • 2.  RE: Aria Automation get username

    Posted May 23, 2025 01:48 PM

    Hey,

    did you try to use Subscription and fetch the username?

    Take a look here: https://knowledge.broadcom.com/external/article/383399/need-to-get-properties-or-other-ids-and.html



    ------------------------------
    If you find the answer helpful, please click on the RECOMMEND button.

    Please visit my blog to get more information: https://clouddepth.com
    ------------------------------



  • 3.  RE: Aria Automation get username

    Posted May 25, 2025 05:56 PM

    So the following will provide the username of the requestor...

    resources:
        requser: ${env.requestedBy}

    Is that what you are looking for?




  • 4.  RE: Aria Automation get username

    Posted May 30, 2025 07:33 AM

    Create an action that accepts no inputs and returns the current user's SSH key based on the requester's username

    Write it as javascript

    var username = System.getContext().getParameter("__metadata_userName");
    var sshKey = getSSHKeyForUser(username); // You must implement this
     
    return sshKey;
    Update your template yaml to use this action as default.

    formatVersion: 1
    inputs:
      sshKey:
        type: string
        title: Clé SSH
        $dynamicDefault: /data/vro-actions/com.xxxx/getSSHKeyForCurrentUser
        readOnly: false
        minLength: 32
        maxLength: 9999

    I havent tested it yet, but its a really interesting topic. I'll try it out soon to improve my understanding too