MLW microservice API

Projects

Operations on Machine Learning Workbench (MLW) Projects.

Info: An active subscription of the MLW microservice is required to perform operations.

GET - List of available projects

{{url}}/service/mlw/projects

Retrieves the list of projects available in MLW.

HEADERS
Authorization {{auth}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects'
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
   {'data': [{'id': '1600926359_Project',
   'name': 'Casting defect',
   'description': 'Casting defect use-case',
   'createdAt': 'Thu Sep 24 05:45:59 2020',
   'properties': [],
   'isModified': True,
   'isFreeze': False,
   'selectedVersion': '',
   'versions': [],
   'resourcesCount': {'data': 3,
    'model': 0,
    'code': 2,
    'workflow': 0,
    'pipeline': 0,
    'nn-designer': 1,
    'totalCount': 6}},]}

Example Request

401 - Unauthorized

curl --request GET "{{url}}/service/mlw/projects"

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

POST - Create a new project

{{url}}/service/mlw/projects

Creates a new project with given project name and description.

HEADERS
Authorization {{auth}}
PARAMS
name (string) required name for the project
description (string) required description of the project

Example Request

200 - OK

curl --location --request POST '{{url}}/service/mlw/projects' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: text/plain' \
--data-raw '{"name":"ExampleProject","description":"A dummy project"}'

Example Response

200 - OK

{
    "id": "1601283001_Project",
    "name": "ExampleProject",
    "description": "A dummy project",
    "createdAt": "Mon Sep 28 08:50:01 2020",
    "properties": [],
    "isModified": true,
    "isFreeze": false,
    "selectedVersion": "",
    "versions": [],
    "resourcesCount": {
        "data": 0,
        "model": 0,
        "code": 0,
        "workflow": 0,
        "pipeline": 0,
        "nn-designer": 0,
        "totalCount": 0
    }
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects' \
--header 'Content-Type: text/plain' \
--data-raw '{"name":"ExampleProject","description":"A dummy project"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

409 - Error

curl --location --request POST '{{url}}/service/mlw/projects' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: text/plain' \
--data-raw '{"name":"ExampleProject","description":"A dummy project"}'

Example Response

409 - Error

{
    "message": "Project Name already exist",
    "errorCode": 409,
    "exception": "Project Exist"
}

POST - Commit the resources of the project

{{url}}/service/mlw/projects/{{projectID}}/commit

Commit the resources of project for version control.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
listOfResources (list) list of resource IDs

Example Request

200 - OK

curl --location --request POST '{{url}}/service/mlw/projects/1600753202_Project/commit' \
--header 'Authorization: {{auth}}
--header 'Content-Type: application/json' \
--data-raw '{"listOfResources":["1601506946_0758_Resource","1600753264_0658_Resource","1600753348_0604_Resource","1600753265_0780_Resource","1601507104_0819_Resource"]}'

Example Response

200 - OK

{
    "id": "1601506976_Tasks",
    "name": "commitProject",
    "createdAt": "Wed Sep 30 23:02:56 2020",
    "type": "COMMIT",
    "cronExpression": "",
    "status": "Not Scheduled",
    "individualTasks": [
        {
            "id": "1601506976_0914_Commit",
            "pID": "68",
            "status": "COMPLETED",
            "message": "Version saved in Inventory",
            "tasksID": "1601506976_Tasks",
            "taskName": "commitProject",
            "type": "COMMIT",
            "executedAt": "Wed Sep 30 23:02:56 2020",
            "projectID": "1600753202_Project",
            "versionNumber": "v2"
        },
        {
            "id": "1601507162_0344_Commit",
            "pID": "69",
            "status": "RUNNING",
            "message": "In Progress",
            "tasksID": "1601506976_Tasks",
            "taskName": "commitProject",
            "type": "COMMIT",
            "executedAt": "Wed Sep 30 23:06:02 2020",
            "projectID": "1600753202_Project",
            "versionNumber": "v3"
        }
    ],
    "projectID": "1600753202_Project",
    "projectName": "commitProject",
    "properties": [
        {
            "key": "verison",
            "label": "Version",
            "value": "v3"
        }
    ],
    "recurrence": "ONE_TIME",
    "startDate": "",
    "startTimeH": "",
    "startTimeM": "",
    "sortTime": 1601507162
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1600753202_Project/commit' \
--header 'Content-Type: application/json' \
--data-raw '{"listOfResources":["1601506946_0758_Resource","1600753264_0658_Resource","1600753348_0604_Resource","1600753265_0780_Resource","1601507104_0819_Resource"]}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

409 - Error

curl --request POST "{{url}}/service/mlw/projects/1600932615_Project/commit" --header "Authorization: {{auth}}" 

Example Response

409 - Error

{'message': 'Please select files',
 'errorCode': 409,
 'exception': 'No file to Commit'}

PUT - Update existing project name and description

{{url}}/service/mlw/projects/{{projectID}}

Updates the exiting project name and description with given new project name and description.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) project ID of the project for which the name needs to be changed
name (string) required name for the project
description (string) required description of the project

Example Request

201 - OK

curl --location --request PUT '{{url}}/service/mlw/projects/1601507741_Project/' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"name":"ProjectNameChanged","description":"A dummy project New"}'

Example Response

201 - OK

{
    "id": "1601507741_Project",
    "name": "ProjectNameChanged",
    "description": "A dummy project New",
    "createdAt": "Wed Sep 30 23:15:41 2020",
    "properties": [],
    "isModified": true,
    "isFreeze": false,
    "selectedVersion": "",
    "versions": [],
    "resourcesCount": {
        "data": 0,
        "model": 0,
        "code": 0,
        "workflow": 0,
        "pipeline": 0,
        "nn-designer": 0,
        "totalCount": 0
    }
}

Example Request

409 - Error

curl --location --request PUT '{{url}}/service/mlw/projects/1601507741_Project/' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"name":"ProjectNameChanged","description":"A dummy project New"}'

Example Response

409 - Error

{'message': 'Project Name already exist for another project, Description also same',
 'errorCode': 409,
 'exception': 'Project Name Exist'}

Example Request

401 - Unauthorized

curl --location --request PUT '{{url}}/service/mlw/projects/1601507741_Project/' \
--header 'Content-Type: application/json' \
--data-raw '{"name":"ProjectNameChanged","description":"A dummy project New"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

DELETE - Delete an existing project

{{url}}/service/mlw/projects/{{projectID}}

Delete the existing project.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) project ID of the project

Example Request

200 - OK

curl --location --request DELETE '{{url}}/service/mlw/projects/1601507741_Project' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \

Example Response

200 - OK

{
    "data": [
        {
            "type": "MLWData",
            "lastUpdated": "2020-09-22T11:18:29.399Z",
            "name": "Vinay",
            "createdAt": "Tue Sep 15 08:46:29 2020",
            "selectedVersion": "v2",
            "description": "Vinay project",
            "resourcesCount": {
                "data": 0,
                "model": 9,
                "code": 2,
                "workflow": 4,
                "pipeline": 1,
                "nn-designer": 1,
                "totalCount": 17
            },
            "projectID": "1600159589_Project",
            "properties": [],
            "versionNumber": "v2",
            "1600159589_Project": {},
            "id": "1600159589_Project",
            "isModified": false,
            "isFreeze": false,
            "versions": [
                "v0",
                "v1",
                "v2"
            ]
        },
        
    ]
}

Example Request

401 - Unauthorized

curl --location --request DELETE '{{url}}/service/mlw/projects/1601507741_Project' \
--header 'Content-Type: application/json' \

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - List of available resources in a project

{{url}}/service/mlw/projects/{{projectID}}/resources

