Skip to Content

Purpose of destination service lite in Cloud Foundry and how to use this in mta.yaml

Hi All,

What is the purpose of destination service lite(CF->Services->Service Market Place) in Cloud Foundry, where we create destination Instance and then we create multiple destinations inside the Destination instance? (not the one at sub account level under Connectivity)

If I have created 2 destinations(for ex: dest_1 & dest_2) inside a destination instance(dest_Employee - this is auto generated in mta.yaml when a html5 module is added to MTA) then, how do I reference a specific destination "dest_1" in my HTML5 module in mta.yaml?

Thanks

Shilpa

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Sep 21, 2018 at 02:17 PM

    Hi Shilpa,

    sorry for the late response, I hope this answer is still helpful:

    First, the consumption works the same for both types of definitions, the ones on a subaccount level as well as for the ones on the service instance level. (see docu for more details)

    In order to consume a destination (here named 'Northwind3') you need to modify the following files:

    1. Add the data source, destination service and the binding in the mta.yml file :

       requires:
       ...
        - name: dest_service
    
    ...
    resources:
     - name: dest_service
       parameters:
          service-plan: lite
          service: destination
       type: org.cloudfoundry.managed-service
    

    2. Define the model in the manifest.json file

    "dataSources": {
      "northwind.svc": {
        "uri": "/v2/northwind/northwind.svc/",
        "type": "OData",
        "settings": {
    	"odataVersion": "2.0",
    	"localUri": "localService/northwind.svc/metadata.xml"
        }
      }
    }
    ...
    
    "models": { 
    "": {
      "uri": "/V2/Northwind/Northwind.svc/",
      "type": "sap.ui.model.odata.v2.ODataModel",
      "settings": {
        "defaultOperationMode": "Server",
        "defaultBindingMode": "OneWay",
        "defaultCountMode": "Request"
      },
      "dataSource": "Northwind.svc",
      "preload": true
    },
    

    3. Add the route to the destination in the file xs-app.json:

    "routes": [{
      "source": "^/V2/(.*)",
      "destination": "Northwind3"
    },

    4. Use it in the SAPUI5 via data binding

    Edit: I've written a blog post about this topic, I hope it provides more insight :)

    Regards,

    Marius

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Marius,

      Thanks again for the reply.

      Of course the developer defines somewhere in the code the name of the destination, the software should be looking for. Especially, if multiple destinations are available, this name has to be unique.

      Nevertheless, the developer defines the name of the destination. In the CF scenario, the developer provides documentation to an account administrator, who deploys the application. After running through the automated installation process, a destination serivce instance is created without any destination definitions. The administrator has to create them manually according to the documentation.

      If the naming in this manual process step is not entered in the same way, the developer has defined it, running the application most likely will fail.

      In the "old NEO" days, we were able to define most of the parameters required for a destination and use mtaext-files to add user specific parameters. That feature is what we are currently looking for.

      Regards.

      Christian

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.