Mprove
.json
GetModel

GetModel

POST/api/ToBackendGetModel

Get a model

Request Body

application/json

Response Body

application/json

curl -X POST "http://localhost:3000/api/ToBackendGetModel" \  -H "Content-Type: application/json" \  -d '{    "info": {      "name": "api/ToBackendGetModel",      "traceId": "string",      "idempotencyKey": "string"    },    "payload": {      "projectId": "string",      "repoId": "string",      "branchId": "string",      "envId": "string",      "modelId": "string",      "getMalloy": true    }  }'
{
  "info": {
    "path": "/api/ToBackendGetModel",
    "method": "POST",
    "mproveVersion": "string",
    "duration": 0,
    "status": "Ok",
    "traceId": "string",
    "error": null
  },
  "payload": {
    "needValidate": true,
    "struct": {
      "projectId": "string",
      "structId": "string",
      "errors": [
        {
          "title": "string",
          "message": "string",
          "lines": [
            {
              "fileId": "string",
              "fileName": "string",
              "lineNumber": -9007199254740991
            }
          ]
        }
      ],
      "metrics": [
        {
          "modelId": "string",
          "modelType": "Store",
          "connectionType": "PostgreSQL",
          "fieldId": "string",
          "fieldClass": "dimension",
          "fieldResult": "day_of_week",
          "timeFieldId": "string",
          "structId": "string",
          "filePath": "string",
          "fieldLineNum": -9007199254740991,
          "type": "Model",
          "metricId": "string",
          "topNode": "string",
          "label": "string",
          "topLabel": "string",
          "partNodeLabel": "string",
          "partFieldLabel": "string",
          "partLabel": "string",
          "timeNodeLabel": "string",
          "timeFieldLabel": "string",
          "timeLabel": "string",
          "description": "string",
          "formatNumber": "string",
          "currencyPrefix": "string",
          "currencySuffix": "string",
          "serverTs": -9007199254740991,
          "hasAccessToModel": true
        }
      ],
      "presets": [
        {
          "presetId": "string",
          "label": "string",
          "path": "string",
          "parsedContent": null
        }
      ],
      "mproveConfig": {
        "mproveDirValue": "string",
        "caseSensitiveStringFilters": true,
        "weekStart": "Sunday",
        "allowTimezones": true,
        "defaultTimezone": "string",
        "formatNumber": "string",
        "currencyPrefix": "string",
        "currencySuffix": "string",
        "thousandsSeparator": "string"
      },
      "mproveVersion": "string",
      "serverTs": -9007199254740991
    },
    "userMember": {
      "projectId": "string",
      "memberId": "string",
      "email": "string",
      "alias": "string",
      "firstName": "string",
      "lastName": "string",
      "fullName": "string",
      "avatarSmall": "string",
      "roles": [
        "string"
      ],
      "isAdmin": true,
      "isEditor": true,
      "isExplorer": true,
      "serverTs": -9007199254740991
    },
    "model": {
      "structId": "string",
      "modelId": "string",
      "type": "Store",
      "source": "string",
      "connectionId": "string",
      "connectionType": "PostgreSQL",
      "filePath": "string",
      "fileText": "string",
      "storeContent": null,
      "dateRangeIncludesRightSide": true,
      "accessRoles": [
        "string"
      ],
      "label": "string",
      "fields": [
        {
          "id": "string",
          "malloyFieldName": "string",
          "malloyFieldPath": [
            "string"
          ],
          "malloyBaseFieldId": "string",
          "malloyTags": [
            {
              "key": "string",
              "value": "string"
            }
          ],
          "mproveTags": [
            {
              "key": "string",
              "value": "string"
            }
          ],
          "hidden": true,
          "required": true,
          "maxFractions": 0,
          "label": "string",
          "fieldClass": "dimension",
          "fieldFileName": "string",
          "fieldFilePath": "string",
          "result": "day_of_week",
          "fieldLineNum": -9007199254740991,
          "suggestModelDimension": "string",
          "sqlName": "string",
          "topId": "string",
          "topLabel": "string",
          "description": "string",
          "type": "count_distinct",
          "groupId": "string",
          "groupLabel": "string",
          "groupDescription": "string",
          "formatNumber": "string",
          "currencyPrefix": "string",
          "currencySuffix": "string",
          "buildMetrics": true,
          "isTimeframeBase": true,
          "timeframe": "string",
          "detail": "timestamps"
        }
      ],
      "nodes": [
        {
          "id": "string",
          "label": "string",
          "description": "string",
          "nodeClass": "dimension",
          "viewName": "string",
          "isField": true,
          "fieldFileName": "string",
          "viewFilePath": "string",
          "fieldFilePath": "string",
          "fieldResult": "day_of_week",
          "fieldLineNum": -9007199254740991,
          "hidden": true,
          "required": true,
          "children": [
            {
              "id": "string",
              "label": "string",
              "description": "string",
              "nodeClass": "dimension",
              "viewName": "string",
              "isField": true,
              "fieldFileName": "string",
              "viewFilePath": "string",
              "fieldFilePath": "string",
              "fieldResult": "day_of_week",
              "fieldLineNum": -9007199254740991,
              "hidden": true,
              "required": true,
              "children": []
            }
          ]
        }
      ],
      "malloyModelDef": null,
      "serverTs": -9007199254740991,
      "hasAccess": true
    }
  }
}