Retrieves the list of files available in the project. It contains info related to each file, counts of resources, all available version information of the selected project.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) project ID of the project

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1600750565_Project/resources' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{'type': 'MLWData',
 'lastUpdated': '2020-09-22T06:50:59.574Z',
 'name': 'sampleDemo',
 'createdAt': 'Tue Sep 22 04:56:05 2020',
 'selectedVersion': 'v2',
 'description': 'sample Bottles NN IC Demo',
 'resources': {'data': [{'id': '1600829327_0380_Resource',
    'name': 'P.Zero.jpg',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/P.Zero.jpg',
    'size': 38797,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1600829336_0326_Resource',
    'name': 'predicted_P_1600829336.json',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_P_1600829336.json',
    'size': 229,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1600751893_0717_Resource',
    'name': 'MD.Diet.jpg',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/MD.Diet.jpg',
    'size': 42146,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1600750617_0744_Resource',
    'name': 'sample.zip',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ZIP',
    'url': './MLW/1600750565_Project/Data/sample.zip',
    'size': 22655457,
    'mimeType': 'application/zip',
    'extension': '.zip',
    'category': 'Data'},
   {'id': '1600828823_0064_Resource',
    'name': 'predicted_MD_1600828823.json',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_MD_1600828823.json',
    'size': 220,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1600829185_0391_Resource',
    'name': 'predicted_M_1600829185.json',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_M_1600829185.json',
    'size': 229,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1600829163_1000_Resource',
    'name': 'M.Beer.jpg',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/M.Beer.jpg',
    'size': 43025,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1601012074_0042_Resource',
    'name': 'predicted_M_1601012074.json',
    'description': '',
    'createdAt': 'Fri Sep 25 05:34:34 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_M_1601012074.json',
    'size': 229,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1601012139_0815_Resource',
    'name': 'predicted_P_1601012139.json',
    'description': '',
    'createdAt': 'Fri Sep 25 05:35:39 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_P_1601012139.json',
    'size': 229,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'}],
  'model': [{'id': '1600751811_0233_Resource',
    'name': 'sampleNewDemo_1600751365.onnx',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ONNX',
    'url': './MLW/1600750565_Project/Model/sampleNewDemo_1600751365.onnx',
    'size': 8296336,
    'mimeType': 'application/ONNX',
    'extension': '.onnx',
    'category': 'Model',
    'deployed': True},
   {'id': '1600754440_0307_Resource',
    'name': 'sampleBottleModel_1600753902.onnx',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ONNX',
    'url': './MLW/1600750565_Project/Model/sampleBottleModel_1600753902.onnx',
    'size': 8296340,
    'mimeType': 'application/ONNX',
    'extension': '.onnx',
    'category': 'Model',
    'deployed': True}],
  'code': [{'id': '1600752121_0420_Resource',
    'name': 'samplePost.py',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [],
    'editedAt': '',
    'type': 'PY',
    'url': './MLW/1600750565_Project/Code/samplePost.py',
    'size': 260,
    'mimeType': 'text/x-python',
    'extension': '.py',
    'category': 'Code'},
   {'id': '1600751640_0643_Resource',
    'name': 'samplePre.py',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [],
    'editedAt': '',
    'type': 'PY',
    'url': './MLW/1600750565_Project/Code/samplePre.py',
    'size': 278,
    'mimeType': 'text/x-python',
    'extension': '.py',
    'category': 'Code'}],
  'pipeline': [{'id': '1600828801_0334_Resource',
    'name': 'samplePipeline.pipeline',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [{'label': 'ONNX Model',
      'value': 'sampleBottleModel_1600753902.onnx',
      'key': 'modelID'},
     {'label': 'Pre-Processing Script',
      'value': 'samplePre.py',
      'key': 'preProcessingID'},
     {'label': 'Post-Processing Script',
      'value': 'samplePost.py',
      'key': 'postProcessingID'}],
    'editedAt': '',
    'type': 'PIPELINE',
    'url': './MLW/1600750565_Project/Pipeline/samplePipeline.pipeline',
    'size': 134,
    'mimeType': 'application/PIPELINE',
    'extension': '.pipeline',
    'category': 'Pipeline',
    'deployed': False}],
  'workflow': [],
  'nn-designer': [{'id': '1600750594_0269_Resource',
    'name': 'sample.architecture',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ARCHITECTURE',
    'url': './MLW/1600750565_Project/NN-Designer/sample.architecture',
    'size': 17176,
    'mimeType': 'application/ARCHITECTURE',
    'extension': '.architecture',
    'category': 'NN-Designer'}]},
 'resourcesCount': {'data': 9,
  'model': 2,
  'code': 2,
  'workflow': 0,
  'pipeline': 1,
  'nn-designer': 1,
  'totalCount': 15},
 'projectID': '1600750565_Project',
 'properties': [],
 'versionNumber': 'v1',
 '1600750565_Project': {},
 'id': '1600750565_Project',
 'isModified': True,
 'isFreeze': False,
 'versions': ['v0', 'v1', 'v2']}

GET - Refresh the list of resources in a project

{{url}}/service/mlw/projects/{{projectID}}/resources

Scans the project structure to list any un-reported file in the system, which would have been generated by code execution or through notebook execution.

HEADERS
Authorization {{auth}}
refresh {{True/False}}
PARAMS
projectID (string) project ID of the project

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1600750565_Project/resources?refresh=true' \
--header 'Authorization: {{auth}}' 

Example Response

200 - OK

{'type': 'MLWData',
 'lastUpdated': '2020-09-22T06:50:59.574Z',
 'name': 'sampleDemo',
 'createdAt': 'Tue Sep 22 04:56:05 2020',
 'selectedVersion': 'v2',
 'description': 'sample Bottles NN IC Demo',
 'resources': {'data': [{'id': '1600829327_0380_Resource',
    'name': 'P.Zero.jpg',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/P.Zero.jpg',
    'size': 38797,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1600829336_0326_Resource',
    'name': 'predicted_P_1600829336.json',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_P_1600829336.json',
    'size': 229,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1600751893_0717_Resource',
    'name': 'MD.Diet.jpg',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/MD.Diet.jpg',
    'size': 42146,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1600750617_0744_Resource',
    'name': 'sample.zip',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ZIP',
    'url': './MLW/1600750565_Project/Data/sample.zip',
    'size': 22655457,
    'mimeType': 'application/zip',
    'extension': '.zip',
    'category': 'Data'},
   {'id': '1600828823_0064_Resource',
    'name': 'predicted_MD_1600828823.json',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_MD_1600828823.json',
    'size': 220,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1600829185_0391_Resource',
    'name': 'predicted_M_1600829185.json',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_M_1600829185.json',
    'size': 229,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1600829163_1000_Resource',
    'name': 'M.Beer.jpg',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/M.Beer.jpg',
    'size': 43025,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1601012074_0042_Resource',
    'name': 'predicted_M_1601012074.json',
    'description': '',
    'createdAt': 'Fri Sep 25 05:34:34 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_M_1601012074.json',
    'size': 229,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1601012139_0815_Resource',
    'name': 'predicted_P_1601012139.json',
    'description': '',
    'createdAt': 'Fri Sep 25 05:35:39 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_P_1601012139.json',
    'size': 229,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'}],
  'model': [{'id': '1600751811_0233_Resource',
    'name': 'sampleNewDemo_1600751365.onnx',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ONNX',
    'url': './MLW/1600750565_Project/Model/sampleNewDemo_1600751365.onnx',
    'size': 8296336,
    'mimeType': 'application/ONNX',
    'extension': '.onnx',
    'category': 'Model',
    'deployed': True},
   {'id': '1600754440_0307_Resource',
    'name': 'sampleBottleModel_1600753902.onnx',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:25 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ONNX',
    'url': './MLW/1600750565_Project/Model/sampleBottleModel_1600753902.onnx',
    'size': 8296340,
    'mimeType': 'application/ONNX',
    'extension': '.onnx',
    'category': 'Model',
    'deployed': True}],
  'code': [{'id': '1600752121_0420_Resource',
    'name': 'samplePost.py',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [],
    'editedAt': '',
    'type': 'PY',
    'url': './MLW/1600750565_Project/Code/samplePost.py',
    'size': 260,
    'mimeType': 'text/x-python',
    'extension': '.py',
    'category': 'Code'},
   {'id': '1600751640_0643_Resource',
    'name': 'samplePre.py',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [],
    'editedAt': '',
    'type': 'PY',
    'url': './MLW/1600750565_Project/Code/samplePre.py',
    'size': 278,
    'mimeType': 'text/x-python',
    'extension': '.py',
    'category': 'Code'}],
  'pipeline': [{'id': '1600828801_0334_Resource',
    'name': 'samplePipeline.pipeline',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [{'label': 'ONNX Model',
      'value': 'sampleBottleModel_1600753902.onnx',
      'key': 'modelID'},
     {'label': 'Pre-Processing Script',
      'value': 'samplePre.py',
      'key': 'preProcessingID'},
     {'label': 'Post-Processing Script',
      'value': 'samplePost.py',
      'key': 'postProcessingID'}],
    'editedAt': '',
    'type': 'PIPELINE',
    'url': './MLW/1600750565_Project/Pipeline/samplePipeline.pipeline',
    'size': 134,
    'mimeType': 'application/PIPELINE',
    'extension': '.pipeline',
    'category': 'Pipeline',
    'deployed': False}],
  'workflow': [],
  'nn-designer': [{'id': '1600750594_0269_Resource',
    'name': 'sample.architecture',
    'description': '',
    'createdAt': 'Thu Sep 24 09:05:24 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ARCHITECTURE',
    'url': './MLW/1600750565_Project/NN-Designer/sample.architecture',
    'size': 17176,
    'mimeType': 'application/ARCHITECTURE',
    'extension': '.architecture',
    'category': 'NN-Designer'}]},
 'resourcesCount': {'data': 9,
  'model': 2,
  'code': 2,
  'workflow': 0,
  'pipeline': 1,
  'nn-designer': 1,
  'totalCount': 15},
 'projectID': '1600750565_Project',
 'properties': [],
 'versionNumber': 'v1',
 '1600750565_Project': {},
 'id': '1600750565_Project',
 'isModified': True,
 'isFreeze': False,
 'versions': ['v0', 'v1', 'v2']}

GET - Pull data from a specific version of the project to work on

{{url}}/service/mlw/projects/{{projectID}}/resources

Pulls all the resources from the C8Y inventory of the selected version of the project.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) project ID of the project
versionNumber {{versionNumber}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1600750565_Project/resources?versionNumber=v0' \
--header 'Authorization: {{auth}}' 

Example Response

200 - OK

{'type': 'MLWData',
 'lastUpdated': '2020-09-22T06:50:59.574Z',
 'name': 'sampleDemo',
 'createdAt': 'Tue Sep 22 04:56:05 2020',
 'selectedVersion': 'v0',
 'description': 'sample Bottles NN IC Demo',
 'resources': {'data': [{'id': '1600753567_0365_Resource',
    'name': 'MD.Orig.jpg',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/MD.Orig.jpg',
    'size': 39675,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1600751893_0717_Resource',
    'name': 'MD.Diet.jpg',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/MD.Diet.jpg',
    'size': 42146,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1600753267_0571_Resource',
    'name': 'predicted_MD_1600753267.json',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_MD_1600753267.json',
    'size': 222,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1600750617_0744_Resource',
    'name': 'sample.zip',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ZIP',
    'url': './MLW/1600750565_Project/Data/sample.zip',
    'size': 22655457,
    'mimeType': 'application/zip',
    'extension': '.zip',
    'category': 'Data'},
   {'id': '1600753576_0003_Resource',
    'name': 'predicted_MD_1600753576.json',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_MD_1600753576.json',
    'size': 235,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'}],
  'model': [{'id': '1600751811_0233_Resource',
    'name': 'sampleNewDemo_1600751365.onnx',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ONNX',
    'url': './MLW/1600750565_Project/Model/sampleNewDemo_1600751365.onnx',
    'size': 8296336,
    'mimeType': 'application/ONNX',
    'extension': '.onnx',
    'category': 'Model',
    'deployed': True}],
  'code': [{'id': '1600752121_0420_Resource',
    'name': 'samplePost.py',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'PY',
    'url': './MLW/1600750565_Project/Code/samplePost.py',
    'size': 260,
    'mimeType': 'text/x-python',
    'extension': '.py',
    'category': 'Code'},
   {'id': '1600751640_0643_Resource',
    'name': 'samplePre.py',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'PY',
    'url': './MLW/1600750565_Project/Code/samplePre.py',
    'size': 278,
    'mimeType': 'text/x-python',
    'extension': '.py',
    'category': 'Code'}],
  'pipeline': [{'id': '1600753248_0497_Resource',
    'name': 'samplePipe.pipeline',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [{'label': 'ONNX Model',
      'value': 'sampleNewDemo_1600751365.onnx',
      'key': 'modelID'},
     {'label': 'Pre-Processing Script',
      'value': 'samplePre.py',
      'key': 'preProcessingID'},
     {'label': 'Post-Processing Script',
      'value': 'samplePost.py',
      'key': 'postProcessingID'}],
    'editedAt': '',
    'type': 'PIPELINE',
    'url': './MLW/1600750565_Project/Pipeline/samplePipe.pipeline',
    'size': 134,
    'mimeType': 'application/PIPELINE',
    'extension': '.pipeline',
    'category': 'Pipeline',
    'deployed': True}],
  'workflow': [],
  'nn-designer': [{'id': '1600750594_0269_Resource',
    'name': 'sample.architecture',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ARCHITECTURE',
    'url': './MLW/1600750565_Project/NN-Designer/sample.architecture',
    'size': 17176,
    'mimeType': 'application/ARCHITECTURE',
    'extension': '.architecture',
    'category': 'NN-Designer'}]},
 'resourcesCount': {'data': 5,
  'model': 1,
  'code': 2,
  'workflow': 0,
  'pipeline': 1,
  'nn-designer': 1,
  'totalCount': 10},
 'projectID': '1600750565_Project',
 'properties': [],
 'versionNumber': 'v1',
 '1600750565_Project': {},
 'id': '1600750565_Project',
 'isModified': True,
 'isFreeze': False,
 'versions': ['v0', 'v1', 'v2']}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1600750565_Project/resources?versionNumber=v0' 

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

POST - Upload files into the Project

{{url}}/service/mlw/projects/{{projectID}}/resources

To upload the resource files to use in the project, files like csv, txt, json.

HEADERS
Authorization {{auth}}
file {{file Object}}
PARAMS
projectID (string) project ID of the project

Example Request

200 - OK

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources' \
--header 'Authorization: {{auth}}' \
--form 'file=@/../../iris Dataset.csv'

Example Response

200 - OK

{
    "id": "1601283001_Project",
    "name": "ExampleProject",
    "description": "A dummy project",
    "createdAt": "Mon Sep 28 08:50:01 2020",
    "properties": [],
    "isModified": true,
    "isFreeze": false,
    "selectedVersion": "",
    "versions": [],
    "resources": {
        "data": [
            {
                "id": "1601283851_0844_Resource",
                "name": "iris Dataset.csv",
                "description": "",
                "createdAt": "Mon Sep 28 09:04:11 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 150
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 5
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "col1",
                            "col2",
                            "col3",
                            "col4",
                            "target"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601283001_Project/Data/iris Dataset.csv",
                "size": 2878,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            }
        ],
        "model": [],
        "code": [],
        "pipeline": [],
        "workflow": [],
        "nn-designer": []
    },
    "resourcesCount": {
        "data": 1,
        "model": 0,
        "code": 0,
        "workflow": 0,
        "pipeline": 0,
        "nn-designer": 0,
        "totalCount": 1
    }
}

Example Request

409 - Not Supported

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources' \
--header '{{auth}}' \
--form 'file=@/../../LogisticR.pmml'

Example Response

409 - Not Supported

{'message': 'File type not supported',
 'errorCode': 409,
 'exception': 'Contact Admin for Support'}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources' \
--form 'file=@/../../iris Dataset.csv'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

POST - Create new resource files into the Project (Python Script file)

{{url}}/service/mlw/projects/{{projectID}}/resources/createnew

To create new resource files (Python script) to use in the project.

HEADERS
Authorization {{auth}}
name {{name of the file}}
type {{py}}
PARAMS
projectID (string) project ID of the project

Example Request

200 - OK 

curl --location --request POST "{{url}}/service/mlw/projects/1600750565_Project/resources/createnew" \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"type":"py","name":"samplePY"}'

Example Response

200 - OK

{'type': 'MLWData',
 'lastUpdated': '2020-09-22T06:50:59.574Z',
 'name': 'sampleDemo',
 'createdAt': 'Tue Sep 22 04:56:05 2020',
 'selectedVersion': 'v0',
 'description': 'sample Bottles NN IC Demo',
 'resources': {'data': [{'id': '1600753567_0365_Resource',
    'name': 'MD.Orig.jpg',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/MD.Orig.jpg',
    'size': 39675,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1600751893_0717_Resource',
    'name': 'MD.Diet.jpg',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/MD.Diet.jpg',
    'size': 42146,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1600753267_0571_Resource',
    'name': 'predicted_MD_1600753267.json',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_MD_1600753267.json',
    'size': 222,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1600750617_0744_Resource',
    'name': 'sample.zip',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ZIP',
    'url': './MLW/1600750565_Project/Data/sample.zip',
    'size': 22655457,
    'mimeType': 'application/zip',
    'extension': '.zip',
    'category': 'Data'},
   {'id': '1600753576_0003_Resource',
    'name': 'predicted_MD_1600753576.json',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_MD_1600753576.json',
    'size': 235,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1601252767_0581_Resource',
    'name': 'admissions.csv',
    'description': '',
    'createdAt': 'Mon Sep 28 00:26:07 2020',
    'properties': [{'key': 'numberOfRows',
      'label': 'Number of Rows',
      'value': 644},
     {'key': 'numberOfColumns', 'label': 'Number of Columns', 'value': 3},
     {'key': 'columnNames',
      'label': 'Column Names',
      'value': ['target', 'gpa', 'gre']}],
    'editedAt': '',
    'type': 'CSV',
    'url': './MLW/1600750565_Project/Data/admissions.csv',
    'size': 17192,
    'mimeType': 'text/csv',
    'extension': '.csv',
    'category': 'Data'}],
  'model': [{'id': '1600751811_0233_Resource',
    'name': 'sampleNewDemo_1600751365.onnx',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ONNX',
    'url': './MLW/1600750565_Project/Model/sampleNewDemo_1600751365.onnx',
    'size': 8296336,
    'mimeType': 'application/ONNX',
    'extension': '.onnx',
    'category': 'Model',
    'deployed': True}],
  'code': [{'id': '1600752121_0420_Resource',
    'name': 'samplePY.py',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'PY',
    'url': './MLW/1600750565_Project/Code/samplePost.py',
    'size': 260,
    'mimeType': 'text/x-python',
    'extension': '.py',
    'category': 'Code'},
   {'id': '1600751640_0643_Resource',
    'name': 'samplePre.py',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'PY',
    'url': './MLW/1600750565_Project/Code/samplePre.py',
    'size': 278,
    'mimeType': 'text/x-python',
    'extension': '.py',
    'category': 'Code'}],
  'pipeline': [{'id': '1600753248_0497_Resource',
    'name': 'samplePipe.pipeline',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [{'label': 'ONNX Model',
      'value': 'sampleNewDemo_1600751365.onnx',
      'key': 'modelID'},
     {'label': 'Pre-Processing Script',
      'value': 'samplePre.py',
      'key': 'preProcessingID'},
     {'label': 'Post-Processing Script',
      'value': 'samplePost.py',
      'key': 'postProcessingID'}],
    'editedAt': '',
    'type': 'PIPELINE',
    'url': './MLW/1600750565_Project/Pipeline/samplePipe.pipeline',
    'size': 134,
    'mimeType': 'application/PIPELINE',
    'extension': '.pipeline',
    'category': 'Pipeline',
    'deployed': True}],
  'workflow': [],
  'nn-designer': [{'id': '1600750594_0269_Resource',
    'name': 'sample.architecture',
    'description': '',
    'createdAt': 'Fri Sep 25 09:49:29 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ARCHITECTURE',
    'url': './MLW/1600750565_Project/NN-Designer/sample.architecture',
    'size': 17176,
    'mimeType': 'application/ARCHITECTURE',
    'extension': '.architecture',
    'category': 'NN-Designer'}]},
 'resourcesCount': {'data': 6,
  'model': 1,
  'code': 2,
  'workflow': 0,
  'pipeline': 1,
  'nn-designer': 1,
  'totalCount': 11},
 'projectID': '1600750565_Project',
 'properties': [],
 'versionNumber': 'v1',
 '1600750565_Project': {},
 'id': '1600750565_Project',
 'isModified': True,
 'isFreeze': False,
 'versions': ['v0', 'v1', 'v2']}

Example Request

401 - Unauthorized

curl --location --request POST "{{url}}/service/mlw/projects/1600750565_Project/resources/createnew" \
--header 'Content-Type: application/json' \
--data-raw '{"type":"py","name":"samplePY"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

POST - Create new resource files into the Project (Workflow file)

{{url}}/service/mlw/projects/{{projectID}}/resources/createnew

To create new resource files (Workflow file) to use in the project.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) project ID of the project
type {{type}}
name {{name of file}}
modelID {{modelID}}
preProcessingID {{preProcessingID}}
dataID {{dataID}}

Example Request

200 - OK 

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/createnew' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"type":"wf","name":"SampleWF1","modelID":"1601285748_0318_Resource","preProcessingID":"1601419709_0877_Resource","dataID":"1601283851_0844_Resource"}'

Example Response

200 - OK

{
    "id": "1601283001_Project",
    "name": "ExampleProject",
    "description": "A dummy project",
    "createdAt": "Mon Sep 28 08:50:01 2020",
    "properties": [],
    "isModified": true,
    "isFreeze": false,
    "selectedVersion": "",
    "versions": [],
    "resources": {
        "data": [
            {
                "id": "1601283851_0844_Resource",
                "name": "iris Dataset.csv",
                "description": "",
                "createdAt": "Mon Sep 28 09:04:11 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 150
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 5
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "col1",
                            "col2",
                            "col3",
                            "col4",
                            "target"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601283001_Project/Data/iris Dataset.csv",
                "size": 2878,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            },
            {
                "id": "1601287703_0088_Resource",
                "name": "sensorData.csv",
                "description": "",
                "createdAt": "Mon Sep 28 10:08:23 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 658
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 5
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "time",
                            "Sensor1_sensor4",
                            "Sensor1_sensor2",
                            "Sensor1_sensor3",
                            "Sensor1_sensor1"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601283001_Project/Data/sensorData.csv",
                "size": 35798,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            },
            {
                "id": "1601287703_0029_Resource",
                "name": "sensorData2.csv",
                "description": "",
                "createdAt": "Mon Sep 28 10:08:23 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 658
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 5
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "time",
                            "Sensor1_sensor4",
                            "Sensor1_sensor2",
                            "Sensor1_sensor3",
                            "Sensor1_sensor1"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601283001_Project/Data/sensorData2.csv",
                "size": 35798,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            }
        ],
        "model": [
            {
                "id": "1601285748_0318_Resource",
                "name": "SampleModel.pmml",
                "description": "",
                "createdAt": "Mon Sep 28 09:35:48 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-28 09:27:35.741949"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "col1",
                            "col2",
                            "col3",
                            "col4",
                            "target"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "classification"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Tree Based Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "SampleModel"
                    },
                    {
                        "key": "numberOfTrees",
                        "label": "Number of trees",
                        "value": 74
                    },
                    {
                        "key": "modelInformation",
                        "label": "Model information",
                        "value": 10
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1601283001_Project/Model/SampleModel.pmml",
                "size": 1070267,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": false
            }
        ],
        "code": [
            {
                "id": "1601419709_0877_Resource",
                "name": "postProcessingScriptMobilenet.py",
                "description": "",
                "createdAt": "Tue Sep 29 22:48:29 2020",
                "properties": [],
                "editedAt": "",
                "type": "PY",
                "url": "./MLW/1601283001_Project/Code/postProcessingScriptMobilenet.py",
                "size": 822,
                "mimeType": "text/x-python",
                "extension": ".py",
                "category": "Code",
                "deployed": false
            }
        ],
        "pipeline": [],
        "workflow": [
            {
                "id": "1601420218_0253_Resource",
                "name": "SampleWF1.wf",
                "description": "",
                "createdAt": "Tue Sep 29 22:56:58 2020",
                "properties": [
                    {
                        "key": "modelID",
                        "label": "PMML Model",
                        "value": "SampleModel.pmml"
                    },
                    {
                        "key": "dataID",
                        "label": "Dataset",
                        "value": "iris Dataset.csv"
                    },
                    {
                        "key": "preProcessingID",
                        "label": "Pre-Processing Script",
                        "value": "postProcessingScriptMobilenet.py"
                    }
                ],
                "editedAt": "Tue Sep 29 22:56:58 2020",
                "type": "WORKFLOW",
                "url": "./MLW/1601283001_Project/Workflow/SampleWF1.wf",
                "size": 124,
                "mimeType": "application/WORKFLOW",
                "extension": ".wf",
                "category": "Workflow",
                "dataID": "1601283851_0844_Resource",
                "modelID": "1601285748_0318_Resource",
                "preProcessingID": "1601419709_0877_Resource"
            }
        ],
        "nn-designer": []
    },
    "resourcesCount": {
        "data": 3,
        "model": 1,
        "code": 1,
        "workflow": 1,
        "pipeline": 0,
        "nn-designer": 0,
        "totalCount": 6
    }
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/createnew' \
--data-raw '{"type":"wf","name":"SampleWF2","preProcessingID":"1601419709_0877_Resource","dataID":"1601283851_0844_Resource"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

POST - Create new resource files into the Project (Notebook file)

{{url}}/service/mlw/projects/{{projectID}}/resources/createnew

To create new resource files (Notebook file) to use in the project.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) project ID of the project
type {{type}}
name {{name of file}}

Example Request

200 - OK 

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/createnew' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"type":"ipynb","name":"sampleNotebook1","modelID":null,"preProcessingID":null,"dataID":null}'

Example Response

200 - OK

{
    "id": "1601283001_Project",
    "name": "ExampleProject",
    "description": "A dummy project",
    "createdAt": "Mon Sep 28 08:50:01 2020",
    "properties": [],
    "isModified": true,
    "isFreeze": false,
    "selectedVersion": "",
    "versions": [],
    "resources": {
        "data": [
            {
                "id": "1601283851_0844_Resource",
                "name": "iris Dataset.csv",
                "description": "",
                "createdAt": "Mon Sep 28 09:04:11 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 150
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 5
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "col1",
                            "col2",
                            "col3",
                            "col4",
                            "target"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601283001_Project/Data/iris Dataset.csv",
                "size": 2878,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            },
            {
                "id": "1601287703_0088_Resource",
                "name": "sensorData.csv",
                "description": "",
                "createdAt": "Mon Sep 28 10:08:23 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 658
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 5
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "time",
                            "Sensor1_sensor4",
                            "Sensor1_sensor2",
                            "Sensor1_sensor3",
                            "Sensor1_sensor1"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601283001_Project/Data/sensorData.csv",
                "size": 35798,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            },
            {
                "id": "1601287703_0029_Resource",
                "name": "sensorData2.csv",
                "description": "",
                "createdAt": "Mon Sep 28 10:08:23 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 658
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 5
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "time",
                            "Sensor1_sensor4",
                            "Sensor1_sensor2",
                            "Sensor1_sensor3",
                            "Sensor1_sensor1"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601283001_Project/Data/sensorData2.csv",
                "size": 35798,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            }
        ],
        "model": [
            {
                "id": "1601285748_0318_Resource",
                "name": "SampleModel.pmml",
                "description": "",
                "createdAt": "Mon Sep 28 09:35:48 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-28 09:27:35.741949"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "col1",
                            "col2",
                            "col3",
                            "col4",
                            "target"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "classification"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Tree Based Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "SampleModel"
                    },
                    {
                        "key": "numberOfTrees",
                        "label": "Number of trees",
                        "value": 74
                    },
                    {
                        "key": "modelInformation",
                        "label": "Model information",
                        "value": 10
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1601283001_Project/Model/SampleModel.pmml",
                "size": 1070267,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": false
            }
        ],
        "code": [
            {
                "id": "1601419709_0877_Resource",
                "name": "postProcessingScriptMobilenet.py",
                "description": "",
                "createdAt": "Tue Sep 29 22:48:29 2020",
                "properties": [],
                "editedAt": "",
                "type": "PY",
                "url": "./MLW/1601283001_Project/Code/postProcessingScriptMobilenet.py",
                "size": 822,
                "mimeType": "text/x-python",
                "extension": ".py",
                "category": "Code",
                "deployed": false
            },
            {
                "id": "1601420557_0857_Resource",
                "name": "sampleNotebook1.ipynb",
                "description": "",
                "createdAt": "Tue Sep 29 23:02:37 2020",
                "properties": [],
                "editedAt": "Tue Sep 29 23:02:37 2020",
                "type": "IPYNB",
                "url": "./MLW/1601283001_Project/Code/sampleNotebook1.ipynb",
                "size": 65,
                "mimeType": "application/NOTEBOOK",
                "extension": ".ipynb",
                "category": "Code"
            }
        ],
        "pipeline": [],
        "workflow": [
            {
                "id": "1601420218_0253_Resource",
                "name": "SampleWF1.wf",
                "description": "",
                "createdAt": "Tue Sep 29 22:56:58 2020",
                "properties": [
                    {
                        "key": "modelID",
                        "label": "PMML Model",
                        "value": "SampleModel.pmml"
                    },
                    {
                        "key": "dataID",
                        "label": "Dataset",
                        "value": "iris Dataset.csv"
                    },
                    {
                        "key": "preProcessingID",
                        "label": "Pre-Processing Script",
                        "value": "postProcessingScriptMobilenet.py"
                    }
                ],
                "editedAt": "Tue Sep 29 22:56:58 2020",
                "type": "WORKFLOW",
                "url": "./MLW/1601283001_Project/Workflow/SampleWF1.wf",
                "size": 124,
                "mimeType": "application/WORKFLOW",
                "extension": ".wf",
                "category": "Workflow",
                "dataID": "1601283851_0844_Resource",
                "modelID": "1601285748_0318_Resource",
                "preProcessingID": "1601419709_0877_Resource"
            }
        ],
        "nn-designer": []
    },
    "resourcesCount": {
        "data": 3,
        "model": 1,
        "code": 2,
        "workflow": 1,
        "pipeline": 0,
        "nn-designer": 0,
        "totalCount": 7
    }
}


Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/createnew' \
--data-raw '{"type":"ipynb","name":"sampleNotebook1","modelID":null,"preProcessingID":null,"dataID":null}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

POST - Create new resource files into the Project (Architecture file)

{{url}}/service/mlw/projects/{{projectID}}/resources/createnew

To create new resource files (Architecture file for NN Designer) to use in the project.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) project ID of the project
type {{type}}
name {{name of file}}

Example Request

200 - OK 

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/createnew' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"type":"architecture","name":"sampleNNDesigner1","modelID":null,"preProcessingID":null,"dataID":null}'

Example Response

200 - OK

{
    "id": "1601283001_Project",
    "name": "ExampleProject",
    "description": "A dummy project",
    "createdAt": "Mon Sep 28 08:50:01 2020",
    "properties": [],
    "isModified": true,
    "isFreeze": false,
    "selectedVersion": "",
    "versions": [],
    "resources": {
        "data": [
            {
                "id": "1601283851_0844_Resource",
                "name": "iris Dataset.csv",
                "description": "",
                "createdAt": "Mon Sep 28 09:04:11 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 150
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 5
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "col1",
                            "col2",
                            "col3",
                            "col4",
                            "target"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601283001_Project/Data/iris Dataset.csv",
                "size": 2878,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            },
            {
                "id": "1601287703_0088_Resource",
                "name": "sensorData.csv",
                "description": "",
                "createdAt": "Mon Sep 28 10:08:23 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 658
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 5
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "time",
                            "Sensor1_sensor4",
                            "Sensor1_sensor2",
                            "Sensor1_sensor3",
                            "Sensor1_sensor1"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601283001_Project/Data/sensorData.csv",
                "size": 35798,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            },
            {
                "id": "1601287703_0029_Resource",
                "name": "sensorData2.csv",
                "description": "",
                "createdAt": "Mon Sep 28 10:08:23 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 658
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 5
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "time",
                            "Sensor1_sensor4",
                            "Sensor1_sensor2",
                            "Sensor1_sensor3",
                            "Sensor1_sensor1"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601283001_Project/Data/sensorData2.csv",
                "size": 35798,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            }
        ],
        "model": [
            {
                "id": "1601285748_0318_Resource",
                "name": "SampleModel.pmml",
                "description": "",
                "createdAt": "Mon Sep 28 09:35:48 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-28 09:27:35.741949"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "col1",
                            "col2",
                            "col3",
                            "col4",
                            "target"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "classification"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Tree Based Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "SampleModel"
                    },
                    {
                        "key": "numberOfTrees",
                        "label": "Number of trees",
                        "value": 74
                    },
                    {
                        "key": "modelInformation",
                        "label": "Model information",
                        "value": 10
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1601283001_Project/Model/SampleModel.pmml",
                "size": 1070267,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": false
            }
        ],
        "code": [
            {
                "id": "1601419709_0877_Resource",
                "name": "postProcessingScriptMobilenet.py",
                "description": "",
                "createdAt": "Tue Sep 29 22:48:29 2020",
                "properties": [],
                "editedAt": "",
                "type": "PY",
                "url": "./MLW/1601283001_Project/Code/postProcessingScriptMobilenet.py",
                "size": 822,
                "mimeType": "text/x-python",
                "extension": ".py",
                "category": "Code",
                "deployed": false
            },
            {
                "id": "1601420557_0857_Resource",
                "name": "sampleNotebook1.ipynb",
                "description": "",
                "createdAt": "Tue Sep 29 23:02:37 2020",
                "properties": [],
                "editedAt": "Tue Sep 29 23:02:37 2020",
                "type": "IPYNB",
                "url": "./MLW/1601283001_Project/Code/sampleNotebook1.ipynb",
                "size": 65,
                "mimeType": "application/NOTEBOOK",
                "extension": ".ipynb",
                "category": "Code"
            }
        ],
        "pipeline": [],
        "workflow": [
            {
                "id": "1601420218_0253_Resource",
                "name": "SampleWF1.wf",
                "description": "",
                "createdAt": "Tue Sep 29 22:56:58 2020",
                "properties": [
                    {
                        "key": "modelID",
                        "label": "PMML Model",
                        "value": "SampleModel.pmml"
                    },
                    {
                        "key": "dataID",
                        "label": "Dataset",
                        "value": "iris Dataset.csv"
                    },
                    {
                        "key": "preProcessingID",
                        "label": "Pre-Processing Script",
                        "value": "postProcessingScriptMobilenet.py"
                    }
                ],
                "editedAt": "Tue Sep 29 22:56:58 2020",
                "type": "WORKFLOW",
                "url": "./MLW/1601283001_Project/Workflow/SampleWF1.wf",
                "size": 124,
                "mimeType": "application/WORKFLOW",
                "extension": ".wf",
                "category": "Workflow",
                "dataID": "1601283851_0844_Resource",
                "modelID": "1601285748_0318_Resource",
                "preProcessingID": "1601419709_0877_Resource"
            }
        ],
        "nn-designer": [
            {
                "id": "1601420795_0895_Resource",
                "name": "sampleNNDesigner1.architecture",
                "description": "",
                "createdAt": "Tue Sep 29 23:06:35 2020",
                "properties": [],
                "editedAt": "Tue Sep 29 23:06:35 2020",
                "type": "ARCHITECTURE",
                "url": "./MLW/1601283001_Project/NN-Designer/sampleNNDesigner1.architecture",
                "size": 0,
                "mimeType": "application/ARCHITECTURE",
                "extension": ".architecture",
                "category": "NN-Designer"
            }
        ]
    },
    "resourcesCount": {
        "data": 3,
        "model": 1,
        "code": 2,
        "workflow": 1,
        "pipeline": 0,
        "nn-designer": 1,
        "totalCount": 8
    }
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/createnew' \
--data-raw '{"type":"architecture","name":"sampleNNDesigner1","modelID":null,"preProcessingID":null,"dataID":null}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

POST - Create new resource files into the Project (Pipeline file)

{{url}}/service/mlw/projects/{{projectID}}/resources/createnew

To create new resource files (Pipeline file) to use in the project.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) project ID of the project
type {{type}}
name {{name of file}}
modelID {{modelID}}
preProcessingID {{preProcessingID}}
postProcessingID {{postProcessingID}}

Example Request

200 - OK 

curl --location --request POST '{{url}}/service/mlw/projects/1600159589_Project/resources/createnew' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"type":"pipeline","name":"samplePipeline","modelID":"1600160427_0551_Resource","preProcessingID":"1600766226_0198_Resource","postProcessingID":"1600766226_0198_Resource"}'

Example Response

200 - OK

{
    "type": "MLWData",
    "lastUpdated": "2020-09-22T11:18:29.399Z",
    "name": "sampleProject",
    "createdAt": "Tue Sep 15 08:46:29 2020",
    "selectedVersion": "v1",
    "description": "Vinay project",
    "resources": {
        "data": [],
        "model": [
            {
                "id": "1600159745_0007_Resource",
                "name": "anomalyModelISO.pmml",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:50 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-15 08:48:35.154704"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "Sensor1_temperature2",
                            "Sensor1_temperature1",
                            "Sensor1_pressure2"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1600159589_Project/Model/anomalyModelISO.pmml",
                "size": 2301780,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": true
            },
            {
                "id": "1600160043_0368_Resource",
                "name": "admsModel_retrained_v1.pmml",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:51 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-15 08:54:03.784880"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "gpa",
                            "gre",
                            "target"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "classification"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Tree Based Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "admsModel"
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1600159589_Project/Model/admsModel_retrained_v1.pmml",
                "size": 10399,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": false
            },
            {
                "id": "1600160427_0551_Resource",
                "name": "admsNN_1600160423.onnx",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:51 2020",
                "properties": [],
                "editedAt": "",
                "type": "ONNX",
                "url": "./MLW/1600159589_Project/Model/admsNN_1600160423.onnx",
                "size": 2313303,
                "mimeType": "application/ONNX",
                "extension": ".onnx",
                "category": "Model",
                "deployed": true
            },
            {
                "id": "1600159745_0280_Resource",
                "name": "anomalyModelOCS.pmml",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:51 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-15 08:49:05.169855"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "Sensor1_temperature2",
                            "Sensor1_temperature1",
                            "Sensor1_pressure2"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1600159589_Project/Model/anomalyModelOCS.pmml",
                "size": 49832,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": true
            },
            {
                "id": "1600159690_0582_Resource",
                "name": "autoModel.pmml",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:51 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-15 08:48:06.024714"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "cylinders",
                            "displacement",
                            "horsepower",
                            "weight",
                            "acceleration",
                            "model_year",
                            "origin",
                            "mpg"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "regression"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Linear Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "autoModel"
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1600159589_Project/Model/autoModel.pmml",
                "size": 3130,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": true
            },
            {
                "id": "1600160054_0140_Resource",
                "name": "admsModel_retrained_v2.pmml",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:51 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-15 08:54:14.918638"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "gpa",
                            "gre",
                            "target"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "classification"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Tree Based Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "admsModel"
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1600159589_Project/Model/admsModel_retrained_v2.pmml",
                "size": 10397,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": false
            },
            {
                "id": "1600160215_0688_Resource",
                "name": "mobilenet_1.00_224.onnx",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:51 2020",
                "properties": [],
                "editedAt": "",
                "type": "ONNX",
                "url": "./MLW/1600159589_Project/Model/mobilenet_1.00_224.onnx",
                "size": 16897186,
                "mimeType": "application/ONNX",
                "extension": ".onnx",
                "category": "Model",
                "deployed": true
            },
            {
                "id": "1600160121_0500_Resource",
                "name": "admsModel_retrained_v3.pmml",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:51 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-15 08:55:21.230076"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "gpa",
                            "gre",
                            "target"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "classification"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Tree Based Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "admsModel"
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1600159589_Project/Model/admsModel_retrained_v3.pmml",
                "size": 11148,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": false
            },
            {
                "id": "1600159682_0955_Resource",
                "name": "admsModel.pmml",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:51 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-15 08:47:47.039683"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "gpa",
                            "gre",
                            "target"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "classification"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Tree Based Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "admsModel"
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1600159589_Project/Model/admsModel.pmml",
                "size": 10399,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": true
            }
        ],
        "code": [
            {
                "id": "1600766226_0198_Resource",
                "name": "postProcessingScriptMobilenet.py",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:50 2020",
                "properties": [],
                "editedAt": "",
                "type": "PY",
                "url": "./MLW/1600159589_Project/Code/postProcessingScriptMobilenet.py",
                "size": 822,
                "mimeType": "text/x-python",
                "extension": ".py",
                "category": "Code"
            }
        ],
        "pipeline": [
            {
                "id": "1600773307_0847_Resource",
                "name": "admsPipe.pipeline",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:50 2020",
                "properties": [
                    {
                        "label": "ONNX Model",
                        "value": "admsNN_1600160423.onnx",
                        "key": "modelID"
                    },
                    {
                        "label": "Pre-Processing Script",
                        "value": "postProcessingScriptMobilenet.py",
                        "key": "preProcessingID"
                    }
                ],
                "editedAt": "",
                "type": "PIPELINE",
                "url": "./MLW/1600159589_Project/Pipeline/admsPipe.pipeline",
                "size": 86,
                "mimeType": "application/PIPELINE",
                "extension": ".pipeline",
                "category": "Pipeline",
                "deployed": true
            },
            {
                "id": "1601421194_0426_Resource",
                "name": "samplePipeline.pipeline",
                "description": "",
                "createdAt": "Tue Sep 29 23:13:14 2020",
                "properties": [
                    {
                        "key": "modelID",
                        "label": "ONNX Model",
                        "value": "admsNN_1600160423.onnx"
                    },
                    {
                        "key": "preProcessingID",
                        "label": "Pre-Processing Script",
                        "value": "postProcessingScriptMobilenet.py"
                    },
                    {
                        "key": "postProcessingID",
                        "label": "Post-Processing Script",
                        "value": "postProcessingScriptMobilenet.py"
                    }
                ],
                "editedAt": "Tue Sep 29 23:13:14 2020",
                "type": "PIPELINE",
                "url": "./MLW/1600159589_Project/Pipeline/samplePipeline.pipeline",
                "size": 134,
                "mimeType": "application/PIPELINE",
                "extension": ".pipeline",
                "category": "Pipeline",
                "preProcessingID": "1600766226_0198_Resource",
                "modelID": "1600160427_0551_Resource",
                "postProcessingID": "1600766226_0198_Resource",
                "deployed": false
            }
        ],
        "workflow": [
            {
                "id": "1600160015_0019_Resource",
                "name": "WF2.wf",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:50 2020",
                "properties": [
                    {
                        "label": "PMML Model",
                        "value": "admsModel.pmml",
                        "key": "modelID"
                    },
                    {
                        "label": "Dataset",
                        "value": "admissions.csv",
                        "key": "dataID"
                    },
                    {
                        "label": "Pre-Processing Script",
                        "value": "ppforDataSupervised.py",
                        "key": "preProcessingID"
                    }
                ],
                "editedAt": "",
                "type": "WORKFLOW",
                "url": "./MLW/1600159589_Project/Workflow/WF2.wf",
                "size": 124,
                "mimeType": "application/WF",
                "extension": ".wf",
                "category": "Workflow"
            },
            {
                "id": "1600160215_0082_Resource",
                "name": "test.wf",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:50 2020",
                "properties": [],
                "editedAt": "",
                "type": "WORKFLOW",
                "url": "./MLW/1600159589_Project/Workflow/test.wf",
                "size": 86,
                "mimeType": "application/WF",
                "extension": ".wf",
                "category": "Workflow"
            },
            {
                "id": "1600159989_0623_Resource",
                "name": "admsWF.wf",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:50 2020",
                "properties": [
                    {
                        "label": "PMML Model",
                        "value": "admsModel.pmml",
                        "key": "modelID"
                    },
                    {
                        "label": "Dataset",
                        "value": "admissions.csv",
                        "key": "dataID"
                    }
                ],
                "editedAt": "",
                "type": "WORKFLOW",
                "url": "./MLW/1600159589_Project/Workflow/admsWF.wf",
                "size": 77,
                "mimeType": "application/WF",
                "extension": ".wf",
                "category": "Workflow"
            },
            {
                "id": "1600160108_0219_Resource",
                "name": "WF3.wf",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:50 2020",
                "properties": [
                    {
                        "label": "PMML Model",
                        "value": "admsModel.pmml",
                        "key": "modelID"
                    },
                    {
                        "label": "Pre-Processing Script",
                        "value": "ppSupervised.py",
                        "key": "preProcessingID"
                    }
                ],
                "editedAt": "",
                "type": "WORKFLOW",
                "url": "./MLW/1600159589_Project/Workflow/WF3.wf",
                "size": 86,
                "mimeType": "application/WF",
                "extension": ".wf",
                "category": "Workflow"
            }
        ],
        "nn-designer": [
            {
                "id": "1600160302_0783_Resource",
                "name": "admsNN.architecture",
                "description": "",
                "createdAt": "Mon Sep 28 05:53:50 2020",
                "properties": [],
                "editedAt": "",
                "type": "ARCHITECTURE",
                "url": "./MLW/1600159589_Project/NN-Designer/admsNN.architecture",
                "size": 3958,
                "mimeType": "application/ARCHITECTURE",
                "extension": ".architecture",
                "category": "NN-Designer"
            }
        ]
    },
    "resourcesCount": {
        "data": 0,
        "model": 9,
        "code": 1,
        "workflow": 4,
        "pipeline": 2,
        "nn-designer": 1,
        "totalCount": 17
    },
    "projectID": "1600159589_Project",
    "properties": [],
    "versionNumber": "v2",
    "1600159589_Project": {},
    "id": "1600159589_Project",
    "isModified": true,
    "isFreeze": false,
    "versions": [
        "v0",
        "v1",
        "v2"
    ]
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1600159589_Project/resources/createnew' \

--data-raw '{"type":"pipeline","name":"samplePipeline","modelID":"1600160427_0551_Resource","preProcessingID":"1600766226_0198_Resource","postProcessingID":"1600766226_0198_Resource"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Get the details of the resource file

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}

Gets the details of a resource file.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601283851_0844_Resource' \
--header 'Authorization: {{auth}}' 

Example Response

200 - OK

{
    "id": "1601283851_0844_Resource",
    "name": "iris Dataset.csv",
    "description": "",
    "createdAt": "Mon Sep 28 09:04:11 2020",
    "properties": [
        {
            "key": "numberOfRows",
            "label": "Number of Rows",
            "value": 150
        },
        {
            "key": "numberOfColumns",
            "label": "Number of Columns",
            "value": 5
        },
        {
            "key": "columnNames",
            "label": "Column Names",
            "value": [
                "col1",
                "col2",
                "col3",
                "col4",
                "target"
            ]
        }
    ],
    "editedAt": "",
    "type": "CSV",
    "url": "./MLW/1601283001_Project/Data/iris Dataset.csv",
    "size": 2878,
    "mimeType": "text/csv",
    "extension": ".csv",
    "category": "Data"
}

Example Request

401 - Unauthorized

curl --request GET "{{url}}/service/mlw/projects/1600750565_Project/resources/1600786266_0437_Resource"

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Preview the Code file

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/preview

Gets the content of the Code file.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601419709_0877_Resource/preview' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "content": "def process(content):\n    import ssl\n    import requests\n    ssl._create_default_https_context = ssl._create_unverified_context\n    class_indexes = requests.get('https://storage.googleapis.com/download.tensorflow.org/data/imagenet_class_index.json').json()\n    preds = content[0]\n    results = []\n    for pred in preds:\n        top_indices = pred.argsort()[-5:][::-1]\n        result = [tuple(class_indexes[str(i)]) + (pred[i],) for i in top_indices]\n        result.sort(key=lambda x: x[2], reverse=True)\n        results.append(result)\n    contents = {}\n    contents[\"predicted_category\"] = {\n        results[0][0][1]: float(results[0][0][2])\n    }\n    contents[\"top_5_categories\"] = []\n    for pred in results[0]:\n        contents[\"top_5_categories\"].append({pred[1]:float(pred[2])})\n    return contents"
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601419709_0877_Resource/preview' \

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Preview the Data file

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/preview

Gets the content of the Data file.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601283851_0844_Resource/preview' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "columns": [
        "col1",
        "col2",
        "col3",
        "col4",
        "target"
    ],
    "rows": [
        {
            "col1": "5.1",
            "col2": "3.5",
            "col3": "1.4",
            "col4": "0.2",
            "target": "0"
        },
        {
            "col1": "4.9",
            "col2": "3.0",
            "col3": "1.4",
            "col4": "0.2",
            "target": "0"
        },
        {
            "col1": "4.7",
            "col2": "3.2",
            "col3": "1.3",
            "col4": "0.2",
            "target": "0"
        },
        {
            "col1": "4.6",
            "col2": "3.1",
            "col3": "1.5",
            "col4": "0.2",
            "target": "0"
        },
        {
            "col1": "5.0",
            "col2": "3.6",
            "col3": "1.4",
            "col4": "0.2",
            "target": "0"
        },
        {
            "col1": "5.4",
            "col2": "3.9",
            "col3": "1.7",
            "col4": "0.4",
            "target": "0"
        },
        {
            "col1": "4.6",
            "col2": "3.4",
            "col3": "1.4",
            "col4": "0.3",
            "target": "0"
        },
        {
            "col1": "5.0",
            "col2": "3.4",
            "col3": "1.5",
            "col4": "0.2",
            "target": "0"
        },
        {
            "col1": "4.4",
            "col2": "2.9",
            "col3": "1.4",
            "col4": "0.2",
            "target": "0"
        },
        {
            "col1": "4.9",
            "col2": "3.1",
            "col3": "1.5",
            "col4": "0.1",
            "target": "0"
        },
        {
            "col1": "5.4",
            "col2": "3.7",
            "col3": "1.5",
            "col4": "0.2",
            "target": "0"
        },
        {
            "col1": "4.8",
            "col2": "3.4",
            "col3": "1.6",
            "col4": "0.2",
            "target": "0"
        },
        {
            "col1": "4.8",
            "col2": "3.0",
            "col3": "1.4",
            "col4": "0.1",
            "target": "0"
        },
        {
            "col1": "4.3",
            "col2": "3.0",
            "col3": "1.1",
            "col4": "0.1",
            "target": "0"
        },
        {
            "col1": "5.8",
            "col2": "4.0",
            "col3": "1.2",
            "col4": "0.2",
            "target": "0"
        },
        {
            "col1": "5.7",
            "col2": "4.4",
            "col3": "1.5",
            "col4": "0.4",
            "target": "0"
        },
        {
            "col1": "5.4",
            "col2": "3.9",
            "col3": "1.3",
            "col4": "0.4",
            "target": "0"
        },
        {
            "col1": "5.1",
            "col2": "3.5",
            "col3": "1.4",
            "col4": "0.3",
            "target": "0"
        },
        {
            "col1": "5.7",
            "col2": "3.8",
            "col3": "1.7",
            "col4": "0.3",
            "target": "0"
        },
        {
            "col1": "5.1",
            "col2": "3.8",
            "col3": "1.5",
            "col4": "0.3",
            "target": "0"
        }
    ],
    "pagination": {
        "totalRecords": 150,
        "page": 1,
        "size": 20,
        "totalPages": 8
    }
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601283851_0844_Resource/preview' \

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Preview the Notebook file

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/jnb-content

Gets the content of the Notebook file.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601420557_0857_Resource/jnb-content' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data": {
        "name": "sampleNotebook1.ipynb",
        "path": "1601283001_Project/Code/sampleNotebook1.ipynb",
        "last_modified": "2020-09-29T23:02:37.279122Z",
        "created": "2020-09-29T23:02:37.279122Z",
        "content": {
            "cells": [],
            "metadata": {},
            "nbformat": 4,
            "nbformat_minor": 4
        },
        "format": "json",
        "mimetype": null,
        "size": 65,
        "writable": true,
        "type": "notebook"
    },
    "session": {
        "id": "bce72e99-6e7b-47dd-b236-2852936147dd",
        "path": "1601283001_Project/Code/sampleNotebook1.ipynb",
        "name": "sampleNotebook1",
        "type": "notebook",
        "kernel": {
            "id": "caa3c162-6ee4-4021-b018-f2e19c97c403",
            "name": "python3",
            "last_activity": "2020-09-29T23:26:23.256662Z",
            "execution_state": "idle",
            "connections": 1
        },
        "notebook": {
            "path": "1601283001_Project/Code/sampleNotebook1.ipynb",
            "name": "sampleNotebook1"
        }
    }
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601420557_0857_Resource/jnb-content' 

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Preview the Architecture file

