Multiple swagger instances with single wildlfy deployment - jboss

I am using wildfly for exposing my APIs and swagger for API documentation.
I am in a situation where I need to expose only some APIs to some people and other APIs to others.
How to achieve this

I recommend using MicroProfile OpenAPI (recently integrated in WildFly 19.0.0.Final) which allows you to filter your OpenAPI document.
https://download.eclipse.org/microprofile/microprofile-open-api-1.1.2/microprofile-openapi-spec.html#_filter

Related

REST Api documentation for Apache CXF application

We use Apache CXF in our application with jax-rs to build REST Api. As of now, there is no documentation about the various endpoints available and is deployed on Tomcat 8.5 server.
I have done some R&D on how to find a solution. I understand that Swagger can be used.
But, I did not find enough documentation to user swagger with Apache CXF.
I understand that these type of questions are prohibited in the site. At the same time, I am not sure which chat room to use for this purpose.
Any information on this would help me a lot.
Depending on the CXF version that you are using, I would suggest to use OpenApiFeature (OpenAPI is newer than Swagger) as described here: http://cxf.apache.org/docs/openapifeature.html
You can also find multiple sample projects with Swagger or OpenAPI here: https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs

How to mock the Kubernetes cluster/server?

Kubernetes OpenAPI specification is hosted here.
https://github.com/kubernetes/kubernetes/tree/master/api/openapi-spec
Additionally, various client APIs for the Kubernetes is provided here:
https://kubernetes.io/docs/reference/using-api/client-libraries/
Using the OpenAPI specification, I am able to generate the server code, which provides the REST services. However, the applications using these K8s client APIs (written in either language - Go, Java, etc.) do not use these REST API directly.
My objective is to mock the K8s server to use in the test automation and build a controlled environment to create various test scenarios.
Is there any ready-to-use Kubernetes mock available? If not, how we can interface the client APIs with the above OpenAPI generated REST server? This way, the applications shall continue to use the client APIs but internally, they will be communicating with the mocked K8s server and not the real one.
Please help with the options.
.
Not really a direct answer to your question, but most solutions i have seen implemented are not trying to mock the k8s API but are really using it through either k3s (from rancher labs) or KinD project (official way)
You then connect to it like a normal kubernetes cluster

How to check the SLA of a webservices

We currently deployed our Spring Boot Application in GKE(Google Kubernetes Engine) and we are currently using cloud endpoint to secure our web services. We have 11 web service developed which will be consumed by external clients. Is there any way i check the SLO (times, performance) of a webservice in cloud endpoint or in stackdriver.
You might want to check:
Spring sleuth
Jaeger operator
Jaeger is a opentracing standard and can help understand the values, and sleuth is a tool to integrate with spring, there are several options, you might want also to consider opencensus
First you need to expose metrics from your applications. Spring Sleuth is a great choice if you're using Spring Boot.
Then you need to collect the metrics and visualize them. Google provides a tool for that called Stackdriver Trace. It can also do metric-based alerts. You can find a sample setup for your use case here.
There are other performance monitoring services such as Dynatrace or Datadog.
If you want a self-hosted solution, you can use Zipkin which is inspired by an internal Google system called Dapper.
Have you looked at Google cloud console UI? Its "Endpoints" tag should show all services your project is running.

Customizing the Hyperledger Composer Rest Server

I have a test Hyperledger Fabric running in the IBM Cloud, with the IBM Blockchain Application Service. I also have a kubernetes cluster running the Hyperledger Composer REST Server. Everything works great, but how do I extend the REST api with some custom api's?
The documentation mentions being able to use the swagger definition (yaml file) with the IBM API Connect or Strongloop product...but how do I do that, as I don't see any way to export the swagger definition?
I don't have a tutorial, but as I see it you would have to do three tasks minimally:
write your REST APIs (to do what you want to do) - perhaps these
resources on REST APIs will help ? -> Loopback ->
https://developer.ibm.com/code/patterns/create-rest-apis-using-loopback/
and in architectural in general
->https://www.ibm.com/developerworks/library/ws-restful/ and
build the routes for your custom APIs
customise your swagger
definitions to document your REST APIs - this may help you ->
https://www.ibm.com/developerworks/library/wa-use-swagger-to-document-and-define-restful-apis/index.html
and Swagger itself -> http://swagger.io/
If you write custom api and call it as 3rd party api which is mentioned in IBM already it will help you to response but it has very limted scope. I belive you should use swagger to understand its end point are properly configured

Azure Service Fabric and API Management Integration

I have provisioned a service fabric cluster on azure. It has two node types: one for the frontend and the other one for the backend.
I have deployed a Stateless self-hosted API on the frontend node-type. Now what i'd like to do is to expose that service through the Azure API Management. I've been trying to import the API without success. I have also tried to use swagger to generate the service specification but it seems that swagger does not work. I can access the swagger URL but it loads a blank page.
Any suggestions on how I can integrate my stateless service with APIM or how swagger works here?
Thanks a lot.
there are a few different ways you can produce your swagger document. If you are using Web API, you can use SwashBuckle to generate your Swagger for you. To validate your swagger file, you can use Swagger Editor. Finally, if you still have problems once you have validated your swagger document, share the document and the error here and we will see what we can do to assist.
Many thanks