POST api/data_source/sql
Request Information
URI Parameters
None.
Body Parameters
DataSource| Name | Description | Type | Additional information |
|---|---|---|---|
| DataSourceId | globally unique identifier |
None. |
|
| ProjectId | globally unique identifier |
None. |
|
| ReferenceId | globally unique identifier |
None. |
|
| Reference | string |
None. |
|
| Name | string |
None. |
|
| Description | string |
None. |
|
| Type | DataSourceType |
None. |
|
| Schema | string |
None. |
|
| Content | string |
None. |
|
| EncodedConnection | string |
None. |
|
| Connection | string |
None. |
|
| Period | PeriodType |
None. |
|
| DynamicPara | DynamicParaType |
None. |
|
| BeginDate | string |
None. |
|
| EndDate | string |
None. |
|
| PeriodNumber | integer |
None. |
|
| PeriodDimension | PeriodDimensionType |
None. |
|
| Compare | CompareType |
None. |
|
| IsReadOnly | boolean |
None. |
|
| CacheInterval | integer |
None. |
|
| TableName | string |
None. |
Request Formats
application/json, text/json
Sample:
{
"dataSourceId": "cf294e0b-6d93-477c-a19d-66a4131b879d",
"projectId": "28460b58-eab1-425a-bae4-7a7c7cf87f9a",
"referenceId": "e3e9cf0e-7cdc-4aea-ba17-5ce9d3d51594",
"reference": "sample string 2",
"name": "sample string 3",
"description": "sample string 4",
"type": 0,
"schema": "sample string 5",
"content": "sample string 6",
"encodedConnection": "c2FtcGxlIHN0cmluZyA4",
"connection": "sample string 8",
"period": 0,
"dynamicPara": 0,
"beginDate": "sample string 9",
"endDate": "sample string 10",
"periodNumber": 11,
"periodDimension": 1,
"compare": 0,
"isReadOnly": true,
"cacheInterval": 1,
"tableName": "sample string 13"
}
application/xml, text/xml
Sample:
<DataSource xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Margin.Core.Data.Entities"> <BeginDate>sample string 9</BeginDate> <CacheInterval>1</CacheInterval> <Compare>Normal</Compare> <Connection>sample string 8</Connection> <Content>sample string 6</Content> <DataSourceId>cf294e0b-6d93-477c-a19d-66a4131b879d</DataSourceId> <Description>sample string 4</Description> <DynamicPara>Interval</DynamicPara> <EncodedConnection>c2FtcGxlIHN0cmluZyA4</EncodedConnection> <EndDate>sample string 10</EndDate> <IsReadOnly>true</IsReadOnly> <Name>sample string 3</Name> <Period>RealTime</Period> <PeriodDimension>Day</PeriodDimension> <PeriodNumber>11</PeriodNumber> <ProjectId>28460b58-eab1-425a-bae4-7a7c7cf87f9a</ProjectId> <Reference>sample string 2</Reference> <ReferenceId>e3e9cf0e-7cdc-4aea-ba17-5ce9d3d51594</ReferenceId> <Schema>sample string 5</Schema> <TableName>sample string 13</TableName> <Type>SQL</Type> </DataSource>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
ApiResult| Name | Description | Type | Additional information |
|---|---|---|---|
| Status | ApiResultStatus |
None. |
|
| Data | Object |
None. |
|
| Message | string |
None. |
|
| Code | integer |
None. |
Response Formats
application/json, text/json
Sample:
{
"status": "success",
"data": {},
"message": "sample string 2",
"code": 1
}
application/xml, text/xml
Sample:
<ApiResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Margin.Models"> <Code>1</Code> <Data /> <Message>sample string 2</Message> <Status>Success</Status> </ApiResult>