{{url}}/service/mlw/projects/1600784593_Project/resources/1603290789_0699_Resource/preview

Gets the content of the Architecture file.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1600784593_Project/resources/1603290789_0699_Resource/preview' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
  "content": {
    "class": "GraphLinksModel",
    "linkKeyProperty": "key",
    "linkFromPortIdProperty": "fromPort",
    "linkToPortIdProperty": "toPort",
    "modelData": {
      "prop": "value"
    },
    "nodeDataArray": [
      {
        "color": "white",
        "itemType": "LAYER",
        "layerType": "Dense",
        "trainable": true,
        "name": "Dense",
        "properties": [
          {
            "dataType": "string",
            "hint": "Activation function for the dense layer",
            "id": "activation",
            "label": "Activation Function",
            "options": [
              "linear",
              "tanh",
              "relu",
              "sigmoid",
              "softmax"
            ],
            "value": "relu"
          },
          {
            "dataType": "integer",
            "hint": "Neurons for fully connected layer",
            "id": "units",
            "label": "Units",
            "options": [],
            "value": "10"
          },
          {
            "dataType": "array",
            "hint": "only required if dragged first",
            "id": "inputDimension",
            "label": "Input Dimension",
            "options": [],
            "value": "none,2"
          }
        ],
        "text": "Dense",
        "key": "Dense",
        "loc": "600 90"
      },
      {
        "color": "white",
        "itemType": "LAYER",
        "layerType": "Dense",
        "trainable": true,
        "name": "Dense",
        "properties": [
          {
            "dataType": "string",
            "hint": "Activation function for the dense layer",
            "id": "activation",
            "label": "Activation Function",
            "options": [
              "linear",
              "tanh",
              "relu",
              "sigmoid",
              "softmax"
            ],
            "value": "relu"
          },
          {
            "dataType": "integer",
            "hint": "Neurons for fully connected layer",
            "id": "units",
            "label": "Units",
            "options": [],
            "value": "1000"
          },
          {
            "dataType": "array",
            "hint": "only required if dragged first",
            "id": "inputDimension",
            "label": "Input Dimension",
            "options": [],
            "value": ""
          }
        ],
        "text": "Dense",
        "key": "Dense2",
        "loc": "600 170"
      },
      {
        "color": "white",
        "itemType": "LAYER",
        "layerType": "Dense",
        "trainable": true,
        "name": "Dense",
        "properties": [
          {
            "dataType": "string",
            "hint": "Activation function for the dense layer",
            "id": "activation",
            "label": "Activation Function",
            "options": [
              "linear",
              "tanh",
              "relu",
              "sigmoid",
              "softmax"
            ],
            "value": "relu"
          },
          {
            "dataType": "integer",
            "hint": "Neurons for fully connected layer",
            "id": "units",
            "label": "Units",
            "options": [],
            "value": "2000"
          },
          {
            "dataType": "array",
            "hint": "only required if dragged first",
            "id": "inputDimension",
            "label": "Input Dimension",
            "options": [],
            "value": ""
          }
        ],
        "text": "Dense",
        "key": "Dense3",
        "loc": "600 250"
      },
      {
        "color": "white",
        "itemType": "LAYER",
        "layerType": "Dense",
        "trainable": true,
        "name": "Dense",
        "properties": [
          {
            "dataType": "string",
            "hint": "Activation function for the dense layer",
            "id": "activation",
            "label": "Activation Function",
            "options": [
              "linear",
              "tanh",
              "relu",
              "sigmoid",
              "softmax"
            ],
            "value": "sigmoid"
          },
          {
            "dataType": "integer",
            "hint": "Neurons for fully connected layer",
            "id": "units",
            "label": "Units",
            "options": [],
            "value": "1"
          },
          {
            "dataType": "array",
            "hint": "only required if dragged first",
            "id": "inputDimension",
            "label": "Input Dimension",
            "options": [],
            "value": ""
          }
        ],
        "text": "Dense",
        "key": "Dense4",
        "loc": "600 330"
      }
    ],
    "linkDataArray": [
      {
        "from": "Dense",
        "to": "Dense2",
        "fromPort": "b",
        "toPort": "t",
        "key": -1,
        "points": [
          600,
          109.69914805335318,
          600,
          119.69914805335318,
          600,
          130,
          600,
          130,
          600,
          140.30085194664682,
          600,
          150.30085194664682
        ]
      },
      {
        "from": "Dense2",
        "to": "Dense3",
        "fromPort": "b",
        "toPort": "t",
        "key": -2,
        "points": [
          600,
          189.69914805335318,
          600,
          199.69914805335318,
          600,
          210,
          600,
          210,
          600,
          220.30085194664684,
          600,
          230.30085194664684
        ]
      },
      {
        "from": "Dense3",
        "to": "Dense4",
        "fromPort": "b",
        "toPort": "t",
        "key": -3,
        "points": [
          600,
          269.6991480533532,
          600,
          279.6991480533532,
          600,
          290,
          600,
          290,
          600,
          300.3008519466468,
          600,
          310.3008519466468
        ]
      }
    ]
  }
}

