Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed API v4 /servers result for query param {profileName} #6847

Merged

Conversation

rimashah25
Copy link
Contributor

@rimashah25 rimashah25 commented May 20, 2022

Closes: #6834


Which Traffic Control components are affected by this PR?

  • Documentation
  • Traffic Ops

What is the best way to verify this PR?

Create two servers, one via APIv4 (and assign multiple profiles, eg:GLOBAL, TRAFFIC_OPS) and one via APIv3(eg: TRAFFIC_OPS)

curl https://localhost:8443/api/4.0/servers?profileName=<profile_name>
curl https://localhost:8443/api/3.0/servers?profileId=<profile_id>

In 4.0, if queried for profileName=TRAFFIC_OPS, one should see 2 results.
In 3.0, if queried for profileId=3, one should see only one result (since TRAFFIC_OPS is at index 0 only in one server).

If this is a bugfix, which Traffic Control versions contained the bug?

6.1.0

PR submission checklist

@rimashah25 rimashah25 changed the title Fixed API v4 /servers result for query param {profileName} Fixed API v4 /servers result for query param {profileName} May 20, 2022
@ocket8888 ocket8888 added bug something isn't working as intended Traffic Ops related to Traffic Ops low impact affects only a small portion of a CDN, and cannot itself break one labels May 20, 2022
@ocket8888 ocket8888 assigned ericholguin and unassigned srijeet0406 May 20, 2022
Copy link
Contributor

@ericholguin ericholguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good and was able to query for profiles using profileId in v3 and profileNames in v4, accounting for multiple profiles.

@ocket8888 ocket8888 merged commit 9b298a0 into apache:master May 21, 2022
@shamrickus shamrickus added this to the 7.0.0 milestone May 23, 2022
@rimashah25 rimashah25 deleted the bugfix/fix_server_v4_queryparam_profile branch May 23, 2022 19:50
zrhoffman pushed a commit to zrhoffman/trafficcontrol that referenced this pull request Oct 2, 2022
…6847)

* Added profileName as query param for APIv4

* Updated select query for APIv4 and APIv3

* Shuffled variable

* Added changelog

* Updated test

* Updated based on review comments

* Updated select queries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended low impact affects only a small portion of a CDN, and cannot itself break one Traffic Ops related to Traffic Ops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GET /api/4.0/servers?profileId={id} does not include all profiles
5 participants