How to discover edge nodes on iOS - edgeengine

I'm looking to recreate the same setup on my iOS application as the sample iOS app. In the sample app, there is an API call http://{localhost}/{clientId}/example/v1/drives?type=nearby that returns a list of EdgeEngineNodes for the application to use.
Do I need to implement this on my microservice or is there a build in function call in edgeEngine?

Issue: Making a call to edgeEngine local discovery services.
Cause: Getting a list of devices in edgeEngine clusters.
Remedy: Calling edgeEngine localDevices API from the deployed edge microservice. Alternatively calling the same API directly from the iOS application at the service link returned by the mimik client library.
curl -i -H 'Authorization: Bearer <edgeEngine access token>’ http://localhost:<$port-number>/<MCM.BASE_API_PATH>/localDevices
mimik edgeEngine client library for iOS provides an API that returns the current edgeEngine service link:
/**
Service link to the edgeEngine instance. For example when configuring microservices for deployment.
- Returns: Service link to the edgeEngine instance.
- Note: Once the service link has been established, it will never change.
- Note: For example http://127.0.0.1:[port-number]
- Warning: The port number is randomly generated when queried the first time, then stored for subsequent restarts and can never change again.
*/
#objc public func edgeEngineServiceLink() -> String
Note: Please see a full example of how this can be implemented in your edge microservice here: https://developer.mimik.com/first-edge-microservice/#title6

Related

How to get a callback when an Azure Marketplace Managed Application is installed from marketplace