PUT - Add content to the file and save

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/save

Updates the contents of a file.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}
content {{content}}

Example Request

200 - OK

curl --location --request PUT '{{url}}/service/mlw/projects/1601283001_Project/resources/1601422676_0095_Resource/save' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: text/plain' \
--data-raw '{"content":"def hello():\r\n    return '\''Hello'\''"}'

Example Response

200 - OK

{
    "message": "File updated successfully!",
    "data": {
        "id": "1601422676_0095_Resource",
        "name": "sampleCode.py",
        "description": "",
        "createdAt": "Tue Sep 29 23:37:56 2020",
        "properties": [],
        "editedAt": "Tue Sep 29 23:37:56 2020",
        "type": "PY",
        "url": "./MLW/1601283001_Project/Code/sampleCode.py",
        "size": 32,
        "mimeType": "application/CODE",
        "extension": ".py",
        "category": "Code"
    }
}

Example Request

401 - Unauthorized

curl --location --request PUT '{{url}}/service/mlw/projects/1601283001_Project/resources/1601422676_0095_Resource/save' \
--header 'Content-Type: text/plain' \
--data-raw '{"content":"def hello():\r\n    return '\''Hello'\''"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

DELETE - Delete the file from the Project

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}

Deletes a resource file.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --request DELETE "{{url}}/service/mlw/projects/1600750565_Project/resources/1600786266_0437_Resource" --header "Authorization: {{auth}}"

Example Response

200 - OK

{'type': 'MLWData',
 'lastUpdated': '2020-09-22T06:50:59.574Z',
 'name': 'sampleDemo',
 'createdAt': 'Tue Sep 22 04:56:05 2020',
 'selectedVersion': 'v0',
 'description': 'sample Bottles NN IC Demo',
 'resources': {'data': [{'id': '1600753567_0365_Resource',
    'name': 'MD.Orig.jpg',
    'description': '',
    'createdAt': 'Mon Sep 28 03:03:54 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/MD.Orig.jpg',
    'size': 39675,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1600751893_0717_Resource',
    'name': 'MD.Diet.jpg',
    'description': '',
    'createdAt': 'Mon Sep 28 03:03:54 2020',
    'properties': [],
    'editedAt': '',
    'type': 'IMAGE',
    'url': './MLW/1600750565_Project/Data/MD.Diet.jpg',
    'size': 42146,
    'mimeType': 'image/jpeg',
    'extension': '.jpg',
    'category': 'Data'},
   {'id': '1600753267_0571_Resource',
    'name': 'predicted_MD_1600753267.json',
    'description': '',
    'createdAt': 'Mon Sep 28 03:03:54 2020',
    'properties': [{'key': 'numberOfobjects',
      'label': 'Number of Objects',
      'value': 2},
     {'key': 'keysInJson',
      'label': 'keys in Dictionary',
      'value': ['Dense3', 'PredictedClass']}],
    'editedAt': '',
    'type': 'JSON',
    'url': './MLW/1600750565_Project/Data/predicted_MD_1600753267.json',
    'size': 222,
    'mimeType': 'application/json',
    'extension': '.json',
    'category': 'Data'},
   {'id': '1600750617_0744_Resource',
    'name': 'sample.zip',
    'description': '',
    'createdAt': 'Mon Sep 28 03:03:55 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ZIP',
    'url': './MLW/1600750565_Project/Data/sample.zip',
    'size': 22655457,
    'mimeType': 'application/zip',
    'extension': '.zip',
    'category': 'Data'}],
  'model': [{'id': '1600751811_0233_Resource',
    'name': 'sampleNewDemo_1600751365.onnx',
    'description': '',
    'createdAt': 'Mon Sep 28 03:03:55 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ONNX',
    'url': './MLW/1600750565_Project/Model/sampleNewDemo_1600751365.onnx',
    'size': 8296336,
    'mimeType': 'application/ONNX',
    'extension': '.onnx',
    'category': 'Model',
    'deployed': True}],
  'code': [{'id': '1600752121_0420_Resource',
    'name': 'samplePost.py',
    'description': '',
    'createdAt': 'Mon Sep 28 03:03:54 2020',
    'properties': [],
    'editedAt': '',
    'type': 'PY',
    'url': './MLW/1600750565_Project/Code/samplePost.py',
    'size': 260,
    'mimeType': 'text/x-python',
    'extension': '.py',
    'category': 'Code'},
   {'id': '1600751640_0643_Resource',
    'name': 'samplePre.py',
    'description': '',
    'createdAt': 'Mon Sep 28 03:03:54 2020',
    'properties': [],
    'editedAt': '',
    'type': 'PY',
    'url': './MLW/1600750565_Project/Code/samplePre.py',
    'size': 278,
    'mimeType': 'text/x-python',
    'extension': '.py',
    'category': 'Code'}],
  'pipeline': [{'id': '1600753248_0497_Resource',
    'name': 'samplePipe.pipeline',
    'description': '',
    'createdAt': 'Mon Sep 28 03:03:54 2020',
    'properties': [{'label': 'ONNX Model',
      'value': 'sampleNewDemo_1600751365.onnx',
      'key': 'modelID'},
     {'label': 'Pre-Processing Script',
      'value': 'samplePre.py',
      'key': 'preProcessingID'},
     {'label': 'Post-Processing Script',
      'value': 'samplePost.py',
      'key': 'postProcessingID'}],
    'editedAt': '',
    'type': 'PIPELINE',
    'url': './MLW/1600750565_Project/Pipeline/samplePipe.pipeline',
    'size': 134,
    'mimeType': 'application/PIPELINE',
    'extension': '.pipeline',
    'category': 'Pipeline',
    'deployed': True}],
  'workflow': [],
  'nn-designer': [{'id': '1600750594_0269_Resource',
    'name': 'sample.architecture',
    'description': '',
    'createdAt': 'Mon Sep 28 03:03:54 2020',
    'properties': [],
    'editedAt': '',
    'type': 'ARCHITECTURE',
    'url': './MLW/1600750565_Project/NN-Designer/sample.architecture',
    'size': 17176,
    'mimeType': 'application/ARCHITECTURE',
    'extension': '.architecture',
    'category': 'NN-Designer'}]},
 'resourcesCount': {'data': 4,
  'model': 1,
  'code': 2,
  'workflow': 0,
  'pipeline': 1,
  'nn-designer': 1,
  'totalCount': 9},
 'projectID': '1600750565_Project',
 'properties': [],
 'versionNumber': 'v1',
 '1600750565_Project': {},
 'id': '1600750565_Project',
 'isModified': True,
 'isFreeze': False,
 'versions': ['v0', 'v1', 'v2']}

Example Request

401 - Unauthorized

curl --request DELETE "{{url}}/service/mlw/projects/1600750565_Project/resources/1600786266_0437_Resource"

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Download the file from the Project in local system

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/download

Downloads a resource file.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601283851_0844_Resource/download' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

col1,col2,col3,col4,target
5.1,3.5,1.4,0.2,0
4.9,3.0,1.4,0.2,0
4.7,3.2,1.3,0.2,0
4.6,3.1,1.5,0.2,0
5.0,3.6,1.4,0.2,0
5.4,3.9,1.7,0.4,0
4.6,3.4,1.4,0.3,0
5.0,3.4,1.5,0.2,0
4.4,2.9,1.4,0.2,0
4.9,3.1,1.5,0.1,0
5.4,3.7,1.5,0.2,0
4.8,3.4,1.6,0.2,0
4.8,3.0,1.4,0.1,0
4.3,3.0,1.1,0.1,0
5.8,4.0,1.2,0.2,0
5.7,4.4,1.5,0.4,0
5.4,3.9,1.3,0.4,0
5.1,3.5,1.4,0.3,0
5.7,3.8,1.7,0.3,0
5.1,3.8,1.5,0.3,0
5.4,3.4,1.7,0.2,0
5.1,3.7,1.5,0.4,0
4.6,3.6,1.0,0.2,0
5.1,3.3,1.7,0.5,0
4.8,3.4,1.9,0.2,0
5.0,3.0,1.6,0.2,0
5.0,3.4,1.6,0.4,0
5.2,3.5,1.5,0.2,0
5.2,3.4,1.4,0.2,0
4.7,3.2,1.6,0.2,0
4.8,3.1,1.6,0.2,0
5.4,3.4,1.5,0.4,0
5.2,4.1,1.5,0.1,0
5.5,4.2,1.4,0.2,0
4.9,3.1,1.5,0.2,0
5.0,3.2,1.2,0.2,0
5.5,3.5,1.3,0.2,0
4.9,3.6,1.4,0.1,0
4.4,3.0,1.3,0.2,0
5.1,3.4,1.5,0.2,0
5.0,3.5,1.3,0.3,0
4.5,2.3,1.3,0.3,0
4.4,3.2,1.3,0.2,0
5.0,3.5,1.6,0.6,0
5.1,3.8,1.9,0.4,0
4.8,3.0,1.4,0.3,0
5.1,3.8,1.6,0.2,0
4.6,3.2,1.4,0.2,0
5.3,3.7,1.5,0.2,0
5.0,3.3,1.4,0.2,0
7.0,3.2,4.7,1.4,1
6.4,3.2,4.5,1.5,1
6.9,3.1,4.9,1.5,1
5.5,2.3,4.0,1.3,1
6.5,2.8,4.6,1.5,1
5.7,2.8,4.5,1.3,1
6.3,3.3,4.7,1.6,1
4.9,2.4,3.3,1.0,1
6.6,2.9,4.6,1.3,1
5.2,2.7,3.9,1.4,1
5.0,2.0,3.5,1.0,1
5.9,3.0,4.2,1.5,1
6.0,2.2,4.0,1.0,1
6.1,2.9,4.7,1.4,1
5.6,2.9,3.6,1.3,1
6.7,3.1,4.4,1.4,1
5.6,3.0,4.5,1.5,1
5.8,2.7,4.1,1.0,1
6.2,2.2,4.5,1.5,1
5.6,2.5,3.9,1.1,1
5.9,3.2,4.8,1.8,1
6.1,2.8,4.0,1.3,1
6.3,2.5,4.9,1.5,1
6.1,2.8,4.7,1.2,1
6.4,2.9,4.3,1.3,1
6.6,3.0,4.4,1.4,1
6.8,2.8,4.8,1.4,1
6.7,3.0,5.0,1.7,1
6.0,2.9,4.5,1.5,1
5.7,2.6,3.5,1.0,1
5.5,2.4,3.8,1.1,1
5.5,2.4,3.7,1.0,1
5.8,2.7,3.9,1.2,1
6.0,2.7,5.1,1.6,1
5.4,3.0,4.5,1.5,1
6.0,3.4,4.5,1.6,1
6.7,3.1,4.7,1.5,1
6.3,2.3,4.4,1.3,1
5.6,3.0,4.1,1.3,1
5.5,2.5,4.0,1.3,1
5.5,2.6,4.4,1.2,1
6.1,3.0,4.6,1.4,1
5.8,2.6,4.0,1.2,1
5.0,2.3,3.3,1.0,1
5.6,2.7,4.2,1.3,1
5.7,3.0,4.2,1.2,1
5.7,2.9,4.2,1.3,1
6.2,2.9,4.3,1.3,1
5.1,2.5,3.0,1.1,1
5.7,2.8,4.1,1.3,1
6.3,3.3,6.0,2.5,2
5.8,2.7,5.1,1.9,2
7.1,3.0,5.9,2.1,2
6.3,2.9,5.6,1.8,2
6.5,3.0,5.8,2.2,2
7.6,3.0,6.6,2.1,2
4.9,2.5,4.5,1.7,2
7.3,2.9,6.3,1.8,2
6.7,2.5,5.8,1.8,2
7.2,3.6,6.1,2.5,2
6.5,3.2,5.1,2.0,2
6.4,2.7,5.3,1.9,2
6.8,3.0,5.5,2.1,2
5.7,2.5,5.0,2.0,2
5.8,2.8,5.1,2.4,2
6.4,3.2,5.3,2.3,2
6.5,3.0,5.5,1.8,2


Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601283851_0844_Resource/download' \

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Tasks

