API - AIoTES/DevTools-DataLakeTools-MetadataStorageExplorer GitHub Wiki

Metadata storage API

In order for certain analytics methods to perform, a training phase needs first to occur. During training, training data are used in order to build a model describing the data, with respect to the desired analytics task. This model can later be used to analyse new data. As an example, in order to classify an input record as being an outlier or not, a certain threshold may be needed beforehand, so that the record values can be compared with it and the decision be made. This threshold is computed by a previous training phase, where a set of records is provided, along with their characterization as outliers or not.

The purpose of the analytics metadata storage is to store such thresholds, models, weights, features, etc. which are produced during training the various analytics methods available. Training processes usually involve large volumes of training data, and are usually timeconsuming. Storing the produced models allows the analytics methods to quickly retrieve them when needed.

The following table summarizes the web service information needed to access the analytics metadata storage sub-services.

Attribute Value
Base URL /api
Headers Content-Type: application/json
Sub-services Create a model
Get a model
Get all models
Edit a model
Delete a model

Each supported sub-service is described in detail below

<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Input</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre> <code>

{ "type": "object", "properties": { "modelID": { "type": "string", "description": "A unique ID for the model." }, "modelParams": { "type": "object", "description": "The model parameters." } } }

Create a model
POST /models
Creates a new analytics model in the metadata storage. This is implicitly called when training a data analytics method.
JSON example

{
"modelID": "arimaModel_1",
"modelParams": {
"arParams": [1.5, 0.3, 0.7, 0.1],
"maParams": [0.2, 0.3, 0.1, 0.1]
}
}
                                    </code></pre></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table></td>
</tr>
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Output</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre><code>

{ "type": "object", "properties": { "message": { "type": "string", "description": "A success or error message." } } }

JSON example

{
"message": "The model was created successfully."
}
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Output</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre><code>

{ "type": "object", "properties": { "modelID": { "type": "string", "description": "The model's unique ID." }, "modelParams": { "type": "object", "description": "The model parameters." } } }

Get a model
GET /models/{model_id}
Returns the stored parameters for an requested model.
JSON example

{
"modelID": "arimaModel_1",
"modelParams": {
"arParams": [1.5, 0.3, 0.7, 0.1],
"maParams": [0.2, 0.3, 0.1, 0.1]
}
}
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Output</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre><code>

{ "type": "array", "items": { "type": "object", "properties": { "modelID": { "type": "string", "description": "The model's unique ID." }, "modelParams": { "type": "object", "description": "The model parameters." } } }

                                </code></pre></td>
                            </tr>
                            <tr>
                                <td>JSON example</td>
                                <td><pre><code>

[ { "modelID": "arimaModel_1", "modelParams": { "arParams": [1.5, 0.3, 0.7, 0.1], "maParams": [0.2, 0.3, 0.1, 0.1] } },{ "modelID": "test_model_2", "modelParams": { "a": 18, "b": 35 } } ]

Get all models
GET /models
Returns the stored parameters of all stored model.
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Input</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre> <code>

{ "type": "object", "properties": { "modelID": { "type": "string", "description": "The model's unique ID." }, "modelParams": { "type": "object", "description": "The new model parameters." } } }

Edit a model
PUT /models
Edits an existing model in the metadata storage.
JSON example

{
"modelID": "arimaModel_1",
"modelParams": {
"arParams": [1.7, 0.4, 0.7, 0.1],
"maParams": [0.5, 0.3, 0.1, 0.1]
}
}
                                    </code></pre></td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table></td>
</tr>
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Output</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre><code>

{ type": "object", "properties": { "modelID": { "type": "string", "description": "The model's unique ID." }, "modelParams": { "type": "object", "description": "The updated model parameters." } } }

JSON example

{
"modelID": "arimaModel_1",
"modelParams": {
"arParams": [1.7, 0.4, 0.7, 0.1],
"maParams": [0.5, 0.3, 0.1, 0.1]
}
}
<tr>
    <td><table>
        <tbody>
            <tr>
                <td>Output</td>
                <td>
                    <table>
                        <tbody>
                            <tr>
                                <td>JSON schema</td>
                                <td><pre><code>

{ "type": "object", "properties": { "message": { "type": "string", "description": "A success or error message." } } }

Delete a model
DELETE /models/{model_id}
Deletes a model from the metadata storage.
JSON example

{
"message": "The model was deleted successfully."
}
⚠️ **GitHub.com Fallback** ⚠️