The Microsoft documentation states:
Provide a notification endpoint URL: In the Notification Endpoint URL
box, provide an HTTPS Webhook endpoint to receive notifications about
all CRUD operations on managed application instances of this plan
version.
I created a simple Logic App and copied the HTTP endpoint into my MPN App Plan under the
It looks like this and has the sig at the end:
https://prod-08.australiaeast.logic.azure.com:443/workflows/fe287d1b9a8c48619a1b44765dad6dc7/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=C9JYfNPjvq-efsLwW66A4K4zTgx6qxGT1oH0RZZRsI0
To test it I hit it with PostMan and confirm that it is getting an HTTP200 as per the MS Docs.
I publish the app to the marketplace:
(you can see the app live here - https://azuremarketplace.microsoft.com/en-us/marketplace/apps/data-drivenai1581501556049.cloudmonitor-analytics-engine)
However - the endpoint never gets called at all. I can see in the logs that no attempt (failed or past) has been made to call it.
I raised a Microsoft Support Ticket and asked a Technical Specialist, however no one can tell me how to debug it or why it is not calling back on installs or failed installs.
Has anyone seen this working?
Update
I found out that each PLAN has a GUID that is automatically used for deployment. Mine is "pid-34881ea9-xxxx--xxxx-xxxx-2cf731e06ef7-partnercenter" - should I be putting this on the callback notification URL as sig=ThisGUID?
In the example for Managed apps with notifications, it shows that managed applications will send a post to https://{your_endpoint_URI}/resource. Can you try adding /resource to your listener and see if it triggers your logic app? I believe that should fix this.

Twitter dialogflow open source integration

I have followed the steps given for integrating with the twitter https://github.com/GoogleCloudPlatform/dialogflow-integrations and everything was done as such and deployment was successfull but I didnt get the response back from the bot.I tried integrating with the same app using the older method of integration and it is working. How can I know what is the problem with the integration?I tried integrating with the same app using the older method of integration and it is working
I’ve had the same issue. When deploying using gcloud beta run deploy ... command it tries to register new webhook on Twitter. In most cases it fails (eg. with High latency on CRC GET request. Your webhook should respond in less than 3 seconds. error). It is possible, that webhook registration will succeed after some deployments, but better approach would be to use local instance of Twitter Activity Dashboard - you can use targetUrl there and register webhook yourself (it’s possible that you will have to try several times). Remember to also verify it later with Verify button.
I have disabled Twitter integration in Dialogflow and my bot is now using Cloud Run webhook for Twitter.
Information in this issue were very helpful.

how can we do logging of conversation messages in database in ibm watson using node.js

I have created a watson conversation using assistant-simple github repo in node.js and it is working fine locally and in ibm cloud also. Now I want to log these conversation messages in a database. How can I log these conversation messages using database in node.js.
Assistant will keep the messages in a log for a small period of time List logs for a workspace and see Log limits.
Alternatively you will have to code putting messages into a database inside the NodeJS (or other language) server Orchestrator layer (which the UI communicates with). This layer gets all the user messages and Assistant responses and so can store them where you want.
I am not aware of a sample which directly communicates with Assistant and stores the user messages in a database. You would need to take various pieces of code and put them together to achieve this.
For example this sample shows how to upload information to a Cloudant database running on IBM Cloud, using NodeJS.
Alternatively if you don't want to write the code locally, you can invoke App Connect to store the data in a database. This Assistant and App Connect sample shows how to use Assistant actions to invoke AppConnect at some point in the dialog flow, either from the Assistant service (using a Cloud Function) or from the Orchestrator layer (as a client action).
The sample passes a user Id found in the utterance, but the approach is to take some data from Assistant, invoke App Connect and pass it to App Connect, and App Connect calls some other external system with the data. In your case, the data could be the user utterance and Assistant response, and App Connect could store this in a database.
One option would be to leverage cloud functions to make a call to another service.
Depending on what you want to do with the conversation data. If you wanted to access chatlogs and metrics you could send it to a logging service such as www.chatseer.com so you can access the logs.

Use hyperledger composer in production

I have some doubts with how to use hyperledger composer in production.
I need to create apis using hyperledger composer which will be used by our front end application which is not of angular js.
I have rest points authenticated with passport-jwt so I need to
have one card to access the network. So do I need to pass that card
to front end? And how will front end will connect to network with
that card to generate more participants and manage whole
application?
Where do we need to store cards for created users?
In our database or we need to share cards to end user?
How can we
create our own custom api using hyperledger composer?
You need to enable authentication in REST server.
export COMPOSER_CARD=name of your card that will be used to start the REST server
export COMPOSER_AUTHENTICATION=true
export COMPOSER_PROVIDERS='{
"github":{
},
...
}'
Also you need to switch on REST server Multi-user mode.
export COMPOSER_MULTIUSER=true
export COMPOSER_DATASOURCES='{
"db":{
"name":"db",
"host":"hostname",
"port":port number,
"database":"database name",
"user":"login",
"password":"password",
"connector":"mongodb"
}
}'
and then start the REST server
composer-rest-server
Now the composer REST server will start with the card COMPOSER_CARD with authentication and Multi-user enabled.
If you now visit http://localhost:3000 you will find a new set of APIs "Wallet". Here the wallet functions are defined.
Now the steps for the user will be as follows:
System Admin creates your participant card and issue identity. He sends you the .card file to you.Or your application must have a process to send your card file as email attachment.
He/she authenticates himself with Google or some other provider (what is configured in REST server).
Capture the token returned from that OAuth
Use that Token and call the REST web service /wallet/import to upload his card to be stored in the MongoDB. While uploading make sure that the Card name you input is exactly same as your card name.
Now call any other core application Web Services. REST web service will use your uploaded card details to call the web service.
Hence even if you started the REST server with COMPOSER_CARD it is using your actual card to execute Web services.
Hope this clarifies.
Also you can go through the actual document related to this one for better understanding:
https://hyperledger.github.io/composer/latest/tutorials/google_oauth2_rest

POSTMAN standalone application does not show the response code name of an API call

I have deployed a sample REST API (spring boot application) on Azure Web app for containers using docker container and tested some API calls using POSTMAN standalone application. I observed that the response does not display the code name. Please refer the image below.
When the same API call was invoked by the POSTMAN browser extension the status code and the code name both were displayed as expected. Please refer the second image below.
Is this a problem of POSTMAN, the way it represent the response ?
Thanks in advance.

Resources