How to connect the back end and the front end and use the Discovery API in IBM cloud app services? - ibm-cloud

I am very new to using APIs so please excuse me. I am currently using a Python-Django App service from IBM cloud app services and the IBM Watson Discovery resouce. I have followed all the steps given here:
https://console.bluemix.net/docs/apps/tutorials/tutorial_web.html#before-you-begin
I have a machine that has docker and so the app got built successfully. However I am lost as to how I am supposed to get the front end ( which I am writing in bootstrap, javascript ) to connect to the backend and link the API.
EDIT
For example : I want my app to accept documents, feed them in Discovery, extract the keywords and sentiments and display them in the UI. How do I know what to access from the server side code and what to link where in the UI.
It is a very broad question but its a compulsory project I need to do and I am clueless. Pleaassee Help !

Before you try to integrate an API, you will need to be familiar with Python and Django. If that is not the case, then you really need to go through a series of tutorials.
Then before deploying to the cloud, you will be better off running your Django app locally on your laptop. Use pip to install the watson-developer-cloud pypi module and use the API documentation to build the python code in your Django application - https://www.ibm.com/watson/developercloud/discovery/api/v1/python.html?python#query
If none of this makes sense, then you need to brush up on your knowledge of Python, Pip, and Django.
When you have the app running on your machine, then you will be ready to package it up into either a docker image or cloud foundry container and deploy to the cloud.

Related

How do I deploy .BNA file on IBM cloud blockchain 2.0 resource?

I am trying to set up a rest API that is connected to an IBM blockchain resource. I have developed a model file, logic file, and acl file.
I have it all packed up in a nice tidy .BNA, and now i would like to deploy it to a channel of my IBM cloud blockchain 2.0 resource, running on a free kubernetes cluster.
Everything on the cloud blockchain resource is set up perfectly, and all orgs, peers, orderers, msps, and CAs are set up correctly. The channel is set up properly, and has nodes and an MSP connected. I have all the admin cred .jsons
The channel only accepts smart contract files, so I tried repackaging the files (logic.js, permissions.acl, and model.cto) by putting them in a contract folder, and using the IBM Blockchain vsCode plugin to package them as a smart contract, but trying to install on the IBM cloud crashes the browser.
I am thinking maybe I have to remote connect into the IBM kubernetes cluster that the blockchain resource is sitting on, and use the hyperledger composer CLI to install the .BNA
Seems very unintuitive, but thats the one thing I can think to try while I wait for this question to get answered.
I expected to just be able to install the .BNA as a smart contract, like a .cds.
In August 2018, IBM announced that we are no longer investing in Hyperledger Composer, and instead focusing 100% on Hyperledger Fabric. As a result, IBM Blockchain Platform v2.0 will not provide any support or tooling around Hyperledger Composer.
The good news is that we've significantly invested in the programming model (APIs and SDKs) used to write smart contracts and applications in Fabric v1.4, and we've also released some great developer tooling in the form of an extension for Visual Studio Code: https://marketplace.visualstudio.com/items?itemName=IBMBlockchain.ibm-blockchain-platform
The extension offers an extensive set of capabilities for writing smart contracts - with tooling for creating new projects, packaging them, deploying them, testing them, and debugging them - all from within one of the most popular IDEs around.
To get started - just install Visual Studio Code, and then the IBM Blockchain Platform extension (there are a few prereqs, check the README first). After that, you will be presented with a homepage that links you to tutorials and samples to help you get started.
For the first one, I can't really suggest a solution. At best, try installing and using the composer CLI and the latest version to make the bna file. Composer playground isn't maintained as well imo.
For the second part, in the connection.json file and docker there will be a bunch of IP addresses that look something like localhost:7040 and so on for the CA, orderer, org and peer. You will need to replace these using the IPs given by IBM. The examples on github that demonstrate integration are to do with nodejs SDK and not composer, however you can refer to https://github.com/IBM-Blockchain/vehicle-manufacture to get the idea.
This link is the only I could find for Hyperledger Composer and IBM platform.
(comments were getting too long to fit)

Can't find Blockchain Cloud Foundry app

I followed the instructions on IoT Asset Tracking on a Hyperledger Blockchain . BUILD and DEPLOY finished successfully, but I can't find the composer-rest-server- app under Cloud Foundry Applications.
I can use the CF Blockchain services, enter the Monitor and open the Swagger UI. The question is, where can I find the application-specific APIs mentioned in the tutorial:
If everything deployed correctly, you can find the app in the IBM Cloud dashboard at https://console.bluemix.net. If you have many apps and services deployed, make sure to filter correctly or to be aware of paging.
If you suspect that something got wrong during build and deploy, go to the toolchain and check the logs. The toolchains can also be reached from the dashboard.

IoT using Google Cloud Service IoT solutions (Weave): How to connect Raspberry Pi and lighting the LED?

I am trying to connect my raspberri pi with Google IoT Cloud solutions using Weave. I have done it already using AWS and IBM Bluemix, but could not find a way to do the same using Google Cloud. As per their documentation, it seems that some of the fies have been deprecated or not been updated.
Moreover, they have been written in C language and I am not much of a C guy. I used Python for both the IBM Bluemix and AWS to connect my Pi to IoT and then establish the subscriber and exchange messages using MQTT gateway.
Can anyone suggest anything regarding this?
Google Weave getting started
To be more specific, certain packages which I saw in error logs while installing the below step:
make -C examples/host/light
it showed in logs the message like
could not find lldap
could not find llssh2
Even after installing them in my developer machine.
Due to error above, the below command
./out/host/examples/light/light
is not executed as the location
/out/host/examples/light/light
is not created by the above make command. Any suggestions for this?
You might want to try instead to use the new Google Cloud IoT Core product instead of Weave - full disclosure, I worked on it. It's currently in public beta and enables the scenarios you're trying to address. You should be able to use MQTT to communicate to/from your device.
There's a high-level overview of the platform on YouTube as well as an industrial applications focused talk from Google I/O.

Why does IBM API Connect run differently in Bluemix than locally?

I just set up my local environment to use IBM API Connect and it gives me "extra options" to make the database. Now i'm using IBM API Connect inside IBM Bluemix and it doesn't have those "extra options" :/ I'd like to use it from IBM Bluemix to start migrating to the cloud, thanks in advance.
(I said this in a comment, but it should be an answer...)
The APIC Designer, which you run locally, helps define your models and connections, you then deploy that to Bluemix. You don't edit it on Bluemix itself.
The Local Developer toolkit gets installed on your computer for modeling and creating the api's through Strongloop or Kitura. After you have created your api's to run and publish them, bluemix publix cloud is used where you get a free developer portal and Node.js runtime environment for running your applications/micro-services.

How do I deploy server-side Swift on google cloud platform?

Im interested in implementing server-side swift on Google Cloud using "Perfect". Though Im quite new to server side, some guidance in implementing this would be helpful !
Knowing nothing about Perfect, I read Perfect's github page and see that in runs on Linux. Therefore, I see three ways to run Perfect on Google Cloud Platform, in order from easiest to most complicated:
On a Linux Virtual Machine in Google Compute Engine.
Building a custom docker image and running it in the App Engine Flexible Environment.
Building a custom docker image and running it in Container Engine.
If you're already familiar with Docker or Kubernetes, then options 2 or 3 may be easier for you.