Set Secure Variables to all Scripted Actions via Powershell (API)

Hi,

 


we do have a need to set secure variables to all our customers (like DevOpsToken, Service User....) and bind them to all scripted actions via nmm API call  with powershell, we already have a function for that. Unfortunately there is no way to make an API call (/rest-api/v1/accounts/{accountId}/secure-variables) and set "all" in the json file for all scripts. At the moment, it only supports integer.  Example for the json file ->

{

  "name": "Variabletest",

  "scriptedActions": [1,2,3], <- is there a number for all scripts?

  "value": "Vari

}

 

Would be great, if this could be added to the API someday.

8

Comments (3 comments)

Avatar
Cory Wood

I'm also interested in this. How do we assign variables to all scripted actions via the API. A network trace of setting them via the portal shows that the scriptAssignType property is sent with a value of 6 in the payload of the request to assign the variable to all scripted actions, but that property doesn't work via the API.

0
Avatar
Dave Stephenson

That sounds like a great idea, and possibly a big time saver.
Like Cory pointed out, the only "workaround" is to do it through the GUI, right now.


Out of curiosity, are you thinking of using the API for just mass-maintenance of applying variables to existing scripts or are you wanting to use the API to automatically create your variables and assign them at the same time?

0
Avatar
Cory Wood

My use case is to both create new inherited/secure variables and assign them to all scripts, and to assign existing inherited/secure variables to all scripts.

We need this to automate the provisioning of new clients in the NMM portal.

0

Please sign in to leave a comment.