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

docs: update public API relative usage #6318

Merged
merged 10 commits into from
Feb 22, 2022

Conversation

bzp2010
Copy link
Contributor

@bzp2010 bzp2010 commented Feb 14, 2022

What this PR does / why we need it:

Update the usage in the documentation of some plugins that use the public API feature.

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

@bzp2010 bzp2010 self-assigned this Feb 14, 2022
@bzp2010 bzp2010 marked this pull request as ready for review February 14, 2022 13:39
shuaijinchao
shuaijinchao previously approved these changes Feb 15, 2022
First you need to setup the route for the API that sign the token, which will use the [public-api](public-api.md) plugin.

```shell
$ curl http://127.0.0.1:9080/apisix/admin/routes/ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$ curl http://127.0.0.1:9080/apisix/admin/routes/ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
$ curl http://127.0.0.1:9080/apisix/admin/routes/jwt-sign -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

tzssangglass
tzssangglass previously approved these changes Feb 16, 2022
@bzp2010
Copy link
Contributor Author

bzp2010 commented Feb 16, 2022

Hi, @spacewander. Please help check it out, thanks!

shuaijinchao
shuaijinchao previously approved these changes Feb 17, 2022
docs/en/latest/plugins/batch-requests.md Outdated Show resolved Hide resolved
docs/en/latest/plugins/jwt-auth.md Outdated Show resolved Hide resolved
docs/en/latest/plugins/prometheus.md Outdated Show resolved Hide resolved
```

## 测试插件

你可以将要访问的请求信息传到网关的批量请求接口( `/apisix/batch-requests` ),网关会以 [http pipeline](https://en.wikipedia.org/wiki/HTTP_pipelining) 的方式自动帮你完成请求。
首先,你需要为 batch request 的 API 设置一个路由,它将使用 [public-api](public-api.md) 插件。
Copy link
Member

Choose a reason for hiding this comment

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

[public-api](public-api.md) only has English version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

broken link fixed

}'
```

Then, we can get the metrics.
Copy link
Member

Choose a reason for hiding this comment

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

We don't need to do it for prometheus, which uses a different port.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think now that we have introduced public-api plugin, can we reduce the existence of APIs with special configuration items on these plugins and let users give priority to using public-api plugin to realize similar functions, such as prometheus plugin and batch-requests plugins.

Copy link
Member

Choose a reason for hiding this comment

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

The default port of Prometheus metrics is 9091, not the 9080.

Copy link
Member

Choose a reason for hiding this comment

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

It is not recommended to configure the port to 9080, which abuses the 9080 port and should be only used in the CI.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should remove the example of public-api in prometheus. Better not encourage the abuse.

Copy link
Contributor Author

@bzp2010 bzp2010 Feb 21, 2022

Choose a reason for hiding this comment

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

@spacewander changes rolled back

Co-authored-by: 琚致远 <juzhiyuan@apache.org>
@juzhiyuan
Copy link
Member

image

Hi @bzp2010, please have a check on this.

Copy link
Contributor

@iamayushdas iamayushdas left a comment

Choose a reason for hiding this comment

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

English Docs are good to go✅

@spacewander spacewander merged commit ecf08c6 into apache:master Feb 22, 2022
hongbinhsu pushed a commit to fitphp/apix that referenced this pull request Feb 23, 2022
* upstream: (52 commits)
  feat: add kubernetes discovery module (apache#4880)
  docs: fix For L7 proxy -> For L4 proxy (apache#6423)
  fix(deps): upgrade jsonschema to 0.9.8 (apache#6407)
  docs: translate Chinese to English in en clickhouse-logger (apache#6416)
  docs: add zh proxy-control.md&modify other doc error (apache#6346)
  docs: update public API relative usage (apache#6318)
  docs(cn): remove datadog from sidebar & fix doc lint conf (apache#6411)
  fix(request-validation): should not limit the urlencoded post args number (apache#6396)
  docs: fix configuration file typo (apache#6395)
  docs(extern-plugin): the implementation of runner (apache#6336)
  docs: polishing skywalking-logger plugin's docs (apache#6377)
  doc: adjust the directory structure of observability's documents (apache#6391)
  change(admin): empty nodes should be encoded as array (apache#6384)
  fix: should not limit the header number (apache#6379)
  ci: remove unnecessary tmate action (apache#6367)
  fix(opentelemetry): batch_span_processor export zero length spans (apache#6349)
  feat(graphql): support http get and post json request (apache#6343)
  feat: support for configuring the number of etcd health check retries (apache#6322)
  feat(wasm): support getting request body (apache#6325)
  fix(hmac-auth): hmac-auth plugin sort array param (apache#6314)
  ...
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.

None yet

6 participants