Operations on MLW tasks.

Info: An active subscription of the MLW microservice is required to perform operations.

GET - Get the list of tasks in the system

{{url}}/service/mlw/tasks

Gets the list of tasks running or completed in the system.

HEADERS
Authorization {{auth}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/tasks' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data": [
        {
            "id": "1601287609_Tasks",
            "name": "sensorData2",
            "createdAt": "Mon Sep 28 10:06:49 2020",
            "type": "C8YDATA",
            "cronExpression": "",
            "status": "Not Scheduled",
            "projectID": "1601283001_Project",
            "projectName": "ExampleProject",
            "properties": [
                {
                    "key": "deviceID",
                    "label": "Device ID",
                    "value": "446"
                },
                {
                    "key": "dateFrom",
                    "label": "Date From",
                    "value": "2020-07-03T06:00:00.000Z"
                },
                {
                    "key": "dateTo",
                    "label": "Date To",
                    "value": "2020-09-28T07:00:10.509Z"
                },
                {
                    "key": "columnNames",
                    "label": "Measurements",
                    "value": [
                        "sensor4",
                        "sensor2",
                        "sensor3",
                        "sensor1"
                    ]
                },
                {
                    "key": "aggregationType",
                    "label": "Aggregation Type",
                    "value": "None"
                }
            ],
            "recurrence": "ONE_TIME",
            "startDate": "",
            "startTimeH": "",
            "startTimeM": "",
            "sortTime": 1601287609
        },
        
    ]
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/tasks' 

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Get the details of a parent task

{{url}}/service/mlw/tasks/{{parenttaskID}}

Gets the details of the parent task running or completed.

HEADERS
Authorization {{auth}}
PARAMS
parenttaskID {{parenttaskID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/tasks/1601287609_Tasks' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "id": "1601287609_Tasks",
    "name": "sensorData2",
    "createdAt": "Mon Sep 28 10:06:49 2020",
    "type": "C8YDATA",
    "cronExpression": "",
    "status": "Not Scheduled",
    "individualTasks": [
        {
            "id": "1601287609_0411_Cumulocity",
            "tasksID": "1601287609_Tasks",
            "taskName": "sensorData2",
            "type": "C8YDATA",
            "executedAt": "Mon Sep 28 10:06:49 2020",
            "deviceID": "446",
            "projectID": "1601283001_Project",
            "fileName": "./MLW/1601283001_Project/Data/sensorData2.csv",
            "pID": "987",
            "status": "COMPLETED",
            "dateFrom": "2020-07-03T06:00:00.000Z",
            "dateTo": "2020-09-28T07:00:10.509Z",
            "message": "Data Saved to Data Section",
            "fileSaved": true
        }
    ],
    "projectID": "1601283001_Project",
    "projectName": "ExampleProject",
    "properties": [
        {
            "key": "deviceID",
            "label": "Device ID",
            "value": "446"
        },
        {
            "key": "dateFrom",
            "label": "Date From",
            "value": "2020-07-03T06:00:00.000Z"
        },
        {
            "key": "dateTo",
            "label": "Date To",
            "value": "2020-09-28T07:00:10.509Z"
        },
        {
            "key": "columnNames",
            "label": "Measurements",
            "value": [
                "sensor4",
                "sensor2",
                "sensor3",
                "sensor1"
            ]
        },
        {
            "key": "aggregationType",
            "label": "Aggregation Type",
            "value": "None"
        }
    ],
    "recurrence": "ONE_TIME",
    "startDate": "",
    "startTimeH": "",
    "startTimeM": "",
    "sortTime": 1601287609
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/tasks/1601287609_Tasks'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Get the details of the individual task within a parent task

{{url}}/service/mlw/tasks/{{parenttaskID}}/task/{{taskID}}

Provides the complete details of the individual task running under a parent task.

HEADERS
Authorization {{auth}}
PARAMS
taskID {{taskID}}
parenttaskID {{parenttaskID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/tasks/1601287609_Tasks/task/1601287609_0411_Cumulocity' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "id": "1601287609_0411_Cumulocity",
    "tasksID": "1601287609_Tasks",
    "taskName": "sensorData2",
    "type": "C8YDATA",
    "executedAt": "Mon Sep 28 10:06:49 2020",
    "deviceID": "446",
    "projectID": "1601283001_Project",
    "fileName": "./MLW/1601283001_Project/Data/sensorData2.csv",
    "pID": "987",
    "status": "COMPLETED",
    "dateFrom": "2020-07-03T06:00:00.000Z",
    "dateTo": "2020-09-28T07:00:10.509Z",
    "message": "Data Saved to Data Section",
    "fileSaved": true
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/tasks/1601287609_Tasks/task/1601287609_0411_Cumulocity'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

DELETE - Delete an individual task within the parent task

{{url}}/service/mlw/tasks/{{parenttaskID}}/task/{{taskID}}

Deletes and stops the individual task running under a parent task.

HEADERS
Authorization {{auth}}
PARAMS
taskID {{taskID}}
parenttaskID {{parenttaskID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/tasks/1601287609_Tasks/task/1601287609_0411_Cumulocity' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK
{
    "data": [
        {
            "id": "1601287609_Tasks",
            "name": "sensorData2",
            "createdAt": "Mon Sep 28 10:06:49 2020",
            "type": "C8YDATA",
            "cronExpression": "",
            "status": "Not Scheduled",
            "individualTasks": [],
            "projectID": "1601283001_Project",
            "projectName": "ExampleProject",
            "properties": [
                {
                    "key": "deviceID",
                    "label": "Device ID",
                    "value": "446"
                },
                {
                    "key": "dateFrom",
                    "label": "Date From",
                    "value": "2020-07-03T06:00:00.000Z"
                },
                {
                    "key": "dateTo",
                    "label": "Date To",
                    "value": "2020-09-28T07:00:10.509Z"
                },
                {
                    "key": "columnNames",
                    "label": "Measurements",
                    "value": [
                        "sensor4",
                        "sensor2",
                        "sensor3",
                        "sensor1"
                    ]
                },
                {
                    "key": "aggregationType",
                    "label": "Aggregation Type",
                    "value": "None"
                }
            ],
            "recurrence": "ONE_TIME",
            "startDate": "",
            "startTimeH": "",
            "startTimeM": "",
            "sortTime": 1601287609
        }
    ]
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/tasks/1601287609_Tasks/task/1601287609_0411_Cumulocity'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

DELETE - Delete a parent task

{{url}}/service/mlw/tasks/{{parenttaskID}}

Deletes and stops all the individual tasks running under a parent task and delete the parent task.

HEADERS
Authorization {{auth}}
PARAMS
parenttaskID {{parenttaskID}}

Example Request

200 - OK

curl --location --request DELETE '{{url}}/service/mlw/tasks/1601287609_Tasks' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK
{
    "data": {
        "1600941378514": {
            "id": "1600941378514",
            "name": "cast",
            "createdAt": "Thu Sep 24 09:56:18 2020",
            "sortTime": 1600941378,
            "type": "NN",
            "individualTasks": {
                "1600941378153": {
                    "status": "COMPLETED",
                    "type": "NN",
                    "projectID": "1600784593_Project",
                    "log": {
                        "ARCH_READ": {
                            "timestamp": "2020-09-24 09:56:18.299939",
                            "type": "INFO",
                            "message": "File read successful.",
                            "error": ""
                        },
                        "ARCH_CREATE_LAYER": {
                            "timestamp": "2020-09-24 09:56:18.301050",
                            "type": "INFO",
                            "message": "layers are ordered.",
                            "error": ""
                        },
                        "DATA_INIT": {
                            "timestamp": "2020-09-24 09:56:19.628340",
                            "type": "INFO",
                            "message": "train and validation folder exist.",
                            "error": ""
                        },
                        "DATA_PROCESS": {
                            "timestamp": "2020-09-24 09:56:19.947158",
                            "type": "INFO",
                            "message": "Data processing complete",
                            "error": ""
                        },
                        "COMPILE": {
                            "timestamp": "2020-09-24 09:56:19.948185",
                            "type": "INFO",
                            "message": "Model compilation successful",
                            "error": ""
                        },
                        "TRAIN": {
                            "timestamp": "2020-09-24 11:03:40.438399",
                            "type": "INFO",
                            "message": "Model training complete",
                            "error": ""
                        },
                        "SAVE": {
                            "timestamp": "2020-09-24 11:03:41.259142",
                            "type": "INFO",
                            "message": "Model saved successfully. --> cast_1600941378.onnx",
                            "error": ""
                        }
                    },
                    "properties": [],
                    "message": "Model Saved to Model Section",
                    "history": [
                        {
                            "epoch": 1,
                            "acc": 0.6681777238845825,
                            "loss": 0.9347285657499664,
                            "lr": 9.999999747378752e-05,
                            "val_acc": 0.7475177049636841,
                            "val_loss": 0.5210347923826664
                        },
                        {
                            "epoch": 2,
                            "acc": 0.7357207536697388,
                            "loss": 0.5306199711164019,
                            "lr": 9.999999747378752e-05,
                            "val_acc": 0.8241134881973267,
                            "val_loss": 0.4010832756757736
                        },
                        {
                            "epoch": 3,
                            "acc": 0.8236627578735352,
                            "loss": 0.3880086645267816,
                            "lr": 9.999999747378752e-05,
                            "val_acc": 0.8794326186180115,
                            "val_loss": 0.2899192896612147
                        },
                        {
                            "epoch": 4,
                            "acc": 0.8703535795211792,
                            "loss": 0.3042577663546298,
                            "lr": 9.999999747378752e-05,
                            "val_acc": 0.9290780425071716,
                            "val_loss": 0.20286435729011576
                        },
                        {
                            "epoch": 5,
                            "acc": 0.9023874402046204,
                            "loss": 0.2476639048612642,
                            "lr": 9.999999747378752e-05,
                            "val_acc": 0.9517730474472046,
                            "val_loss": 0.16410305897923225
                        }
                    ],
                    "tasksID": "1600941378514",
                    "taskName": "cast",
                    "id": "1600941378153",
                    "executedAt": "Thu Sep 24 09:56:18 2020",
                    "pID": "68",
                    "fileName": "./MLW/1600784593_Project/Model/cast_1600941378.onnx",
                    "completedAt": "Thu Sep 24 11:03:41 2020",
                    "fileSaved": true
                }
            },
            "projectID": "1600784593_Project",
            "projectName": "blah project",
            "startDate": "2020-09-24",
            "startTimeH": "09",
            "startTimeM": "56",
            "properties": [
                {
                    "key": "problemType",
                    "label": "Problem Type",
                    "value": "classification"
                },
                {
                    "key": "optimizer",
                    "label": "Optimizer",
                    "value": "adam"
                },
                {
                    "key": "learningRate",
                    "label": "Learning Rate",
                    "value": 0.0001
                },
                {
                    "key": "loss",
                    "label": "Loss",
                    "value": "categorical_crossentropy"
                },
                {
                    "key": "metrics",
                    "label": "Metrics",
                    "value": [
                        "accuracy"
                    ]
                },
                {
                    "key": "epoch",
                    "label": "Epoch",
                    "value": 5
                },
                {
                    "key": "testSize",
                    "label": "Test Size",
                    "value": 0.3
                },
                {
                    "key": "batchSize",
                    "label": "Batch Size",
                    "value": 15
                }
            ],
            "cronExpression": "",
            "status": "NOT SCHEDULED",
            "recurrence": "ONE_TIME"
        },
        
    }
}

Example Request

401 - Unauthorized

curl --location --request DELETE '{{url}}/service/mlw/tasks/1601287609_Tasks' 

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

AutoML

Operations on MLW Automated ML.

Info: An active subscription of the MLW microservice is required to perform operations.

GET - Start the AutoML process

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/automl 

Start the AutoML process by passing the data to the engine and get the initial information to start the AutoML process.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601283851_0844_Resource/automl' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data_details": {
        "data": [
            {
                "position": 1,
                "variable": "col1",
                "dtype": "float64",
                "missing_val": 0,
                "changedataType": "Continuous",
                "imputation_method": "None",
                "data_transformation_step": "None",
                "use_for_model": true
            },
            {
                "position": 2,
                "variable": "col2",
                "dtype": "float64",
                "missing_val": 0,
                "changedataType": "Continuous",
                "imputation_method": "None",
                "data_transformation_step": "None",
                "use_for_model": true
            },
            {
                "position": 3,
                "variable": "col3",
                "dtype": "float64",
                "missing_val": 0,
                "changedataType": "Continuous",
                "imputation_method": "None",
                "data_transformation_step": "None",
                "use_for_model": true
            },
            {
                "position": 4,
                "variable": "col4",
                "dtype": "float64",
                "missing_val": 0,
                "changedataType": "Continuous",
                "imputation_method": "None",
                "data_transformation_step": "None",
                "use_for_model": true
            },
            {
                "position": 5,
                "variable": "target",
                "dtype": "int64",
                "missing_val": 0,
                "changedataType": "Continuous",
                "imputation_method": "None",
                "data_transformation_step": "None",
                "use_for_model": true
            }
        ],
        "options": {
            "changedataTypes": [
                "None",
                "Continuous",
                "Categorical"
            ],
            "imputation_methods": [
                "None",
                "Mean",
                "Median",
                "Mode"
            ],
            "data_transformation_steps": [
                "None",
                "One Hot Encoding",
                "Label Encoding",
                "Normalize",
                "Scaling Standard",
                "Scaling Min Max",
                "Scaling Max Absolute"
            ],
            "algorithmTypes": {
                "Regression": [
                    "GradientBoostingRegressor",
                    "DecisionTreeRegressor",
                    "LinearSVR",
                    "RandomForestRegressor",
                    "XGBRegressor",
                    "KNeighborsRegressor",
                    "LinearRegression",
                    "LGBMRegressor"
                ],
                "Classification": [
                    "DecisionTreeClassifier",
                    "RandomForestClassifier",
                    "GradientBoostingClassifier",
                    "KNeighborsClassifier",
                    "LinearSVC",
                    "LogisticRegression",
                    "XGBClassifier",
                    "LGBMClassifier"
                ],
                "Anomaly": [
                    "IsolationForest",
                    "OneClassSVM"
                ]
            }
        },
        "idforData": "1601284185_autoML"
    }
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601283851_0844_Resource/automl'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

POST - Start the training process of the AutoML

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/automl

Train an AutoML model by using pre-processing options for variables and using the hyper-parameter given by the user in the form.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}
data filled form values
idforData required description of the project
target_variable column name which is target
problem_type Classification/Regression
HYPER- PARAMS
algorithm Selected Algorithms
generation integer
population_size integer
model_name name
scoring select one of the option

Example Request

200 - OK

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/1601283851_0844_Resource/automl' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"data_details": {"data": [{"position": 1,
    "variable": "col1","dtype": "float64","missing_val": 0,"changedataType": "Continuous",
    "imputation_method": "None","data_transformation_step": "None","use_for_model": true},
   {"position": 2,"variable": "col2","dtype": "float64","missing_val": 0,
    "changedataType": "Continuous","imputation_method": "None","data_transformation_step": "None",
    "use_for_model": true},
   {"position": 3,"variable": "col3","dtype": "float64","missing_val": 0,
    "changedataType": "Continuous","imputation_method": "None","data_transformation_step": "None",
    "use_for_model": true},
   {"position": 4,"variable": "col4","dtype": "float64","missing_val": 0,
    "changedataType": "Continuous","imputation_method": "None","data_transformation_step": "None",
    "use_for_model": true},
   {"position": 5,"variable": "target","dtype": "int64","missing_val": 0,
    "changedataType": "Continuous","imputation_method": "None","data_transformation_step": "None",
    "use_for_model": false}],
  "options": {"changedataTypes": ["None", "Continuous", "Categorical"],
   "imputation_methods": ["None", "Mean", "Median", "Mode"],
   "data_transformation_steps": ["None","One Hot Encoding",    "Label Encoding",
    "Normalize",    "Scaling Standard","Scaling Min Max",    "Scaling Max Absolute"],
   "algorithmTypes": {"Regression": ["ExtraTreeRegressor","GradientBoostingRegressor","DecisionTreeRegressor",
                                     "LinearSVR","RandomForestRegressor","XGBRegressor","KNeighborsRegressor", 
                                     "LinearRegression","LGBMRegressor"],
    "Classification": ["DecisionTreeClassifier","ExtraTreesClassifier","RandomForestClassifier",
    "GradientBoostingClassifier","KNeighborsClassifier","LinearSVC","LogisticRegression","XGBClassifier","LGBMClassifier"],
    "Anomaly": ["IsolationForest", "OneClassSVM"]}},
    "idforData": "1601284185_autoML",
    "target_variable":"target",
    "problem_type":"Classification",
                  "newPMMLFileName": "SampleModel",
    "parameters": {"generation": 10, "population_size": 2,
                   "model_name": "SampleModel", "scoring": "accuracy",
                   "algorithm": ["DecisionTreeClassifier","ExtraTreesClassifier","RandomForestClassifier",
    "GradientBoostingClassifier","KNeighborsClassifier","LinearSVC","LogisticRegression","XGBClassifier","LGBMClassifier"]}}}'

Example Response

200 - OK

{
    "id": "1601284841_Tasks",
    "name": "SampleModel",
    "createdAt": "Mon Sep 28 09:20:41 2020",
    "type": "AUTOML",
    "cronExpression": "",
    "status": "Not Scheduled",
    "individualTasks": [
        {
            "pID": "859",
            "status": "RUNNING",
            "message": "In Progress",
            "targetVar": "target",
            "problem_type": "Classification",
            "id": "1601284185_autoML",
            "tasksID": "1601284841_Tasks",
            "shape": [
                150,
                5
            ],
            "taskName": "SampleModel",
            "type": "AUTOML",
            "executedAt": "Mon Sep 28 09:20:41 2020",
            "listOfModelAccuracy": [],
            "projectID": "1601283001_Project"
        }
    ],
    "projectID": "1601283001_Project",
    "projectName": "ExampleProject",
    "properties": [
        {
            "key": "targetVar",
            "label": "Target variable",
            "value": "target"
        },
        {
            "key": "problem_type",
            "label": "Problem Type",
            "value": "Classification"
        },
        {
            "key": "dataSize",
            "label": "Data Size",
            "value": [
                150,
                5
            ]
        },
        {
            "key": "model_name",
            "label": "Model Name",
            "value": "SampleModel"
        },
        {
            "key": "alogrithm",
            "label": "Algorithms Size",
            "value": [
                "DecisionTreeClassifier",
                "ExtraTreesClassifier",
                "RandomForestClassifier",
                "GradientBoostingClassifier",
                "KNeighborsClassifier",
                "LinearSVC",
                "LogisticRegression",
                "XGBClassifier",
                "LGBMClassifier"
            ]
        },
        {
            "key": "population_size",
            "label": "Population Size",
            "value": 2
        },
        {
            "key": "generation",
            "label": "Generation",
            "value": 10
        }
    ],
    "recurrence": "ONE_TIME",
    "startDate": "",
    "startTimeH": "",
    "startTimeM": "",
    "sortTime": 1601284841
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/1601283851_0844_Resource/automl' \
--data-raw '{"data_details": {"data": [{"position": 1,
    "variable": "col1","dtype": "float64","missing_val": 0,"changedataType": "Continuous",
    "imputation_method": "None","data_transformation_step": "None","use_for_model": true},
   {"position": 2,"variable": "col2","dtype": "float64","missing_val": 0,
    "changedataType": "Continuous","imputation_method": "None","data_transformation_step": "None",
    "use_for_model": true},
   {"position": 3,"variable": "col3","dtype": "float64","missing_val": 0,
    "changedataType": "Continuous","imputation_method": "None","data_transformation_step": "None",
    "use_for_model": true},
   {"position": 4,"variable": "col4","dtype": "float64","missing_val": 0,
    "changedataType": "Continuous","imputation_method": "None","data_transformation_step": "None",
    "use_for_model": true},
   {"position": 5,"variable": "target","dtype": "int64","missing_val": 0,
    "changedataType": "Continuous","imputation_method": "None","data_transformation_step": "None",
    "use_for_model": false}],
  "options": {"changedataTypes": ["None", "Continuous", "Categorical"],
   "imputation_methods": ["None", "Mean", "Median", "Mode"],
   "data_transformation_steps": ["None","One Hot Encoding",    "Label Encoding",
    "Normalize",    "Scaling Standard","Scaling Min Max",    "Scaling Max Absolute"],
   "algorithmTypes": {"Regression": ["ExtraTreeRegressor","GradientBoostingRegressor","DecisionTreeRegressor",
                                     "LinearSVR","RandomForestRegressor","XGBRegressor","KNeighborsRegressor", 
                                     "LinearRegression","LGBMRegressor"],
    "Classification": ["DecisionTreeClassifier","ExtraTreesClassifier","RandomForestClassifier",
    "GradientBoostingClassifier","KNeighborsClassifier","LinearSVC","LogisticRegression","XGBClassifier","LGBMClassifier"],
    "Anomaly": ["IsolationForest", "OneClassSVM"]}},
    "idforData": "1601284185_autoML",
    "target_variable":"target",
    "problem_type":"Classification",
                  "newPMMLFileName": "SampleModel",
    "parameters": {"generation": 10, "population_size": 2,
                   "model_name": "SampleModel", "scoring": "accuracy",
                   "algorithm": ["DecisionTreeClassifier","ExtraTreesClassifier","RandomForestClassifier",
    "GradientBoostingClassifier","KNeighborsClassifier","LinearSVC","LogisticRegression","XGBClassifier","LGBMClassifier"]}}}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Start the Anomaly detection model training process

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/automl

Start the Anomaly detection model training process by passing the data to the engine and get the initial information to start the training.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601423136_0703_Resource/automl' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data_details": {
        "data": [
            {
                "position": 1,
                "variable": "time",
                "dtype": "object",
                "missing_val": 0,
                "changedataType": "Categorical",
                "imputation_method": "None",
                "data_transformation_step": "None",
                "use_for_model": true
            },
            {
                "position": 2,
                "variable": "Sensor1_sensor4",
                "dtype": "float64",
                "missing_val": 0,
                "changedataType": "Continuous",
                "imputation_method": "None",
                "data_transformation_step": "None",
                "use_for_model": true
            },
            {
                "position": 3,
                "variable": "Sensor1_sensor2",
                "dtype": "float64",
                "missing_val": 0,
                "changedataType": "Continuous",
                "imputation_method": "None",
                "data_transformation_step": "None",
                "use_for_model": true
            },
            {
                "position": 4,
                "variable": "Sensor1_sensor3",
                "dtype": "float64",
                "missing_val": 0,
                "changedataType": "Continuous",
                "imputation_method": "None",
                "data_transformation_step": "None",
                "use_for_model": true
            },
            {
                "position": 5,
                "variable": "Sensor1_sensor1",
                "dtype": "float64",
                "missing_val": 0,
                "changedataType": "Continuous",
                "imputation_method": "None",
                "data_transformation_step": "None",
                "use_for_model": true
            }
        ],
        "options": {
            "changedataTypes": [
                "None",
                "Continuous",
                "Categorical"
            ],
            "imputation_methods": [
                "None",
                "Mean",
                "Median",
                "Mode"
            ],
            "data_transformation_steps": [
                "None",
                "One Hot Encoding",
                "Label Encoding",
                "Normalize",
                "Scaling Standard",
                "Scaling Min Max",
                "Scaling Max Absolute"
            ],
            "algorithmTypes": {
                "Regression": [
                    "GradientBoostingRegressor",
                    "DecisionTreeRegressor",
                    "LinearSVR",
                    "RandomForestRegressor",
                    "XGBRegressor",
                    "KNeighborsRegressor",
                    "LinearRegression",
                    "LGBMRegressor"
                ],
                "Classification": [
                    "DecisionTreeClassifier",
                    "RandomForestClassifier",
                    "GradientBoostingClassifier",
                    "KNeighborsClassifier",
                    "LinearSVC",
                    "LogisticRegression",
                    "XGBClassifier",
                    "LGBMClassifier"
                ],
                "Anomaly": [
                    "IsolationForest",
                    "OneClassSVM"
                ]
            }
        },
        "idforData": "1601423242_autoML"
    }
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601423136_0703_Resource/automl' \

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

POST - Start the training process of the Anomaly detection model

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/anomaly

Train an Anomaly detection model by using pre-processing options for variables and using the model options given by the user in the form.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}
data filled form values
idforData required description of the project
HYPER- PARAMS
algorithm selected algorithms

