Last active
August 29, 2015 14:03
-
-
Save ryumei/ab0cf154d13d6adb02f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get number of virtual servers via SLAPI | |
import SoftLayer | |
client = SoftLayer.Client() | |
for user in client['Account'].getUsers(mask='id,username'): | |
count1 = client['User_Customer'].getVirtualGuestCount(id=user['id']) | |
vss = client['User_Customer'].getVirtualGuests(id=user['id'], mask='id') | |
count2 = len(vss) | |
print("user_id:%d username:%s, # of vs: %d/%d, vs: %s" | |
% (user['id'], user['username'], count1, count2, vss)) |
I expected
user_id:17yyyy username:LIMITED_USER, # of vs: 0/0, vs: []
for LIMITED_USER.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got the following result:
LIMITED_USER can get list of virtual servers via getVirtualGuests.