modzyClient.getAllModels

Get all models

modzyclient.getAllModels()

Returns a list of all deployed models. The list includes each model’s modelId, versions, and latestVersion.

Returns

{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "type": "array",
    "items": {
        "$ref": "#/definitions/ModelItem"
    },
    "definitions": {
        "ModelItem": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "modelId": {
                    "type": "string"
                },
                "latestVersion": {
                    "type": "string"
                },
                "versions": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            },
            "required": [
                "latestVersion",
                "modelId",
                "versions"
            ]
        }
    }
}

Example

let models = await modzyClient.getAllModels();
console.log( `All models ${models.length}` );

Using promises

modzyClient.getAllModels()
  .then(
    (models)=>{
      console.log( `All models ${models.length}` );
    }
  )
  .catch(
    (error)=>{
      console.error(error);
    }
  );

Did this page help you?