Example Request

200 - OK

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/1601423136_0703_Resource/anomaly' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"data_details":{"data":[{"position":1,"variable":"time","dtype":"object","missing_val":0,"changedataType":"Categorical","imputation_method":"None","data_transformation_step":"None","use_for_model":false},{"position":2,"variable":"Sensor1_sensor4","dtype":"float64","missing_val":0,"changedataType":"Continuous","imputation_method":"None","data_transformation_step":"None","use_for_model":true},{"position":3,"variable":"Sensor1_sensor2","dtype":"float64","missing_val":0,"changedataType":"Continuous","imputation_method":"None","data_transformation_step":"None","use_for_model":true},{"position":4,"variable":"Sensor1_sensor3","dtype":"float64","missing_val":0,"changedataType":"Continuous","imputation_method":"None","data_transformation_step":"None","use_for_model":true},{"position":5,"variable":"Sensor1_sensor1","dtype":"float64","missing_val":0,"changedataType":"Continuous","imputation_method":"None","data_transformation_step":"None","use_for_model":true}],"problem_type":"Classification","idforData":"1601423566_autoML","newPMMLFileName":"anomalyModel","parameters":{"generation":10,"population_size":25,"model_name":"anomalyModel","algorithm":"IsolationForest"}}}'

Example Response

200 - OK

{
    "id": "1601423370_Tasks",
    "name": "anomalyModel",
    "createdAt": "Tue Sep 29 23:49:30 2020",
    "type": "ANOMALY",
    "cronExpression": "",
    "status": "Not Scheduled",
    "individualTasks": [
        {
            "pID": "1901",
            "status": "RUNNING",
            "message": "Final pipeline trained",
            "problem_type": "Anomaly",
            "id": "1601423341_autoML",
            "tasksID": "1601423370_Tasks",
            "shape": [
                658,
                5
            ],
            "taskName": "anomalyModel",
            "type": "ANOMALY",
            "executedAt": "Tue Sep 29 23:49:30 2020",
            "listOfModelAccuracy": [],
            "projectID": "1601283001_Project",
            "dataFrameFileName": "./MLW/1601283001_Project/Model/anomalyModel_df.pkl"
        },
        {
            "pID": "1902",
            "status": "RUNNING",
            "message": "In Progress",
            "problem_type": "Anomaly",
            "id": "1601423566_autoML",
            "tasksID": "1601423370_Tasks",
            "shape": [
                658,
                5
            ],
            "taskName": "anomalyModel",
            "type": "ANOMALY",
            "executedAt": "Tue Sep 29 23:54:29 2020",
            "listOfModelAccuracy": [],
            "projectID": "1601283001_Project"
        }
    ],
    "projectID": "1601283001_Project",
    "projectName": "ExampleProject",
    "properties": [
        {
            "key": "problem_type",
            "label": "Problem Type",
            "value": "Anomaly"
        },
        {
            "key": "dataSize",
            "label": "Data Size",
            "value": [
                658,
                5
            ]
        },
        {
            "key": "model_name",
            "label": "Model Name",
            "value": "anomalyModel"
        },
        {
            "key": "alogrithm",
            "label": "Algorithms Size",
            "value": "IsolationForest"
        },
        {
            "key": "population_size",
            "label": "Population Size",
            "value": 25
        },
        {
            "key": "generation",
            "label": "Generation",
            "value": 10
        }
    ],
    "recurrence": "ONE_TIME",
    "startDate": "",
    "startTimeH": "",
    "startTimeM": "",
    "sortTime": 1601423669
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/1601423136_0703_Resource/anomaly' \
--header 'Content-Type: application/json' \
--data-raw '{"data_details":{"data":[{"position":1,"variable":"time","dtype":"object","missing_val":0,"changedataType":"Categorical","imputation_method":"None","data_transformation_step":"None","use_for_model":false},{"position":2,"variable":"Sensor1_sensor4","dtype":"float64","missing_val":0,"changedataType":"Continuous","imputation_method":"None","data_transformation_step":"None","use_for_model":true},{"position":3,"variable":"Sensor1_sensor2","dtype":"float64","missing_val":0,"changedataType":"Continuous","imputation_method":"None","data_transformation_step":"None","use_for_model":true},{"position":4,"variable":"Sensor1_sensor3","dtype":"float64","missing_val":0,"changedataType":"Continuous","imputation_method":"None","data_transformation_step":"None","use_for_model":true},{"position":5,"variable":"Sensor1_sensor1","dtype":"float64","missing_val":0,"changedataType":"Continuous","imputation_method":"None","data_transformation_step":"None","use_for_model":true}],"problem_type":"Classification","idforData":"1601423566_autoML","newPMMLFileName":"anomalyModel","parameters":{"generation":10,"population_size":25,"model_name":"anomalyModel","algorithm":"IsolationForest"}}}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Cumulocity IoT data pull

Operations on MLW data connectors - Data pull from Cumulocity IoT

Info: An active subscription of the MLW microservice is required to perform operations.

GET - Get the list of devices from the C8Y inventory

{{url}}/service/mlw/listDevices

Gets the list of devices from the C8Y inventory.

HEADERS
Authorization {{auth}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/listDevices' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data": [
        {
            "additionParents": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/373/additionParents",
                "references": []
            },
            "owner": "vinayvinkumar@sag.com",
            "childDevices": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/373/childDevices",
                "references": []
            },
            "childAssets": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/373/childAssets",
                "references": []
            },
            "creationTime": "2020-09-15T12:43:07.121Z",
            "lastUpdated": "2020-09-15T12:43:07.121Z",
            "childAdditions": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/373/childAdditions",
                "references": []
            },
            "name": "robot",
            "assetParents": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/373/assetParents",
                "references": []
            },
            "deviceParents": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/373/deviceParents",
                "references": []
            },
            "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/373",
            "id": "373",
            "c8y_IsDevice": {},
            "c8y_SupportedMeasurements": [
                "Sensor1"
            ],
            "c8y_SupportedOperations": [
                "c8y_Restart",
                "c8y_Configuration",
                "c8y_Software",
                "c8y_Firmware",
                "c8y_Command"
            ]
        },
        {
            "additionParents": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/446/additionParents",
                "references": []
            },
            "owner": "vinayvinkumar@sag.com",
            "childDevices": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/446/childDevices",
                "references": []
            },
            "childAssets": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/446/childAssets",
                "references": []
            },
            "creationTime": "2020-09-15T12:44:39.791Z",
            "lastUpdated": "2020-09-15T12:44:39.791Z",
            "childAdditions": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/446/childAdditions",
                "references": []
            },
            "name": "IoT_Robot",
            "assetParents": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/446/assetParents",
                "references": []
            },
            "deviceParents": {
                "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/446/deviceParents",
                "references": []
            },
            "self": "http://t71836.basic.stage.c8y.io/inventory/managedObjects/446",
            "id": "446",
            "c8y_IsDevice": [],
            "c8y_SupportedMeasurements": [
                "Sensors"
            ],
            "c8y_SupportedOperations": [
                "c8y_Restart",
                "c8y_Configuration",
                "c8y_Software",
                "c8y_Firmware",
                "c8y_Command"
            ]
        }
    ]
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1601283001_Project/resources/1601283851_0844_Resource/automl'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Get the list of measurements from the C8Y inventory

{{url}}/service/mlw/listDevices/{{deviceID}}

Gets the list of measurements from the C8Y inventory.

HEADERS
Authorization {{auth}}
PARAMS
deviceID (string) device ID of the registered device

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/listDevices/446' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data": [
        "sensor4",
        "sensor2",
        "sensor3",
        "sensor1"
    ]
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/listDevices/446' \

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

POST - Download the data from the inventory for the selected device ID

{{url}}/service/mlw/projects/{{projectID}}/resources/importFromCumulocity/data

Downloads the data in the data section from Cumulocity IoT inventory wih given aggregation, it is a long running process.

HEADERS
Authorization {{auth}}
PARAMS
fileName name of the file
dateFrom date from
timeFromH time from (hour)
timeFromM time from (minute)
dateTo date to
timeToH time to (hour)
timeToM time to (minute)
source device ID
series list of measurement names

Example Request

200 - OK

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/importFromCumulocity/data' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"fileName":"sensorData2","dateFrom":"2020-07-03T06:00:00.000Z","timeFromH":11,"timeFromM":30,"dateTo":"2020-09-28T07:00:10.509Z","timeToH":12,"timeToM":30,"source":"446","series":["sensor4","sensor2","sensor3","sensor1"]}'

Example Response

200 - OK

{
    "id": "1601287609_Tasks",
    "name": "sensorData2",
    "createdAt": "Mon Sep 28 10:06:49 2020",
    "type": "C8YDATA",
    "cronExpression": "",
    "status": "Not Scheduled",
    "individualTasks": [
        {
            "id": "1601287609_0411_Cumulocity",
            "tasksID": "1601287609_Tasks",
            "taskName": "sensorData2",
            "type": "C8YDATA",
            "executedAt": "Mon Sep 28 10:06:49 2020",
            "deviceID": "446",
            "projectID": "1601283001_Project",
            "fileName": "./MLW/1601283001_Project/Data/sensorData2.csv",
            "pID": "987",
            "status": "In Progress"
        }
    ],
    "projectID": "1601283001_Project",
    "projectName": "ExampleProject",
    "properties": [
        {
            "key": "deviceID",
            "label": "Device ID",
            "value": "446"
        },
        {
            "key": "dateFrom",
            "label": "Date From",
            "value": "2020-07-03T06:00:00.000Z"
        },
        {
            "key": "dateTo",
            "label": "Date To",
            "value": "2020-09-28T07:00:10.509Z"
        },
        {
            "key": "columnNames",
            "label": "Measurements",
            "value": [
                "sensor4",
                "sensor2",
                "sensor3",
                "sensor1"
            ]
        },
        {
            "key": "aggregationType",
            "label": "Aggregation Type",
            "value": "None"
        }
    ],
    "recurrence": "ONE_TIME",
    "startDate": "",
    "startTimeH": "",
    "startTimeM": "",
    "sortTime": 1601287609
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601283001_Project/resources/importFromCumulocity/data' \
--data-raw '{"fileName":"sensorData2","dateFrom":"2020-07-03T06:00:00.000Z","timeFromH":11,"timeFromM":30,"dateTo":"2020-09-28T07:00:10.509Z","timeToH":12,"timeToM":30,"source":"446","series":["sensor4","sensor2","sensor3","sensor1"]}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

DataHub data pull

Operations on MLW data connectors - Data pull from Cumulocity IoT DataHub.

Info: An active subscription of the MLW microservice (mlw-cdh) is required to perform operations.

POST - Pull data from Cumulocity IoT DataHub

{{url}}/service/mlw/projects/{{projectID}}/resources/importFromDatahub/data

Pulls the data with the given query from Cumulocity IoT DataHub.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
sql (string) required SQL query to pull the data
fileName (string) required file name to store the pulled data

Example Request

200 - OK

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/importFromDatahub/data' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"sql":"select * from t23897369DataLake.\"c8y-dremio\".t23897369.alarms","fileName":"cdhData"}'

Example Response

200 - OK

{'id': '159643788874_Tasks',
 'name': 'cdhData',
 'createdAt': 'Mon Aug  3 12:28:08 2020',
 'type': 'DATAHUB',
 'cronExpression': '',
 'status': 'RUNNING',
 'individualTasks': {'159643788896_DataHub': {'pID': '20432',
   'status': 'RUNNING',
   'type': 'DATAHUB',
   'id': '159643788896_DataHub',
   'message': 'Pulling Data from DataHub',
   'executedAt': 'Mon Aug  3 12:28:08 2020'}},
 'projectID': '1601355085_Project',
 'projectName': 'DemoProject',
 'recurrence': 'ONE_TIME',
 'startDate': '',
 'startTimeH': '',
 'startTimeM': '',
 'properties': [{'key': 'file_name',
   'label': 'File Name',
   'value': 'cdhData'}]}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/importFromDatahub/data' \
--header 'Content-Type: application/json' \
--data-raw '{"sql":"select * from t23897369DataLake.\"c8y-dremio\".t23897369.alarms","fileName":"cdhData"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

409 - Error

curl --location --request POST '{{url}}/service/mlw/projects/{{projectID}}/resources/importFromDatahub/data' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"sql":"select * from t23897369DataLake.\"c8y-dremio\".t23897369.alarms","fileName":"cdhData"}'

Example Response

409 - Error

{
    "message": "File name already exists. Please provide another name",
    "errorCode": 409,
    "exception": "Duplicate name"
}

Training WorkFlow

Training WorkFlow in MLW.

Info: An active subscription of the MLW microservice is required to perform operations.

POST - Retrain Machine Learning models using WorkFlow

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourcesID}}/workflow

Trains the WorkFlow using the already created AutoML model, pre-processing script and the dataset.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) required path variable of an existing project ID
resourceID (string) required path variable of an existing resource ID
taskName (string) required body parameter of a task name to start the re-training
cronExpression (string) required body parameter of a cron expression
recurrence (string) required body parameter of a recurrence (ONE_TIME or REPEAT)
startDate (string) optional startDate body parameter in “%Y-%m-%dT%H:%M:%S.%fZ” format

Example Request

200 - OK

curl --request POST "{{url}}/service/mlw/projects/1601355085_Project/resources/160128911974_WorkFlow/workflow" \
     --header "Authorization: {{auth}}" \
     --header "Content-Type: application/json" \
     --data-raw '{"recurrence":"ONE_TIME","cronExpression":"","taskName":"workFlowTrain","startDate": "2020-03-08T18:30:00.000Z"}'

Example Response

200 - OK

