Data Source 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 data sources.

GET v1/datasources

Obtains a list of data sources.

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

GET v1/datasources/<id>

Obtains information about the data source with the specified ID.

POST v1/datasources

Creates a data source. Your request must provide the following fields:

  • name
  • databaseType
  • description (optional)
  • stewards (optional)
    Note: You only need to specify either the ID or the name of each steward. For example: { "name": "jane" }
  • properties (optional)
  • properties.name (optional)
  • properties.value (optional)
  • category.name (optional)
  • category.id (optional)
  • category.color (optional)
  • location (optional)
  • productionLevel (optional)
  • geoLocation.latitude (optional)
  • geoLocation.longitude(optional)
  • applicationAffinity (optional)

Depending on the specified databaseType you must provide some additional fields as well.

If successful, the response from the server provides all the details about your new data source.

PUT v1/datasources/<id>

Updates the information of a data source. Your request can provide any combination of the following fields:

  • name (optional)
  • description (optional)
  • status (optional)
  • stewards (optional)
    Note: You only need to specify either the ID or the name of each steward. For example: { "name": "jane" }
  • abbreviations (optional)
  • aliases (optional)
  • userData (optional)
  • properties (optional)
  • properties.name (optional)
  • properties.value (optional)
  • category.name (optional)
  • category.id (optional)
  • category.color (optional)
  • location (optional)
  • productionLevel (optional)
  • geoLocation.latitude (optional)
  • geoLocation.longitude(optional)
  • applicationAffinity (optional)


If successful, the response from the server provides all the details about your modified data source.

DELETE v1/datasources/<id>

Deletes the data source with the specified ID. If successful, the response is {"message":"OK","status":"200"}.

Data Source Fields

DBMS-Agnostic Fields

Data source resources in Data Source API requests and responses can include any combination of the following fields:

Item Example Description

"id"

33

An integer that uniquely identifies the data source.

"name"

"User Database"

The name of the data source.

"description"

"Main database to store user information of any kind."

A description of the data source.

"databaseType"

"InterBase"

The type of database management system (DBMS) of the data source. Supported DBMS are:

  • DB2 LUW
  • DB2 z/OS
  • InterBase
  • Firebird
  • JDBC
  • MySQL
  • ODBC
  • Oracle
  • SQL Azure
  • SQL Server
  • Sybase
  • Sybase IQ

"properties"

[
    {
        "name": "view",
        "value": "mycustomview"
    },
    // …
]

Some custom properties of the data source.

"createdAt"

1372150068

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

"ModifiedAt"

1372150068

The date when the data source was last modified, in Unix time (seconds since 1970).

"url"

"/v1/datasources/33"

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

"link"

"/datasource/view.spg?key=33"

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

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 data source at http://teamserver.example.com/datasource/view.spg?key=33 .

"stewards"

[
    {
        "id": "2",
        "name": "jane",
        "type": "person",
        "url": "/v1/people/2"
    },
    // …
]

A list of people that are stewards of the data source.

Each person entry provides the following fields:

  • id
  • name
  • type
  • url

"type"

"Data Source"

The type of the resource. Its value is always "Data Source" for data source resources.

"Abbreviations"

"PKDB"

Any abbreviations used.

"Aliases"

 

"userData"

 

"Properties"

"jdbc:mysql://neptune.acme.com:3306/test
jdbc:mysql://127.0.0.1:3306/test
jdbc:mysql://localhost:3306/mysql?connectTimeout=0&socketTimeout=0&autoReconnect=true"

Custom properties

"Properties.name"

"dialect"

Property name

"properties.value"

"1"

Property value

"category.name"

 

Category name

"category.id"

 

Category ID

"category.color"

 

Category color

"location"

"Elche"

Location

"productionLevel"

"Development"

Production, Test, QA

"geoLocation.latitude"

"90"

Latitude coordinate (float)

"geoLocation.longitude"

"90"

Longitude coordinate (float)

"applicationAffinity"

["Marketing", "Client Data"]

Application affinities

"Create_Date"

"25-10-2013"

The Data Source creation date. Possible from a GET command.

"Modify_Date"

"25-10-2013"

The Data Source latest modified date. Possible from a GET command.

DBMS-Specific Fields

The following fields are only available for specific types of database management systems (DBMS). See Data Source Fields for a Specific Database Management System for more information.

Item Example Description

"hostname"

"127.0.0.1"

  • DB2 (required): DB2 Client Alias or Host Name
  • InterBase (required): Host Name
  • Firebird (required): Host Name
  • JDBC (required): Connection URL
  • MySQL (required): Host Name
  • ODBC (required): DSN or Connect String
  • Oracle (required): TNSNames.ora alias or Oracle Connect Descriptor or Host Name
  • SQL Azure (required): Host Name
  • SQL Server (required): Host Name or Alias
  • Sybase (required): Host Name or Alias
  • Sybase IQ (required): Host Name

"port"

"3050"

  • DB2 (required): Port
  • InterBase (optional): Port
  • Firebird (optional): Port
  • MySQL (optional): Port
  • Oracle (required): Port
  • SQL Azure (optional): Port
  • SQL Server (optional): Port
  • Sybase (required): Port
  • Sybase IQ (required): Port

