Skip to content

feat(control): add dump upstream api#5259

Merged
spacewander merged 1 commit into
apache:masterfrom
Xunzhuo:master
Oct 19, 2021
Merged

feat(control): add dump upstream api#5259
spacewander merged 1 commit into
apache:masterfrom
Xunzhuo:master

Conversation

@Xunzhuo

@Xunzhuo Xunzhuo commented Oct 18, 2021

Copy link
Copy Markdown
Contributor

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

Xunzhuo commented Oct 18, 2021

Copy link
Copy Markdown
Contributor Author

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
Comment thread docs/en/latest/control-api.md Outdated
Comment thread t/control/upstreams.t Outdated
Comment thread t/control/upstreams.t
Comment thread t/control/upstreams.t
Comment thread apisix/control/v1.lua
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
Copy Markdown
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]?

@Xunzhuo Xunzhuo Oct 19, 2021

Copy link
Copy Markdown
Contributor Author

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 😃

Comment thread apisix/control/v1.lua
Comment thread docs/en/latest/control-api.md Outdated
Comment thread docs/en/latest/control-api.md Outdated
@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