You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/08/20 17:52:33 UTC

[GitHub] [trafficcontrol] ocket8888 opened a new issue #6130: Docs for /users has incorrect field name

ocket8888 opened a new issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130


   ## This Bug Report affects these Traffic Control components:
   - Documentation
   
   ## Current behavior:
   The docs say that there's a field containing the Name of the User's Role called `roleName`.
   
   
   ## Expected behavior:
   The docs should accurately document the API's output.
   
   
   ## Steps to reproduce:
   `toget -kp 'users?limit=1' | jq '.response[0]'` - returns:
   ```json
   {
           "rolename": "admin",
           "username": "admin",
           "registrationSent": null,
           "addressLine1": null,
           "addressLine2": null,
           "city": null,
           "company": null,
           "country": null,
           "email": null,
           "fullName": null,
           "gid": null,
           "id": 2,
           "newUser": false,
           "phoneNumber": null,
           "postalCode": null,
           "publicSshKey": null,
           "role": 1,
           "stateOrProvince": null,
           "tenant": "root",
           "tenantId": 1,
           "uid": null,
           "lastUpdated": "2021-08-20 17:47:38+00"
   }
   ```
   
   Note the field name is `rolename`, not `roleName`.
   
   It's unclear whether this is a regression without digging further into git history than I feel like doing right now, but I think that's unlikely, and it's probably just that the docs have been copied with each successive major API version release from the previous version since v2 was added, and the GoDoc for the field on the `lib/go-tc` struct related to API User representations mentions a difference between API versions in the name of that property. Interestingly, though, the API docs for v2 get the name right, while v3 and v4 both use the incorrect camelCase form.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp closed issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
rawlinp closed issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny commented on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
Ayushsunny commented on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-937679476


   > `toget` is a script provided by the [Python client](https://github.com/apache/trafficcontrol/tree/master/traffic_control/clients/python) which you probably don't have installed. You probably don't have `jq` installed either, I would guess.
   > 
   > Some API versions are documented as outputting objects containing a `rolename` field when actually those endpoints output objects that have a field named `roleName`, so they'll need to be updated wherever that's wrong. According to the issue, that's in the documentation for `/users` in API versions 3 and 4. But that may have changed for API v4 since the issue was written. Also, it's unclear whether `/user/current` has the same issue.
   
   Now I'm getting this `"Traffic Ops hostname not set! Set the TO_URL environment variable or use '--to-url'."` ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny edited a comment on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
Ayushsunny edited a comment on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-927168961


   Hey @ocket8888 can you guide me a bit more on this issue as I want to work on this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny removed a comment on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
Ayushsunny removed a comment on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-927168961


   Hey @ocket8888 can you guide me a bit more on this issue as I want to work on this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny commented on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
Ayushsunny commented on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-927168961


   Hey @ocket8888 can you guide me a bit more for this issue as I want to work on this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny commented on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
Ayushsunny commented on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-937679476


   > `toget` is a script provided by the [Python client](https://github.com/apache/trafficcontrol/tree/master/traffic_control/clients/python) which you probably don't have installed. You probably don't have `jq` installed either, I would guess.
   > 
   > Some API versions are documented as outputting objects containing a `rolename` field when actually those endpoints output objects that have a field named `roleName`, so they'll need to be updated wherever that's wrong. According to the issue, that's in the documentation for `/users` in API versions 3 and 4. But that may have changed for API v4 since the issue was written. Also, it's unclear whether `/user/current` has the same issue.
   
   Now I'm getting this `"Traffic Ops hostname not set! Set the TO_URL environment variable or use '--to-url'."` ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-937415648


   `toget` is a script provided by the [Python client](https://github.com/apache/trafficcontrol/tree/master/traffic_control/clients/python) which you probably don't have installed. You probably don't have `jq` installed either, I would guess.
   
   Some API versions are documented as outputting objects containing a `rolename` field when actually those endpoints output objects that have a field named `roleName`, so they'll need to be updated wherever that's wrong. According to the issue, that's in the documentation for `/users` in API versions 3 and 4. But that may have changed for API v4 since the issue was written. Also, it's unclear whether `/user/current` has the same issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-937748588


   Yeah, the command I used omitted some information that was in environment variables for convenience. Like it says, you need to tell it where your TO server is, but if you do that it will say the same thing about your username and password. So you can either do
   
   ```bash
   toget -kp --to-url='https://to-host:port' --to-user=username --to-password=password -k 'users?limit=1'
   ```
   instead of just
   ```bash
   toget -k 'users?limit=1'
   ```
   or set those things in environment variables before calling `toget` like:
   ```shell
   $ export TO_URL='https://to-host:port'
   $ export TO_USER=username
   $ export TO_PASSWORD=password
   $ toget -k 'users?limit=1' | jq '.response[0]'
   ```
   where `to-host` is the fully qualified domain name on which TO is listening, `port` is the port on which it listens, `username` is the name of the user as whom to authenticate with TO, and `password` is the password of that user. For example, if running a local CDN-in-a-Box with exposed ports and an unchanged `variables.env`, those values should probably be `localhost`, `6443`, `admin`, and `twelve12`, respectively. Example:
   
   ```shell
   $ export TO_URL='https://localhost:6443'
   $ export TO_USER=admin
   $ export TO_PASSWORD=twelve12
   $ toget -k 'users?limit=1' | jq '.response[0]'
   Some output
   $ # equivalent to:
   $ toget -k --to-url='https://localhost:6443' --to-user=admin --to-password=twelve12 'users?limit=1' | jq '.response[0]'
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
rawlinp commented on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-946079263


   > Also, it's unclear whether /user/current has the same issue.
   
   The /user/current route uses `roleName`, while the other user routes use `rolename`. @Ayushsunny @ocket8888 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-937415648






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny commented on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
Ayushsunny commented on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-932857858


   Hey, @ocket8888 Can I pick this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-933532650


   sure, all yours


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny commented on issue #6130: Docs for /users has incorrect field name

Posted by GitBox <gi...@apache.org>.
Ayushsunny commented on issue #6130:
URL: https://github.com/apache/trafficcontrol/issues/6130#issuecomment-935742775


   Hey @ocket8888 need your help here -
   
   1. ` toget -kp 'users?limit=1' | jq '.response[0]' ` this command returned 'toget' command not found.
   2. So we are changing `roleName` to `rolename` everywhere or just in users.rst file ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org