SoftLayer getUsers by userStatusID

2019-03-02 01:12发布

问题:

I am trying to retrieve SoftLayer user profiles by userStatusId.

I am using URL:

 <curl -X GET -k -n "https://api.softlayer.com/rest/v3/SoftLayer_Account/getUsers.jsoni?objectMask=mask\[virtualGuestCount,hardwareCount,userStatus,username,id,email,createDate;accountId,passwordExpireDate,secondaryPasswordTimeoutDays,secondaryPasswordModifyDate,userStatusId\]&objectFilter=\{\"userStatusId\":\{\"operation\":1021\}\}">

The user profiles returned are only 1001 status id for Active.

How do I retrieve other status IDs like 1002 = Disabled, 1003 = Inactive, 1021 = cancel_pending, 1022 = VPN Only

Thank you.

回答1:

Try the following request:

For the example, we are filtering by an inactive user:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getUsers.json?objectMask=mask[id;username,userStatus]&objectFilter={   "users": {     "userStatus": {       "id": {         "operation": "1003"       }     }   } }

The statuses that you can filter will the same statuses displayed to change in user profile: Active, Disabled, Inactive, VPN Only.

Once any user is deleted, it won't show in Portal nor Api.