You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by Zexuan Luo <sp...@apache.org> on 2020/12/01 01:18:19 UTC

Re: Discuss: Add a new API to get plugin information

> plugin metadata includes
name, version, type, priority, which is common to all plugins, and is used
to describe the nature of the plugin

The terminology of  'plugin metadata' is already taken by plugin level
configuration. We should avoid redefinition of 'plugin metadata' and define
a new name for plugin info

王三 <tz...@gmail.com> 于2020年11月30日周一 下午10:20写道:

> I think metadata and schema are parallel things, plugin metadata includes
> name, version, type, priority, which is common to all plugins, and is used
> to describe the nature of the plugin.
> The schema and consumer_schema are the plugin's schema, which defines the
> configuration parameters for generating a plugin instance.
>
> Perhaps the above perception is slightly radical.
> I prefer to think of the schema and consumer_schema as part of the plugin‘s
> metadata, except that some plugins have a null consumer_schema.
>
> 刘曦冉 <be...@126.com> 于2020年11月30日周一 下午10:00写道:
>
> >
> >
> >
> > There are a few questions I'd like to confirm:
> > 1、Is meta data only a part of plugin's information?
> > 2、In v2.0, Manager-api and Admin-api are independent of each other,
> > right?  After checking, the exist API listed by membphis are admin-apis,
> > and currently there are two exist APIs in manger-api
> > `GET /apisix/admin/plugins` to get plugin names list
> > `GET /apisix/admin/schema/plugins/{plugin_name}` to get specific plugin's
> > schema
> >
> > 在 2020-11-30 20:30:27,"YuanSheng Wang" <me...@apache.org> 写道:
> > >exist API list:
> > > /apisix/admin/plugins/list
> > > /apisix/admin/plugins/reload
> > > /apisix/admin/plugins/{plugin_name}
> > > /apisix/admin/plugin_metadata/{plugin_name}
> > >
> > >How about this name?
> > > /apisix/admin/plugins/list_all
> > >
> > >
> > >On Mon, Nov 30, 2020 at 7:43 PM Zexuan Luo <sp...@apache.org>
> > wrote:
> > >
> > >> We already have API for plugin_metadata and it is not related to the
> > plugin
> > >> information. I am afraid there will be some confusion.
> > >>
> > >> YuanSheng Wang <me...@apache.org> 于2020年11月30日周一 下午6:26写道:
> > >>
> > >> > The idea is very good.
> > >> > The response data format is fine to me too.
> > >> >
> > >> > Just small changing(not important):
> > >> > `GET /apisix/admin/plugins/meta_data`
> > >> > change to
> > >> > `GET /apisix/admin/plugins/metadata`
> > >> >
> > >> >
> > >> > On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <be...@126.com> wrote:
> > >> >
> > >> > > Hi  Community:
> > >> > >
> > >> > >
> > >> > >
> > >> > > This discussion originates from issue:
> > >> > > https://github.com/apache/apisix-dashboard/issues/529
> > >> > >
> > >> > >
> > >> > > Background
> > >> > > Dashboard wants to optimize the UE of config the plugins. For the
> > >> plugins
> > >> > > such as `key-auth` `prometheus` etc. user only need to
> > enable/disable
> > >> > them
> > >> > > in route or service without any configurations. so it would be
> > better
> > >> > that
> > >> > > only show switch for these plugins.
> > >> > > When rendering the plugin page, the FE needs to know not only the
> > name
> > >> of
> > >> > > the plugins(which have already been returned by `GET
> > >> > > /apisix/admin/plugins`), but also need to know the plugins' schema
> > >> which
> > >> > is
> > >> > > used to judge whether the plugin needs to be config
> > >> > > Solution
> > >> > > Refer to
> > >> > >
> > >> >
> > >>
> >
> https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857
> > >> > > It would be better to create a new API in manger-api, which is
> used
> > to
> > >> > > return all the information of the plugins, the ideal data
> structure
> > is
> > >> as
> > >> > > follows:
> > >> > > ```json
> > >> > > [
> > >> > >   {
> > >> > >     "name": "key-auth",
> > >> > >     "type":  "auth",
> > >> > >     "schema": {
> > >> > >      ....
> > >> > >     }
> > >> > >     ...other plugin meta_data
> > >> > >   },
> > >> > >  {
> > >> > >    ...
> > >> > >  }
> > >> > > ]
> > >> > > ```
> > >> > > And for the API name
> > >> > > Just follow the current convention:as `GET /apisix/admin/plugins`
> > has
> > >> > > already in use for get all plugins names list, so the new name
> > would be
> > >> > > `GET /apisix/admin/plugins/meta_data`  to get all plugins
> > informations
> > >> > list.
> > >> > > When we have a large version change: for a better Reatful way, I
> > perfer
> > >> > > this way:
> > >> > >
> > >> >
> > >>
> >
> https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561
> > >> > > the name would be  `GET /api/version/plugins`
> > >> > >
> > >> > >
> > >> > > What do you think? Looking forward to your comments and
> suggestions.
> > >> > > Thanks~!
> > >> > >
> > >> > >
> > >> > > Best wishes
> > >> > > Liuxiran
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> >
> > >> > *MembPhis*
> > >> > My GitHub: https://github.com/membphis
> > >> > Apache APISIX: https://github.com/apache/apisix
> > >> >
> > >>
> > >
> > >
> > >--
> > >
> > >*MembPhis*
> > >My GitHub: https://github.com/membphis
> > >Apache APISIX: https://github.com/apache/apisix
> >
>

Re: Discuss: Add a new API to get plugin information

Posted by 刘曦冉 <be...@126.com>.
Yes, you are right the returned data structure is the same as it was mentioned at the beginning.
This API depends on a command-line tool mentioned in: https://lists.apache.org/thread.html/rb1c19fe9b6e51ede3b5aead122e2bcd4de6249f42b971eabfb8a79ac%40%3Cdev.apisix.apache.org%3E
在 2020-12-07 22:30:01,"王三" <tz...@gmail.com> 写道:
>is that the returned data structure is as you said at first?
>
>this
>```json
>[
>  {
>    "name": "key-auth",
>    "type":  "auth",
>    "schema": {
>     ....
>    }
>    ...other plugin meta_data
>  },
> {
>   ...
> }
>]
>```
>
>
>刘曦冉 <be...@126.com> 于2020年12月7日周一 下午1:23写道:
>
>> Hi  Community:For the name of the API, zexuan recommended `
>> /apisix/admin/plugins?all=true`, because
>> > The definition of `plugin attributes` is taken too.
>>
>>
>> it is fine for me and what do you think?
>>
>> At 2020-12-01 11:18:37, "Zexuan Luo" <sp...@apache.org> wrote:
>> >The definition of `plugin attributes` is taken too, see
>> >
>> https://github.com/apache/apisix/blob/9dfe697b644691509b55cd7ec58188b33dd3e792/conf/config-default.yaml#L245
>> >
>> >What about using ` /apisix/admin/plugins?all=true`?
>> >
>> >BTW, it would be better if we can avoid the verb in the REST API, to make
>> >it less like RPC.
>> >If the verb is inevitable, put it in the last part, like this:
>> >/apisix/admin/plugins:list?all=true.
>> >Therefore we can avoid conflict when we need to introduce
>> >/apisix/admin/plugin/<plugin_name> API.
>> >
>> >YuanSheng Wang <me...@apache.org> 于2020年12月1日周二 上午10:38写道:
>> >
>> >> I think this is fine for us.
>> >>
>> >> API: */apisix/admin/plugins/list_with_attributes*
>> >> Desc: return all the attributes of the plugin.
>> >>
>> >> Return value:
>> >>
>> >> ```json
>> >> [
>> >>   {
>> >>     "name": "key-auth",
>> >>     "type":  "auth",
>> >>     "schema": {
>> >>      ....
>> >>     }
>> >>     ...other plugin meta_data
>> >>   },
>> >>  {
>> >>    ...
>> >>  }
>> >> ]
>> >> ```
>> >>
>> >>
>> >> On Tue, Dec 1, 2020 at 10:36 AM 刘曦冉 <be...@126.com> wrote:
>> >>
>> >> >
>> >> >
>> >> >
>> >> > Thanks  for zexuan‘s  explanation which answered my question.
>> >> > as for the name of the new api,
>> >> > > How about this name?
>> >> > /apisix/admin/plugins/list_all
>> >> >
>> >> >
>> >> > agree, for 2.x is a good compromise.
>> >> > we can add a TODO here, when we do a big version upgrade, we could
>> >> > consider to  uses `/plugins` and query params to get all plugin
>> >> information
>> >> > and  specific plugin information.
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > 在 2020-12-01 09:18:19,"Zexuan Luo" <sp...@apache.org> 写道:
>> >> > >> plugin metadata includes
>> >> > >name, version, type, priority, which is common to all plugins, and is
>> >> used
>> >> > >to describe the nature of the plugin
>> >> > >
>> >> > >The terminology of  'plugin metadata' is already taken by plugin
>> level
>> >> > >configuration. We should avoid redefinition of 'plugin metadata' and
>> >> > define
>> >> > >a new name for plugin info
>> >> > >
>> >> > >王三 <tz...@gmail.com> 于2020年11月30日周一 下午10:20写道:
>> >> > >
>> >> > >> I think metadata and schema are parallel things, plugin metadata
>> >> > includes
>> >> > >> name, version, type, priority, which is common to all plugins, and
>> is
>> >> > used
>> >> > >> to describe the nature of the plugin.
>> >> > >> The schema and consumer_schema are the plugin's schema, which
>> defines
>> >> > the
>> >> > >> configuration parameters for generating a plugin instance.
>> >> > >>
>> >> > >> Perhaps the above perception is slightly radical.
>> >> > >> I prefer to think of the schema and consumer_schema as part of the
>> >> > plugin‘s
>> >> > >> metadata, except that some plugins have a null consumer_schema.
>> >> > >>
>> >> > >> 刘曦冉 <be...@126.com> 于2020年11月30日周一 下午10:00写道:
>> >> > >>
>> >> > >> >
>> >> > >> >
>> >> > >> >
>> >> > >> > There are a few questions I'd like to confirm:
>> >> > >> > 1、Is meta data only a part of plugin's information?
>> >> > >> > 2、In v2.0, Manager-api and Admin-api are independent of each
>> other,
>> >> > >> > right?  After checking, the exist API listed by membphis are
>> >> > admin-apis,
>> >> > >> > and currently there are two exist APIs in manger-api
>> >> > >> > `GET /apisix/admin/plugins` to get plugin names list
>> >> > >> > `GET /apisix/admin/schema/plugins/{plugin_name}` to get specific
>> >> > plugin's
>> >> > >> > schema
>> >> > >> >
>> >> > >> > 在 2020-11-30 20:30:27,"YuanSheng Wang" <me...@apache.org> 写道:
>> >> > >> > >exist API list:
>> >> > >> > > /apisix/admin/plugins/list
>> >> > >> > > /apisix/admin/plugins/reload
>> >> > >> > > /apisix/admin/plugins/{plugin_name}
>> >> > >> > > /apisix/admin/plugin_metadata/{plugin_name}
>> >> > >> > >
>> >> > >> > >How about this name?
>> >> > >> > > /apisix/admin/plugins/list_all
>> >> > >> > >
>> >> > >> > >
>> >> > >> > >On Mon, Nov 30, 2020 at 7:43 PM Zexuan Luo <
>> spacewander@apache.org
>> >> >
>> >> > >> > wrote:
>> >> > >> > >
>> >> > >> > >> We already have API for plugin_metadata and it is not related
>> to
>> >> > the
>> >> > >> > plugin
>> >> > >> > >> information. I am afraid there will be some confusion.
>> >> > >> > >>
>> >> > >> > >> YuanSheng Wang <me...@apache.org> 于2020年11月30日周一 下午6:26写道:
>> >> > >> > >>
>> >> > >> > >> > The idea is very good.
>> >> > >> > >> > The response data format is fine to me too.
>> >> > >> > >> >
>> >> > >> > >> > Just small changing(not important):
>> >> > >> > >> > `GET /apisix/admin/plugins/meta_data`
>> >> > >> > >> > change to
>> >> > >> > >> > `GET /apisix/admin/plugins/metadata`
>> >> > >> > >> >
>> >> > >> > >> >
>> >> > >> > >> > On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <be...@126.com>
>> >> wrote:
>> >> > >> > >> >
>> >> > >> > >> > > Hi  Community:
>> >> > >> > >> > >
>> >> > >> > >> > >
>> >> > >> > >> > >
>> >> > >> > >> > > This discussion originates from issue:
>> >> > >> > >> > > https://github.com/apache/apisix-dashboard/issues/529
>> >> > >> > >> > >
>> >> > >> > >> > >
>> >> > >> > >> > > Background
>> >> > >> > >> > > Dashboard wants to optimize the UE of config the plugins.
>> For
>> >> > the
>> >> > >> > >> plugins
>> >> > >> > >> > > such as `key-auth` `prometheus` etc. user only need to
>> >> > >> > enable/disable
>> >> > >> > >> > them
>> >> > >> > >> > > in route or service without any configurations. so it
>> would
>> >> be
>> >> > >> > better
>> >> > >> > >> > that
>> >> > >> > >> > > only show switch for these plugins.
>> >> > >> > >> > > When rendering the plugin page, the FE needs to know not
>> only
>> >> > the
>> >> > >> > name
>> >> > >> > >> of
>> >> > >> > >> > > the plugins(which have already been returned by `GET
>> >> > >> > >> > > /apisix/admin/plugins`), but also need to know the
>> plugins'
>> >> > schema
>> >> > >> > >> which
>> >> > >> > >> > is
>> >> > >> > >> > > used to judge whether the plugin needs to be config
>> >> > >> > >> > > Solution
>> >> > >> > >> > > Refer to
>> >> > >> > >> > >
>> >> > >> > >> >
>> >> > >> > >>
>> >> > >> >
>> >> > >>
>> >> >
>> >>
>> https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857
>> >> > >> > >> > > It would be better to create a new API in manger-api,
>> which
>> >> is
>> >> > >> used
>> >> > >> > to
>> >> > >> > >> > > return all the information of the plugins, the ideal data
>> >> > >> structure
>> >> > >> > is
>> >> > >> > >> as
>> >> > >> > >> > > follows:
>> >> > >> > >> > > ```json
>> >> > >> > >> > > [
>> >> > >> > >> > >   {
>> >> > >> > >> > >     "name": "key-auth",
>> >> > >> > >> > >     "type":  "auth",
>> >> > >> > >> > >     "schema": {
>> >> > >> > >> > >      ....
>> >> > >> > >> > >     }
>> >> > >> > >> > >     ...other plugin meta_data
>> >> > >> > >> > >   },
>> >> > >> > >> > >  {
>> >> > >> > >> > >    ...
>> >> > >> > >> > >  }
>> >> > >> > >> > > ]
>> >> > >> > >> > > ```
>> >> > >> > >> > > And for the API name
>> >> > >> > >> > > Just follow the current convention:as `GET
>> >> > /apisix/admin/plugins`
>> >> > >> > has
>> >> > >> > >> > > already in use for get all plugins names list, so the new
>> >> name
>> >> > >> > would be
>> >> > >> > >> > > `GET /apisix/admin/plugins/meta_data`  to get all plugins
>> >> > >> > informations
>> >> > >> > >> > list.
>> >> > >> > >> > > When we have a large version change: for a better Reatful
>> >> way,
>> >> > I
>> >> > >> > perfer
>> >> > >> > >> > > this way:
>> >> > >> > >> > >
>> >> > >> > >> >
>> >> > >> > >>
>> >> > >> >
>> >> > >>
>> >> >
>> >>
>> https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561
>> >> > >> > >> > > the name would be  `GET /api/version/plugins`
>> >> > >> > >> > >
>> >> > >> > >> > >
>> >> > >> > >> > > What do you think? Looking forward to your comments and
>> >> > >> suggestions.
>> >> > >> > >> > > Thanks~!
>> >> > >> > >> > >
>> >> > >> > >> > >
>> >> > >> > >> > > Best wishes
>> >> > >> > >> > > Liuxiran
>> >> > >> > >> >
>> >> > >> > >> >
>> >> > >> > >> >
>> >> > >> > >> > --
>> >> > >> > >> >
>> >> > >> > >> > *MembPhis*
>> >> > >> > >> > My GitHub: https://github.com/membphis
>> >> > >> > >> > Apache APISIX: https://github.com/apache/apisix
>> >> > >> > >> >
>> >> > >> > >>
>> >> > >> > >
>> >> > >> > >
>> >> > >> > >--
>> >> > >> > >
>> >> > >> > >*MembPhis*
>> >> > >> > >My GitHub: https://github.com/membphis
>> >> > >> > >Apache APISIX: https://github.com/apache/apisix
>> >> > >> >
>> >> > >>
>> >> >
>> >>
>> >>
>> >> --
>> >>
>> >> *MembPhis*
>> >> My GitHub: https://github.com/membphis
>> >> Apache APISIX: https://github.com/apache/apisix
>> >>
>>

