Search code examples
ibm-mobilefirstmobilefirst-adapters

How do I invoke the methods in the IBM MobileFirst 7.1 adapter from the CLI?


I am reading the IBM developerWorks article "Integrating with Cloudant by using an adapter" https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/server-side-development/cloudant/

to try to use a MobileFirst adapter to access Cloudant from the 7.1 version of the MobileFirst CLI.

The article has a list of methods such as createDB (name) and getDoc (name, docID) but no explanation for how to invoke these methods from the IBM MobileFirst CLI command line.

So from the command line I do: mfp invoke CloudantAdapter ... and then what is the full invocation? It is not documented and I can't figure it out.


Solution

  • The question is not clear and does not explain what you have actually tried.

    First, you say you use 7.1, but you're using a sample from 7.0... Use the sample for 7.1 because it was updated for 7.1: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/server-side-development-category/cloudant/

    You also need to update your CLI to version 7.1... the commands to call adapters from the CLI have changed.

    I suggest that you will extensively review the tutorial and the sample. They are very much different from the 7.0 tutorial and sample.

    Once you have everything setup, you need only run the command: mfp adapter call and the Interactive command-line will kick in, instructing you to select the adapter from a list of adapters as well as the procedure from a list of procedures, and supply any required parameters (based on the explanation in the tutorial, and what you see in the functions in the adapter JS file...).