Entity API

From TeamServer ER/Studio
Jump to: navigation, search

Go Up to API Reference

This part of the Team Server API lets you work with entities.

GET v1/entities

Obtains a list of entities.

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

GET v1/models/<model id>/entities

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

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

GET v1/entities/<id>

Obtains information about the entity with the specified ID.

Entity Fields

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

Item Example Description

"id"

40

An integer that uniquely identifies the entity.

"name"

"Address"

The name of the entity.

"description"

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

A description of the entity.

"schema"

"Person"

The schema of the entity.

"notes"

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

Some notes about the entity.

"url"

"/v1/entities/40"

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

"link"

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

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

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

"createdAt"

1369928964

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

"diagramId"

2

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

"diagram"

"Adventure Works.DM1"

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

"diagramURL"

"/v1/diagrams/2"

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

"diagramLink"

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

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

"modelId"

3

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

"model"

"Logical"

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

"modelURL"

"/v1/models/3"

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

"modelLink"

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

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

"tableName"

"Address"

The name of the table implementing the entity. See "name" in the Table API.

"attributes"

[ { "id": "409", "default": "", "definition": "Unique identification number for the state or province. Foreign key to StateProvince table.", "keytype": "Inherited Non-Key", "link": "/object/view.spg?key=409", "name": "StateProvinceID", "domain": "", "isNullable": "NOT NULL", "datatype": "INTEGER", "url": "/v1/columns/409" }, // … ]

A list of attributes of the entity. Each entry provides the following fields:

  • id
  • name
  • definition
  • domain
  • keytype
  • datatype
  • isNullable
  • default
  • url
  • link

See the Attribute 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 entity. 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 entity. Each entry provides the following fields:

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

See the Security Property API for more information.

"submodels"

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

A list of models that are children of the entity. 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 entity. 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"

"Entity"

The type of the resource. Its value is always "Entity" for entity resources.

Example Response

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

{
    "metadata_": {
        "limit": 25,
        "totalCount": 101,
        "offset": 0
    },
    "entities": [
        {
            "diagramURL": "/v1/diagrams/2",
            "model": "Logical",
            "link": "/object/view.spg?key=40",
            "type": "Entity",
            "schema": "Person",
            "id": 40,
            "modelURL": "/v1/models/3",
            "alerts": [],
            "tableName": "Address",
            "createdAt": 1369928964,
            "description": "Street address information for customers, employees, and vendors.",
            "name": "Address",
            "modelLink": "/object/view.spg?key=3",
            "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/entities/40",
            "modelId": 3,
            "submodels": [
                {
                    "id": "3040",
                    "description": "",
                    "link": "/object/view.spg?key=3040",
                    "name": "Main Model",
                    "image": "/getDiagImage.spg?image=8b13b1e8ad4b4b1a86f9291c2d6ff1ea"
                },
                // …
            ],
            "diagram": "Adventure Works.DM1",
            "attributes": [
                {
                    "id": "409",
                    "default": "",
                    "definition": "Unique identification number for the state or province. Foreign key to StateProvince table.",
                    "keytype": "Inherited Non-Key",
                    "link": "/object/view.spg?key=409",
                    "name": "StateProvinceID",
                    "domain": "",
                    "isNullable": "NOT NULL",
                    "datatype": "INTEGER",
                    "url": "/v1/columns/409"
                },
                // …
            ],
            "notes": "",
        },
        // …
    ]
}

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

{
    "entity": {
        "diagramURL": "/v1/diagrams/2",
        "model": "Logical",
        "link": "/object/view.spg?key=40",
        "type": "Entity",
        "schema": "Person",
        "id": 40,
        "modelURL": "/v1/models/3",
        "alerts": [],
        "tableName": "Address",
        "createdAt": 1369928964,
        "description": "Street address information for customers, employees, and vendors.",
        "name": "Address",
        "modelLink": "/object/view.spg?key=3",
        "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/entities/40",
        "modelId": 3,
        "submodels": [
            {
                "id": "3040",
                "description": "",
                "link": "/object/view.spg?key=3040",
                "name": "Main Model",
                "image": "/getDiagImage.spg?image=8b13b1e8ad4b4b1a86f9291c2d6ff1ea"
            },
            // …
        ],
        "diagram": "Adventure Works.DM1",
        "attributes": [
            { 
                "id": "411",
                "default": "",
                "definition": "Second street address line.",
                "keytype": "Non-Inherited Non-Key",
                "link": "/object/view.spg?key=411",
                "name": "AddressLine2",
                "domain": "",
                "isNullable": "NULL",
                "datatype": "NVARCHAR",
                "url": "/v1/columns/411"
            },
            // …
        ],
        "notes": ""
    }
}

See Also

Personal tools
Product Videos