Model API
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 |
---|---|---|
|
|
An integer that uniquely identifies the model. |
|
|
The name of the model. |
|
|
A description of the model. |
|
|
The type of the model. |
|
|
The notation used to define the model. |
|
|
The style of the model. |
|
|
The project that contains the model. |
|
|
A list of owners of the model. |
|
|
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 . |
|
|
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 . |
|
|
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 . |
|
|
The ID of the diagram containing the model. See |
|
|
The name of the diagram containing the model. See |
|
|
API path of the diagram containing the model. See |
|
|
Relative URL of the diagram containing the model. See |
|
|
A list of attachments of the model. Each entry provides the following fields:
See the Attachment API for more information. |
|
|
A list of security properties of the model. Each entry provides the following fields:
See the Security Property API for more information. |
|
|
A list of models that are children of the model. Each entry provides the following fields:
See the Model API for more information. |
|
|
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
}
}