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

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.

Related

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.

FF4J: REST endpoint as a feature store

I am currently looking at implementing feature toggles using ff4j for our application. We want to have a remote central config app which will hold all the features in it and the applications will talk to this central config app via REST to get the features. We will not be able to leverage Spring Cloud Config or Archaius for this purpose.
I went through the documentation and it seems there is a support for HttpClient (https://github.com/ff4j/ff4j/wiki/Store-Technologies#httpclient). But I couldn't find any sample for the same. Can someone please let me know if I can leverage this method to build my feature store from a REST endpoint. Also, I would appreciate if someone could point me to a sample of this.
This is a common pattern.
A component holds the Administration UI (console) and the REST API. You can call it the "Admin Component". For security reasons It may be the only component to have access to persistance unit (any of the 15 DB implementation available)
For the "admin component" HERE is sample using standAlone spring-bppt application using JDBC DB, and HERE you find a simple web application.
The REST API can be secured using credentials user/password and/or API Key. More information HERE
All microservices access the REST API as clients and request feature store. You will need the dependency ff4j-webapi-jersey2x or ff4j-webapi-jersey1x that hold the client http> Then you can define the store using :
FeatureStoreHttp storeHTT = new FeatureStoreHttp("http://localhost:9998/ff4j");
Warning : Please consider using cache to limit overhead introduce by accessing the REST API at each feature usage. More info on cache HERE

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.

Create Azure Api App from Swagger meta data

I have created some APIs in API management layer, which are essentially proxies between the calling client and an underlying web api.
I did this by importing the swagger file of the underlying API, and then adding the newly created API to a Product, repeating this for each separate proxy that I needed. This means then that the underlying API could be called but not without the subscriber key of the product that the newly created API was attached to.
Is it possible to do something similar with API apps, i.e. creating API apps using just the swagger file from the underlying API in the azure portal, that act as proxies between the calling client and an underlying web api (as below)?
Do you mind expanding on why do you need to have API Apps acting as proxies?
I am not aware of such capability for API Apps specifically. There are Swagger-based code generation tools available, for example on http://swagger.io/open-source-integrations/. So perhaps you will be able to find something that would work for you.

Zend - Creating an PHP API for a mobile application

I'm currently planning the creation of a mobile application for ios and android.
The application will permit to the end-user to manage and see the progress of its projects. (Web creation company).
The application will have:
Project management (multiple)
View progress
View tasks
View hours
View files
View messages
Login/Logout form + Profile/Edit Profile section
Send/Reply Messages
Add comment on tasks and files
The question is: What is the best way to create an API (Restful or something else) using the Zend Framework?
This API must and will be integrated to a custom-made Projects Management System and a MySQL DB.
I just working on PHP API (no matter if API is for mobile platforms or another webs) and after realizing between SOAP and REST I chose a RESTful API and I can recommend it...
Zend Framework has components for both of mentioned approaches, but REST is easier and more understandable in comp. with SOAP...
The one thing what you have to think about is logging, you can use HTTP Auth or OAuth (HTTP autentification is easier), but better approach according to me is generate unique API KEY for your users (each user should have own KEY) and this KEY ensure you can recognize user and a security risk is minimal because user do not have to send login and password inside HTTP request (security risk) and in case of KEY is catched on WIFI or infrastructure, hacker do not get user logins to web application, only for API where propably will not be all features what main web app offer.
And if you set some time expiration for you KEYs or IP restriction for KEY, than you can make it more safe:)
Some tip for the end: Implement API as new separated ZF module.
One of the best stuffs I have noticed so far is http://getfrapi.com/
It makes use of everything from Zend to Pear. May be you should checkout the video http://www.youtube.com/watch?v=vJVQi7ZFSaQ