I am using WSO2 APIM2.0 and enabled the import/export tool (api-import-export-2.0.0-v0). I am able to export the API ok. My API has got custom input and output sequence attached to it. I can see the custom sequences in the exported zip file. But when I import the same into any other environment the APIs are created properly but the custom sequences neither created nor attached to the imported APIs. Am I missing something here?
Thanks in advance
I think it's fixed by now. Please get latest tool (v2) from https://docs.wso2.com/display/AM200/Migrating+the+APIs+to+a+Different+Environment
Related
I am working on a project that, among other things, automatically generates Swagger APIs for Python projects. One thing that I have noticed is that the curl text exposes passwords if the API requires those. Since there's no way to mask the passwords as of now (https://github.com/swagger-api/swagger-ui/issues/5025), it seems like the easiest thing to do is to simply disable the curl text so that I can screenshare my Swagger API without exposing my password.
In another issue (https://github.com/swagger-api/swagger-ui/issues/5020), a plugin is shown that can disable the curl text.
However, I'm totally stumped on how to actually import and use this plugin. There's lots of documentation about how to write plugins, and none on how to import them. I can see that I can load plugins using the plugins option in https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/, but I don't know how where to put the code.
As Helen alludes to, the answer to your question depends on your setup. However, I would hazard to guess that you will need to configure the SwaggerUI object by running an "unbundled" version of the app. You might think of this as creating a custom entrypoint to a docker container, say.
For example, the link you provide shows suggestions for running a customised version of SwaggerUI. Those customisations are written in JavaScript, so any old HTML page with the necessary dependencies in place which loads the script you write to configure SwaggerUI would answer the question of "where to put that code".
The details would depend on any frameworks you are or are not using.
What I expect: After typing amplify codegen models, it should generate the model "classes" for my already existing backend.
What happens: Message Output:
No AppSync API configured. Please add an API.
What I did so far:
Already did the Amplify Prerequisites mentioned here
I added my existing API to my Android Project by amplify codegen
That resulted in generated files for mutations/queries/subscriptions and the schema.json as you can see on the screenshot below.
I wanted to generate the models classes as mentioned here
But as said, the model classes are not generated. May someone has the solution for my situation out there. Would help me a lot :)
amplify codegen models uses CLI codegen to generate models to be used for the new Amplify API and Amplify DataStore categories, which is separate from the generated code used by the AppSync client.
To generate models for Amplify API, try using the following command: amplify add api, to add a new API. When prompted to edit your models, follow the instructions to edit the schema.graphql file in specified path.
If you try amplify codegen models at this point, then you will find that the models are generated.
I'm considering using GraphQL with a Django backend service but I couldn't find much information regarding the API documentation. I need some solution to dynamically generate the documentation, perhaps like npm's graphql-docs with a result similar to GitHub's API docs.
Is it feasible to accomplish with graphene-django? If not, what's a good alternative for a python environment?
Yes, it's very easy to do by using GraphiQL, which is embedded in to Graphene.
The instructions on how to integrate this with Graphene are here in the graphene-python documentation. --- basically you need to add the parameter graphiql=True when setting up the API route in your urls.py file.
After it is set up, if go to your API endpoint in your browser, you'll see a nice interface for sending API calls, getting API responses, and reading documentation for both queries and mutations. The documentation is initially hidden on the right until you click on the "< Docs" link.
I have a linear regression model build using spark mlib. Now i want to export the model and use the model via a web service.
I was looking into PMML was not able to find a proper source as how can I use it. Do I need to install any specific PMML library or how can it be done.
The same model i tried exporting as a pickle file using joblib and deployed it as a web service via flask. I want to do something similar for the model developed in Spark mlib.
Can anyone please help me out or point me to correct source?
For a simple REST web service using PMML you could have a look at https://github.com/openscoring/openscoring. It uses JAVA though. For Python+Flask I have no idea but PMML is nothing more than a XML file which needs to be evaluated. So you could try to write your own Python logic to do it. I've also found this https://github.com/maxkferg/pmml-scoring-engine but it doesn't have much stars.
It is noted though that PMML is quite limited in its usage. Not all models are supported e.g. ALS. Another approach is to deploy a PySpark application via its binaries. I blogged about this here. We deployed it using Cloud Foundry but you can use the buildpack to deploy it on Heroku as well if you need a public endpoint. Hope this helps.
API manager import/export tool is useful in a situation where the api is not available at all in the target environment. What is the best way to move the updates to an API from one environment to another, without incrementing the API version?
I can think of a way to remove the API in the target environment, and import the updated API zip file again. Is there a better way to achieve this?
I believe this issue has been fixed in wso2am 2.1 version. Following is JIRA opened for exactly same scenario you have explained above.
APIMANAGER-4569Support updating an API with API import tool
WSO2-API-Manager-2-1-0 release note says so.[APIMANAGER-4569] - Support updating an API with API import tool
I have not try it myself, you may want to try new version. Thanks.