node-saucelabs icon indicating copy to clipboard operation
node-saucelabs copied to clipboard

Fetching list of active tunnels by user

Open valishah opened this issue 5 years ago • 5 comments

Hello,

While using the Rest API I could able to pull the active tunnels by username

Request: rest/v1/USERNAME/tunnels Response: ['tunnel-id-1','tunnel-id-2']

But while using the node module, I'm getting the information from all the users under the organization. Is it because of the user being admin?

Request: api.listAvailableTunnels(USERNAME) Response:

{ "user-1": [], "user-2":[]}

Reference picture of fetching available tunnels https://share.getcloudapp.com/BluJkZOJ

valishah avatar Jul 17 '19 15:07 valishah

Is it because of the user being admin?

Yeah most likely. I can double check on that.

christian-bromann avatar Jul 17 '19 16:07 christian-bromann

Sure. As we are expecting SAUCE_USERNAME from env (or) user during constructor initialization, Asking for username to be mentioned while fetching listOfAvailableTunnels might not be needed I believe. Everything resides in a single process and object-level scope.

valishah avatar Jul 17 '19 23:07 valishah

might not be needed I believe.

It is though since you can pull the data not only for your user but also for your sub-accounts.

christian-bromann avatar Jul 18 '19 09:07 christian-bromann

Yeah. I agreed. Then we should give the list of tunnels of the specified user instead of listing all the sub-accounts. If the user doesn't provide username, We can list all tunnels including sub-accounts.

valishah avatar Jul 18 '19 10:07 valishah

If the user doesn't provide username, We can list all tunnels including sub-accounts.

This is more difficult. As you can see all API commands are generated based on the Swagger definition and all special behaviors need to be implemented separately.

christian-bromann avatar Jul 18 '19 10:07 christian-bromann