skip to main content
Hybrid Data Pipeline API reference : Management API : Data Sources API : Create a data source
  

Try Now
Create a data source

Purpose

Creates a data source or group data source. The user who creates the data source is the owner of the data source. When an administrator creates a data source on behalf of a user, the user identified with the user query parameter is the owner of the data source.
Note: A group data source is a data source that is comprised of member data sources. The creation and configuration of group data sources allows a single OData endpoint to be configured for multiple member data sources. See Configuring data sources for OData connectivity and working with data source groups for details.
Note: An administrator can execute this operation on behalf of a user by appending the user query parameter to the request and specifying a user name. See also Managing resources on behalf of users.
Note: Permissions can only be set on a data source by an administrator when creating or updating the data source on behalf of a user.

URL

https://<myserver>:<port>/api/mgmt/datasources

Method

POST

URL Parameters

<myserver> is the hostname or IP address of the machine hosting the Hybrid Data Pipeline server for a standalone installation, or the machine hosting the load balancer for a load balancer installation. For a standalone installation, <port> is the port number specified as the Server Access Port during installation. For a load balancer installation, <port> must be either 80 for http or 443 for https. Whenever port 80 or 443 are used, it is not necessary to include the port number in the URL.

Request Payload Definition

The request takes the following format. The properties of the request are described in the table that follows.
Note: The values for "dataStore" and "connectionType" cannot be changed once the data source is created. A new data source must be created if any of these values need to be changed.
{
"name": "datasource_name",
"dataStore": datastore_id,
"connectionType": "connection_type",
"description": "datasource_description",
"options": {
"option1": "option1_value",
"option2": "option2_value",
...
},
"permissions": [integer, integer, ...],
"members": ["datasource1", "datasource2", ...]
}
Parameter
Description
Usage
Valid Values
"name"
The name of the data source. This name is passed as a database parameter when establishing a connection to the data source with the ODBC driver, the JDBC driver, or the OData API.
Required
The first character of the name must be a letter, and the name can contain only alphanumeric characters, underscores, and dashes.
"dataStore"
The ID of the data store on which the data source is being created. The data store defines the options that can be specified when creating the data source.
Group data sources must be created on the Hybrid Data Pipeline group data store. A group data source is comprised of multiple member data sources that connect to one or more back end data stores such as Salesforce or SQL Server.
Required
The integer ID of the data store
If you are creating a group data source, this property must be set to 56 to specify the DataSource Group data store.
Data store IDs can be obtained with the Get data stores call.
"connectionType"
Specifies whether the data source is a cloud, hybrid, or group data source
Required
"Cloud" | "Hybrid" | Group
If set to "Cloud", the data source is accessible from the public WAN.
If set to "Hybrid" the data source is a hybrid data source. Depending on how it is configured, a hybrid data source can connect to either a public WAN data source or to a data source behind a firewall using the On-Premises Connector to create a cloud-only data source.
If set to Group, the data source is a group data source. A group data source must be created on the DataSource Group data store by setting the "dataStore" property to 56.
"description"
A description of the data source
Optional
A description of the data source provided by the user who created the data source
"options"
The list of option names and values to be set on the data source. The list of allowed options depends on the data store. Data store options can be retrieved with the Get options for a data store call.
Required
A comma separated list of options and their values.
The content of the options object is zero or more sets of option names and values. If no options are to be set on the data source, specify an empty object {}.
"permissions"
A list of permissions associated explicitly with the data source. Permissions can only be set on a data source by an administrator when creating or updating the data source on behalf of a user.
Any permissions specified for this data source will override the permissions for the user or the user's role that own this data source. You must specify the exact set of permissions that you want to set for this data source as no permissions are inherited from the user or user's role if permissions are specified on a data source.
Permissions set on a group data source override permissions set on any of its member data sources.
Optional
A comma separated list of permission IDs
See Data source permissions for supported permissions.
"members"
The members object can be used to assign member data sources to a group data source. A member data source cannot itself be a group data source. Member data sources can be assigned when a group data source is being created or added after the group data source has been created.
Optional
The members object includes an "id" property and an "entityPrefix" property.
The "id" specifies the ID of a member data source. The member data source cannot itself be a group data source.
The "entityPrefix" is a user-defined prefix associated with a specific data source to resolve naming conflicts. The prefix must be 1 to 64 characters in length and must be unique.

Example 1: Request Payload

In this example, a standard user creates a data source on a Salesforce data store.
POST https://Server03:8443/api/mgmt/datasources
{
"name": "SF2",
"dataStore": "1",
"connectionType": "Cloud",
"description": "Test Salesforce access",
"options": {
"Database": "Accounting",
"User": "mySForceUserId",
"Password": "mySForcePassword",
"SecurityToken": "mySecurityToken",
"StmtCallLimit": "60"
}
}

Success Response

Status code: 201
Successful response
{
"id":"5039",
"name": "SF2",
"dataStore": "1",
"connectionType": "Cloud",
"description": "Test Salesforce access",
"options": {
"Database": "Accounting",
"User": "mySForceUserId",
"Password": "mySForcePassword",
"SecurityToken": "mySecurityToken",
"StmtCallLimit": "60"
}
}

Example 2: Request Payload

In this example, an administrator creates a data source with permissions on behalf of a user. The user's access to the data store is restricted by the permissions.
https://Server03:8443/api/mgmt/datasources?user=user11
{
"name": "SF2",
"dataStore": "1",
"connectionType": "Cloud",
"description": "Test Salesforce access",
"options": {
"Database": "Accounting",
"User": "mySForceUserId",
"Password": "mySForcePassword",
"SecurityToken": "mySecurityToken",
"StmtCallLimit": "60"
},
"permissions": [
1,
2,
3,
4,
5
]
}

Success Response

Status code: 201
Successful response
{
"id":"6444",
"name": "SF2",
"dataStore": "1",
"connectionType": "Cloud",
"description": "Test Salesforce access",
"options": {
"Database": "Accounting",
"User": "mySForceUserId",
"Password": "mySForcePassword",
"SecurityToken": "mySecurityToken",
"StmtCallLimit": "60"
},
"permissions": [
1,
2,
3,
4,
5
]
}

Example 3: Request Payload

In this example, a standard user creates a group data source for testing OData access.
https://Server03:8443/api/mgmt/datasources
{
"name": "OData_Group",
"dataStore": "56",
"connectionType": "Group",
"description": "Test OData connectivity",
"options": {
"Name": "OData_Group",
"Description": "Test OData connectivity",
"ODataVersion": "4",
"MaximumEntityNameLength": "64"
},
"members": [
{
"id": 3,
"entityPrefix": "fin"
},
{
"id": 6,
"entityPrefix": "mkt"
}
]
}

Sample Success Responses

Status code: 201
Successful response
{
"id":"7255",
"name": "OData_Group",
"dataStore": "56",
"connectionType": "Group",
"description": "Test OData connectivity",
"options": {
"Name": "OData_Group",
"Description": "Test OData connectivity",
"ODataVersion": "Version 4",
"MaximumEntityNameLength": 64,
"ODataDataSourceCaching": 1
},
"members": [
{
"id": 3,
"entityPrefix": "fin"
},
{
"id": 6,
"entityPrefix": "mkt"
}
]
}

Authentication

Basic Authentication using Login ID and Password.

Authorization

The user must have the MgmtAPI (11) and CreateDataSource (1) permissions.