GetModels

POST/api/ToBackendGetModels

Get models

Request Body

application/json

Response Body

application/json

curl -X POST "http://localhost:3000/api/ToBackendGetModels" \  -H "Content-Type: application/json" \  -d '{    "info": {      "name": "api/ToBackendGetModels",      "traceId": "string",      "idempotencyKey": "string"    },    "payload": {      "projectId": "string",      "repoId": "string",      "branchId": "string",      "envId": "string"    }  }'
{
  "info": {
    "path": "/api/ToBackendGetModels",
    "method": "POST",
    "mproveVersion": "string",
    "duration": 0,
    "status": "Ok",
    "traceId": "string",
    "error": null
  },
  "payload": {
    "needValidate": true,
    "struct": {
      "projectId": "string",
      "structId": "string",
      "errors": [
        {
          "title": "string",
          "message": "string",
          "lines": [
            {
              "fileId": "string",
              "fileName": "string",
              "lineNumber": -9007199254740991
            }
          ]
        }
      ],
      "metrics": [
        {
          "modelId": "string",
          "modelType": "Store",
          "connectionType": "PostgreSQL",
          "fieldId": "string",
          "fieldClass": "dimension",
          "fieldResult": "day_of_week",
          "timeFieldId": "string",
          "structId": "string",
          "filePath": "string",
          "fieldLineNum": -9007199254740991,
          "type": "Model",
          "metricId": "string",
          "topNode": "string",
          "label": "string",
          "topLabel": "string",
          "partNodeLabel": "string",
          "partFieldLabel": "string",
          "partLabel": "string",
          "timeNodeLabel": "string",
          "timeFieldLabel": "string",
          "timeLabel": "string",
          "description": "string",
          "formatNumber": "string",
          "currencyPrefix": "string",
          "currencySuffix": "string",
          "serverTs": -9007199254740991,
          "hasAccessToModel": true
        }
      ],
      "presets": [
        {
          "presetId": "string",
          "label": "string",
          "path": "string",
          "parsedContent": null
        }
      ],
      "mproveConfig": {
        "mproveDirValue": "string",
        "caseSensitiveStringFilters": true,
        "weekStart": "Sunday",
        "allowTimezones": true,
        "defaultTimezone": "string",
        "formatNumber": "string",
        "currencyPrefix": "string",
        "currencySuffix": "string",
        "thousandsSeparator": "string"
      },
      "mproveVersion": "string",
      "serverTs": -9007199254740991
    },
    "userMember": {
      "projectId": "string",
      "memberId": "string",
      "email": "string",
      "alias": "string",
      "firstName": "string",
      "lastName": "string",
      "fullName": "string",
      "avatarSmall": "string",
      "roles": [
        "string"
      ],
      "isAdmin": true,
      "isEditor": true,
      "isExplorer": true,
      "serverTs": -9007199254740991
    },
    "models": [
      {
        "structId": "string",
        "modelId": "string",
        "type": "Store",
        "source": "string",
        "connectionId": "string",
        "connectionType": "PostgreSQL",
        "filePath": "string",
        "fileText": "string",
        "storeContent": null,
        "dateRangeIncludesRightSide": true,
        "accessRoles": [
          "string"
        ],
        "label": "string",
        "fields": [
          {
            "id": "string",
            "malloyFieldName": "string",
            "malloyFieldPath": [
              "string"
            ],
            "malloyBaseFieldId": "string",
            "malloyTags": [
              {
                "key": "string",
                "value": "string"
              }
            ],
            "mproveTags": [
              {
                "key": "string",
                "value": "string"
              }
            ],
            "hidden": true,
            "required": true,
            "maxFractions": 0,
            "label": "string",
            "fieldClass": "dimension",
            "fieldFileName": "string",
            "fieldFilePath": "string",
            "result": "day_of_week",
            "fieldLineNum": -9007199254740991,
            "suggestModelDimension": "string",
            "sqlName": "string",
            "topId": "string",
            "topLabel": "string",
            "description": "string",
            "type": "count_distinct",
            "groupId": "string",
            "groupLabel": "string",
            "groupDescription": "string",
            "formatNumber": "string",
            "currencyPrefix": "string",
            "currencySuffix": "string",
            "buildMetrics": true,
            "isTimeframeBase": true,
            "timeframe": "string",
            "detail": "timestamps"
          }
        ],
        "nodes": [
          {
            "id": "string",
            "label": "string",
            "description": "string",
            "nodeClass": "dimension",
            "viewName": "string",
            "isField": true,
            "fieldFileName": "string",
            "viewFilePath": "string",
            "fieldFilePath": "string",
            "fieldResult": "day_of_week",
            "fieldLineNum": -9007199254740991,
            "hidden": true,
            "required": true,
            "children": [
              {
                "id": "string",
                "label": "string",
                "description": "string",
                "nodeClass": "dimension",
                "viewName": "string",
                "isField": true,
                "fieldFileName": "string",
                "viewFilePath": "string",
                "fieldFilePath": "string",
                "fieldResult": "day_of_week",
                "fieldLineNum": -9007199254740991,
                "hidden": true,
                "required": true,
                "children": []
              }
            ]
          }
        ],
        "malloyModelDef": null,
        "serverTs": -9007199254740991,
        "hasAccess": true
      }
    ]
  }
}

On this page