conversation.getWorkspace is not a function? - ibm-cloud

I am trying to get details of conversation workspace. I am using node and the getWorkspace API as mentioned in this reference doc
When I run the conversation.getWorkspace() function, I get the error - conversation.getWorkspace is not a function.
Is this a deprecated API? Any suggestion on how I can get the status of a workspace using the watson-developer-cloud package?

Node.js functions for managing IBM Watson Conversation Service workspaces and its included objects can be found in the Watson Developer Cloud Node SDK. Make sure to be on the latest version to get the full functions. Note that the version needs to be set as part of initializing the API.

Related

google spanner and direct REST api calls

I'm trying to use spanner emulator and I followed the instructions reported here:
https://cloud.google.com/spanner/docs/emulator
to set it up.
I can use gcloud shell commands to create instance, database, tables, etc. and all works correctly.
But I am not able to use the Rest API directly to access the emulator, even though the google documentation reports it is possible not only to use google client libs to access the emulator, but also the rest api.
The first problem is that it is not clear if I have to use either the base URL
https://spanner.googleapis.com/
or
http://localhost:9020/
When I try with
http://localhost:9020/v1/parent=projects/local-project/instanceConfigs
I always returns and "Not found" message, which means the the Rest API ws are responding, but through gcloud commands I can manage such instance and project!
What am I wrong with?!
According to the official documentation :
Using the Cloud Spanner
Emulator
"The Cloud SDK provides a local, in-memory emulator, which you can
use to develop and test your applications for free without creating a
GCP Project or a billing account."
Therefore you should use the localhost (localhost:9020 for REST requests).
You should use http://localhost:9020 to access the emulator if you want to manually access the REST API, so you were on the right track there.
The URL should however be http://localhost:9020/v1/projects/test-project/instanceConfigs to list all instance configurations on the emulator. Use http://localhost:9020/v1/projects/test-project/instances to list all instances.

How to list all vpc_access_connector in gcp project using python

Attempting to create, list , delete vpc access connectors in gcp using python
Is there a library for this or do I use the discovery API? Unsure which discovery API to use. Examples would be extremely helpful
As mentioned on the VPC Access API document, there are some client libraries in order to call the service. Nevertheless, I was unable to find you any example for this in the official Github for the python client library.
I hope you find this information useful!

REST endpoint registration and bootstrap(Creating range-index) using U Deploy

I have my code in Git repository. I am using UDeploy to deploy my code into MarkLogic environment. I can able to move all my modules successfully but facing two problems
1. Creating New indexes
2. REST endpoint creation
Please let me know if there is anyway to implement these two
For creating indexes, I have tried to do it using API functions(admin:database-range-element-index()) and I have successful in that part. But is there any way to do it from UDeploy or DevOps.
For register REST endpoint I couldn't able to find anyway to try.
Have you looked at MarkLogic's REST Management APIs - https://docs.marklogic.com/REST/management. In particular, see if https://docs.marklogic.com/REST/POST/manage/v2/databases will help you create indexes via REST management APIs.
The most common way to deploy MarkLogic code & configuration is ml-gradle, a plugin to the widely used gradle tool. ml-gradle uses MarkLogic's Management API, mentioned by Ganesh, and is scriptable.

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

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.

IBM Bluemix - Kitura Swift - is missing a required environment variable: 'OPENAPI_SPEC'

I am stuck for the moment. I cannot obtain the source code for the mobile project and I do not know where is the problem. All my researches was without positive result.
My intention with IBM Bluemix is to develop myself a small project only in Swift (server side + iOS) because I am iOS mobile developer.
When I try to get the code for mobile project (iOS) I get these error:
Error Notification:
The Cloud Foundry App 'XXX' is missing a required environment variable: 'OPENAPI_SPEC'.
I want to use OpenWhisk SDK for iOS. I do not know where to set the variable OPENAPI_SPEC and what value to put in it.
I have setup a Cloud Foundry App started from "Runtime for Swift - Kitura" and a mobile project named started from "Code Starter - OpenWhisk".
Can you help me with some advice or some sample?
Thank you!
If you added a Swift server side Compute to your mobile project, you will need to add an environment variable called OPENAPI_SPEC to your backend to point to a valid Open API swagger document outlining the API.
This way when you download the project, it will auto-generate an SDK corresponding with your backend's Open API.
For instance, here is how you set the environment variable:
And here is a valid API doc that it's using (albeit not in the most elegant Open API compliant format yet but it works).
https://updatesdk.mybluemix.net/explorer/swagger.json
The idea is that the "project" concept takes an abstracted view of a Compute runtime (Cloud Foundry, Docker, etc.) and only cares that it exposes an API compliant with the Open API specification. Using that defined Open API spec, you can dynamically generate an SDK for a "project" when it's downloaded (for iOS, Android, etc.).
If your backend Compute exposes no Open API specification at this time, and you just want to download the code of OpenWhisk for iOS, you can just deassociate that backend Compute from your mobile project for now, and it should download the code. If you ever build on top of that backend and want to reconnect it in the future, you can add it and redownload at a later time (doing a git diff or using the Bluemix CLI SDK plugin to download an SDK from your Open API specification later in your project's lifecycle).