Attribute 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 attributes.

GET v1/entities/<entity id>/attributes

Obtains a list of attributes of the entity with the specified ID.

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

GET v1/attributes/<id>

Obtains information about the attribute with the specified ID.

Attribute Fields

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

Item Example Description

"id"

413

An integer that uniquely identifies the attribute.

"name"

"AddressID"

The name of the attribute.

"description"

"Primary key for Address records."

A description of the attribute.

"notes"

"New values should always be higher than the higher existing value."

Some notes about the attribute.

"schema"

"Person"

The schema of the entity that contains the attribute.

"domain"

""

The domain of the attribute.

"datatype"

"INTEGER"

The type of the value of the attribute.

"keytype"

"Non-Inherited Key"

The type of key of the attribute.

"primaryKey"

"True"

Whether or not the attribute is part of the primary key of its parent entity.

"foreignKey"

"False"

Whether or not the attribute is a foreign key.

"isNullable"

"NOT NULL"

Whether or not the value of the attribute can be none, null.

"scale"

""

The scale of the attribute.

"length"

""

The maximum length of the value of the attribute.

"default"

""

The default value of the attribute, if any.

"url"

"/v1/attributes/413"

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

"link"

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

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

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

"createdAt"

1369928964

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

"diagramId"

2

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

"diagram"

"Adventure Works.DM1"

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

"diagramURL"

"/v1/diagrams/2"

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

"diagramLink"

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

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

"modelId"

5

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

"model"

"Adventure Works"

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

"modelURL"

"/v1/models/5"

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

"modelLink"

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

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

"tableName"

"Address"

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

"entityId"

108

The ID of the entity that contains the attribute. See "id" in the Entity API.

"entityName"

"Address"

The name of the entity that contains the attribute. See "name" in the Entity API.

"entityURL"

"/v1/attributes/108"

API path of the entity that contains the attribute. See "url" in the Entity API.

"entityLink"

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

Relative URL of the entity that contains the attribute. See "link" in the Entity API.

"columnName"

"Adventure Works.DM1"

The name of the column implementing the attribute. See "name" in the Column 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 attribute. 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 attribute. 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 attribute. 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 attribute. 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"

"Attribute"

The type of the resource. Its value is always "Attribute" for attribute resources.

Example Response

This is an example response from a GET v1/entities/<entity id>/attributes call:

{
    "metadata_": {
        "limit": 25,
        "totalCount": 8,
        "offset": 0
    },
    "attributes": [
        {
            "scale": "",
            "diagramURL": "/v1/diagrams/2",
            "model": "Logical",
            "link": "/object/view.spg?key=413",
            "entityId": 40,
            "type": "Attribute",
            "schema": "Person",
            "id": 413,
            "modelURL": "/v1/models/3",
            "alerts": [],
            "description": "Primary key for Address records.",
            "tableName": "Address",
            "createdAt": 1369928964,
            "diagramLink": "/object/view.spg?key=2",
            "name": "AddressID",
            "modelLink": "/object/view.spg?key=3",
            "domain": "",
            "isNullable": "NOT NULL",
            "length": "",
            "columnName": "AddressID",
            "attachments": [],
            "diagramId": 2,
            "foreignKey": "False",
            "securityproperties": [],
            "entityURL": "/v1/v1/entities/40",
            "url": "/v1/attributes/413",
            "modelId": 3,
            "default": "",
            "keytype": "Non-Inherited Key",
            "submodels": [
                {
                    "id": "3040",
                    "description": "",
                    "link": "/object/view.spg?key=3040",
                    "name": "Main Model",
                    "image": "/getDiagImage.spg?image=8b13b1e8ad4b4b1a86f9291c2d6ff1ea"
                },
                // …
            ],
            "primaryKey": "True",
            "datatype": "INTEGER",
            "diagram": "Adventure Works.DM1",
            "notes": "",
            "entityLink": "/object/view.spg?key=40"
        },
        // …
    ]
}

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

{
    "attribute": {
        "scale": "",
        "diagramURL": "/v1/diagrams/2",
        "model": "Logical",
        "link": "/object/view.spg?key=413",
        "entityId": 40,
        "type": "Attribute",
        "schema": "Person",
        "id": 413,
        "modelURL": "/v1/models/3",
        "alerts": [],
        "description": "Primary key for Address records.",
        "tableName": "Address",
        "createdAt": 1369928964,
        "diagramLink": "/object/view.spg?key=2",
        "name": "AddressID",
        "modelLink": "/object/view.spg?key=3",
        "domain": "",
        "isNullable": "NOT NULL",
        "length": "",
        "columnName": "AddressID",
        "attachments": [],
        "diagramId": 2,
        "foreignKey": "False",
        "securityproperties": [],
        "entityURL": "/v1/v1/entities/40",
        "url": "/v1/attributes/413",
        "modelId": 3,
        "default": "",
        "keytype": "Non-Inherited Key",
        "submodels": [
            {
                "id": "3040",
                "description": "",
                "link": "/object/view.spg?key=3040",
                "name": "Main Model",
                "image": "/getDiagImage.spg?image=8b13b1e8ad4b4b1a86f9291c2d6ff1ea"
            },
            // …
        ],
        "primaryKey": "True",
        "datatype": "INTEGER",
        "diagram": "Adventure Works.DM1",
        "notes": "",
        "entityLink": "/object/view.spg?key=40"
    }
}

See Also

Personal tools
Product Videos