"path"

"C:\\users.gdb"

  • DB2 (optional): Functional Path
  • InterBase (required) Database Path
  • Firebird (required) Database Path

"database"

"user_database"

  • DB2 (required): Remote Database Name
  • MySQL (optional): Database Name
  • Oracle (optional): Instance Name
  • SQL Azure (optional): Database Name
  • SQL Server (optional): Database Name
  • Sybase (optional): Database Name
  • Sybase IQ (optional): Database Name

"schema"

"MYSCHEMAID"

  • DB2 (optional): Schema ID

"servicename"

"MYSID"

  • Oracle (required): SID/Service Name

"characterset"

"UTF-8"

  • InterBase (optional): Character Set
  • Firebird (optional): Character Set
  • Sybase (optional): Character Set

"dialect"

"3"

  • InterBase (optional): Dialect
  • Firebird (optional): Dialect

"role"

"MYROLE"

  • InterBase (optional): Role
  • Firebird (optional): Role
  • Oracle (optional): Role ("normal", "sysasm", "sysdba", "sysoper")

"protocol"

"TCP/IP"

  • DB2 (optional): "Use DB2 client aliases"
  • ODBC (optional): "Use DSN"
  • Oracle (required): Use ("SID", "SERVICE_NAME", "CONNECT_DESCRIPTOR", "Alias")
  • SQL Server (optional): Protocol ("TCP/IP", "Named Pipes", "Alias")
  • Sybase (optional): "Use Sybase SQL.INI aliases"

"encryption"

true

  • SQL Server (optional)
  • Sybase (optional)

"packetsize"

4096

  • SQL Server (optional)
  • Sybase (optional)

"maxconnections"

10

  • Sybase (optional)

"trusted"

true

  • DB2 (optional): OS Authentication
  • MySQL (optional): Window Authentication
  • Oracle (optional): Window Authentication
  • SQL Server (optional): Window Authentication
  • Sybase (optional): Kerberos Authentication
  • Sybase IQ (optional): Window Authentication

"trustedHost"

"SybaseSvc/example.com:1234"

  • Sybase (required if "trusted": true): Server Principal for Kerberos

Example Response

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

{
    "datasources": [
        {
            "databaseType": "SQL Server",
            "port": "1433",
            "protocol": "TCP/IP",
            "trusted": false,
            "link": "/datasource/view.spg?key=34",
            "hostname": "127.0.0.1",
            "type": "Data Source",
            "url": "/v1/datasources/34",
            "database": "ReportingDatabase",
            "id": 34,
            "encryption": true,
            "createdAt": 1372171322,
            "description": "Database to store progress and status reports.",
            "name": "Reporting Database",
            "stewards": [
                {
                    "id": "2",
                    "name": "jane",
                    "type": "person",
                    "url": "/v1/people/2"
                }
            ]
        },
        {
            "databaseType": "InterBase",
            "port": "3050",
            "dialect": "3",
            "link": "/datasource/view.spg?key=33",
            "hostname": "127.0.0.1",
            "type": "Data Source",
            "url": "/v1/datasources/33",
            "id": 33,
            "characterset": "UTF-8",
            "createdAt": 1372171125,
            "description": "Main database to store user information of any kind.",
            "name": "User Database",
            "path": "C:\\users.gdb",
            "role": "",
            "stewards": [
                {
                    "id": "2",
                    "name": "jane",
                    "type": "person",
                    "url": "/v1/people/2"
            "status": "Online",
            "databaseType" : "SQLServer",
            "hostname" : "ss01"
            "properties": [
            { "name": "dialect",
              "value": "1"]}
            "applicationAffinity": [ "Client data",  "Marketing"],
            "location": "Elche",
            "geoLocation" :
            { "latitude" : 90,
              "longitude" : 90  },
            "productionLevel" : "Development"}                }
    ],
    "metadata_": {
        "limit": 25,
        "totalCount": 2,
        "offset": 0
        "status": "Online",
}    }
}

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

{
    "datasource": {
        "databaseType": "InterBase",
        "port": "3050",
        "dialect": "3",
        "link": "/datasource/view.spg?key=33",
        "hostname": "127.0.0.1",
        "type": "Data Source",
        "url": "/v1/datasources/33",
        "id": 33,
        "characterset": "UTF-8",
        "createdAt": 1372171125,
        "description": "Main database to store user information of any kind.",
        "name": "User Database",
        "path": "C:\\users.gdb",
        "role": "",
        "stewards": [
            {
                "id": "2",
                "name": "jane",
                "type": "person",
                "url": "/v1/people/2"
        "status": "Online",
        "databaseType" : "SQLServer",
        "hostname" : "ss01"
        "properties": [
        { "name": "dialect",
          "value": "1"}],
        "applicationAffinity": [ "Client data",  "Marketing"],
        "location": "Elche",
        "geoLocation" :
        { "latitude" : 90,
          "longitude" : 90},
        "productionLevel" : "Development"}
}
}

See Also

Personal tools
Product Videos