View 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 views.

GET v1/views

Obtains a list of views.

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

GET v1/models/<model id>/views

Obtains a list of views of the model with the specified ID.

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

GET v1/views/<id>

Obtains information about the view with the specified ID.

View Fields

View resources in View API requests and responses can include any combination of the following fields:

Item Example Description

"id"

6668

An integer that uniquely identifies the view.

"name"

"Alphabetical list of products"

The name of the view.

"description"

"A list of products in sorted alphabetically."

A description of the view.

"notes"

"Always use this view instead of the whole table."

Some notes about the view.

"schema"

""

The schema of the model that contains the view.

"project"

"Projects"

The project of the view.

"platform"

"Logical"

The platform of the view.

"url"

"/v1/views/6668"

Path relative to the Team Server root API URL that points to the entry of the view 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 view resource at http://teamserver.example.com/api/v1/views/6668 .

"link"

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

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

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 view at http://teamserver.example.com/object/view.spg?key=6668 .

"createdAt"

1369928964

The date when the view was created, in Unix time (seconds since 1970).

"diagramId"

6111

The ID of the diagram containing the view. See "id" in the Diagram API.-->

"diagram"

"Adventure Works.DM1"

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

"diagramURL"

"/v1/diagrams/6111"

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

"diagramLink"

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

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

"modelId"

6112

The ID of the model containing the view. See "id" in the Model API.

"model"

"Adventure Works"

The name of the model containing the view. See "name" in the Model API.

"modelURL"

"/v1/models/6112"

API path of the model containing the view. See "url" in the Model API.

"modelLink"

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

Relative URL of the model containing the view. See "link" in the Model API.

"columns"

[ { "expression": "", "id": 6775, "alias": "", "sequence": "10", "name": "Discontinued" }, // … ]

A list of columns of the view. Each entry provides the following fields:

  • id
  • name
  • expression
  • alias
  • sequence

See the View Column API for more information.

"attachments"

[ { "id": "7137", "link": "/object/view.spg?key=7137", "name": "Team Member List", "value": "ALL", "dictionary": "Northwind_DD", "datatype": "Text List", "type": "General Attachments" }, // … ]

A list of attachments of the view. 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 view. Each entry provides the following fields:

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

See the Security Property API for more information.

"submodels"

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

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

  • id
  • name
  • description
  • image
  • link

See the Model API for more information.

"type"

"View"

The type of the resource. Its value is always "View" for view resources.

"logicalOnly"

"False"

Set to "True" if the relationship is set to Logical Only.

"physicalOnly"

"False"

Set to "True" if the relationship is set to Physical Only.

Example Response

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

{
    "views": [
        {
            "diagramURL": "/v1/diagrams/6111",
            "platform": "Logical",
            "securityproperties": [],
            "model": "Logical",
            "link": "/object/view.spg?key=6668",
            "columns": [
                {
                    "expression": "",
                    "id": 6775,
                    "alias": "",
                    "sequence": "10",
                    "name": "Discontinued"
                },
                // …
            ],
            "type": "View",
            "url": "/v1/views/6668",
            "id": 6668,
            "schema": "",
            "modelId": 6112,
            "project": "Projects",
            "modelURL": "/v1/models/6112",
            "description": "",
            "createdAt": 1369929045,
            "submodels": [
                {
                    "id": "6898",
                    "description": "",
                    "link": "/object/view.spg?key=6898",
                    "name": "Main Model",
                    "image": "/getDiagImage.spg?image=e2e6f0cf22cc4c60aeec5dd92820ff9e"
                },
                // …
            ],
            "diagramLink": "/object/view.spg?key=6111",
            "name": "Alphabetical list of products",
            "modelLink": "/object/view.spg?key=6112",
            "attachments": [
                {
                    "id": "7137",
                    "link": "/object/view.spg?key=7137",
                    "name": "Team Member List",
                    "value": "ALL",
                    "dictionary": "Northwind_DD",
                    "datatype": "Text List",
                    "type": "General Attachments"
                },
                // …
            ],
            "diagram": "Northwind Sample",
            "notes": "",
            "diagramId": 6111
        },
        // …
    ],
    "metadata_": {
        "limit": 25,
        "totalCount": 71,
        "offset": 0
    }
}

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

{
    "view": {
        "diagramURL": "/v1/diagrams/6111",
        "platform": "Logical",
        "securityproperties": [],
        "model": "Logical",
        "link": "/object/view.spg?key=6668",
        "columns": [
            {
                "expression": "",
                "id": 6781,
                "alias": "",
                "sequence": "4",
                "name": "CategoryID"
            },
            // …
        ],
        "type": "View",
        "url": "/v1/views/6668",
        "id": 6668,
        "schema": "",
        "modelId": 6112,
        "project": "Projects",
        "modelURL": "/v1/models/6112",
        "description": "",
        "createdAt": 1369929045,
        "submodels": [
            {
                "id": "6898",
                "description": "",
                "link": "/object/view.spg?key=6898",
                "name": "Main Model",
                "image": "/getDiagImage.spg?image=e2e6f0cf22cc4c60aeec5dd92820ff9e"
            },
            // …
        ],
        "diagramLink": "/object/view.spg?key=6111",
        "name": "Alphabetical list of products",
        "modelLink": "/object/view.spg?key=6112",
        "attachments": [
            {
                "id": "7137",
                "link": "/object/view.spg?key=7137",
                "name": "Team Member List",
                "value": "ALL",
                "dictionary": "Northwind_DD",
                "datatype": "Text List",
                "type": "General Attachments"
            },
            // …
        ],
        "diagram": "Northwind Sample",
        "notes": "",
        "diagramId": 6111
    }
}

See Also