{
   "id":"160128911998_Tasks",
   "name":"workFlowTrain",
   "createdAt":"Mon Sep 28 10:31:59 2020",
   "type":"WORKFLOW",
   "sortTime":1601289119,
   "cronExpression":"",
   "status":"RUNNING",
   "individualTasks":[
      {
         "status":"RUNNING",
         "type":"WORKFLOW",
         "message":"In Progress",
         "id":"160128911974_WorkFlow",
         "projectID":"1600784593_Project",
         "tasksID":"160128911998_Tasks",
         "listOfModelAccuracy":[  
         ],
         "executedAt":"Mon Sep 28 10:31:59 2020",
         "pID":"140281294558976"
      }
   ],
   "projectID":"1600784593_Project",
   "projectName":"Demo project",
   "recurrence":"ONE_TIME",
   "startDate":"2020-03-08",
   "startTimeH":"18",
   "startTimeM":"30",
   "timeZone":"UTC",
   "workflowName":"yyy",
   "properties":[
      {
         "key":"targetVar",
         "label":"Target variable",
         "value":"target"
      },
      {
         "key":"problem_type",
         "label":"Problem Type",
         "value":"Classification"
      },
      {
         "key":"dataSize",
         "label":"Data Size",
         "value":[
            "644",
            "3"
         ]
      },
      {
         "key":"model_name",
         "label":"Model Name",
         "value":"admsModel"
      }
   ]
}

Example Request

401 - Unauthorized

curl --request POST "{{url}}/service/mlw/projects/1601355085_Project/resources/160128911974_WorkFlow/workflow" \
     --header "Content-Type: application/json" \
     --data-raw '{"recurrence":"ONE_TIME","cronExpression":"","taskName":"workFlowTrain"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

409 - Error

curl --request POST "{{url}}/service/mlw/projects/1601355085_Project/resources/160128911974_WorkFlow/workflow" \
     --header "Authorization: {{auth}}" \
     --header "Content-Type: application/json" \
     --data-raw '{"recurrence":"ONE_TIME","cronExpression":"","taskName":"workFlowTrain"}'

Example Response

409 - Error

{
    "message": "Task name already exists. Please provide another name",
    "errorCode": 409,
    "exception": "Duplicate name"
}

MLE integration

Operations on models.

Info: An active subscription of the MLW microservice is required to perform operations.

GET - List of deployed PMML models

{{url}}/service/mlw/resources/deploy?type=PMML

Retrieves the list of PMML models deployed to MLE.

HEADERS
Authorization {{auth}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/resources/deploy?type=PMML' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data": [
        {
            "id": "admissionsModel",
            "name": "admissionsModel",
            "type": "PMML"
        },
        {
            "id": "admissionsScenario",
            "name": "admissionsScenario",
            "type": "PMML"
        },
        {
            "id": "admsModel",
            "name": "admsModel",
            "type": "PMML"
        },
        {
            "id": "anomalyModelISO",
            "name": "anomalyModelISO",
            "type": "PMML"
        }
    ]
}

Example Request

401 - Unauthorized

curl --request GET "{{url}}/service/mlw/resources/deploy?type=PMML"

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - List of deployed ONNX models

{{url}}/service/mlw/resources/deploy?type=ONNX

Retrieves the list of ONNX models deployed to MLE.

HEADERS
Authorization {{auth}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/resources/deploy?type=ONNX' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data": [
        {
            "id": "retrainCasting",
            "name": "retrainCasting",
            "type": "ONNX"
        },
        {
            "id": "sodaBottleModel",
            "name": "sodaBottleModel",
            "type": "ONNX"
        },
        {
            "id": "nnAdms",
            "name": "nnAdms",
            "type": "ONNX"
        },
        {
            "id": "cast",
            "name": "cast",
            "type": "ONNX"
        }
    ]
}

Example Request

401 - Unauthorized

curl --request GET "{{url}}/service/mlw/resources/deploy?type=ONNX"

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - List of deployed PIPELINES

{{url}}/service/mlw/resources/deploy?type=PIPELINE

Retrieves the list of PIPELINES deployed to MLE.

HEADERS
Authorization {{auth}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/resources/deploy?type=PIPELINE' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data": [
        {
            "id": "inferencePipeline",
            "name": "inferencePipeline",
            "type": "PIPELINE"
        },
        {
            "id": "castPipelineNew",
            "name": "castPipelineNew",
            "type": "PIPELINE"
        },
        {
            "id": "admsPipelineTest",
            "name": "admsPipelineTest",
            "type": "PIPELINE"
        },
        {
            "id": "castingNewModel",
            "name": "castingNewModel",
            "type": "PIPELINE"
        }
    ]
}

Example Request

401 - Unauthorized

curl --request GET "{{url}}/service/mlw/resources/deploy?type=PIPELINE"

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

404 - Error

curl --location --request POST '{{url}}/service/mlw/resources/deploy?type=H5' \
--header 'Authorization: {{auth}}'

Example Response

404 - Error

{
    "message": "Invalid Model Type",
    "errorCode": 404,
    "exception": "invalid model"
}

POST - Deploy model to MLE (PMML)

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/deploy

Deploys the PMML model to MLE.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355165_0193_Resource/deploy' \
--header 'Authorization: {{auth}}' \

Example Response

200 - OK

{
    "id": "1601355165_0193_Resource",
    "name": "deployModel.pmml",
    "description": "",
    "createdAt": "Tue Sep 29 04:52:45 2020",
    "properties": [
        {
            "key": "version",
            "label": "Version",
            "value": "4.4"
        },
        {
            "key": "fileCreated",
            "label": "Time File Created",
            "value": "2020-09-29 04:52:42.843828"
        },
        {
            "key": "desc",
            "label": "Description",
            "value": "Default Description"
        },
        {
            "key": "columns",
            "label": "Column names",
            "value": [
                "gpa",
                "gre",
                "target"
            ]
        },
        {
            "key": "functionName",
            "label": "Function Name",
            "value": "classification"
        },
        {
            "key": "modelType",
            "label": "Model Type",
            "value": "Tree Based Model"
        },
        {
            "key": "modelName",
            "label": "Model Name",
            "value": "deployModel"
        },
        {
            "key": "numberOfTrees",
            "label": "Number of trees",
            "value": 100
        },
        {
            "key": "modelInformation",
            "label": "Model information",
            "value": 10
        }
    ],
    "editedAt": "",
    "type": "PMML",
    "url": "./MLW/1601355085_Project/Model/deployModel.pmml",
    "size": 699812,
    "mimeType": "application/PMML",
    "extension": ".pmml",
    "category": "Model",
    "deployed": true,
    "mleID": "deployModel"
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355165_0193_Resource/deploy'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

409 - Error

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355165_0193_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

409 - Error

{
    "message": "A model with the name 'deployModel' already exists.",
    "errorCode": 409,
    "exception": "invalid/error"
}

Example Request

400 - Error

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355166_0193_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

400 - Error

{
    "message": "Invalid XML format.",
    "errorCode": 400,
    "exception": "invalid/error"
}

Example Request

404 - Error

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355165_0193_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

404 - Error

{
    "message": "'errors'",
    "errorCode": 404,
    "exception": "Not Found"
}

POST - Deploy model to MLE (ONNX)

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/deploy

Deploys the ONNX model to MLE.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357305_0916_Resource/deploy' \
--header 'Authorization: {{auth}}' \

Example Response

200 - OK

{
    "id": "1601357305_0916_Resource",
    "name": "admsNNN_1601357289.onnx",
    "description": "",
    "createdAt": "Tue Sep 29 05:28:25 2020",
    "properties": [],
    "editedAt": "",
    "type": "ONNX",
    "url": "./MLW/1601355085_Project/Model/admsNNN_1601357289.onnx",
    "size": 204024,
    "mimeType": "application/ONNX",
    "extension": ".onnx",
    "category": "Model",
    "deployed": true,
    "mleID": "admsNNN"
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357305_0916_Resource/deploy'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

409 - Error

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357305_0916_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

409 - Error

{
    "message": "A model with the name 'admsNNN' already exists.",
    "errorCode": 404,
    "exception": "invalid/error"
}

Example Request

400 - Error

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357306_0916_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

400 - Error

{
    "message": "Invalid onnx format.",
    "errorCode": 400,
    "exception": "invalid/error"
}

Example Request

404 - Error

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355165_0193_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

404 - Error

{
    "message": "Onnx microservice is unsubscribed. Subscribe to Onnx microservice.",
    "errorCode": 404,
    "exception": "invalid/error"
}

POST - Deploy model to MLE (PIPELINE)

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/deploy

Deploys the PIPELINE to MLE.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357604_0359_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "id": "1601357604_0359_Resource",
    "name": "PPP.pipeline",
    "description": "",
    "createdAt": "Tue Sep 29 05:33:24 2020",
    "properties": [
        {
            "key": "modelID",
            "label": "ONNX Model",
            "value": "admsNNN_1601357289.onnx"
        },
        {
            "key": "preProcessingID",
            "label": "Pre-Processing Script",
            "value": "preScriptCastDefect.py"
        },
        {
            "key": "postProcessingID",
            "label": "Post-Processing Script",
            "value": "postScriptCastDefect.py"
        }
    ],
    "editedAt": "Tue Sep 29 05:33:24 2020",
    "type": "PIPELINE",
    "url": "./MLW/1601355085_Project/Pipeline/PPP.pipeline",
    "size": 134,
    "mimeType": "application/PIPELINE",
    "extension": ".pipeline",
    "category": "Pipeline",
    "preProcessingID": "1601357477_0219_Resource",
    "modelID": "1601357305_0916_Resource",
    "postProcessingID": "1601357477_0011_Resource",
    "deployed": true,
    "mleID": "PPP"
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357604_0359_Resource/deploy'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

409 - Error

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357604_0359_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

409 - Error

{
    "message": "A pipeline with the same name already exists.",
    "errorCode": 409,
    "exception": "Duplicate Name"
}

DELETE - Remove model from MLE (PMML)

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/deploy

Removes the PMML model from MLE.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355165_0193_Resource/deploy' \
--header 'Authorization: {{auth}}' \

Example Response

200 - OK

{
    "id": "1601355165_0193_Resource",
    "name": "deployModel.pmml",
    "description": "",
    "createdAt": "Tue Sep 29 04:52:45 2020",
    "properties": [
        {
            "key": "version",
            "label": "Version",
            "value": "4.4"
        },
        {
            "key": "fileCreated",
            "label": "Time File Created",
            "value": "2020-09-29 04:52:42.843828"
        },
        {
            "key": "desc",
            "label": "Description",
            "value": "Default Description"
        },
        {
            "key": "columns",
            "label": "Column names",
            "value": [
                "gpa",
                "gre",
                "target"
            ]
        },
        {
            "key": "functionName",
            "label": "Function Name",
            "value": "classification"
        },
        {
            "key": "modelType",
            "label": "Model Type",
            "value": "Tree Based Model"
        },
        {
            "key": "modelName",
            "label": "Model Name",
            "value": "deployModel"
        },
        {
            "key": "numberOfTrees",
            "label": "Number of trees",
            "value": 100
        },
        {
            "key": "modelInformation",
            "label": "Model information",
            "value": 10
        }
    ],
    "editedAt": "",
    "type": "PMML",
    "url": "./MLW/1601355085_Project/Model/deployModel.pmml",
    "size": 699812,
    "mimeType": "application/PMML",
    "extension": ".pmml",
    "category": "Model",
    "deployed": false,
    "mleID": "deployModel"
}

Example Request

401 - Unauthorized

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355165_0193_Resource/deploy'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

404 - Error

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355165_0193_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

404 - Error

{
    "message": "Model 'deployModel' not found.",
    "errorCode": 404,
    "exception": "invalid/error"
}

Example Request

404 - Error

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355165_0193_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

404 - Error

{
    "message": "'errors'",
    "errorCode": 404,
    "exception": "Not Found"
}

DELETE - Remove model from MLE (ONNX)

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/deploy

Removes the ONNX model from MLE.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357305_0916_Resource/deploy' \
--header 'Authorization: {{auth}}' \

Example Response

200 - OK

{
    "id": "1601357305_0916_Resource",
    "name": "admsNNN_1601357289.onnx",
    "description": "",
    "createdAt": "Tue Sep 29 05:28:25 2020",
    "properties": [],
    "editedAt": "",
    "type": "ONNX",
    "url": "./MLW/1601355085_Project/Model/admsNNN_1601357289.onnx",
    "size": 204024,
    "mimeType": "application/ONNX",
    "extension": ".onnx",
    "category": "Model",
    "deployed": false,
    "mleID": "admsNNN"
}

Example Request

401 - Unauthorized

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357305_0916_Resource/deploy'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

404 - Error

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357305_0916_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

404 - Error

{
    "message": "Model 'admsNNN' not found.",
    "errorCode": 404,
    "exception": "invalid/error"
}

Example Request

500 - Error

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357305_0916_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

500 - Error

{
    "message": "The model 'admsNNN' is required by the Pipeline(s) ['PPP']. Please delete these pipeline(s) before deleting the model 'admsNNN'.",
    "errorCode": 500,
    "exception": "invalid/error"
}

Example Request

404 - Error

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357305_0916_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

404 - Error

{
    "message": "Onnx microservice is unsubscribed. Subscribe to Onnx microservice.",
    "errorCode": 404,
    "exception": "invalid/error"
}

DELETE - Remove model from MLE (PIPELINE)

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/deploy

Removes the PIPELINE from MLE.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357604_0359_Resource/deploy' \
--header 'Authorization: {{auth}}' \

Example Response

200 - OK

{
    "id": "1601357604_0359_Resource",
    "name": "PPP.pipeline",
    "description": "",
    "createdAt": "Tue Sep 29 05:33:24 2020",
    "properties": [
        {
            "key": "modelID",
            "label": "ONNX Model",
            "value": "admsNNN_1601357289.onnx"
        },
        {
            "key": "preProcessingID",
            "label": "Pre-Processing Script",
            "value": "preScriptCastDefect.py"
        },
        {
            "key": "postProcessingID",
            "label": "Post-Processing Script",
            "value": "postScriptCastDefect.py"
        }
    ],
    "editedAt": "Tue Sep 29 05:33:24 2020",
    "type": "PIPELINE",
    "url": "./MLW/1601355085_Project/Pipeline/PPP.pipeline",
    "size": 134,
    "mimeType": "application/PIPELINE",
    "extension": ".pipeline",
    "category": "Pipeline",
    "preProcessingID": "1601357477_0219_Resource",
    "modelID": "1601357305_0916_Resource",
    "postProcessingID": "1601357477_0011_Resource",
    "deployed": false,
    "mleID": "PPP"
}

Example Request

401 - Unauthorized

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357604_0359_Resource/deploy'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

404 - Error

curl --location --request DELETE '{{url}}/service/mlw/projects/1601355085_Project/resources/1601357604_0359_Resource/deploy' \
--header 'Authorization: {{auth}}'

Example Response

404 - Error

{
    "message": "Pipeline 'PPP' not found.",
    "errorCode": 404,
    "exception": "invalid/error"
}

GET - Predict using the deployed PMML models

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/predict/{{modelID}}?type=PMML

Predicts from the list of deployed PMML models in MLE.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601355085_Project/resources/1601359513_0301_Resource/predict/deployModel?type=PMML' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "id": "1601355085_Project",
    "name": "vinsy",
    "description": "test project",
    "createdAt": "Tue Sep 29 04:51:25 2020",
    "properties": [],
    "isModified": true,
    "isFreeze": false,
    "selectedVersion": "",
    "versions": [],
    "resources": {
        "data": [
            {
                "id": "1601359513_0301_Resource",
                "name": "admissions_test.csv",
                "description": "",
                "createdAt": "Tue Sep 29 06:05:13 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 644
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 2
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "gpa",
                            "gre"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601355085_Project/Data/admissions_test.csv",
                "size": 15897,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            },
            {
                "id": "1601359589_0521_Resource",
                "name": "predicted_admissions_test_1601359589.csv",
                "description": "",
                "createdAt": "Tue Sep 29 06:06:29 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 644
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 3
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "probability_0",
                            "probability_1",
                            "predicted_target"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601355085_Project/Data/predicted_admissions_test_1601359589.csv",
                "size": 7439,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            }
        ],
        "model": [
            {
                "id": "1601355165_0193_Resource",
                "name": "deployModel.pmml",
                "description": "",
                "createdAt": "Tue Sep 29 04:52:45 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-29 04:52:42.843828"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "gpa",
                            "gre",
                            "target"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "classification"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Tree Based Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "deployModel"
                    },
                    {
                        "key": "numberOfTrees",
                        "label": "Number of trees",
                        "value": 100
                    },
                    {
                        "key": "modelInformation",
                        "label": "Model information",
                        "value": 10
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1601355085_Project/Model/deployModel.pmml",
                "size": 699812,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": false,
                "mleID": "deployModel"
            },
            {
                "id": "1601357305_0916_Resource",
                "name": "admsNNN_1601357289.onnx",
                "description": "",
                "createdAt": "Tue Sep 29 05:28:25 2020",
                "properties": [],
                "editedAt": "",
                "type": "ONNX",
                "url": "./MLW/1601355085_Project/Model/admsNNN_1601357289.onnx",
                "size": 204024,
                "mimeType": "application/ONNX",
                "extension": ".onnx",
                "category": "Model",
                "deployed": false,
                "mleID": "admsNNN"
            }
        ],
        "code": [
        ],
        "pipeline": [
        ],
        "workflow": [],
        "nn-designer": [
        ]
    },
    "resourcesCount": {
        "data": 2,
        "model": 2,
        "code": 0,
        "workflow": 0,
        "pipeline": 0,
        "nn-designer": 0,
        "totalCount": 4
    }
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1601355085_Project/resources/1601359513_0301_Resource/predict/deployModel?type=PMML'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

GET - Predict using the deployed ONNX models

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/predict/{{modelID}}?type=ONNX

Predicts from the list of deployed ONNX models in MLE.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601355085_Project/resources/1601359513_0301_Resource/predict/admsNNN?type=ONNX' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "id": "1601355085_Project",
    "name": "vinsy",
    "description": "test project",
    "createdAt": "Tue Sep 29 04:51:25 2020",
    "properties": [],
    "isModified": true,
    "isFreeze": false,
    "selectedVersion": "",
    "versions": [],
    "resources": {
        "data": [
            {
                "id": "1601359513_0301_Resource",
                "name": "admissions_test.csv",
                "description": "",
                "createdAt": "Tue Sep 29 06:05:13 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 644
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 2
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "gpa",
                            "gre"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601355085_Project/Data/admissions_test.csv",
                "size": 15897,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            },
            {
                "id": "1601359589_0521_Resource",
                "name": "predicted_admissions_test_1601359589.csv",
                "description": "",
                "createdAt": "Tue Sep 29 06:06:29 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 644
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 3
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "probability_0",
                            "probability_1",
                            "predicted_target"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601355085_Project/Data/predicted_admissions_test_1601359589.csv",
                "size": 7439,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            },
        ],
        "model": [
            {
                "id": "1601355165_0193_Resource",
                "name": "deployModel.pmml",
                "description": "",
                "createdAt": "Tue Sep 29 04:52:45 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-29 04:52:42.843828"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "gpa",
                            "gre",
                            "target"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "classification"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Tree Based Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "deployModel"
                    },
                    {
                        "key": "numberOfTrees",
                        "label": "Number of trees",
                        "value": 100
                    },
                    {
                        "key": "modelInformation",
                        "label": "Model information",
                        "value": 10
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1601355085_Project/Model/deployModel.pmml",
                "size": 699812,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": false,
                "mleID": "deployModel"
            },
            {
                "id": "1601357305_0916_Resource",
                "name": "admsNNN_1601357289.onnx",
                "description": "",
                "createdAt": "Tue Sep 29 05:28:25 2020",
                "properties": [],
                "editedAt": "",
                "type": "ONNX",
                "url": "./MLW/1601355085_Project/Model/admsNNN_1601357289.onnx",
                "size": 204024,
                "mimeType": "application/ONNX",
                "extension": ".onnx",
                "category": "Model",
                "deployed": false,
                "mleID": "admsNNN"
            }
        ],
        "code": [
        ],
        "pipeline": [
        ],
        "workflow": [],
        "nn-designer": [
        ]
    },
    "resourcesCount": {
        "data": 2,
        "model": 2,
        "code": 0,
        "workflow": 0,
        "pipeline": 0,
        "nn-designer": 0,
        "totalCount": 4
    }
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1601355085_Project/resources/1601359513_0301_Resource/predict/admsNNN?type=ONNX'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

404 - Error

curl --location --request GET '{{url}}/service/mlw/projects/1601355085_Project/resources/1601359513_0301_Resource/predict/admsNNN?type=ONNX' \
--header 'Authorization: {{auth}}'

Example Response

404 - Error

{
    "message": "Onnx microservice is unsubscribed. Subscribe to Onnx microservice.",
    "errorCode": 404,
    "exception": "invalid/error"
}

GET - Predict using the deployed PIPELINES

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/predict/PPP?type=PIPELINE

Predicts from the list of deployed PIPELINE models in MLE.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601355085_Project/resources/1601359513_0301_Resource/predict/PPP?type=PIPELINE' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "id": "1601355085_Project",
    "name": "vinsy",
    "description": "test project",
    "createdAt": "Tue Sep 29 04:51:25 2020",
    "properties": [],
    "isModified": true,
    "isFreeze": false,
    "selectedVersion": "",
    "versions": [],
    "resources": {
        "data": [
            {
                "id": "1601359513_0301_Resource",
                "name": "admissions_test.csv",
                "description": "",
                "createdAt": "Tue Sep 29 06:05:13 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 644
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 2
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "gpa",
                            "gre"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601355085_Project/Data/admissions_test.csv",
                "size": 15897,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            },
            {
                "id": "1601360114_0707_Resource",
                "name": "predicted_admissions_test_1601360114.csv",
                "description": "",
                "createdAt": "Tue Sep 29 06:15:14 2020",
                "properties": [
                    {
                        "key": "numberOfRows",
                        "label": "Number of Rows",
                        "value": 644
                    },
                    {
                        "key": "numberOfColumns",
                        "label": "Number of Columns",
                        "value": 1
                    },
                    {
                        "key": "columnNames",
                        "label": "Column Names",
                        "value": [
                            "0"
                        ]
                    }
                ],
                "editedAt": "",
                "type": "CSV",
                "url": "./MLW/1601355085_Project/Data/predicted_admissions_test_1601360114.csv",
                "size": 12482,
                "mimeType": "text/csv",
                "extension": ".csv",
                "category": "Data"
            }
        ],
        "model": [
            {
                "id": "1601355165_0193_Resource",
                "name": "deployModel.pmml",
                "description": "",
                "createdAt": "Tue Sep 29 04:52:45 2020",
                "properties": [
                    {
                        "key": "version",
                        "label": "Version",
                        "value": "4.4"
                    },
                    {
                        "key": "fileCreated",
                        "label": "Time File Created",
                        "value": "2020-09-29 04:52:42.843828"
                    },
                    {
                        "key": "desc",
                        "label": "Description",
                        "value": "Default Description"
                    },
                    {
                        "key": "columns",
                        "label": "Column names",
                        "value": [
                            "gpa",
                            "gre",
                            "target"
                        ]
                    },
                    {
                        "key": "functionName",
                        "label": "Function Name",
                        "value": "classification"
                    },
                    {
                        "key": "modelType",
                        "label": "Model Type",
                        "value": "Tree Based Model"
                    },
                    {
                        "key": "modelName",
                        "label": "Model Name",
                        "value": "deployModel"
                    },
                    {
                        "key": "numberOfTrees",
                        "label": "Number of trees",
                        "value": 100
                    },
                    {
                        "key": "modelInformation",
                        "label": "Model information",
                        "value": 10
                    }
                ],
                "editedAt": "",
                "type": "PMML",
                "url": "./MLW/1601355085_Project/Model/deployModel.pmml",
                "size": 699812,
                "mimeType": "application/PMML",
                "extension": ".pmml",
                "category": "Model",
                "deployed": false,
                "mleID": "deployModel"
            },
            {
                "id": "1601357305_0916_Resource",
                "name": "admsNNN_1601357289.onnx",
                "description": "",
                "createdAt": "Tue Sep 29 05:28:25 2020",
                "properties": [],
                "editedAt": "",
                "type": "ONNX",
                "url": "./MLW/1601355085_Project/Model/admsNNN_1601357289.onnx",
                "size": 204024,
                "mimeType": "application/ONNX",
                "extension": ".onnx",
                "category": "Model",
                "deployed": false,
                "mleID": "admsNNN"
            }
        ],
        "code": [],
        "pipeline": [],
        "workflow": [],
        "nn-designer": []
    },
    "resourcesCount": {
        "data": 2,
        "model": 2,
        "code": 0,
        "workflow": 0,
        "pipeline": 0,
        "nn-designer": 0,
        "totalCount": 4
    }
}

Example Request

401 - Unauthorized

curl --request GET "{{url}}/service/mlw/projects/1601355085_Project/resources/1601359513_0301_Resource/predict/PPP?type=PIPELINE"

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

404 - Error

curl --location --request POST '{{url}}/service/mlw/projects/1601355085_Project/resources/1601359513_0301_Resource/predict/PPP?type=H5' \
--header 'Authorization: {{auth}}'

Example Response

404 - Error

{
    "message": "Invalid Model Type/File Type.",
    "errorCode": 404,
    "exception": "invalid model"
}

Neural network

Neural network training.

Info: An active subscription of the MLW microservice is required to perform operations.

POST - Start the training process of the neural network

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/trainNN

Train a neural network model using architecture file.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) required path variable of an existing project ID
resourceID (string) required path variable of an existing resource ID
batchSize (integer) required batchSize body parameter to train model
epoch (integer) required epoch body parameter to train model
stepPerEpoch (integer) required stepPerEpoch body parameter to train model
learningRate (float) required learningRate body parameter to train model
loss (string) required loss function body parameter to train model
metrics (list) required metrics body parameter to train model
optimizer (string) required optimizer body parameter to train model
testSize (float) required testSize body parameter to train model
recurrence (string) required ONE_TIME/REPEAT
cronExpression (string) mandatory Cron expression body parameter if recurrence is “REPEAT”
modelName (string) required modelName body parameter
dataID (string) required resource ID of data (body parameter)
codeID (string) optional resource ID of pre-processing script (body parameter)
problemType (string) required classification/regression
startDate (string) optional startDate body parameter in “%Y-%m-%dT%H:%M:%S.%fZ” format

