API Automation for private APIs using K6 that cannot be directly called using postman - automation

I have these APIs which I can manually test by calling the pod using port-forwarding but since APIs are scattered in different pods, I am not able to automate this. Is there a way in K6 where I can call each pod based on the API and automate my API collection in one go.

Related

How to load testing an application that calling external service APIs using Jmeter?

I currently want to perform a load testing an application using Jmeter but some functions need to call an external service APIs.
So I want to know how do I test those APIs without the app calling the actual external API service.
For example, I want to test an application that calling Google Maps Platform Directions API to get a direction from point A to B.
There is a concept of Mock Object, you can configure your application to point to your own external API implementation instead of Directions API which will return static or random or pre-defined response.
One of possible options is using i.e. Wiremock for this, you can interact with Wiremock REST API using JMeter's HTTP Request samplers to create/amend mock responses on the fly.

Create an API endpoint within Sanity?

How can we create an endpoint using Sanity CMS which lets us execute custom server-side code? e.g. https://my-sanity-cms.com/api/my-endpoint
Within NextJS we can create /pages/api/endpoint.js and we can then access .com/api/endpoint via any http clients.
We want to be able to do this as our CMS needs to talk to some 3rd party systems and execute some server-side code, so ideally we can make an endpoint we can use?
Thanks
you can just set that up with NextJS and have it do whatever it needs to do using the Sanity APIs to read/write content inside Sanity and the 3rd party APIs to do whatever they need to do. You can then deploy that with Vercel or similar and use that endpoint from inside the studio.
There is however no way to run custom code inside the Sanity backend service, but lots of companies deploy separate projects in order to integrate data across systems.

How to allow access to subset of API only when connected via my official frontend, using Nest.js?

I'm starting a Nest.js API, and a subset of my API is business critical. I don't want it accessible openly via HTTP(S), except if the request is coming from my website. Other APIs might instead by accessible with whatever third-party client.
Is there a way to achieve this using Nest.js?

how to consume meteor API call

I need to write a Java web application to call a function Meteor APP. One way is through API call. Are there any other means to call Meteor function from 3rd party application.
Thanks
Murali
It all depends on what your requirements are, how your Meteor app is structured, and what sort of integration you desire.
If you are wanting your Java web application to be able to natively call Meteor methods or subscribe to publications, then you will have to use a Java DDP Client to do this. Fortunately, there is at least one documented Java DDP client that you can use for this (and probably many others out there is you search). For your reference, here is a compiled list of DDP clients for other languages/technologies.
If on the other hand you don't want to interface with you meteor app using DDP, then you could always implement a REST API in your meteor app. There are several packages available to do this, but I would highly recommend the simple:rest package.
This package automatically creates a REST API for all your existing publications and methods without any extra code (just simply add the package to your meteor app). If you do need to configure or modify the REST API, the package also provides several options that you can use in your publication or meteor method definition. The package also enforces all your app's security rules and authorization.
For example, if your app had a publication called openTasks, then the corresponding REST endpoint would be.
GET /publications/openTasks
There are quite a few packages at https://atmospherejs.com/?q=rest that can expose your Meteor methods as RESTful API points which your Java app can consume.

Does Openshift Origin 1.1 REST API allow to create new applications based on templates?

We are developing a custom console to manage development environments. We have several application templates preloaded in openshift, and whenever a developer wants to create a new environment, we would need to tell openshift (via REST API) to create a new application based on one of those templates (oc new-app template).
I can't find anything in the REST API specification. Is there any alternative way to do this?
Thanks
There is no single API that today creates all of that in one go. The reason is that the create flow is intended to span multiple disjoint API servers (today, Kube and OpenShift resources can be created at once, and in the future, individual Kube extensions). We wanted to preserve the possibility that a client was authenticated to each individual API group. However, it makes it harder to write easy clients like this, so it is something we plan on adding.
Today the flow from the CLI and WebUI is:
Fetch the template
Invoke the POST /processedtemplates endpoint
For each "object" returned invoke the right create call.