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

HTTP API for inspect #477

Closed
Tracked by #247 ...
sirex opened this issue Jun 13, 2023 · 2 comments · Fixed by #505
Closed
Tracked by #247 ...

HTTP API for inspect #477

sirex opened this issue Jun 13, 2023 · 2 comments · Fixed by #505
Assignees
Labels

Comments

@sirex
Copy link
Collaborator

sirex commented Jun 13, 2023

Create POST /:inspect API endpoint, which accepts a multipart/form-data form and returns manifest in CSV/HTML or other specified format. Return format can be specified via ?format() or via Accept header.

Form should accept following fields:

  • manifest - a manifest type, like csv, json, ... (see list of available formats). If not given, use tabular.
  • dataset - dataset name, that will be used in resulting manifest file, if not given, use dataset1.
  • url or file with a schema, to read data structure from, one or the other must be provided.

If there are errors, provide errors in JSON or HTML format as specified in ?format() or Accept:.

Epic

Related

@sirex
Copy link
Collaborator Author

sirex commented Jun 28, 2023

Probably multipart/form-data won't work, so better way to do same request as described in #475.

@adp-atea adp-atea moved this to In Progress in Portalo plėtra Aug 8, 2023
@sirex
Copy link
Collaborator Author

sirex commented Aug 8, 2023

Ignore previouse comment, because, it looks, that multipart/form-data is the better way to implement this, because we need to pass multiple parameters in order to make this work.

Form should accept following fields:

  • dataset - required, a dataset name
  • manifest.type - required if resource.type is not given, a manifest type, like csv, json, ... (see list of available formats). If not given, use csv tabular format.
  • manifest.file - required if manifest.type is given, a manifest file in specified manifest.type format, this will be used as a main manifest, that can be updated from a resource.
  • manifest.source - required if manifest.file is not given, a url containing manifest file
  • resource.type - required if manifest.type is not given, another manifest, that supports inspect from a resource, same as manifest.type.
  • resource.file - required if resource.source is not given, a manifest file of resource.type type
  • resource.source - required if resource.file is not given, a url containing manifest file
  • resource.prepare - optional formula to prepare resource before reading

Basically we have this:

spinta inspect {manifest.file|manifest.source} -r {resource.type} {resource.file|manirfest.source} -f {resource.prepare}

In addition we give dataset to put into manifest file instead of a generated dataset name.

One of manifest.* or resource.* is required, but also both can be given. If boths ar given, then manifest is updated from resource.

If only manifest is given, then we read resources if any given from manifest table.

@adp-atea adp-atea linked a pull request Aug 16, 2023 that will close this issue
@adp-atea adp-atea moved this from In Progress to Review in Portalo plėtra Aug 22, 2023
@sirex sirex moved this from Review to Todo in Portalo plėtra Nov 13, 2023
@adp-atea adp-atea moved this from Todo to In Progress in Portalo plėtra Dec 18, 2023
@adp-atea adp-atea moved this from In Progress to Review in Portalo plėtra Dec 19, 2023
@sirex sirex moved this from Review to Deploy in Portalo plėtra Jan 22, 2024
@github-project-automation github-project-automation bot moved this from Deploy to Done in Portalo plėtra Jan 23, 2024
@adp-atea adp-atea moved this from Done to Deploy in Portalo plėtra Jan 23, 2024
@sirex sirex moved this from Deploy to Test in Portalo plėtra Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Test
Development

Successfully merging a pull request may close this issue.

3 participants