Re: Discuss: Add a new API to get plugin information

Posted by 王三 <tz...@gmail.com>.
is that the returned data structure is as you said at first?

this
```json
[
  {
    "name": "key-auth",
    "type":  "auth",
    "schema": {
     ....
    }
    ...other plugin meta_data
  },
 {
   ...
 }
]
```


刘曦冉 <be...@126.com> 于2020年12月7日周一 下午1:23写道:

> Hi  Community:For the name of the API, zexuan recommended `
> /apisix/admin/plugins?all=true`, because
> > The definition of `plugin attributes` is taken too.
>
>
> it is fine for me and what do you think?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> At 2020-12-01 11:18:37, "Zexuan Luo" <sp...@apache.org> wrote:
> >The definition of `plugin attributes` is taken too, see
> >
> https://github.com/apache/apisix/blob/9dfe697b644691509b55cd7ec58188b33dd3e792/conf/config-default.yaml#L245
> >
> >What about using ` /apisix/admin/plugins?all=true`?
> >
> >BTW, it would be better if we can avoid the verb in the REST API, to make
> >it less like RPC.
> >If the verb is inevitable, put it in the last part, like this:
> >/apisix/admin/plugins:list?all=true.
> >Therefore we can avoid conflict when we need to introduce
> >/apisix/admin/plugin/<plugin_name> API.
> >
> >YuanSheng Wang <me...@apache.org> 于2020年12月1日周二 上午10:38写道:
> >
> >> I think this is fine for us.
> >>
> >> API: */apisix/admin/plugins/list_with_attributes*
> >> Desc: return all the attributes of the plugin.
> >>
> >> Return value:
> >>
> >> ```json
> >> [
> >>   {
> >>     "name": "key-auth",
> >>     "type":  "auth",
> >>     "schema": {
> >>      ....
> >>     }
> >>     ...other plugin meta_data
> >>   },
> >>  {
> >>    ...
> >>  }
> >> ]
> >> ```
> >>
> >>
> >> On Tue, Dec 1, 2020 at 10:36 AM 刘曦冉 <be...@126.com> wrote:
> >>
> >> >
> >> >
> >> >
> >> > Thanks  for zexuan‘s  explanation which answered my question.
> >> > as for the name of the new api,
> >> > > How about this name?
> >> > /apisix/admin/plugins/list_all
> >> >
> >> >
> >> > agree, for 2.x is a good compromise.
> >> > we can add a TODO here, when we do a big version upgrade, we could
> >> > consider to  uses `/plugins` and query params to get all plugin
> >> information
> >> > and  specific plugin information.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > 在 2020-12-01 09:18:19,"Zexuan Luo" <sp...@apache.org> 写道:
> >> > >> plugin metadata includes
> >> > >name, version, type, priority, which is common to all plugins, and is
> >> used
> >> > >to describe the nature of the plugin
> >> > >
> >> > >The terminology of  'plugin metadata' is already taken by plugin
> level
> >> > >configuration. We should avoid redefinition of 'plugin metadata' and
> >> > define
> >> > >a new name for plugin info
> >> > >
> >> > >王三 <tz...@gmail.com> 于2020年11月30日周一 下午10:20写道:
> >> > >
> >> > >> I think metadata and schema are parallel things, plugin metadata
> >> > includes
> >> > >> name, version, type, priority, which is common to all plugins, and
> is
> >> > used
> >> > >> to describe the nature of the plugin.
> >> > >> The schema and consumer_schema are the plugin's schema, which
> defines
> >> > the
> >> > >> configuration parameters for generating a plugin instance.
> >> > >>
> >> > >> Perhaps the above perception is slightly radical.
> >> > >> I prefer to think of the schema and consumer_schema as part of the
> >> > plugin‘s
> >> > >> metadata, except that some plugins have a null consumer_schema.
> >> > >>
> >> > >> 刘曦冉 <be...@126.com> 于2020年11月30日周一 下午10:00写道:
> >> > >>
> >> > >> >
> >> > >> >
> >> > >> >
> >> > >> > There are a few questions I'd like to confirm:
> >> > >> > 1、Is meta data only a part of plugin's information?
> >> > >> > 2、In v2.0, Manager-api and Admin-api are independent of each
> other,
> >> > >> > right?  After checking, the exist API listed by membphis are
> >> > admin-apis,
> >> > >> > and currently there are two exist APIs in manger-api
> >> > >> > `GET /apisix/admin/plugins` to get plugin names list
> >> > >> > `GET /apisix/admin/schema/plugins/{plugin_name}` to get specific
> >> > plugin's
> >> > >> > schema
> >> > >> >
> >> > >> > 在 2020-11-30 20:30:27,"YuanSheng Wang" <me...@apache.org> 写道:
> >> > >> > >exist API list:
> >> > >> > > /apisix/admin/plugins/list
> >> > >> > > /apisix/admin/plugins/reload
> >> > >> > > /apisix/admin/plugins/{plugin_name}
> >> > >> > > /apisix/admin/plugin_metadata/{plugin_name}
> >> > >> > >
> >> > >> > >How about this name?
> >> > >> > > /apisix/admin/plugins/list_all
> >> > >> > >
> >> > >> > >
> >> > >> > >On Mon, Nov 30, 2020 at 7:43 PM Zexuan Luo <
> spacewander@apache.org
> >> >
> >> > >> > wrote:
> >> > >> > >
> >> > >> > >> We already have API for plugin_metadata and it is not related
> to
> >> > the
> >> > >> > plugin
> >> > >> > >> information. I am afraid there will be some confusion.
> >> > >> > >>
> >> > >> > >> YuanSheng Wang <me...@apache.org> 于2020年11月30日周一 下午6:26写道:
> >> > >> > >>
> >> > >> > >> > The idea is very good.
> >> > >> > >> > The response data format is fine to me too.
> >> > >> > >> >
> >> > >> > >> > Just small changing(not important):
> >> > >> > >> > `GET /apisix/admin/plugins/meta_data`
> >> > >> > >> > change to
> >> > >> > >> > `GET /apisix/admin/plugins/metadata`
> >> > >> > >> >
> >> > >> > >> >
> >> > >> > >> > On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <be...@126.com>
> >> wrote:
> >> > >> > >> >
> >> > >> > >> > > Hi  Community:
> >> > >> > >> > >
> >> > >> > >> > >
> >> > >> > >> > >
> >> > >> > >> > > This discussion originates from issue:
> >> > >> > >> > > https://github.com/apache/apisix-dashboard/issues/529
> >> > >> > >> > >
> >> > >> > >> > >
> >> > >> > >> > > Background
> >> > >> > >> > > Dashboard wants to optimize the UE of config the plugins.
> For
> >> > the
> >> > >> > >> plugins
> >> > >> > >> > > such as `key-auth` `prometheus` etc. user only need to
> >> > >> > enable/disable
> >> > >> > >> > them
> >> > >> > >> > > in route or service without any configurations. so it
> would
> >> be
> >> > >> > better
> >> > >> > >> > that
> >> > >> > >> > > only show switch for these plugins.
> >> > >> > >> > > When rendering the plugin page, the FE needs to know not
> only
> >> > the
> >> > >> > name
> >> > >> > >> of
> >> > >> > >> > > the plugins(which have already been returned by `GET
> >> > >> > >> > > /apisix/admin/plugins`), but also need to know the
> plugins'
> >> > schema
> >> > >> > >> which
> >> > >> > >> > is
> >> > >> > >> > > used to judge whether the plugin needs to be config
> >> > >> > >> > > Solution
> >> > >> > >> > > Refer to
> >> > >> > >> > >
> >> > >> > >> >
> >> > >> > >>
> >> > >> >
> >> > >>
> >> >
> >>
> https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857
> >> > >> > >> > > It would be better to create a new API in manger-api,
> which
> >> is
> >> > >> used
> >> > >> > to
> >> > >> > >> > > return all the information of the plugins, the ideal data
> >> > >> structure
> >> > >> > is
> >> > >> > >> as
> >> > >> > >> > > follows:
> >> > >> > >> > > ```json
> >> > >> > >> > > [
> >> > >> > >> > >   {
> >> > >> > >> > >     "name": "key-auth",
> >> > >> > >> > >     "type":  "auth",
> >> > >> > >> > >     "schema": {
> >> > >> > >> > >      ....
> >> > >> > >> > >     }
> >> > >> > >> > >     ...other plugin meta_data
> >> > >> > >> > >   },
> >> > >> > >> > >  {
> >> > >> > >> > >    ...
> >> > >> > >> > >  }
> >> > >> > >> > > ]
> >> > >> > >> > > ```
> >> > >> > >> > > And for the API name
> >> > >> > >> > > Just follow the current convention:as `GET
> >> > /apisix/admin/plugins`
> >> > >> > has
> >> > >> > >> > > already in use for get all plugins names list, so the new
> >> name
> >> > >> > would be
> >> > >> > >> > > `GET /apisix/admin/plugins/meta_data`  to get all plugins
> >> > >> > informations
> >> > >> > >> > list.
> >> > >> > >> > > When we have a large version change: for a better Reatful
> >> way,
> >> > I
> >> > >> > perfer
> >> > >> > >> > > this way:
> >> > >> > >> > >
> >> > >> > >> >
> >> > >> > >>
> >> > >> >
> >> > >>
> >> >
> >>
> https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561
> >> > >> > >> > > the name would be  `GET /api/version/plugins`
> >> > >> > >> > >
> >> > >> > >> > >
> >> > >> > >> > > What do you think? Looking forward to your comments and
> >> > >> suggestions.
> >> > >> > >> > > Thanks~!
> >> > >> > >> > >
> >> > >> > >> > >
> >> > >> > >> > > Best wishes
> >> > >> > >> > > Liuxiran
> >> > >> > >> >
> >> > >> > >> >
> >> > >> > >> >
> >> > >> > >> > --
> >> > >> > >> >
> >> > >> > >> > *MembPhis*
> >> > >> > >> > My GitHub: https://github.com/membphis
> >> > >> > >> > Apache APISIX: https://github.com/apache/apisix
> >> > >> > >> >
> >> > >> > >>
> >> > >> > >
> >> > >> > >
> >> > >> > >--
> >> > >> > >
> >> > >> > >*MembPhis*
> >> > >> > >My GitHub: https://github.com/membphis
> >> > >> > >Apache APISIX: https://github.com/apache/apisix
> >> > >> >
> >> > >>
> >> >
> >>
> >>
> >> --
> >>
> >> *MembPhis*
> >> My GitHub: https://github.com/membphis
> >> Apache APISIX: https://github.com/apache/apisix
> >>
>

