Table 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 tables.

GET v1/tables

Obtains a list of tables.

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

GET v1/models/<model id>/tables

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

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

GET v1/tables/<id>

Obtains information about the table with the specified ID.

Table Fields

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

Item Example Description

"id"

108

An integer that uniquely identifies the table.

"name"

"Address"

The name of the table.

"description"

"Street address information for customers, employees, and vendors."

A description of the table.

"schema"

"Person"

The schema of the table.

"notes"

"Use local address conventions, this value is provided as is to local mailing and transport services."

Some notes about the table.

"url"

"/v1/tables/108"

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

"link"

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

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

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

"createdAt"

1369928964

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

"diagramId"

2

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

"diagram"

"Adventure Works.DM1"

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

"diagramURL"

"/v1/diagrams/2"

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

"diagramLink"

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

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

"modelId"

3

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

"model"

"Logical"

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

"modelURL"

"/v1/models/3"

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

"modelLink"

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

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

"entityName"

"Address"

The name of the entity implemented by the table. See "name" in the Entity API.

"columns"

[ { "scale": "", "securityproperties": [], "attributeLink": "/object/view.spg?key=189", "link": "/object/view.spg?key=997", "attributeId": 189, "type": "Column", "url": "/v1/columns/997", "id": "997", "attributeName": "rowguid", "default": "", "keytype": "Non-Inherited Non-Key", "createdAt": 1369928964, "description": "ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.", "primaryKey": "False", "name": "rowguid", "domain": "", "isNullable": "NOT NULL", "length": "", "attachments": [], "datatype": "uniqueidentifier", "notes": "", "attributeURL": "/v1/attributes/189", "foreignKey": "False" }, // … ]

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

  • id
  • name
  • description
  • notes
  • domain
  • datatype
  • keytype
  • primaryKey
  • foreignKey
  • isNullable
  • scale
  • length
  • default
  • url
  • link
  • createdAt
  • attributeId
  • attributeName
  • attributeURL
  • attributeLink
  • attachments
  • securityproperties
  • type

See the Column API for more information.

"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 table. 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 table. Each entry provides the following fields:

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

See the Security Property API for more information.

"submodels"

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

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

  • id
  • name
  • description
  • image
  • link

See the Model API for more information.

"alerts"

[ { "securityproperty": [ { "id": "3804" } ], "id": "54", "alertText": "This ER object has a moderate security level.", "alertType": "Value", "alertLevel": "Info", "type": "Alert", "alertValue": "Moderate" }, // … ]

A list of alerts that affect the table. Each entry provides the following fields:

  • id
  • alertType
  • alertValue (only if "alertType": "Value")
  • alertLevel
  • alertText
  • securityproperty
  • type

See the Alert API for more information.

"type"

"Table"

The type of the resource. Its value is always "Table" for table resources.

Example Response

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

{
    "tables": [
        {
            "diagramURL": "/v1/diagrams/2",
            "model": "Adventure Works",
            "link": "/object/view.spg?key=108",
            "columns": [
                {
                    "scale": "",
                    "securityproperties": [],
                    "attributeLink": "/object/view.spg?key=411",
                    "link": "/object/view.spg?key=1000",
                    "attributeId": 411,
                    "type": "Column",
                    "url": "/v1/columns/1000",
                    "id": "1000",
                    "attributeName": "AddressLine2",
                    "default": "",
                    "keytype": "Non-Inherited Non-Key",
                    "createdAt": 1369928964,
                    "description": "Second street address line.",
                    "primaryKey": "False",
                    "name": "AddressLine2",
                    "domain": "",
                    "isNullable": "NULL",
                    "length": "60",
                    "attachments": [],
                    "datatype": "nvarchar",
                    "notes": "",
                    "attributeURL": "/v1/attributes/411",
                    "foreignKey": "False"
                },
                // …
            ],
            "type": "Table",
            "schema": "Person",
            "id": 108,
            "modelURL": "/v1/models/5",
            "alerts": [],
            "createdAt": 1369928964,
            "description": "Street address information for customers, employees, and vendors.",
            "name": "Address",
            "modelLink": "/object/view.spg?key=5",
            "diagramLink": "/object/view.spg?key=2",
            "attachments": [],
            "diagramId": 2,
            "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"
                },
                // …
            ],
            "url": "/v1/tables/108",
            "entityName": "Address",
            "modelId": 5,
            "submodels": [
                {
                    "id": "3048",
                    "description": "",
                    "link": "/object/view.spg?key=3048",
                    "name": "Main Model",
                    "image": "/getDiagImage.spg?image=013208b00fcb42b091b0be14d439ac3a"
                },
                // …
            ],
            "diagram": "Adventure Works.DM1",
            "notes": ""
        },
        // …
    ],
    "metadata_": {
        "limit": 25,
        "totalCount": 120,
        "offset": 0
    }
}

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

{
    "table": {
        "diagramURL": "/v1/diagrams/2",
        "model": "Adventure Works",
        "link": "/object/view.spg?key=108",
        "columns": [
            {
                "scale": "",
                "securityproperties": [],
                "attributeLink": "/object/view.spg?key=189",
                "link": "/object/view.spg?key=997",
                "attributeId": 189,
                "type": "Column",
                "url": "/v1/columns/997",
                "id": "997",
                "attributeName": "rowguid",
                "default": "",
                "keytype": "Non-Inherited Non-Key",
                "createdAt": 1369928964,
                "description": "ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.",
                "primaryKey": "False",
                "name": "rowguid",
                "domain": "",
                "isNullable": "NOT NULL",
                "length": "",
                "attachments": [],
                "datatype": "uniqueidentifier",
                "notes": "",
                "attributeURL": "/v1/attributes/189",
                "foreignKey": "False"
            },
            // …
        ],
        "type": "Table",
        "schema": "Person",
        "id": 108,
        "modelURL": "/v1/models/5",
        "alerts": [],
        "createdAt": 1369928964,
        "description": "Street address information for customers, employees, and vendors.",
        "name": "Address",
        "modelLink": "/object/view.spg?key=5",
        "diagramLink": "/object/view.spg?key=2",
        "attachments": [],
        "diagramId": 2,
        "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"
            },
            // …
        ],
        "entityURL": "/v1/entities/40",
        "url": "/v1/tables/108",
        "entityName": "Address",
        "modelId": 5,
        "submodels": [
            {
                "id": "3048",
                "description": "",
                "link": "/object/view.spg?key=3048",
                "name": "Main Model",
                "image": "/getDiagImage.spg?image=013208b00fcb42b091b0be14d439ac3a"
            },
            // …
        ],
        "diagram": "Adventure Works.DM1",
        "notes": ""
    }
}

See Also

Personal tools
Product Videos