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

Add detail on creating endpoints #31

Open
alansill opened this issue Apr 11, 2019 · 2 comments
Open

Add detail on creating endpoints #31

alansill opened this issue Apr 11, 2019 · 2 comments

Comments

@alansill
Copy link

alansill commented Apr 11, 2019

I managed to get this to install by cloning the repository to my $GOPATH/src, running "dep ensure -v" and figuring out where the latest scoop.yaml file is in the latest release (links are broken in the instructions for this and a few other things). I have everything started in my kubernetes instance and the right results showing up as the results of a kubectl get all -n gloo-system command.

Rather than start the petstore example, I'd like to deploy sqoop for a REST test service of my own that has an OpenAPI description available. I can even deploy it as a GraphQL endpoint if needed, but would like to start with an example of using sqoop with an OpenAPI endpoint on my own.

Any pointers to reading to get started? The main point is that eventually it would be good to show people how to get past the bundled petstore example.

@ilackarms
Copy link
Member

@alansill sorry you had so much trouble getting sqoop and running!

the tutorial provided will work with any REST app with an OpenAPI Spec. the key is that discovery needs to pick up the swagger spec off of a common endpoint. i don't recall all the endpoints discovery currently tries, but i'm sure /swagger.json works if you are able to serve the spec from that location.

try deploying your app with the /swagger.json endpoint and run glooctl get upstreams

you should see that the REST functions were discovered and are listed on the upstream

once that's done, you'll need to create a GraphQL schema that represents the data types your REST app.

upload the schema using sqoopctl create schema .... sqoop will then create a ResolverMap for the schema.

once the resolvermap is created, register the fields from your schema to the REST functions you'd like Sqoop to map them to via

sqoopctl resolvermap register -u <upstream-name> -s <schema-name> -g <function-name> <Schema Type> <Schema Field>

@EItanya EItanya mentioned this issue Apr 11, 2019
@alansill
Copy link
Author

Thanks! This is helpful.

In cases in which the services being proxied are not running in k8s, but are provided as external OpenAPI REST services, is there a way to do that (preferably being able to provide the OpenAPI yaml or json description file spearately, out of band from the service itself)? Also, is OpenAPIv3 supported for discovery? A few more links would be helpful.

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

No branches or pull requests

2 participants