Re: Re: Discuss: Add a new API to get plugin information

Posted by YuanSheng Wang <me...@apache.org>.
Hi:

One more thing, I think we only need to implement this API in Manager
API(for Dashboard), all right?

On Tue, Dec 8, 2020 at 6:09 PM 刘曦冉 <be...@126.com> wrote:

> I think so, too ^-^, for currently `GET /apisix/admin/plugins` only return
> plugin names list, and as we want to keep the original api the same
>
> 在 2020-12-07 19:24:46,"Zhiyuan Ju" <ju...@apache.org> 写道:
> >OK for me, and it's default value should be false IMO?
> >
> >刘曦冉 <be...@126.com> 于 2020年12月7日周一 下午1:23写道:
> >
> >> Hi  Community:For the name of the API, zexuan recommended `
> >> /apisix/admin/plugins?all=true`, because
> >> > The definition of `plugin attributes` is taken too.
> >>
> >>
> >> it is fine for me and what do you think?
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> At 2020-12-01 11:18:37, "Zexuan Luo" <sp...@apache.org> wrote:
> >> >The definition of `plugin attributes` is taken too, see
> >> >
> >>
> https://github.com/apache/apisix/blob/9dfe697b644691509b55cd7ec58188b33dd3e792/conf/config-default.yaml#L245
> >> >
> >> >What about using ` /apisix/admin/plugins?all=true`?
> >> >
> >> >BTW, it would be better if we can avoid the verb in the REST API, to
> make
> >> >it less like RPC.
> >> >If the verb is inevitable, put it in the last part, like this:
> >> >/apisix/admin/plugins:list?all=true.
> >> >Therefore we can avoid conflict when we need to introduce
> >> >/apisix/admin/plugin/<plugin_name> API.
> >> >
> >> >YuanSheng Wang <me...@apache.org> 于2020年12月1日周二 上午10:38写道:
> >> >
> >> >> I think this is fine for us.
> >> >>
> >> >> API: */apisix/admin/plugins/list_with_attributes*
> >> >> Desc: return all the attributes of the plugin.
> >> >>
> >> >> Return value:
> >> >>
> >> >> ```json
> >> >> [
> >> >>   {
> >> >>     "name": "key-auth",
> >> >>     "type":  "auth",
> >> >>     "schema": {
> >> >>      ....
> >> >>     }
> >> >>     ...other plugin meta_data
> >> >>   },
> >> >>  {
> >> >>    ...
> >> >>  }
> >> >> ]
> >> >> ```
> >> >>
> >> >>
> >> >> On Tue, Dec 1, 2020 at 10:36 AM 刘曦冉 <be...@126.com> wrote:
> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > Thanks  for zexuan‘s  explanation which answered my question.
> >> >> > as for the name of the new api,
> >> >> > > How about this name?
> >> >> > /apisix/admin/plugins/list_all
> >> >> >
> >> >> >
> >> >> > agree, for 2.x is a good compromise.
> >> >> > we can add a TODO here, when we do a big version upgrade, we could
> >> >> > consider to  uses `/plugins` and query params to get all plugin
> >> >> information
> >> >> > and  specific plugin information.
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > 在 2020-12-01 09:18:19,"Zexuan Luo" <sp...@apache.org> 写道:
> >> >> > >> plugin metadata includes
> >> >> > >name, version, type, priority, which is common to all plugins,
> and is
> >> >> used
> >> >> > >to describe the nature of the plugin
> >> >> > >
> >> >> > >The terminology of  'plugin metadata' is already taken by plugin
> >> level
> >> >> > >configuration. We should avoid redefinition of 'plugin metadata'
> and
> >> >> > define
> >> >> > >a new name for plugin info
> >> >> > >
> >> >> > >王三 <tz...@gmail.com> 于2020年11月30日周一 下午10:20写道:
> >> >> > >
> >> >> > >> I think metadata and schema are parallel things, plugin metadata
> >> >> > includes
> >> >> > >> name, version, type, priority, which is common to all plugins,
> and
> >> is
> >> >> > used
> >> >> > >> to describe the nature of the plugin.
> >> >> > >> The schema and consumer_schema are the plugin's schema, which
> >> defines
> >> >> > the
> >> >> > >> configuration parameters for generating a plugin instance.
> >> >> > >>
> >> >> > >> Perhaps the above perception is slightly radical.
> >> >> > >> I prefer to think of the schema and consumer_schema as part of
> the
> >> >> > plugin‘s
> >> >> > >> metadata, except that some plugins have a null consumer_schema.
> >> >> > >>
> >> >> > >> 刘曦冉 <be...@126.com> 于2020年11月30日周一 下午10:00写道:
> >> >> > >>
> >> >> > >> >
> >> >> > >> >
> >> >> > >> >
> >> >> > >> > There are a few questions I'd like to confirm:
> >> >> > >> > 1、Is meta data only a part of plugin's information?
> >> >> > >> > 2、In v2.0, Manager-api and Admin-api are independent of each
> >> other,
> >> >> > >> > right?  After checking, the exist API listed by membphis are
> >> >> > admin-apis,
> >> >> > >> > and currently there are two exist APIs in manger-api
> >> >> > >> > `GET /apisix/admin/plugins` to get plugin names list
> >> >> > >> > `GET /apisix/admin/schema/plugins/{plugin_name}` to get
> specific
> >> >> > plugin's
> >> >> > >> > schema
> >> >> > >> >
> >> >> > >> > 在 2020-11-30 20:30:27,"YuanSheng Wang" <me...@apache.org>
> 写道:
> >> >> > >> > >exist API list:
> >> >> > >> > > /apisix/admin/plugins/list
> >> >> > >> > > /apisix/admin/plugins/reload
> >> >> > >> > > /apisix/admin/plugins/{plugin_name}
> >> >> > >> > > /apisix/admin/plugin_metadata/{plugin_name}
> >> >> > >> > >
> >> >> > >> > >How about this name?
> >> >> > >> > > /apisix/admin/plugins/list_all
> >> >> > >> > >
> >> >> > >> > >
> >> >> > >> > >On Mon, Nov 30, 2020 at 7:43 PM Zexuan Luo <
> >> spacewander@apache.org
> >> >> >
> >> >> > >> > wrote:
> >> >> > >> > >
> >> >> > >> > >> We already have API for plugin_metadata and it is not
> related
> >> to
> >> >> > the
> >> >> > >> > plugin
> >> >> > >> > >> information. I am afraid there will be some confusion.
> >> >> > >> > >>
> >> >> > >> > >> YuanSheng Wang <me...@apache.org> 于2020年11月30日周一
> 下午6:26写道:
> >> >> > >> > >>
> >> >> > >> > >> > The idea is very good.
> >> >> > >> > >> > The response data format is fine to me too.
> >> >> > >> > >> >
> >> >> > >> > >> > Just small changing(not important):
> >> >> > >> > >> > `GET /apisix/admin/plugins/meta_data`
> >> >> > >> > >> > change to
> >> >> > >> > >> > `GET /apisix/admin/plugins/metadata`
> >> >> > >> > >> >
> >> >> > >> > >> >
> >> >> > >> > >> > On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <belovedxixi@126.com
> >
> >> >> wrote:
> >> >> > >> > >> >
> >> >> > >> > >> > > Hi  Community:
> >> >> > >> > >> > >
> >> >> > >> > >> > >
> >> >> > >> > >> > >
> >> >> > >> > >> > > This discussion originates from issue:
> >> >> > >> > >> > > https://github.com/apache/apisix-dashboard/issues/529
> >> >> > >> > >> > >
> >> >> > >> > >> > >
> >> >> > >> > >> > > Background
> >> >> > >> > >> > > Dashboard wants to optimize the UE of config the
> plugins.
> >> For
> >> >> > the
> >> >> > >> > >> plugins
> >> >> > >> > >> > > such as `key-auth` `prometheus` etc. user only need to
> >> >> > >> > enable/disable
> >> >> > >> > >> > them
> >> >> > >> > >> > > in route or service without any configurations. so it
> >> would
> >> >> be
> >> >> > >> > better
> >> >> > >> > >> > that
> >> >> > >> > >> > > only show switch for these plugins.
> >> >> > >> > >> > > When rendering the plugin page, the FE needs to know
> not
> >> only
> >> >> > the
> >> >> > >> > name
> >> >> > >> > >> of
> >> >> > >> > >> > > the plugins(which have already been returned by `GET
> >> >> > >> > >> > > /apisix/admin/plugins`), but also need to know the
> >> plugins'
> >> >> > schema
> >> >> > >> > >> which
> >> >> > >> > >> > is
> >> >> > >> > >> > > used to judge whether the plugin needs to be config
> >> >> > >> > >> > > Solution
> >> >> > >> > >> > > Refer to
> >> >> > >> > >> > >
> >> >> > >> > >> >
> >> >> > >> > >>
> >> >> > >> >
> >> >> > >>
> >> >> >
> >> >>
> >>
> https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857
> >> >> > >> > >> > > It would be better to create a new API in manger-api,
> >> which
> >> >> is
> >> >> > >> used
> >> >> > >> > to
> >> >> > >> > >> > > return all the information of the plugins, the ideal
> data
> >> >> > >> structure
> >> >> > >> > is
> >> >> > >> > >> as
> >> >> > >> > >> > > follows:
> >> >> > >> > >> > > ```json
> >> >> > >> > >> > > [
> >> >> > >> > >> > >   {
> >> >> > >> > >> > >     "name": "key-auth",
> >> >> > >> > >> > >     "type":  "auth",
> >> >> > >> > >> > >     "schema": {
> >> >> > >> > >> > >      ....
> >> >> > >> > >> > >     }
> >> >> > >> > >> > >     ...other plugin meta_data
> >> >> > >> > >> > >   },
> >> >> > >> > >> > >  {
> >> >> > >> > >> > >    ...
> >> >> > >> > >> > >  }
> >> >> > >> > >> > > ]
> >> >> > >> > >> > > ```
> >> >> > >> > >> > > And for the API name
> >> >> > >> > >> > > Just follow the current convention:as `GET
> >> >> > /apisix/admin/plugins`
> >> >> > >> > has
> >> >> > >> > >> > > already in use for get all plugins names list, so the
> new
> >> >> name
> >> >> > >> > would be
> >> >> > >> > >> > > `GET /apisix/admin/plugins/meta_data`  to get all
> plugins
> >> >> > >> > informations
> >> >> > >> > >> > list.
> >> >> > >> > >> > > When we have a large version change: for a better
> Reatful
> >> >> way,
> >> >> > I
> >> >> > >> > perfer
> >> >> > >> > >> > > this way:
> >> >> > >> > >> > >
> >> >> > >> > >> >
> >> >> > >> > >>
> >> >> > >> >
> >> >> > >>
> >> >> >
> >> >>
> >>
> https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561
> >> >> > >> > >> > > the name would be  `GET /api/version/plugins`
> >> >> > >> > >> > >
> >> >> > >> > >> > >
> >> >> > >> > >> > > What do you think? Looking forward to your comments and
> >> >> > >> suggestions.
> >> >> > >> > >> > > Thanks~!
> >> >> > >> > >> > >
> >> >> > >> > >> > >
> >> >> > >> > >> > > Best wishes
> >> >> > >> > >> > > Liuxiran
> >> >> > >> > >> >
> >> >> > >> > >> >
> >> >> > >> > >> >
> >> >> > >> > >> > --
> >> >> > >> > >> >
> >> >> > >> > >> > *MembPhis*
> >> >> > >> > >> > My GitHub: https://github.com/membphis
> >> >> > >> > >> > Apache APISIX: https://github.com/apache/apisix
> >> >> > >> > >> >
> >> >> > >> > >>
> >> >> > >> > >
> >> >> > >> > >
> >> >> > >> > >--
> >> >> > >> > >
> >> >> > >> > >*MembPhis*
> >> >> > >> > >My GitHub: https://github.com/membphis
> >> >> > >> > >Apache APISIX: https://github.com/apache/apisix
> >> >> > >> >
> >> >> > >>
> >> >> >
> >> >>
> >> >>
> >> >> --
> >> >>
> >> >> *MembPhis*
> >> >> My GitHub: https://github.com/membphis
> >> >> Apache APISIX: https://github.com/apache/apisix
> >> >>
> >>
>


