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

feat(control): add dump upstream api #5259

Merged
merged 1 commit into from
Oct 19, 2021
Merged

feat(control): add dump upstream api #5259

merged 1 commit into from
Oct 19, 2021

Conversation

Xunzhuo
Copy link
Contributor

@Xunzhuo Xunzhuo commented Oct 18, 2021

What this PR does / why we need it:

feat: add dump upstream api in control api

  • support: dump all upstreams info with /v1/upstreams
  • support: dump specific upstream info by upstream_id with /v1/upstream/{upstream_id}

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@Xunzhuo
Copy link
Contributor Author

Xunzhuo commented Oct 18, 2021

cc @spacewander , would you like to take a look at this?

@Xunzhuo Xunzhuo marked this pull request as ready for review October 18, 2021 10:07
docs/en/latest/control-api.md Outdated Show resolved Hide resolved
t/control/upstreams.t Outdated Show resolved Hide resolved
t/control/upstreams.t Show resolved Hide resolved
local upstream_id = uri_segs[4]
local upstream = iter_add_get_upstream_info(upstreams, upstream_id)
if not upstream then
return 404, {error_msg = str_format("upstream[%s] not found", upstream_id)}
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a space like upstream [%s]?

Copy link
Contributor Author

@Xunzhuo Xunzhuo Oct 19, 2021

Choose a reason for hiding this comment

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

If this will be changed, the error msg from dump routes should be changed in this format too, so in my view, this is OK for me 😃

apisix/control/v1.lua Show resolved Hide resolved
docs/en/latest/control-api.md Outdated Show resolved Hide resolved
docs/en/latest/control-api.md Outdated Show resolved Hide resolved
@spacewander spacewander changed the title feat: add dump upstream api in control api feat(control): add dump upstream api Oct 19, 2021
@spacewander spacewander merged commit 50fed63 into apache:master Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants