WSO2 API Manager(wso2am-2.1.0) - Maintaining a Separate Log File - wso2

I'm using WSO2 API Manager 2.1.0.
Is it possible to maintain a separate log file for a specific API as required?
Thanks in advance.

How about using the APILogMessageHandler? I don't know whether you can create a separate log file from it, but you can add api specific logs. You just need to add following handler to the synapse api file generated in <APIM_HOME>/repository/deployment/server/synapse-configs/default/api directory.
<handler class="org.wso2.carbon.apimgt.gateway.handlers.logging.APILogMessageHandler"/>
More information can be found in here. https://docs.wso2.com/display/AM210/Writing+Custom+Handlers

Other than creating a custom log handler. You can also consider creating a separate service logger for that API as mentioned here.

Related

CLI/SDK to create Google-cloud oAuth client

Is it possible to create an OAuth client (https://developers.google.com/identity/protocols/OAuth2) using a script (gcloud or any library)?
Google recommended way (https://developers.google.com/identity/protocols/OAuth2WebServer#creatingcred) is to manually create from https://console.developers.google.com/apis/credentials.
I have multiple apps with different url_redirects like https://a.domain.com, https://b.domain.com https://c.domain.com, https://d.domain.com, this subdomain list is large to manage manually.
I want to automate this process for my use case. I'm not able to find any library to do this.
Update: Endpoint used by GCP console https://clientauthconfig.clients6.google.com/v1/clients and there is related permission also "clientauthconfig.clients.create" but there is no API provided for it.
You would need API client to create new API client anyway. Is it really necessary for you to create it this way? You can rather create multiple "user" credentials for your application using only that one API client.
I think you are looking for something like this, hope Java is good for you.
I've also found the following relevant information that might help you. Link
Also relevant for you. Link
Let me know.

Does graphene-django dynamically create an API documentation?

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.

wso2esb: can I use my own way to build a page that can add new proxy services?

wso2esb is based on a datasource, at first I thought that the data stored by the datasource contains the proxy service what is added by the wso2esb console, but I didn't find
corresponding data in that database, that is a big trouble for me.
Some users told me that the ui of wso2esb console is too complex and professional, so I want to build new pages that can let them add new proxy services and the methods are based on the original methods of wso2esb;
Is there original codes of method that can help me with this?
I read the source code of wso2esb, but I didn't know how it handle the data from the webpage and how the data user input saved.
As I know, wso2esb deploys service automatically, if you put file in right directory. I advice to create artifact with UI, name it and then search in wso2esb home directory.
For example, directory for services: $CARBON_HOME/repository/deployment/server/synapse-configs/default/proxy-services
Although, I think that creating of UI with similar functionality is very strange idea and could be very hard.

developing custom WSO2 Carbon authenticator clients

I am implementing new authentication methods for WSO2 Carbon. I know there is a pretty good explanation and sample piece of code in this post.
The problem is, what if I want to generate stub and service client components from the sample BE authenticator? What are the steps to follow? Any tools (java2wsdl / wsdl2java, maven plugins,...) or reference tutorial that can help to achieve this in the most straightforward way?
I know there are several existing authenticators (IWA, webseal,...), but they already come with some stub/ui built in the existing repositories. I would be rather interested in being able to develop/generate all the components more or less from scratch rather than having to modify existing code, which is often prone to errors.
Thanks
This is some high level thing.. but hope this is useful.
1st you can develop the BE component as OSGI bundle. Then you can deploy it in /repository/components/dropins directory. Here you need to have a service.xml file to expose as web service (Please refer WebSeal BE component)
Then configure following property in the carbon.xml file.. if BE service has been defined as admin service
true
Open browser and locate your WSDL of new service
https://{ip}:{port}/services/{service name}.wsdl
Then use wsdl2java tool to create the stub class for you. There is a UI tool in WSO2AS product to do it.
Use stub as a dependency for your FE

calling web services from UNIX

I have a requirement to kickoff a workflow which is in salesforce.com thorugh web service from UNIX box. Can any one suggest me options or guide lines to achive this scenario?
I don't think you can just "kick off workflows". You'll have to perform an insert or update of records in Salesforce that will satisfy the workflow's entry criteria.
There's a Java tool called Data Loader for your basic data manipulation activities (you can download it from your own production org)
and it can be scripted for scheduled runs, has config file where you can store user's password in secure way etc. Check out the pdf guide for more ("Command Line Quick Start" chapter)
So I don't think you really need a webservice call...
Unless I misunderstood and you're talking about calling an Apex class' method that has "webservice" keyword and it will somehow perform the updates?
In that case you'll need to download the WSDL file generated for this class (Setup->Develop->Classes) and well, consume it in language of your choice (Java, PHP, Python... this link will help, steps aren't too different), then do your command line magic?
http://wiki.developerforce.com/page/Integration has tons of resources for you :)
Salesforce uses SOAP for their web service. They don't have restful web services now. Just request them to give the wsdl file.
Use this wsdl file to generate the java code. After that get their webService url so that you can proceed with your data pulling
This link may help you..
http://salesforce-walker.blogspot.in/2011/12/to-access-salesforce-data-from-java-we.html
Hope this helps