-- 

*MembPhis*
My GitHub: https://github.com/membphis
Apache APISIX: https://github.com/apache/apisix

Re:Re: Discuss: Add a new API to get plugin information

Posted by 刘曦冉 <be...@126.com>.
I think so, too ^-^, for currently `GET /apisix/admin/plugins` only return plugin names list, and as we want to keep the original api the same

在 2020-12-07 19:24:46,"Zhiyuan Ju" <ju...@apache.org> 写道:
>OK for me, and it's default value should be false IMO?
>
>刘曦冉 <be...@126.com> 于 2020年12月7日周一 下午1:23写道:
>
>> Hi  Community:For the name of the API, zexuan recommended `
>> /apisix/admin/plugins?all=true`, because
>> > The definition of `plugin attributes` is taken too.
>>
>>
>> it is fine for me and what do you think?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> At 2020-12-01 11:18:37, "Zexuan Luo" <sp...@apache.org> wrote:
>> >The definition of `plugin attributes` is taken too, see
>> >
>> https://github.com/apache/apisix/blob/9dfe697b644691509b55cd7ec58188b33dd3e792/conf/config-default.yaml#L245
>> >
>> >What about using ` /apisix/admin/plugins?all=true`?
>> >
>> >BTW, it would be better if we can avoid the verb in the REST API, to make
>> >it less like RPC.
>> >If the verb is inevitable, put it in the last part, like this:
>> >/apisix/admin/plugins:list?all=true.
>> >Therefore we can avoid conflict when we need to introduce
>> >/apisix/admin/plugin/<plugin_name> API.
>> >
>> >YuanSheng Wang <me...@apache.org> 于2020年12月1日周二 上午10:38写道:
>> >
>> >> I think this is fine for us.
>> >>
>> >> API: */apisix/admin/plugins/list_with_attributes*
>> >> Desc: return all the attributes of the plugin.
>> >>
>> >> Return value:
>> >>
>> >> ```json
>> >> [
>> >>   {
>> >>     "name": "key-auth",
>> >>     "type":  "auth",
>> >>     "schema": {
>> >>      ....
>> >>     }
>> >>     ...other plugin meta_data
>> >>   },
>> >>  {
>> >>    ...
>> >>  }
>> >> ]
>> >> ```
>> >>
>> >>
>> >> On Tue, Dec 1, 2020 at 10:36 AM 刘曦冉 <be...@126.com> wrote:
>> >>
>> >> >
>> >> >
>> >> >
>> >> > Thanks  for zexuan‘s  explanation which answered my question.
>> >> > as for the name of the new api,
>> >> > > How about this name?
>> >> > /apisix/admin/plugins/list_all
>> >> >
>> >> >
>> >> > agree, for 2.x is a good compromise.
>> >> > we can add a TODO here, when we do a big version upgrade, we could
>> >> > consider to  uses `/plugins` and query params to get all plugin
>> >> information
>> >> > and  specific plugin information.
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > 在 2020-12-01 09:18:19,"Zexuan Luo" <sp...@apache.org> 写道:
>> >> > >> plugin metadata includes
>> >> > >name, version, type, priority, which is common to all plugins, and is
>> >> used
>> >> > >to describe the nature of the plugin
>> >> > >
>> >> > >The terminology of  'plugin metadata' is already taken by plugin
>> level
>> >> > >configuration. We should avoid redefinition of 'plugin metadata' and
>> >> > define
>> >> > >a new name for plugin info
>> >> > >
>> >> > >王三 <tz...@gmail.com> 于2020年11月30日周一 下午10:20写道:
>> >> > >
>> >> > >> I think metadata and schema are parallel things, plugin metadata
>> >> > includes
>> >> > >> name, version, type, priority, which is common to all plugins, and
>> is
>> >> > used
>> >> > >> to describe the nature of the plugin.
>> >> > >> The schema and consumer_schema are the plugin's schema, which
>> defines
>> >> > the
>> >> > >> configuration parameters for generating a plugin instance.
>> >> > >>
>> >> > >> Perhaps the above perception is slightly radical.
>> >> > >> I prefer to think of the schema and consumer_schema as part of the
>> >> > plugin‘s
>> >> > >> metadata, except that some plugins have a null consumer_schema.
>> >> > >>
>> >> > >> 刘曦冉 <be...@126.com> 于2020年11月30日周一 下午10:00写道:
>> >> > >>
>> >> > >> >
>> >> > >> >
>> >> > >> >
>> >> > >> > There are a few questions I'd like to confirm:
>> >> > >> > 1、Is meta data only a part of plugin's information?
>> >> > >> > 2、In v2.0, Manager-api and Admin-api are independent of each
>> other,
>> >> > >> > right?  After checking, the exist API listed by membphis are
>> >> > admin-apis,
>> >> > >> > and currently there are two exist APIs in manger-api
>> >> > >> > `GET /apisix/admin/plugins` to get plugin names list
>> >> > >> > `GET /apisix/admin/schema/plugins/{plugin_name}` to get specific
>> >> > plugin's
>> >> > >> > schema
>> >> > >> >
>> >> > >> > 在 2020-11-30 20:30:27,"YuanSheng Wang" <me...@apache.org> 写道:
>> >> > >> > >exist API list:
>> >> > >> > > /apisix/admin/plugins/list
>> >> > >> > > /apisix/admin/plugins/reload
>> >> > >> > > /apisix/admin/plugins/{plugin_name}
>> >> > >> > > /apisix/admin/plugin_metadata/{plugin_name}
>> >> > >> > >
>> >> > >> > >How about this name?
>> >> > >> > > /apisix/admin/plugins/list_all
>> >> > >> > >
>> >> > >> > >
>> >> > >> > >On Mon, Nov 30, 2020 at 7:43 PM Zexuan Luo <
>> spacewander@apache.org
>> >> >
>> >> > >> > wrote:
>> >> > >> > >
>> >> > >> > >> We already have API for plugin_metadata and it is not related
>> to
>> >> > the
>> >> > >> > plugin
>> >> > >> > >> information. I am afraid there will be some confusion.
>> >> > >> > >>
>> >> > >> > >> YuanSheng Wang <me...@apache.org> 于2020年11月30日周一 下午6:26写道:
>> >> > >> > >>
>> >> > >> > >> > The idea is very good.
>> >> > >> > >> > The response data format is fine to me too.
>> >> > >> > >> >
>> >> > >> > >> > Just small changing(not important):
>> >> > >> > >> > `GET /apisix/admin/plugins/meta_data`
>> >> > >> > >> > change to
>> >> > >> > >> > `GET /apisix/admin/plugins/metadata`
>> >> > >> > >> >
>> >> > >> > >> >
>> >> > >> > >> > On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <be...@126.com>
>> >> wrote:
>> >> > >> > >> >
>> >> > >> > >> > > Hi  Community:
>> >> > >> > >> > >
>> >> > >> > >> > >
>> >> > >> > >> > >
>> >> > >> > >> > > This discussion originates from issue:
>> >> > >> > >> > > https://github.com/apache/apisix-dashboard/issues/529
>> >> > >> > >> > >
>> >> > >> > >> > >
>> >> > >> > >> > > Background
>> >> > >> > >> > > Dashboard wants to optimize the UE of config the plugins.
>> For
>> >> > the
>> >> > >> > >> plugins
>> >> > >> > >> > > such as `key-auth` `prometheus` etc. user only need to
>> >> > >> > enable/disable
>> >> > >> > >> > them
>> >> > >> > >> > > in route or service without any configurations. so it
>> would
>> >> be
>> >> > >> > better
>> >> > >> > >> > that
>> >> > >> > >> > > only show switch for these plugins.
>> >> > >> > >> > > When rendering the plugin page, the FE needs to know not
>> only
>> >> > the
>> >> > >> > name
>> >> > >> > >> of
>> >> > >> > >> > > the plugins(which have already been returned by `GET
>> >> > >> > >> > > /apisix/admin/plugins`), but also need to know the
>> plugins'
>> >> > schema
>> >> > >> > >> which
>> >> > >> > >> > is
>> >> > >> > >> > > used to judge whether the plugin needs to be config
>> >> > >> > >> > > Solution
>> >> > >> > >> > > Refer to
>> >> > >> > >> > >
>> >> > >> > >> >
>> >> > >> > >>
>> >> > >> >
>> >> > >>
>> >> >
>> >>
>> https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857
>> >> > >> > >> > > It would be better to create a new API in manger-api,
>> which
>> >> is
>> >> > >> used
>> >> > >> > to
>> >> > >> > >> > > return all the information of the plugins, the ideal data
>> >> > >> structure
>> >> > >> > is
>> >> > >> > >> as
>> >> > >> > >> > > follows:
>> >> > >> > >> > > ```json
>> >> > >> > >> > > [
>> >> > >> > >> > >   {
>> >> > >> > >> > >     "name": "key-auth",
>> >> > >> > >> > >     "type":  "auth",
>> >> > >> > >> > >     "schema": {
>> >> > >> > >> > >      ....
>> >> > >> > >> > >     }
>> >> > >> > >> > >     ...other plugin meta_data
>> >> > >> > >> > >   },
>> >> > >> > >> > >  {
>> >> > >> > >> > >    ...
>> >> > >> > >> > >  }
>> >> > >> > >> > > ]
>> >> > >> > >> > > ```
>> >> > >> > >> > > And for the API name
>> >> > >> > >> > > Just follow the current convention:as `GET
>> >> > /apisix/admin/plugins`
>> >> > >> > has
>> >> > >> > >> > > already in use for get all plugins names list, so the new
>> >> name
>> >> > >> > would be
>> >> > >> > >> > > `GET /apisix/admin/plugins/meta_data`  to get all plugins
>> >> > >> > informations
>> >> > >> > >> > list.
>> >> > >> > >> > > When we have a large version change: for a better Reatful
>> >> way,
>> >> > I
>> >> > >> > perfer
>> >> > >> > >> > > this way:
>> >> > >> > >> > >
>> >> > >> > >> >
>> >> > >> > >>
>> >> > >> >
>> >> > >>
>> >> >
>> >>
>> https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561
>> >> > >> > >> > > the name would be  `GET /api/version/plugins`
>> >> > >> > >> > >
>> >> > >> > >> > >
>> >> > >> > >> > > What do you think? Looking forward to your comments and
>> >> > >> suggestions.
>> >> > >> > >> > > Thanks~!
>> >> > >> > >> > >
>> >> > >> > >> > >
>> >> > >> > >> > > Best wishes
>> >> > >> > >> > > Liuxiran
>> >> > >> > >> >
>> >> > >> > >> >
>> >> > >> > >> >
>> >> > >> > >> > --
>> >> > >> > >> >
>> >> > >> > >> > *MembPhis*
>> >> > >> > >> > My GitHub: https://github.com/membphis
>> >> > >> > >> > Apache APISIX: https://github.com/apache/apisix
>> >> > >> > >> >
>> >> > >> > >>
>> >> > >> > >
>> >> > >> > >
>> >> > >> > >--
>> >> > >> > >
>> >> > >> > >*MembPhis*
>> >> > >> > >My GitHub: https://github.com/membphis
>> >> > >> > >Apache APISIX: https://github.com/apache/apisix
>> >> > >> >
>> >> > >>
>> >> >
>> >>
>> >>
>> >> --
>> >>
>> >> *MembPhis*
>> >> My GitHub: https://github.com/membphis
>> >> Apache APISIX: https://github.com/apache/apisix
>> >>
>>

