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

Add "simplified" flag to app list #2138

Open
ggarnier opened this Issue Aug 28, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@ggarnier
Member

ggarnier commented Aug 28, 2018

app list command in tsuru client supports a -q flag to return only the app names, but it's implemented in the client. We could add this flag to the api, making this call much faster. The dashboard initial page would benefit from this.

@aman12592

This comment has been minimized.

Show comment
Hide comment
@aman12592

aman12592 Sep 30, 2018

@ggarnier I would like to contribute towards resolving the issue. If you could please provide any points on getting started would be of great help.

aman12592 commented Sep 30, 2018

@ggarnier I would like to contribute towards resolving the issue. If you could please provide any points on getting started would be of great help.

@ggarnier

This comment has been minimized.

Show comment
Hide comment
@ggarnier

ggarnier Oct 1, 2018

Member

@aman12592 the idea is adding support to a new flag in /apps endpoint (something like nameOnly=true). If this flag is present, we would return only the app names (no need to check units status).

The code for this is in api/app.go file. Let us know if you need more help.

Member

ggarnier commented Oct 1, 2018

@aman12592 the idea is adding support to a new flag in /apps endpoint (something like nameOnly=true). If this flag is present, we would return only the app names (no need to check units status).

The code for this is in api/app.go file. Let us know if you need more help.

@juanjcsr

This comment has been minimized.

Show comment
Hide comment
@juanjcsr

juanjcsr Oct 5, 2018

Hi! I am working on this issue. Is there any preferred format for the output?

I can return the names in a simple array like this:

[
   "app-name1",
   "app-name2"
]

Or the output could be more complex, such as:

[
    {"name": "app-name1"},
    {"name": "app-name2"}
]

Or, if there is another output format, I can make it happen 😄

juanjcsr commented Oct 5, 2018

Hi! I am working on this issue. Is there any preferred format for the output?

I can return the names in a simple array like this:

[
   "app-name1",
   "app-name2"
]

Or the output could be more complex, such as:

[
    {"name": "app-name1"},
    {"name": "app-name2"}
]

Or, if there is another output format, I can make it happen 😄

@ggarnier

This comment has been minimized.

Show comment
Hide comment
@ggarnier

ggarnier Oct 5, 2018

Member

@juanjcsr I prefer the second option, because it keeps the contract of the API:

[
    {"name": "app-name1"},
    {"name": "app-name2"}
]
Member

ggarnier commented Oct 5, 2018

@juanjcsr I prefer the second option, because it keeps the contract of the API:

[
    {"name": "app-name1"},
    {"name": "app-name2"}
]
@juanjcsr

This comment has been minimized.

Show comment
Hide comment
@juanjcsr

juanjcsr Oct 9, 2018

Hi @ggarnier ! I think I managed to solve this issue. I added a new bool flag nameOnly that when it is true, returns only the name of the apps and then skips the retrieval of the unit.

I also added a test to check the correct use of the new flag if the resulting array has the correct format.

However, I do not know how I can document this feature. I looked around the docs but I could not find a reference to the API endpoint parameters. Do you have some inputs on where to look?

juanjcsr commented Oct 9, 2018

Hi @ggarnier ! I think I managed to solve this issue. I added a new bool flag nameOnly that when it is true, returns only the name of the apps and then skips the retrieval of the unit.

I also added a test to check the correct use of the new flag if the resulting array has the correct format.

However, I do not know how I can document this feature. I looked around the docs but I could not find a reference to the API endpoint parameters. Do you have some inputs on where to look?

@ggarnier

This comment has been minimized.

Show comment
Hide comment
@ggarnier

ggarnier Oct 11, 2018

Member

Hi @juanjcsr. We started documenting tsuru API using OpenAPI spec. You can add the new flag in the parameters section of AppList:

parameters:

Member

ggarnier commented Oct 11, 2018

Hi @juanjcsr. We started documenting tsuru API using OpenAPI spec. You can add the new flag in the parameters section of AppList:

parameters:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment