Open APIs

 View Only
  • 1.  Issues getting started with reference implementation code

    TM Forum Member
    Posted Mar 04, 2020 07:23
    Hi,

    I've downloaded the reference implementation project for TMF 632, and I'm having issues getting it up and running so I can see it in action.

    I've imported the project into my IDE, run npm install, and then executed npm start.

    I'm now facing issues with MongoDB connection. I've installed MongoDB community edition locally, such that it should now in principle be accessible via localhost:27017. However, I have been unable to provide this URL to the mongoUtils.js class via configuration.

    The documentation in the README is extremely sparse - it just says "start local mongoDB (or change /service/config.json file for external mongoDB)".

    Aside from the fact that that config.json file is at the project root, and not in service/, it's extremely unclear to me how exactly I specify the connection without hardcoding it in mongoUtils.

    Can anyone advise?

    ------------------------------
    Ben R
    TDC
    ------------------------------


  • 2.  RE: Issues getting started with reference implementation code

    TM Forum Member
    Posted Mar 04, 2020 09:26
    Hello @Ben R I'm sorry you are having problems with the RI.

    Thank you for bringing the typo on the location of the config.json to my attention, it is now fixed for this repository.

    The default configuration expect the database to be running locally on the default port (localhost:27017).

    If can please send me the error output to my e-mail (hrodrigues@tmforum.org) I will be happy yo help you run the RI.

    Best Regards,

    Henrique Rodrigues

    ​​

    ------------------------------
    Henrique Rodrigues
    TM Forum
    ------------------------------



  • 3.  RE: Issues getting started with reference implementation code

    TM Forum Member
    Posted Jul 08, 2020 08:44
    I am also facing same issue to connect local mongodb, what are the properties need to include if I want to specify mongodb host and pwd in the  /service/config.json file for external mongoDB? please suggest....I see only below property in the config json...

    {

    "strict_schema": true
    }

    Below is the log of Node JS for local mongo db issue...


    createImportJob :: POST /tmf-api/productCatalogManagement/v4/importJob localhost:8080

    createImportJob :: validate request :: payloadType=importJob

    Debug1111111111222222222

    Debug111111111133333333

    createImportJob :: validationRulesType2 does not include importJob

    Debug1111111111444444444

    Debug1111111111444444444

    Debug1111111111444444444

    Debug1111111111444444444

    Debug1111111111444444444

    processCommonAttributes:: typedef={

      "description": "Represents a task used to import resources from a file",

      "example": {

        "@baseType": "@baseType",

        "@schemaLocation": "http://example.com/aeiou",

        "@type": "@type",

        "completionDate": "2000-01-23T04:56:07.000+00:00",

        "contentType": "contentType",

        "creationDate": "2000-01-23T04:56:07.000+00:00",

        "errorLog": "errorLog",

        "href": "href",

        "id": "id",

        "path": "path",

        "status": {},

        "url": "url"

      },

      "properties": {

        "@baseType": {

          "description": "When sub-classing, this defines the super-class",

          "type": "string"

        },

        "@schemaLocation": {

          "description": "A URI to a JSON-Schema file that defines additional attributes and relationships",

          "format": "uri",

          "type": "string"

        },

        "@type": {

          "description": "When sub-classing, this defines the sub-class entity name",

          "type": "string"

        },

        "completionDate": {

          "description": "Date at which the job was completed",

          "format": "date-time",

          "type": "string"

        },

        "contentType": {

          "description": "Indicates the format of the imported data",

          "type": "string"

        },

        "creationDate": {

          "description": "Date at which the job was created",

          "format": "date-time",

          "type": "string"

        },

        "errorLog": {

          "description": "Reason for failure if status is failed",

          "type": "string"

        },

        "href": {

          "description": "Reference of the import job",

          "type": "string"

        },

        "id": {

          "description": "Identifier of the import job",

          "type": "string"

        },

        "path": {

          "description": "URL of the root resource where the content of the file specified by the import job must be applied",

          "type": "string"

       },

        "status": {

          "$ref": "#/definitions/JobStateType",

          "description": "Status of the import job (not started, running, succeeded, failed)"

        },

        "url": {

          "description": "URL of the file containing the data to be imported",

          "type": "string"

        }

      },

      "type": "object"

    }

    createImportJob: error=AssertionError [ERR_ASSERTION]: App must be bound to compose-for-mongodb service



    ------------------------------
    Harikrishna Chavali
    Oracle Corporation
    ------------------------------



  • 4.  RE: Issues getting started with reference implementation code

    TM Forum Member
    Posted Jul 13, 2020 10:01
    Possibly @Henrique Rodrigues could assist here, he's the TM Forum development focal for CTKs, RIs, etc.
    Hope it helps.​

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
    ------------------------------



  • 5.  RE: Issues getting started with reference implementation code

    Posted Jul 17, 2020 11:59
    Hi Henrique,

    Has any progress been made on this issue? It seems to be a missing configuration setting for MongoDB.

    Regards,

    John Hansen
    Ericsson

    ------------------------------
    John Hansen
    Ericsson Inc.
    ------------------------------



  • 6.  RE: Issues getting started with reference implementation code

    Posted Jun 17, 2021 11:19
    For anyone still experiencing this issue... utils/mongoUtils.js is expecting a config file at utils/vcap-local.json (because it assumes that the application is running in a Cloud Foundry platform). If you're running locally, you can create a file at utils/vcap-local.json with the following contents:
    {
        "services": {
            "compose-for-mongodb": [
                {
                    "name": "local-mongodb-connector",
                    "label": "local-mongodb-connector",
                    "credentials": {
                        "uri": "mongodb://localhost:27017/tmforum"
                    }
                }
            ]
        }
    }
    Replace tmforum on line 8 with the name of the local database you want to use, and change 27017 if you're using a non-standard port.

    Then change lines 47-52 of utils/mongoUtils.js from:
      // We always want to make a validated TLS/SSL connection
      let options = {
          ssl: true,
          sslValidate: true,
          useNewUrlParser: true
      };
    to:
      // Connect to MongoDB without SSL (standard local installation):
      let options = {
          ssl: false,
          sslValidate: false,
          useNewUrlParser: true
      };​
    (this assumes you don't have a proper TLS certificate for your local MongoDB database, which is the standard out-of-the-box configuration).

    This should get you running locally.

    ------------------------------
    Reed Tomlinson
    TelcoDR
    ------------------------------