Re: Discuss: Add a new API to get plugin information

Posted by Zhiyuan Ju <ju...@apache.org>.
OK for me, and it's default value should be false IMO?

刘曦冉 <be...@126.com> 于 2020年12月7日周一 下午1:23写道:

> Hi  Community:For the name of the API, zexuan recommended `
> /apisix/admin/plugins?all=true`, because
> > The definition of `plugin attributes` is taken too.
>
>
> it is fine for me and what do you think?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> At 2020-12-01 11:18:37, "Zexuan Luo" <sp...@apache.org> wrote:
> >The definition of `plugin attributes` is taken too, see
> >
> https://github.com/apache/apisix/blob/9dfe697b644691509b55cd7ec58188b33dd3e792/conf/config-default.yaml#L245
> >
> >What about using ` /apisix/admin/plugins?all=true`?
> >
> >BTW, it would be better if we can avoid the verb in the REST API, to make
> >it less like RPC.
> >If the verb is inevitable, put it in the last part, like this:
> >/apisix/admin/plugins:list?all=true.
> >Therefore we can avoid conflict when we need to introduce
> >/apisix/admin/plugin/<plugin_name> API.
> >
> >YuanSheng Wang <me...@apache.org> 于2020年12月1日周二 上午10:38写道:
> >
> >> I think this is fine for us.
> >>
> >> API: */apisix/admin/plugins/list_with_attributes*
> >> Desc: return all the attributes of the plugin.
> >>
> >> Return value:
> >>
> >> ```json
> >> [
> >>   {
> >>     "name": "key-auth",
> >>     "type":  "auth",
> >>     "schema": {
> >>      ....
> >>     }
> >>     ...other plugin meta_data
> >>   },
> >>  {
> >>    ...
> >>  }
> >> ]
> >> ```
> >>
> >>
> >> On Tue, Dec 1, 2020 at 10:36 AM 刘曦冉 <be...@126.com> wrote:
> >>
> >> >
> >> >
> >> >
> >> > Thanks  for zexuan‘s  explanation which answered my question.
> >> > as for the name of the new api,
> >> > > How about this name?
> >> > /apisix/admin/plugins/list_all
> >> >
> >> >
> >> > agree, for 2.x is a good compromise.
> >> > we can add a TODO here, when we do a big version upgrade, we could
> >> > consider to  uses `/plugins` and query params to get all plugin
> >> information
> >> > and  specific plugin information.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > 在 2020-12-01 09:18:19,"Zexuan Luo" <sp...@apache.org> 写道:
> >> > >> plugin metadata includes
> >> > >name, version, type, priority, which is common to all plugins, and is
> >> used
> >> > >to describe the nature of the plugin
> >> > >
> >> > >The terminology of  'plugin metadata' is already taken by plugin
> level
> >> > >configuration. We should avoid redefinition of 'plugin metadata' and
> >> > define
> >> > >a new name for plugin info
> >> > >
> >> > >王三 <tz...@gmail.com> 于2020年11月30日周一 下午10:20写道:
> >> > >
> >> > >> I think metadata and schema are parallel things, plugin metadata
> >> > includes
> >> > >> name, version, type, priority, which is common to all plugins, and
> is
> >> > used
> >> > >> to describe the nature of the plugin.
> >> > >> The schema and consumer_schema are the plugin's schema, which
> defines
> >> > the
> >> > >> configuration parameters for generating a plugin instance.
> >> > >>
> >> > >> Perhaps the above perception is slightly radical.
> >> > >> I prefer to think of the schema and consumer_schema as part of the
> >> > plugin‘s
> >> > >> metadata, except that some plugins have a null consumer_schema.
> >> > >>
> >> > >> 刘曦冉 <be...@126.com> 于2020年11月30日周一 下午10:00写道:
> >> > >>
> >> > >> >
> >> > >> >
> >> > >> >
> >> > >> > There are a few questions I'd like to confirm:
> >> > >> > 1、Is meta data only a part of plugin's information?
> >> > >> > 2、In v2.0, Manager-api and Admin-api are independent of each
> other,
> >> > >> > right?  After checking, the exist API listed by membphis are
> >> > admin-apis,
> >> > >> > and currently there are two exist APIs in manger-api
> >> > >> > `GET /apisix/admin/plugins` to get plugin names list
> >> > >> > `GET /apisix/admin/schema/plugins/{plugin_name}` to get specific
> >> > plugin's
> >> > >> > schema
> >> > >> >
> >> > >> > 在 2020-11-30 20:30:27,"YuanSheng Wang" <me...@apache.org> 写道:
> >> > >> > >exist API list:
> >> > >> > > /apisix/admin/plugins/list
> >> > >> > > /apisix/admin/plugins/reload
> >> > >> > > /apisix/admin/plugins/{plugin_name}
> >> > >> > > /apisix/admin/plugin_metadata/{plugin_name}
> >> > >> > >
> >> > >> > >How about this name?
> >> > >> > > /apisix/admin/plugins/list_all
> >> > >> > >
> >> > >> > >
> >> > >> > >On Mon, Nov 30, 2020 at 7:43 PM Zexuan Luo <
> spacewander@apache.org
> >> >
> >> > >> > wrote:
> >> > >> > >
> >> > >> > >> We already have API for plugin_metadata and it is not related
> to
> >> > the
> >> > >> > plugin
> >> > >> > >> information. I am afraid there will be some confusion.
> >> > >> > >>
> >> > >> > >> YuanSheng Wang <me...@apache.org> 于2020年11月30日周一 下午6:26写道:
> >> > >> > >>
> >> > >> > >> > The idea is very good.
> >> > >> > >> > The response data format is fine to me too.
> >> > >> > >> >
> >> > >> > >> > Just small changing(not important):
> >> > >> > >> > `GET /apisix/admin/plugins/meta_data`
> >> > >> > >> > change to
> >> > >> > >> > `GET /apisix/admin/plugins/metadata`
> >> > >> > >> >
> >> > >> > >> >
> >> > >> > >> > On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <be...@126.com>
> >> wrote:
> >> > >> > >> >
> >> > >> > >> > > Hi  Community:
> >> > >> > >> > >
> >> > >> > >> > >
> >> > >> > >> > >
> >> > >> > >> > > This discussion originates from issue:
> >> > >> > >> > > https://github.com/apache/apisix-dashboard/issues/529
> >> > >> > >> > >
> >> > >> > >> > >
> >> > >> > >> > > Background
> >> > >> > >> > > Dashboard wants to optimize the UE of config the plugins.
> For
> >> > the
> >> > >> > >> plugins
> >> > >> > >> > > such as `key-auth` `prometheus` etc. user only need to
> >> > >> > enable/disable
> >> > >> > >> > them
> >> > >> > >> > > in route or service without any configurations. so it
> would
> >> be
> >> > >> > better
> >> > >> > >> > that
> >> > >> > >> > > only show switch for these plugins.
> >> > >> > >> > > When rendering the plugin page, the FE needs to know not
> only
> >> > the
> >> > >> > name
> >> > >> > >> of
> >> > >> > >> > > the plugins(which have already been returned by `GET
> >> > >> > >> > > /apisix/admin/plugins`), but also need to know the
> plugins'
> >> > schema
> >> > >> > >> which
> >> > >> > >> > is
> >> > >> > >> > > used to judge whether the plugin needs to be config
> >> > >> > >> > > Solution
> >> > >> > >> > > Refer to
> >> > >> > >> > >
> >> > >> > >> >
> >> > >> > >>
> >> > >> >
> >> > >>
> >> >
> >>
> https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857
> >> > >> > >> > > It would be better to create a new API in manger-api,
> which
> >> is
> >> > >> used
> >> > >> > to
> >> > >> > >> > > return all the information of the plugins, the ideal data
> >> > >> structure
> >> > >> > is
> >> > >> > >> as
> >> > >> > >> > > follows:
> >> > >> > >> > > ```json
> >> > >> > >> > > [
> >> > >> > >> > >   {
> >> > >> > >> > >     "name": "key-auth",
> >> > >> > >> > >     "type":  "auth",
> >> > >> > >> > >     "schema": {
> >> > >> > >> > >      ....
> >> > >> > >> > >     }
> >> > >> > >> > >     ...other plugin meta_data
> >> > >> > >> > >   },
> >> > >> > >> > >  {
> >> > >> > >> > >    ...
> >> > >> > >> > >  }
> >> > >> > >> > > ]
> >> > >> > >> > > ```
> >> > >> > >> > > And for the API name
> >> > >> > >> > > Just follow the current convention:as `GET
> >> > /apisix/admin/plugins`
> >> > >> > has
> >> > >> > >> > > already in use for get all plugins names list, so the new
> >> name
> >> > >> > would be
> >> > >> > >> > > `GET /apisix/admin/plugins/meta_data`  to get all plugins
> >> > >> > informations
> >> > >> > >> > list.
> >> > >> > >> > > When we have a large version change: for a better Reatful
> >> way,
> >> > I
> >> > >> > perfer
> >> > >> > >> > > this way:
> >> > >> > >> > >
> >> > >> > >> >
> >> > >> > >>
> >> > >> >
> >> > >>
> >> >
> >>
> https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561
> >> > >> > >> > > the name would be  `GET /api/version/plugins`
> >> > >> > >> > >
> >> > >> > >> > >
> >> > >> > >> > > What do you think? Looking forward to your comments and
> >> > >> suggestions.
> >> > >> > >> > > Thanks~!
> >> > >> > >> > >
> >> > >> > >> > >
> >> > >> > >> > > Best wishes
> >> > >> > >> > > Liuxiran
> >> > >> > >> >
> >> > >> > >> >
> >> > >> > >> >
> >> > >> > >> > --
> >> > >> > >> >
> >> > >> > >> > *MembPhis*
> >> > >> > >> > My GitHub: https://github.com/membphis
> >> > >> > >> > Apache APISIX: https://github.com/apache/apisix
> >> > >> > >> >
> >> > >> > >>
> >> > >> > >
> >> > >> > >
> >> > >> > >--
> >> > >> > >
> >> > >> > >*MembPhis*
> >> > >> > >My GitHub: https://github.com/membphis
> >> > >> > >Apache APISIX: https://github.com/apache/apisix
> >> > >> >
> >> > >>
> >> >
> >>
> >>
> >> --
> >>
> >> *MembPhis*
> >> My GitHub: https://github.com/membphis
> >> Apache APISIX: https://github.com/apache/apisix
> >>
>