Example Request

200 - OK

curl --location --request POST '{{url}}/projects/{{projectID}}/resources/{{resourceID}}/trainNN' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: text/plain' \
--data-raw '{"batchSize":15,"epoch":100,"stepPerEpoch":10,"learningRate":0.001,"loss":"categorical_crossentropy","metrics":["accuracy","f1"],"optimizer":"adam","testSize":0.3,"scriptOutput":"NA","recurrence":"ONE_TIME","cronExpression":"","modelName":"modelName","dataID":"1601289034_0614_Resource","codeID":"1601282978_0253_Resource","problemType":"classification","startDate": "2020-03-08T18:30:00.000Z"}'

Example Response

200 - OK

{
   "id":"1601358322415",
   "name":"modelName",
   "createdAt":"Tue Sep 29 05:45:22 2020",
   "sortTime":1601358322,
   "type":"NN",
   "individualTasks":[
      {
         "status":"INITIALISING",
         "type":"NN",
         "projectID":"1600784593_Project",
         "log":{
            
         },
         "properties":[
            
         ],
         "message":"Initialising",
         "history":[
            
         ],
         "tasksID":"1601358322415",
         "taskName":"modelName",
         "id":"1601358322191",
         "executedAt":"Tue Sep 29 05:45:22 2020",
         "pID":"1394"
      }
   ],
   "projectID":"1600784593_Project",
   "projectName":"blah project",
   "startDate":"2020-03-08",
   "startTimeH":"18",
   "startTimeM":"30",
   "timeZone":"UTC",
   "properties":[
      {
         "key":"problemType",
         "label":"Problem Type",
         "value":"classification"
      },
      {
         "key":"optimizer",
         "label":"Optimizer",
         "value":"adam"
      },
      {
         "key":"learningRate",
         "label":"Learning Rate",
         "value":0.001
      },
      {
         "key":"loss",
         "label":"Loss",
         "value":"categorical_crossentropy"
      },
      {
         "key":"metrics",
         "label":"Metrics",
         "value":[
            "accuracy",
            "f1"
         ]
      },
      {
         "key":"epoch",
         "label":"Epoch",
         "value":100
      },
      {
         "key":"testSize",
         "label":"Test Size",
         "value":0.3
      },
      {
         "key":"batchSize",
         "label":"Batch Size",
         "value":15
      }
   ],
   "cronExpression":"",
   "status":"NOT SCHEDULED",
   "recurrence":"ONE_TIME"
}

Example Request

401 - Unauthorized

curl --location --request POST '{{url}}/projects/{{projectID}}/resources/{{resourceID}}/trainNN' \
--header 'Content-Type: text/plain' \
--data-raw '{"batchSize":15,"epoch":100,"stepPerEpoch":10,"learningRate":0.001,"loss":"categorical_crossentropy","metrics":["accuracy","f1"],"optimizer":"adam","testSize":0.3,"scriptOutput":"NA","recurrence":"ONE_TIME","cronExpression":"","modelName":"someName","dataID":"1601289034_0614_Resource","codeID":"1601282978_0253_Resource","problemType":"classification"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

400 Bad Request

curl --location --request POST '{{url}}/projects/{{projectID}}/resources/{{resourceID}}/trainNN' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: text/plain' \
--data-raw '{"batchSize":15,"epoch":100,"stepPerEpoch":10,"learningRate":0.001,"loss":"categorical_crossentropy","metrics":["accuracy","f1"],"optimizer":"Adam","testSize":0.3,"scriptOutput":"NA","recurrence":"ONE_TIME","cronExpression":"","modelName":"someName","dataID":"1600786268_0337_Resource"}'

Example Response

400 Bad Request

{
   "message":"one of mandatory hyperparameter not found",
   "errorCode":400,
   "exception":"one of mandatory hyperparameter not found"
}

Script execution

Operations on MLW projects.

Info: An active subscription of the MLW microservice is required to perform operations.

POST - Execute a script

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/execute

Execute a python script.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) required path variable of an existing project ID
resourceID (string) required path variable of an existing resource ID
recurrence (string) required ONE_TIME/REPEAT
cronExpression (string) mandatory Cron expression body parameter if recurrence is “REPEAT”
taskName (string) required taskName body parameter
startDate (string) optional startDate body parameter in “%Y-%m-%dT%H:%M:%S.%fZ” format

Example Request

200 - OK

curl --location --request POST 'https://mlw.latest.stage.c8y.io/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/execute' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"recurrence":"ONE_TIME","cronExpression":"","taskName":"script1","startDate": "2020-03-08T18:30:00.000Z"}'

Example Response

200 - OK

{
   "id":"160136083625_Tasks",
   "name":"script1",
   "createdAt":"Tue Sep 29 06:27:16 2020",
   "sortTime":1601360836,
   "type":"CODE",
   "individualTasks":[
      {
         "type":"CODE",
         "projectID":"1600784593_Project",
         "tasksID":"160136083625_Tasks",
         "taskName":"script1",
         "id":"160136083614_Tasks",
         "executedAt":"Tue Sep 29 06:27:16 2020",
         "pID":"140281294558976",
         "status":"RUNNING"
      }
   ],
   "projectID":"1600784593_Project",
   "projectName":"blah project",
   "startDate":"2020-03-08",
   "startTimeH":"18",
   "startTimeM":"30",
   "timeZone":"UTC",
   "properties":[
      
   ],
   "cronExpression":"",
   "status":"EXECUTED",
   "recurrence":"ONE_TIME"
}

Example Request

401 - Unauthorized

curl --location --request POST 'https://mlw.latest.stage.c8y.io/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/execute' \
--header 'Content-Type: application/json' \
--data-raw '{"recurrence":"ONE_TIME","cronExpression":"","taskName":"script1"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

400 Bad Request

curl --location --request POST 'https://mlw.latest.stage.c8y.io/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/execute' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: application/json' \
--data-raw '{"recurrence":"ONE_TIME","cronExpression":""}'

Example Response

400 Bad Request

{
   "message":"Missing parameter taskName",
   "errorCode":400,
   "exception":"Missing parameters"
}

Jupyter integration

Operations on Jupyter Notebook.

Info: An active subscription of the MLW microservice is required to perform operations.

GET - Preview the Notebook code along with the session creation

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/jnb-content

Gets the content of the Jupyter Notebook file and also creates a Jupyter session.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355159_0193_Resource/jnb-content' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data": {
        "name": "untitled.ipynb",
        "path": "1601355085_Project/Code/untitled.ipynb",
        "last_modified": "2020-09-30T07:31:59.062747Z",
        "created": "2020-09-30T07:31:59.062747Z",
        "content": {
            "cells": [],
            "metadata": {},
            "nbformat": 4,
            "nbformat_minor": 4
        },
        "format": "json",
        "mimetype": null,
        "size": 78,
        "writable": true,
        "type": "notebook"
    },
    "session": {
        "id": "e2ba72b2-2daf-4aa6-851d-1b3e491cc2f3",
        "path": "1601355085_Project/Code/untitled.ipynb",
        "name": "untitled",
        "type": "notebook",
        "kernel": {
            "id": "7fd616bf-1044-4954-a0cd-591c973ee950",
            "name": "python3",
            "last_activity": "2020-09-30T07:33:20.920222Z",
            "execution_state": "starting",
            "connections": 0
        },
        "notebook": {
            "path": "1601355085_Project/Code/untitled.ipynb",
            "name": "untitled"
        }
    }
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355159_0193_Resource/jnb-content' 

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

PUT - Update the Jupyter Notebook contents

{{url}}/service/mlw/projects/{{projectID}}/resources/{{resourceID}}/jnb-content

Updates the contents of the Jupyter Notebook file.

HEADERS
Authorization {{auth}}
PARAMS
projectID (string) {{project ID}}
resourceID (string) {{resource ID}}
content (string) updated contents of Jupyter Notebook
format (string) required format (ex. ‘json’)
type (string) required type (ex. ‘notebook’)

Example Request

200 - OK

curl --location --request PUT '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355159_0193_Resource/jnb-content' \
--header 'Authorization: {{auth}} \
--header 'Content-Type: text/plain' \
--data-raw '{"content": {"cells": [{"cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": ["asdasfas"]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.9"}}, "nbformat": 4, "nbformat_minor": 4},
"format": "json",
"type": "notebook"}'

Example Response

200 - OK

{
    "name": "untitled.ipynb",
    "path": "1601355085_Project/Code/untitled.ipynb",
    "last_modified": "2020-09-30T07:40:02.608464Z",
    "created": "2020-09-30T07:40:02.608464Z",
    "content": null,
    "format": null,
    "mimetype": null,
    "size": 571,
    "writable": true,
    "type": "notebook"
}

Example Request

401 - Unauthorized

curl --location --request PUT '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355159_0193_Resource/jnb-content' \
--header 'Content-Type: text/plain' \
--data-raw '{"content": {"cells": [{"cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": ["asdasfas"]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.9"}}, "nbformat": 4, "nbformat_minor": 4},
"format": "json",
"type": "notebook"}'

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Example Request

400 - Error

curl --location --request PUT '{{url}}/service/mlw/projects/1601355085_Project/resources/1601355159_0193_Resource/jnb-content' \
--header 'Authorization: {{auth}}' \
--header 'Content-Type: text/plain' \
--data-raw '{"content": {"cells": [{"cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": ["asdasfas"]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.9"}}, "nbformat": 4, "nbformat_minor": 4},
"format": "json",
"type": "jnb"}'

Example Response

400 - Error

{
    "message": "Unhandled contents type: jnb",
    "reason": null
}

GET - List of created Jupyter sessions

{{url}}/service/mlw/jnb-sessions

Gets the list of created Jupyter sessions.

HEADERS
Authorization {{auth}}

Example Request

200 - OK

curl --location --request GET '{{url}}/service/mlw/jnb-sessions' \
--header 'Authorization: {{auth}}'

Example Response

200 - OK

{
    "data": [
        {
            "id": "e1b8e814-36c2-4e5a-ba2a-e3524fe2d03c",
            "path": "1600784593_Project/Code/untitled.ipynb",
            "name": "untitled",
            "type": "notebook",
            "kernel": {
                "id": "63b58129-f89e-4325-a069-ef010153ff46",
                "name": "python3",
                "last_activity": "2020-09-28T06:00:14.946977Z",
                "execution_state": "idle",
                "connections": 0
            },
            "notebook": {
                "path": "1600784593_Project/Code/untitled.ipynb",
                "name": "untitled"
            },
            "projectID": "1600784593_Project",
            "projectName": "blah project",
            "fileName": "untitled.ipynb"
        },
        {
            "id": "e2ba72b2-2daf-4aa6-851d-1b3e491cc2f3",
            "path": "1601355085_Project/Code/untitled.ipynb",
            "name": "untitled",
            "type": "notebook",
            "kernel": {
                "id": "7fd616bf-1044-4954-a0cd-591c973ee950",
                "name": "python3",
                "last_activity": "2020-09-30T07:33:20.920222Z",
                "execution_state": "starting",
                "connections": 0
            },
            "notebook": {
                "path": "1601355085_Project/Code/untitled.ipynb",
                "name": "untitled"
            },
            "projectID": "1601355085_Project",
            "projectName": "vinsy",
            "fileName": "untitled.ipynb"
        }
    ]
}

Example Request

401 - Unauthorized

curl --location --request GET '{{url}}/service/mlw/jnb-sessions' 

Example Response

401 - Unauthorized

{
    "error": "general/internalError",
    "message": "No auth information found",
    "info": "https://cumulocity.com/guides/reference/rest-implementation/#error_reporting"
}

Using Postman

Graphical REST clients such as Postman are a convenient way to explore REST interfaces and the Cumulocity IoT database content.

If you are already using the Cumulocity IoT API collection in Postman and the environment to access the collection for your tenant is set up, then you can directly import the MLW microservice collection (see below).

If you are doing a fresh set up of Postman for using the Machine Learning Workbench (MLW) microservice collection, first follow the steps described in Using the REST interface > Overview > Using Postman in the Microservice SDK guide.

Importing the Machine Learning Workbench (MLW) microservice collection into Postman

Import the APIs as a JSON file.

Alternatively click: Run in Postman After importing, you will see a new collection “MLW Microservice API” in the Collections tab in Postman.