VMware {code} Community
Walkndude
Contributor
Contributor
Jump to solution

AddAuthorizationRole

I am working on a project for VM 7.0.3 and I am new to both VMWare and Python. What I have  is a csv file with all of the roles and privs that go with a server.  I am going to use this file to select a role out of and I want to apply it to a new server. I have searched all over for some code that could help me. 

What I cannot figure out is the way to push it to the target server. Name+Privs should be all that is needed for this. Is the formatting of the strings specific? If I have multiple privileges to copy, are there quotes or just commas in the list?

Target_vcenter.authorizationManager.updateAuthorizationRole(Role.name , Role.privilege)

The MOB worked for me but I cannot figure out how to do this after making the connection in Python. It does not seem to like my inputs.

 

0 Kudos
1 Solution

Accepted Solutions
Walkndude
Contributor
Contributor
Jump to solution

I figured it out myself.

View solution in original post

0 Kudos
2 Replies
Walkndude
Contributor
Contributor
Jump to solution

Do the privileges need to be in a certain format, or does a string work? Can I just push them as a string variable?

privs = "Operations Global.CancelTask InventoryService.Tagging.ObjectAttachable ScheduledTask.Create ScheduledTask.Delete ScheduledTask.Edit ScheduledTask.Run System.Anonymous System.Read System.View "

0 Kudos
Walkndude
Contributor
Contributor
Jump to solution

I figured it out myself.

0 Kudos