Re:Discuss: Add a new API to get plugin information

Posted by 刘曦冉 <be...@126.com>.
Hi  Community:For the name of the API, zexuan recommended ` /apisix/admin/plugins?all=true`, because
> The definition of `plugin attributes` is taken too.


it is fine for me and what do you think?

















At 2020-12-01 11:18:37, "Zexuan Luo" <sp...@apache.org> wrote:
>The definition of `plugin attributes` is taken too, see
>https://github.com/apache/apisix/blob/9dfe697b644691509b55cd7ec58188b33dd3e792/conf/config-default.yaml#L245
>
>What about using ` /apisix/admin/plugins?all=true`?
>
>BTW, it would be better if we can avoid the verb in the REST API, to make
>it less like RPC.
>If the verb is inevitable, put it in the last part, like this:
>/apisix/admin/plugins:list?all=true.
>Therefore we can avoid conflict when we need to introduce
>/apisix/admin/plugin/<plugin_name> API.
>
>YuanSheng Wang <me...@apache.org> 于2020年12月1日周二 上午10:38写道:
>
>> I think this is fine for us.
>>
>> API: */apisix/admin/plugins/list_with_attributes*
>> Desc: return all the attributes of the plugin.
>>
>> Return value:
>>
>> ```json
>> [
>>   {
>>     "name": "key-auth",
>>     "type":  "auth",
>>     "schema": {
>>      ....
>>     }
>>     ...other plugin meta_data
>>   },
>>  {
>>    ...
>>  }
>> ]
>> ```
>>
>>
>> On Tue, Dec 1, 2020 at 10:36 AM 刘曦冉 <be...@126.com> wrote:
>>
>> >
>> >
>> >
>> > Thanks  for zexuan‘s  explanation which answered my question.
>> > as for the name of the new api,
>> > > How about this name?
>> > /apisix/admin/plugins/list_all
>> >
>> >
>> > agree, for 2.x is a good compromise.
>> > we can add a TODO here, when we do a big version upgrade, we could
>> > consider to  uses `/plugins` and query params to get all plugin
>> information
>> > and  specific plugin information.
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > 在 2020-12-01 09:18:19,"Zexuan Luo" <sp...@apache.org> 写道:
>> > >> plugin metadata includes
>> > >name, version, type, priority, which is common to all plugins, and is
>> used
>> > >to describe the nature of the plugin
>> > >
>> > >The terminology of  'plugin metadata' is already taken by plugin level
>> > >configuration. We should avoid redefinition of 'plugin metadata' and
>> > define
>> > >a new name for plugin info
>> > >
>> > >王三 <tz...@gmail.com> 于2020年11月30日周一 下午10:20写道:
>> > >
>> > >> I think metadata and schema are parallel things, plugin metadata
>> > includes
>> > >> name, version, type, priority, which is common to all plugins, and is
>> > used
>> > >> to describe the nature of the plugin.
>> > >> The schema and consumer_schema are the plugin's schema, which defines
>> > the
>> > >> configuration parameters for generating a plugin instance.
>> > >>
>> > >> Perhaps the above perception is slightly radical.
>> > >> I prefer to think of the schema and consumer_schema as part of the
>> > plugin‘s
>> > >> metadata, except that some plugins have a null consumer_schema.
>> > >>
>> > >> 刘曦冉 <be...@126.com> 于2020年11月30日周一 下午10:00写道:
>> > >>
>> > >> >
>> > >> >
>> > >> >
>> > >> > There are a few questions I'd like to confirm:
>> > >> > 1、Is meta data only a part of plugin's information?
>> > >> > 2、In v2.0, Manager-api and Admin-api are independent of each other,
>> > >> > right?  After checking, the exist API listed by membphis are
>> > admin-apis,
>> > >> > and currently there are two exist APIs in manger-api
>> > >> > `GET /apisix/admin/plugins` to get plugin names list
>> > >> > `GET /apisix/admin/schema/plugins/{plugin_name}` to get specific
>> > plugin's
>> > >> > schema
>> > >> >
>> > >> > 在 2020-11-30 20:30:27,"YuanSheng Wang" <me...@apache.org> 写道:
>> > >> > >exist API list:
>> > >> > > /apisix/admin/plugins/list
>> > >> > > /apisix/admin/plugins/reload
>> > >> > > /apisix/admin/plugins/{plugin_name}
>> > >> > > /apisix/admin/plugin_metadata/{plugin_name}
>> > >> > >
>> > >> > >How about this name?
>> > >> > > /apisix/admin/plugins/list_all
>> > >> > >
>> > >> > >
>> > >> > >On Mon, Nov 30, 2020 at 7:43 PM Zexuan Luo <spacewander@apache.org
>> >
>> > >> > wrote:
>> > >> > >
>> > >> > >> We already have API for plugin_metadata and it is not related to
>> > the
>> > >> > plugin
>> > >> > >> information. I am afraid there will be some confusion.
>> > >> > >>
>> > >> > >> YuanSheng Wang <me...@apache.org> 于2020年11月30日周一 下午6:26写道:
>> > >> > >>
>> > >> > >> > The idea is very good.
>> > >> > >> > The response data format is fine to me too.
>> > >> > >> >
>> > >> > >> > Just small changing(not important):
>> > >> > >> > `GET /apisix/admin/plugins/meta_data`
>> > >> > >> > change to
>> > >> > >> > `GET /apisix/admin/plugins/metadata`
>> > >> > >> >
>> > >> > >> >
>> > >> > >> > On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <be...@126.com>
>> wrote:
>> > >> > >> >
>> > >> > >> > > Hi  Community:
>> > >> > >> > >
>> > >> > >> > >
>> > >> > >> > >
>> > >> > >> > > This discussion originates from issue:
>> > >> > >> > > https://github.com/apache/apisix-dashboard/issues/529
>> > >> > >> > >
>> > >> > >> > >
>> > >> > >> > > Background
>> > >> > >> > > Dashboard wants to optimize the UE of config the plugins. For
>> > the
>> > >> > >> plugins
>> > >> > >> > > such as `key-auth` `prometheus` etc. user only need to
>> > >> > enable/disable
>> > >> > >> > them
>> > >> > >> > > in route or service without any configurations. so it would
>> be
>> > >> > better
>> > >> > >> > that
>> > >> > >> > > only show switch for these plugins.
>> > >> > >> > > When rendering the plugin page, the FE needs to know not only
>> > the
>> > >> > name
>> > >> > >> of
>> > >> > >> > > the plugins(which have already been returned by `GET
>> > >> > >> > > /apisix/admin/plugins`), but also need to know the plugins'
>> > schema
>> > >> > >> which
>> > >> > >> > is
>> > >> > >> > > used to judge whether the plugin needs to be config
>> > >> > >> > > Solution
>> > >> > >> > > Refer to
>> > >> > >> > >
>> > >> > >> >
>> > >> > >>
>> > >> >
>> > >>
>> >
>> https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857
>> > >> > >> > > It would be better to create a new API in manger-api, which
>> is
>> > >> used
>> > >> > to
>> > >> > >> > > return all the information of the plugins, the ideal data
>> > >> structure
>> > >> > is
>> > >> > >> as
>> > >> > >> > > follows:
>> > >> > >> > > ```json
>> > >> > >> > > [
>> > >> > >> > >   {
>> > >> > >> > >     "name": "key-auth",
>> > >> > >> > >     "type":  "auth",
>> > >> > >> > >     "schema": {
>> > >> > >> > >      ....
>> > >> > >> > >     }
>> > >> > >> > >     ...other plugin meta_data
>> > >> > >> > >   },
>> > >> > >> > >  {
>> > >> > >> > >    ...
>> > >> > >> > >  }
>> > >> > >> > > ]
>> > >> > >> > > ```
>> > >> > >> > > And for the API name
>> > >> > >> > > Just follow the current convention:as `GET
>> > /apisix/admin/plugins`
>> > >> > has
>> > >> > >> > > already in use for get all plugins names list, so the new
>> name
>> > >> > would be
>> > >> > >> > > `GET /apisix/admin/plugins/meta_data`  to get all plugins
>> > >> > informations
>> > >> > >> > list.
>> > >> > >> > > When we have a large version change: for a better Reatful
>> way,
>> > I
>> > >> > perfer
>> > >> > >> > > this way:
>> > >> > >> > >
>> > >> > >> >
>> > >> > >>
>> > >> >
>> > >>
>> >
>> https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561
>> > >> > >> > > the name would be  `GET /api/version/plugins`
>> > >> > >> > >
>> > >> > >> > >
>> > >> > >> > > What do you think? Looking forward to your comments and
>> > >> suggestions.
>> > >> > >> > > Thanks~!
>> > >> > >> > >
>> > >> > >> > >
>> > >> > >> > > Best wishes
>> > >> > >> > > Liuxiran
>> > >> > >> >
>> > >> > >> >
>> > >> > >> >
>> > >> > >> > --
>> > >> > >> >
>> > >> > >> > *MembPhis*
>> > >> > >> > My GitHub: https://github.com/membphis
>> > >> > >> > Apache APISIX: https://github.com/apache/apisix
>> > >> > >> >
>> > >> > >>
>> > >> > >
>> > >> > >
>> > >> > >--
>> > >> > >
>> > >> > >*MembPhis*
>> > >> > >My GitHub: https://github.com/membphis
>> > >> > >Apache APISIX: https://github.com/apache/apisix
>> > >> >
>> > >>
>> >
>>
>>
>> --
>>
>> *MembPhis*
>> My GitHub: https://github.com/membphis
>> Apache APISIX: https://github.com/apache/apisix
>>

