Model API

From TeamServer ER/Studio
Jump to: navigation, search

Go Up to API Reference

This part of the Team Server API allows you to work with models.

GET v1/models

Obtains a list of models.

If successful, the response from the server provides a list of models with details about each one of them.

GET v1/models/<id>

Obtains information about the model with the specified ID.

Model Fields

Model resources in Model API requests and responses may include any combination of the following fields:

Item Example Description

"id"

5

An integer that uniquely identifies the model.

"name"

"Address"

The name of the model.

"description"

""

A description of the model.

"modelType"

"physical"

The type of the model.

"notation"

"IE-Crows Feet"

The notation used to define the model.

"style"

"Relational"

The style of the model.

"project"

"Projects"

The project that contains the model.

"owners"

[ "Production", // … ]

A list of owners of the model.

"url"

"/v1/models/5"

Path relative to the Team Server root API URL that points to the entry of the model resource.

For example, if the Team Server root API URL is http://teamserver.example.com/api , the example value here determines that you can access the model resource at http://teamserver.example.com/api/v1/models/5 .

"link"

"/object/view.spg?key=5"

Path relative to the Team Server root URL that points to the page of the model.

For example, if the Team Server root URL is http://teamserver.example.com , the example value here determines that you can access the page of the model at http://teamserver.example.com/object/view.spg?key=5 .

"image"

"/getDiagImage.spg?image=8b13b1e8ad4b4b1a86f9291c2d6ff1ea"

Path relative to the Team Server root URL that points to the image of the model.

For example, if the Team Server root URL is http://teamserver.example.com , the example value here determines that you can access the page of the model at http://teamserver.example.com/getDiagImage.spg?image=8b13b1e8ad4b4b1a86f9291c2d6ff1ea .

"diagramId"

2

The ID of the diagram containing the model. See "id" in the Diagram API.

"diagram"

"Adventure Works.DM1"

The name of the diagram containing the model. See "name" in the Diagram API.

"diagramURL"

"/v1/diagrams/2"

API path of the diagram containing the model. See "url" in the Diagram API.

"diagramLink"

"/object/view.spg?key=2"

Relative URL of the diagram containing the model. See "link" in the Diagram API.

"attachments"

[ { "id": "3790", "link": "/object/view.spg?key=3790", "name": "Post transformation tasks", "value": "", "dictionary": "Adventure Works_DD", "datatype": "Text", "type": "Pre and Post Operations" }, // … ]

A list of attachments of the model. Each entry provides the following fields:

  • id
  • name
  • value
  • type
  • datatype
  • dictionary
  • link

See the Attachment API for more information.

"securityproperties"

[ { "id": "3804", "link": "/object/view.spg?key=3804", "name": "Security Impact", "value": "Moderate", "dictionary": "Adventure Works_DD", "datatype": "Text List", "type": "Data Security Classification" }, // … ]

A list of security properties of the model. Each entry provides the following fields:

  • id
  • name
  • value
  • type
  • datatype
  • dictionary
  • link

See the Security Property API for more information.

"submodels"

[ { "id": "305", "description": "", "link": "/object/view.spg?key=305", "name": "Main Model", "image": "/getDiagImage.spg?image=8b13b1e8ad4b4b1a86f9291c2d6ff1ea" }, // … ]

A list of models that are children of the model. Each entry provides the following fields:

  • id
  • name
  • description
  • image
  • link

See the Model API for more information.

"type"

"Model"

The type of the resource. Its value is always "Model" for model resources.

Example Response

This is an example response from a GET v1/models call:

{
    "models": [
        {
            "diagramURL": "/v1/diagrams/2",
            "securityproperties": [],
            "link": "/object/view.spg?key=5",
            "type": "Model",
            "url": "/v1/models/5",
            "id": 5,
            "project": "Projects",
            "style": "Relational",
            "modelType": "physical",
            "submodels": [
                {
                    "id": "3052",
                    "description": "",
                    "link": "/object/view.spg?key=3052",
                    "name": "Human Resources",
                    "image": "/getDiagImage.spg?image=fbbc2b968dff4e60a2a5ca6246c2caf1"
                },
                // …
            ],
            "name": "Adventure Works",
            "diagramLink": "/object/view.spg?key=2",
            "attachments": [],
            "diagram": "Adventure Works.DM1",
            "owners": [
                "Production",
                // …
            ],
            "notation": "IE-Crows Feet",
            "diagramId": 2
        },
        // …
    ],
    "metadata_": {
        "limit": 25,
        "totalCount": 7,
        "offset": 0
    }
}

This is from a GET v1/models/<id> call:

{
    "model": {
        "diagramURL": "/v1/diagrams/2",
        "securityproperties": [],
        "link": "/object/view.spg?key=5",
        "type": "Model",
        "url": "/v1/models/5",
        "id": 5,
        "project": "Projects",
        "style": "Relational",
        "modelType": "physical",
        "submodels": [
            {
                "id": "3052",
                "description": "",
                "link": "/object/view.spg?key=3052",
                "name": "Human Resources",
                "image": "/getDiagImage.spg?image=fbbc2b968dff4e60a2a5ca6246c2caf1"
            },
            // …
        ],
        "name": "Adventure Works",
        "diagramLink": "/object/view.spg?key=2",
        "attachments": [],
        "diagram": "Adventure Works.DM1",
        "owners": [
            "Purchasing",
            // …
        ],
        "notation": "IE-Crows Feet",
        "diagramId": 2
    }
}

See Also

Personal tools
Product Videos