Re: Discuss: Add a new API to get plugin information

Posted by Zexuan Luo <sp...@apache.org>.
The definition of `plugin attributes` is taken too, see
https://github.com/apache/apisix/blob/9dfe697b644691509b55cd7ec58188b33dd3e792/conf/config-default.yaml#L245

What about using ` /apisix/admin/plugins?all=true`?

BTW, it would be better if we can avoid the verb in the REST API, to make
it less like RPC.
If the verb is inevitable, put it in the last part, like this:
/apisix/admin/plugins:list?all=true.
Therefore we can avoid conflict when we need to introduce
/apisix/admin/plugin/<plugin_name> API.

YuanSheng Wang <me...@apache.org> 于2020年12月1日周二 上午10:38写道:

> I think this is fine for us.
>
> API: */apisix/admin/plugins/list_with_attributes*
> Desc: return all the attributes of the plugin.
>
> Return value:
>
> ```json
> [
>   {
>     "name": "key-auth",
>     "type":  "auth",
>     "schema": {
>      ....
>     }
>     ...other plugin meta_data
>   },
>  {
>    ...
>  }
> ]
> ```
>
>
> On Tue, Dec 1, 2020 at 10:36 AM 刘曦冉 <be...@126.com> wrote:
>
> >
> >
> >
> > Thanks  for zexuan‘s  explanation which answered my question.
> > as for the name of the new api,
> > > How about this name?
> > /apisix/admin/plugins/list_all
> >
> >
> > agree, for 2.x is a good compromise.
> > we can add a TODO here, when we do a big version upgrade, we could
> > consider to  uses `/plugins` and query params to get all plugin
> information
> > and  specific plugin information.
> >
> >
> >
> >
> >
> >
> >
> >
> > 在 2020-12-01 09:18:19,"Zexuan Luo" <sp...@apache.org> 写道:
> > >> plugin metadata includes
> > >name, version, type, priority, which is common to all plugins, and is
> used
> > >to describe the nature of the plugin
> > >
> > >The terminology of  'plugin metadata' is already taken by plugin level
> > >configuration. We should avoid redefinition of 'plugin metadata' and
> > define
> > >a new name for plugin info
> > >
> > >王三 <tz...@gmail.com> 于2020年11月30日周一 下午10:20写道:
> > >
> > >> I think metadata and schema are parallel things, plugin metadata
> > includes
> > >> name, version, type, priority, which is common to all plugins, and is
> > used
> > >> to describe the nature of the plugin.
> > >> The schema and consumer_schema are the plugin's schema, which defines
> > the
> > >> configuration parameters for generating a plugin instance.
> > >>
> > >> Perhaps the above perception is slightly radical.
> > >> I prefer to think of the schema and consumer_schema as part of the
> > plugin‘s
> > >> metadata, except that some plugins have a null consumer_schema.
> > >>
> > >> 刘曦冉 <be...@126.com> 于2020年11月30日周一 下午10:00写道:
> > >>
> > >> >
> > >> >
> > >> >
> > >> > There are a few questions I'd like to confirm:
> > >> > 1、Is meta data only a part of plugin's information?
> > >> > 2、In v2.0, Manager-api and Admin-api are independent of each other,
> > >> > right?  After checking, the exist API listed by membphis are
> > admin-apis,
> > >> > and currently there are two exist APIs in manger-api
> > >> > `GET /apisix/admin/plugins` to get plugin names list
> > >> > `GET /apisix/admin/schema/plugins/{plugin_name}` to get specific
> > plugin's
> > >> > schema
> > >> >
> > >> > 在 2020-11-30 20:30:27,"YuanSheng Wang" <me...@apache.org> 写道:
> > >> > >exist API list:
> > >> > > /apisix/admin/plugins/list
> > >> > > /apisix/admin/plugins/reload
> > >> > > /apisix/admin/plugins/{plugin_name}
> > >> > > /apisix/admin/plugin_metadata/{plugin_name}
> > >> > >
> > >> > >How about this name?
> > >> > > /apisix/admin/plugins/list_all
> > >> > >
> > >> > >
> > >> > >On Mon, Nov 30, 2020 at 7:43 PM Zexuan Luo <spacewander@apache.org
> >
> > >> > wrote:
> > >> > >
> > >> > >> We already have API for plugin_metadata and it is not related to
> > the
> > >> > plugin
> > >> > >> information. I am afraid there will be some confusion.
> > >> > >>
> > >> > >> YuanSheng Wang <me...@apache.org> 于2020年11月30日周一 下午6:26写道:
> > >> > >>
> > >> > >> > The idea is very good.
> > >> > >> > The response data format is fine to me too.
> > >> > >> >
> > >> > >> > Just small changing(not important):
> > >> > >> > `GET /apisix/admin/plugins/meta_data`
> > >> > >> > change to
> > >> > >> > `GET /apisix/admin/plugins/metadata`
> > >> > >> >
> > >> > >> >
> > >> > >> > On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <be...@126.com>
> wrote:
> > >> > >> >
> > >> > >> > > Hi  Community:
> > >> > >> > >
> > >> > >> > >
> > >> > >> > >
> > >> > >> > > This discussion originates from issue:
> > >> > >> > > https://github.com/apache/apisix-dashboard/issues/529
> > >> > >> > >
> > >> > >> > >
> > >> > >> > > Background
> > >> > >> > > Dashboard wants to optimize the UE of config the plugins. For
> > the
> > >> > >> plugins
> > >> > >> > > such as `key-auth` `prometheus` etc. user only need to
> > >> > enable/disable
> > >> > >> > them
> > >> > >> > > in route or service without any configurations. so it would
> be
> > >> > better
> > >> > >> > that
> > >> > >> > > only show switch for these plugins.
> > >> > >> > > When rendering the plugin page, the FE needs to know not only
> > the
> > >> > name
> > >> > >> of
> > >> > >> > > the plugins(which have already been returned by `GET
> > >> > >> > > /apisix/admin/plugins`), but also need to know the plugins'
> > schema
> > >> > >> which
> > >> > >> > is
> > >> > >> > > used to judge whether the plugin needs to be config
> > >> > >> > > Solution
> > >> > >> > > Refer to
> > >> > >> > >
> > >> > >> >
> > >> > >>
> > >> >
> > >>
> >
> https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857
> > >> > >> > > It would be better to create a new API in manger-api, which
> is
> > >> used
> > >> > to
> > >> > >> > > return all the information of the plugins, the ideal data
> > >> structure
> > >> > is
> > >> > >> as
> > >> > >> > > follows:
> > >> > >> > > ```json
> > >> > >> > > [
> > >> > >> > >   {
> > >> > >> > >     "name": "key-auth",
> > >> > >> > >     "type":  "auth",
> > >> > >> > >     "schema": {
> > >> > >> > >      ....
> > >> > >> > >     }
> > >> > >> > >     ...other plugin meta_data
> > >> > >> > >   },
> > >> > >> > >  {
> > >> > >> > >    ...
> > >> > >> > >  }
> > >> > >> > > ]
> > >> > >> > > ```
> > >> > >> > > And for the API name
> > >> > >> > > Just follow the current convention:as `GET
> > /apisix/admin/plugins`
> > >> > has
> > >> > >> > > already in use for get all plugins names list, so the new
> name
> > >> > would be
> > >> > >> > > `GET /apisix/admin/plugins/meta_data`  to get all plugins
> > >> > informations
> > >> > >> > list.
> > >> > >> > > When we have a large version change: for a better Reatful
> way,
> > I
> > >> > perfer
> > >> > >> > > this way:
> > >> > >> > >
> > >> > >> >
> > >> > >>
> > >> >
> > >>
> >
> https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561
> > >> > >> > > the name would be  `GET /api/version/plugins`
> > >> > >> > >
> > >> > >> > >
> > >> > >> > > What do you think? Looking forward to your comments and
> > >> suggestions.
> > >> > >> > > Thanks~!
> > >> > >> > >
> > >> > >> > >
> > >> > >> > > Best wishes
> > >> > >> > > Liuxiran
> > >> > >> >
> > >> > >> >
> > >> > >> >
> > >> > >> > --
> > >> > >> >
> > >> > >> > *MembPhis*
> > >> > >> > My GitHub: https://github.com/membphis
> > >> > >> > Apache APISIX: https://github.com/apache/apisix
> > >> > >> >
> > >> > >>
> > >> > >
> > >> > >
> > >> > >--
> > >> > >
> > >> > >*MembPhis*
> > >> > >My GitHub: https://github.com/membphis
> > >> > >Apache APISIX: https://github.com/apache/apisix
> > >> >
> > >>
> >
>
>
> --
>
> *MembPhis*
> My GitHub: https://github.com/membphis
> Apache APISIX: https://github.com/apache/apisix
>

Re: Discuss: Add a new API to get plugin information

Posted by YuanSheng Wang <me...@apache.org>.
I think this is fine for us.

API: */apisix/admin/plugins/list_with_attributes*
Desc: return all the attributes of the plugin.

Return value:

```json
[
  {
    "name": "key-auth",
    "type":  "auth",
    "schema": {
     ....
    }
    ...other plugin meta_data
  },
 {
   ...
 }
]
```


On Tue, Dec 1, 2020 at 10:36 AM 刘曦冉 <be...@126.com> wrote:

>
>
>
> Thanks  for zexuan‘s  explanation which answered my question.
> as for the name of the new api,
> > How about this name?
> /apisix/admin/plugins/list_all
>
>
> agree, for 2.x is a good compromise.
> we can add a TODO here, when we do a big version upgrade, we could
> consider to  uses `/plugins` and query params to get all plugin information
> and  specific plugin information.
>
>
>
>
>
>
>
>
> 在 2020-12-01 09:18:19,"Zexuan Luo" <sp...@apache.org> 写道:
> >> plugin metadata includes
> >name, version, type, priority, which is common to all plugins, and is used
> >to describe the nature of the plugin
> >
> >The terminology of  'plugin metadata' is already taken by plugin level
> >configuration. We should avoid redefinition of 'plugin metadata' and
> define
> >a new name for plugin info
> >
> >王三 <tz...@gmail.com> 于2020年11月30日周一 下午10:20写道:
> >
> >> I think metadata and schema are parallel things, plugin metadata
> includes
> >> name, version, type, priority, which is common to all plugins, and is
> used
> >> to describe the nature of the plugin.
> >> The schema and consumer_schema are the plugin's schema, which defines
> the
> >> configuration parameters for generating a plugin instance.
> >>
> >> Perhaps the above perception is slightly radical.
> >> I prefer to think of the schema and consumer_schema as part of the
> plugin‘s
> >> metadata, except that some plugins have a null consumer_schema.
> >>
> >> 刘曦冉 <be...@126.com> 于2020年11月30日周一 下午10:00写道:
> >>
> >> >
> >> >
> >> >
> >> > There are a few questions I'd like to confirm:
> >> > 1、Is meta data only a part of plugin's information?
> >> > 2、In v2.0, Manager-api and Admin-api are independent of each other,
> >> > right?  After checking, the exist API listed by membphis are
> admin-apis,
> >> > and currently there are two exist APIs in manger-api
> >> > `GET /apisix/admin/plugins` to get plugin names list
> >> > `GET /apisix/admin/schema/plugins/{plugin_name}` to get specific
> plugin's
> >> > schema
> >> >
> >> > 在 2020-11-30 20:30:27,"YuanSheng Wang" <me...@apache.org> 写道:
> >> > >exist API list:
> >> > > /apisix/admin/plugins/list
> >> > > /apisix/admin/plugins/reload
> >> > > /apisix/admin/plugins/{plugin_name}
> >> > > /apisix/admin/plugin_metadata/{plugin_name}
> >> > >
> >> > >How about this name?
> >> > > /apisix/admin/plugins/list_all
> >> > >
> >> > >
> >> > >On Mon, Nov 30, 2020 at 7:43 PM Zexuan Luo <sp...@apache.org>
> >> > wrote:
> >> > >
> >> > >> We already have API for plugin_metadata and it is not related to
> the
> >> > plugin
> >> > >> information. I am afraid there will be some confusion.
> >> > >>
> >> > >> YuanSheng Wang <me...@apache.org> 于2020年11月30日周一 下午6:26写道:
> >> > >>
> >> > >> > The idea is very good.
> >> > >> > The response data format is fine to me too.
> >> > >> >
> >> > >> > Just small changing(not important):
> >> > >> > `GET /apisix/admin/plugins/meta_data`
> >> > >> > change to
> >> > >> > `GET /apisix/admin/plugins/metadata`
> >> > >> >
> >> > >> >
> >> > >> > On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <be...@126.com> wrote:
> >> > >> >
> >> > >> > > Hi  Community:
> >> > >> > >
> >> > >> > >
> >> > >> > >
> >> > >> > > This discussion originates from issue:
> >> > >> > > https://github.com/apache/apisix-dashboard/issues/529
> >> > >> > >
> >> > >> > >
> >> > >> > > Background
> >> > >> > > Dashboard wants to optimize the UE of config the plugins. For
> the
> >> > >> plugins
> >> > >> > > such as `key-auth` `prometheus` etc. user only need to
> >> > enable/disable
> >> > >> > them
> >> > >> > > in route or service without any configurations. so it would be
> >> > better
> >> > >> > that
> >> > >> > > only show switch for these plugins.
> >> > >> > > When rendering the plugin page, the FE needs to know not only
> the
> >> > name
> >> > >> of
> >> > >> > > the plugins(which have already been returned by `GET
> >> > >> > > /apisix/admin/plugins`), but also need to know the plugins'
> schema
> >> > >> which
> >> > >> > is
> >> > >> > > used to judge whether the plugin needs to be config
> >> > >> > > Solution
> >> > >> > > Refer to
> >> > >> > >
> >> > >> >
> >> > >>
> >> >
> >>
> https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857
> >> > >> > > It would be better to create a new API in manger-api, which is
> >> used
> >> > to
> >> > >> > > return all the information of the plugins, the ideal data
> >> structure
> >> > is
> >> > >> as
> >> > >> > > follows:
> >> > >> > > ```json
> >> > >> > > [
> >> > >> > >   {
> >> > >> > >     "name": "key-auth",
> >> > >> > >     "type":  "auth",
> >> > >> > >     "schema": {
> >> > >> > >      ....
> >> > >> > >     }
> >> > >> > >     ...other plugin meta_data
> >> > >> > >   },
> >> > >> > >  {
> >> > >> > >    ...
> >> > >> > >  }
> >> > >> > > ]
> >> > >> > > ```
> >> > >> > > And for the API name
> >> > >> > > Just follow the current convention:as `GET
> /apisix/admin/plugins`
> >> > has
> >> > >> > > already in use for get all plugins names list, so the new name
> >> > would be
> >> > >> > > `GET /apisix/admin/plugins/meta_data`  to get all plugins
> >> > informations
> >> > >> > list.
> >> > >> > > When we have a large version change: for a better Reatful way,
> I
> >> > perfer
> >> > >> > > this way:
> >> > >> > >
> >> > >> >
> >> > >>
> >> >
> >>
> https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561
> >> > >> > > the name would be  `GET /api/version/plugins`
> >> > >> > >
> >> > >> > >
> >> > >> > > What do you think? Looking forward to your comments and
> >> suggestions.
> >> > >> > > Thanks~!
> >> > >> > >
> >> > >> > >
> >> > >> > > Best wishes
> >> > >> > > Liuxiran
> >> > >> >
> >> > >> >
> >> > >> >
> >> > >> > --
> >> > >> >
> >> > >> > *MembPhis*
> >> > >> > My GitHub: https://github.com/membphis
> >> > >> > Apache APISIX: https://github.com/apache/apisix
> >> > >> >
> >> > >>
> >> > >
> >> > >
> >> > >--
> >> > >
> >> > >*MembPhis*
> >> > >My GitHub: https://github.com/membphis
> >> > >Apache APISIX: https://github.com/apache/apisix
> >> >
> >>
>


-- 

*MembPhis*
My GitHub: https://github.com/membphis
Apache APISIX: https://github.com/apache/apisix

Re:Discuss: Add a new API to get plugin information

Posted by 刘曦冉 <be...@126.com>.


Thanks  for zexuan‘s  explanation which answered my question.
as for the name of the new api, 
> How about this name?
/apisix/admin/plugins/list_all


agree, for 2.x is a good compromise.
we can add a TODO here, when we do a big version upgrade, we could consider to  uses `/plugins` and query params to get all plugin information and  specific plugin information.








在 2020-12-01 09:18:19,"Zexuan Luo" <sp...@apache.org> 写道:
>> plugin metadata includes
>name, version, type, priority, which is common to all plugins, and is used
>to describe the nature of the plugin
>
>The terminology of  'plugin metadata' is already taken by plugin level
>configuration. We should avoid redefinition of 'plugin metadata' and define
>a new name for plugin info
>
>王三 <tz...@gmail.com> 于2020年11月30日周一 下午10:20写道:
>
>> I think metadata and schema are parallel things, plugin metadata includes
>> name, version, type, priority, which is common to all plugins, and is used
>> to describe the nature of the plugin.
>> The schema and consumer_schema are the plugin's schema, which defines the
>> configuration parameters for generating a plugin instance.
>>
>> Perhaps the above perception is slightly radical.
>> I prefer to think of the schema and consumer_schema as part of the plugin‘s
>> metadata, except that some plugins have a null consumer_schema.
>>
>> 刘曦冉 <be...@126.com> 于2020年11月30日周一 下午10:00写道:
>>
>> >
>> >
>> >
>> > There are a few questions I'd like to confirm:
>> > 1、Is meta data only a part of plugin's information?
>> > 2、In v2.0, Manager-api and Admin-api are independent of each other,
>> > right?  After checking, the exist API listed by membphis are admin-apis,
>> > and currently there are two exist APIs in manger-api
>> > `GET /apisix/admin/plugins` to get plugin names list
>> > `GET /apisix/admin/schema/plugins/{plugin_name}` to get specific plugin's
>> > schema
>> >
>> > 在 2020-11-30 20:30:27,"YuanSheng Wang" <me...@apache.org> 写道:
>> > >exist API list:
>> > > /apisix/admin/plugins/list
>> > > /apisix/admin/plugins/reload
>> > > /apisix/admin/plugins/{plugin_name}
>> > > /apisix/admin/plugin_metadata/{plugin_name}
>> > >
>> > >How about this name?
>> > > /apisix/admin/plugins/list_all
>> > >
>> > >
>> > >On Mon, Nov 30, 2020 at 7:43 PM Zexuan Luo <sp...@apache.org>
>> > wrote:
>> > >
>> > >> We already have API for plugin_metadata and it is not related to the
>> > plugin
>> > >> information. I am afraid there will be some confusion.
>> > >>
>> > >> YuanSheng Wang <me...@apache.org> 于2020年11月30日周一 下午6:26写道:
>> > >>
>> > >> > The idea is very good.
>> > >> > The response data format is fine to me too.
>> > >> >
>> > >> > Just small changing(not important):
>> > >> > `GET /apisix/admin/plugins/meta_data`
>> > >> > change to
>> > >> > `GET /apisix/admin/plugins/metadata`
>> > >> >
>> > >> >
>> > >> > On Mon, Nov 30, 2020 at 5:54 PM 刘曦冉 <be...@126.com> wrote:
>> > >> >
>> > >> > > Hi  Community:
>> > >> > >
>> > >> > >
>> > >> > >
>> > >> > > This discussion originates from issue:
>> > >> > > https://github.com/apache/apisix-dashboard/issues/529
>> > >> > >
>> > >> > >
>> > >> > > Background
>> > >> > > Dashboard wants to optimize the UE of config the plugins. For the
>> > >> plugins
>> > >> > > such as `key-auth` `prometheus` etc. user only need to
>> > enable/disable
>> > >> > them
>> > >> > > in route or service without any configurations. so it would be
>> > better
>> > >> > that
>> > >> > > only show switch for these plugins.
>> > >> > > When rendering the plugin page, the FE needs to know not only the
>> > name
>> > >> of
>> > >> > > the plugins(which have already been returned by `GET
>> > >> > > /apisix/admin/plugins`), but also need to know the plugins' schema
>> > >> which
>> > >> > is
>> > >> > > used to judge whether the plugin needs to be config
>> > >> > > Solution
>> > >> > > Refer to
>> > >> > >
>> > >> >
>> > >>
>> >
>> https://github.com/apache/apisix-dashboard/issues/529#issuecomment-735641857
>> > >> > > It would be better to create a new API in manger-api, which is
>> used
>> > to
>> > >> > > return all the information of the plugins, the ideal data
>> structure
>> > is
>> > >> as
>> > >> > > follows:
>> > >> > > ```json
>> > >> > > [
>> > >> > >   {
>> > >> > >     "name": "key-auth",
>> > >> > >     "type":  "auth",
>> > >> > >     "schema": {
>> > >> > >      ....
>> > >> > >     }
>> > >> > >     ...other plugin meta_data
>> > >> > >   },
>> > >> > >  {
>> > >> > >    ...
>> > >> > >  }
>> > >> > > ]
>> > >> > > ```
>> > >> > > And for the API name
>> > >> > > Just follow the current convention:as `GET /apisix/admin/plugins`
>> > has
>> > >> > > already in use for get all plugins names list, so the new name
>> > would be
>> > >> > > `GET /apisix/admin/plugins/meta_data`  to get all plugins
>> > informations
>> > >> > list.
>> > >> > > When we have a large version change: for a better Reatful way, I
>> > perfer
>> > >> > > this way:
>> > >> > >
>> > >> >
>> > >>
>> >
>> https://github.com/apache/apisix-dashboard/issues/849#issuecomment-735338561
>> > >> > > the name would be  `GET /api/version/plugins`
>> > >> > >
>> > >> > >
>> > >> > > What do you think? Looking forward to your comments and
>> suggestions.
>> > >> > > Thanks~!
>> > >> > >
>> > >> > >
>> > >> > > Best wishes
>> > >> > > Liuxiran
>> > >> >
>> > >> >
>> > >> >
>> > >> > --
>> > >> >
>> > >> > *MembPhis*
>> > >> > My GitHub: https://github.com/membphis
>> > >> > Apache APISIX: https://github.com/apache/apisix
>> > >> >
>> > >>
>> > >
>> > >
>> > >--
>> > >
>> > >*MembPhis*
>> > >My GitHub: https://github.com/membphis
>> > >Apache APISIX: https://github.com/apache/apisix
>> >
>>