Creating Data Sources
Function
This API is used to create a data source.
URI
POST /v2/{project_id}/fdi/instances/{instance_id}/datasources
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Appendix > Obtaining a Project ID in the ROMA Connect API Reference. |
instance_id |
Yes |
String |
Instance ID |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. The token can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
datasource_name |
Yes |
String |
Data source name. The value can contain 1 to 255 characters. It cannot be all spaces or contain the following special characters: &<>"'() |
datasource_type |
Yes |
String |
Data source type. |
app_id |
Yes |
String |
ID of the application to which the data source belongs. |
content |
Yes |
Content object |
Data source details. |
description |
No |
String |
description. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
gauss100_version |
No |
String |
GaussDB 100 version. This parameter is mandatory for a GaussDB 100 data source. |
host |
No |
String |
Host IP address.
|
port |
No |
String |
Port number, which ranges from 0 to 65535.
|
database_name |
No |
String |
Database name.
|
redis_database |
No |
String |
Redis data source type, which is a database ID containing only digits. |
user_name |
No |
String |
Username for logging in to the service.
|
password |
No |
String |
Password for logging in to the service.
|
mode |
No |
String |
Data source connection mode. Options: default, professional, and multiAddress. |
cdc_mode |
No |
String |
CDC mode, which is used only for composite tasks. |
multi_oracle_address |
No |
Array of MultiOracleAddress objects |
IP address of the Oracle cluster. This parameter is mandatory when mode is set to multiAddress. |
oracle_service_name |
No |
String |
Service name of the Oracle cluster. |
ftp_connect_mode |
No |
String |
Connection mode for accessing the FTP service. The value can be active or passive. |
ftp_protocol |
No |
String |
Protocol for accessing the FTP service. The value can be SFTP or FTP. |
address |
No |
String |
Address.
|
ak |
No |
String |
Access key ID. |
sk |
No |
String |
Secret access key. |
bucket_name |
No |
String |
Bucket name. This parameter is mandatory when the data source is OBS. |
https |
No |
Boolean |
Whether to use HTTPS. This parameter is mandatory when the data source is OBS. Generally, HTTPS is used by default. |
url |
No |
String |
Connection URL. |
api_method |
No |
String |
API access request mode. |
auth_method |
No |
String |
Authentication mode for accessing the WEBSOCKET service. |
api_auth_detail |
No |
ApiAuthDetail object |
API authentication field details. |
broker |
No |
String |
Addresses of the Kafka, MQS and ActiveMQ servers, in the format of IP address:Port number. Use commas (,) to separate multiple IP addresses and port numbers. |
ssl |
No |
Boolean |
Whether to enable SSL authentication. |
ssl_enable |
No |
Boolean |
Whether to enable SSL authentication. |
ssl_username |
No |
String |
SSL user name or application key. |
ssl_password |
No |
String |
SSL password or application secret. |
acl_enable |
No |
Boolean |
Whether to enable access control authentication. |
mq_type |
No |
String |
Message queue type of the IMF data source. |
mongodb_auth_source |
No |
String |
MONGODB authentication source. |
mongodb_cluster_enable |
No |
Boolean |
MONGODB cluster mode. |
mongodb_replica_set |
No |
String |
MongoDB replica set. Mandatory when MongoDB is in non-cluster mode. |
encoding |
No |
String |
Encoding format. |
mysql_timeout |
No |
Integer |
MySQL connection timeout time (seconds). |
trust_store_password |
No |
String |
Password of the public key library. |
trust_store |
No |
String |
Public key library file. |
trust_store_file_type |
No |
String |
Type of a public key library file. |
ssl_auth_method |
No |
String |
Authentication method. This parameter is mandatory when the data source is ACTIVEMQ or ARTEMISMQ and SSL authentication is enabled. |
key_store |
No |
String |
Content of the private key library file. |
key_store_file_type |
No |
String |
Type of the private key library file. |
key_store_password |
No |
String |
Private key library password. |
key_store_key_password |
No |
String |
Private key of the private key library. |
dis_tunnel_name |
No |
String |
DIS tunnel name. |
dis_data_type |
No |
String |
DIS data type. |
dis_setting_type |
No |
String |
DIS configuration type. |
dis_endpoint |
No |
String |
DIS endpoint. This parameter is mandatory when setting_type is set to senior. |
dis_region |
No |
String |
DIS region. This parameter is mandatory when setting_type is set to senior. |
dis_source_project_id |
No |
String |
Project ID of the DIS source. This parameter is mandatory when setting_type is set to senior. |
hl7_position |
No |
String |
HL7 data source direction. |
hl7_whitelist_enable |
No |
Boolean |
Whether to enable the HL7 whitelist setting. |
hl7_whitelist |
No |
String |
HL7 whitelist. IP address of the server that allows data synchronization to the HL7 source end. Set this parameter when HL7 is the source (position set to source) and the whitelist setting is enabled (open_whitelist set to true). |
ldap_security_auth_type |
No |
String |
LDAP security authentication type. |
rabbitmq_virtual_host |
No |
String |
RabbitMQ virtual host. |
rabbitmq_ssl_protocol |
No |
String |
RabbitMQ SSL authentication protocol. |
rocketmq_namesrv_addr |
No |
String |
RocketMQ connection address of the IMF data source. This parameter is mandatory when mq_type is set to RocketMQ. Use commas (,) to separate multiple addresses. |
namesrv_addr |
No |
String |
ROMA 20.0 MQS connection address |
app_id |
No |
String |
ROMA 20.0 MQS APP Key |
app_secret |
No |
String |
ROMA 20.0 APP Secret |
sap_client |
No |
String |
SAP client ID. |
sap_sysnr |
No |
String |
SAP instance ID. |
snmp_network_protocol |
No |
String |
SNMP network protocol. |
snmp_version |
No |
Integer |
SNMP version number. |
snmp_community |
No |
String |
SNMP community name, which is used as an authentication password for access to the SNMP management agent. |
ibmmq_ccs_id |
No |
String |
IBMMQ character set ID. |
ibmmq_queue_manager |
No |
String |
IBMMQ queue manager. |
ibmmq_channel |
No |
String |
IBMMQ channel name. |
ibmmq_cipher_suite |
No |
String |
IBMMQ cipher algorithm suite. |
hdfs_path |
No |
String |
HDFS URL. This parameter is mandatory when the data source is MRSHIVE or MRSHDFS. |
principal_name |
No |
String |
Machine-machine interaction username. This parameter is mandatory when the data source is MRS Hive, MRS HDFS, MRS HBase, MRS Kafka, or MRS Redis. |
config_file_name |
No |
String |
User authentication file. For details about how to obtain the file, see "Appendix" > "Obtaining a Data Source Configuration File" in the API Reference. |
config_file_content |
No |
String |
Content of the user authentication file. Base64-encoded file content corresponding to config_file_name. Mandatory when the data source type is MRS Hive, MRS HDFS, MRS HBase, MRS Kafka, MRS Redis, or MRS ClickHouse. |
connection_instance_id |
No |
String |
Connector instance ID, which is generated when a connector is published |
connector_params |
No |
Object |
Data source parameter corresponding to the connector. Set this parameter based on actual requirements. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
oracle_address |
No |
String |
Oracle address. |
oracle_port |
No |
String |
Oracle port number. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
auth_method |
No |
String |
Authentication mode for accessing the API service. |
app_auth_type |
No |
String |
App authentication mode for accessing the API service. This parameter is mandatory when the authentication mode is apiGateway. |
user_name |
No |
String |
Username for accessing the API service. |
password |
No |
String |
Password for accessing the API service. |
app_key |
No |
String |
AppKey for accessing the API service. |
app_secret |
No |
String |
AppSecret for accessing the API service. |
secret |
No |
String |
Secret for accessing the API service. |
alt_ip |
No |
String |
Alternative IP address for accessing the API service. |
access_token_url |
No |
String |
AccessTokenUrl for accessing the API service. |
client_id |
No |
String |
Client ID for accessing the API service. |
client_id_key |
No |
String |
Client ID for accessing the API service. Set this parameter if the authentication mode is OAuth 2.0. The default value is client_id if not specified. |
client_secret |
No |
String |
Client secret for accessing the API service. |
client_secret_key |
No |
String |
Client key for accessing the API service. Set this parameter if the authentication mode is OAuth 2.0. The default value is client_secret if not specified. |
scope |
No |
String |
Scope for accessing the API service. |
authorization |
No |
String |
Authorization for accessing the API service. |
grant_type |
No |
String |
Authorization type for accessing the API service. |
Response Parameters
Status code: 201
Parameter |
Type |
Description |
---|---|---|
datasource_id |
String |
Data source ID. |
datasource_name |
String |
Data source name |
datasource_type |
String |
Data source type. |
vpc_id |
String |
ID of the VPC to which the data source belongs. |
app_id |
String |
ID of the application to which the data source belongs. |
app_name |
String |
Name of the application to which the data source belongs. |
instance_id |
String |
ID of the instance to which the data source belongs. |
create_time |
Long |
Data source creation time. |
update_time |
Long |
Data source modification time. |
custom_plugin_id |
String |
ID of the connector to which the data source belongs. |
content |
Content object |
Data source details. |
description |
String |
Data source description. |
app_permission |
Array of strings |
Integration application permission. |
Parameter |
Type |
Description |
---|---|---|
gauss100_version |
String |
GaussDB 100 version. This parameter is mandatory for a GaussDB 100 data source. |
host |
String |
Host IP address.
|
port |
String |
Port number, which ranges from 0 to 65535.
|
database_name |
String |
Database name.
|
redis_database |
String |
Redis data source type, which is a database ID containing only digits. |
user_name |
String |
Username for logging in to the service.
|
password |
String |
Password for logging in to the service.
|
mode |
String |
Data source connection mode. Options: default, professional, and multiAddress. |
cdc_mode |
String |
CDC mode, which is used only for composite tasks. |
multi_oracle_address |
Array of MultiOracleAddress objects |
IP address of the Oracle cluster. This parameter is mandatory when mode is set to multiAddress. |
oracle_service_name |
String |
Service name of the Oracle cluster. |
ftp_connect_mode |
String |
Connection mode for accessing the FTP service. The value can be active or passive. |
ftp_protocol |
String |
Protocol for accessing the FTP service. The value can be SFTP or FTP. |
address |
String |
Address.
|
ak |
String |
Access key ID. |
sk |
String |
Secret access key. |
bucket_name |
String |
Bucket name. This parameter is mandatory when the data source is OBS. |
https |
Boolean |
Whether to use HTTPS. This parameter is mandatory when the data source is OBS. Generally, HTTPS is used by default. |
url |
String |
Connection URL. |
api_method |
String |
API access request mode. |
auth_method |
String |
Authentication mode for accessing the WEBSOCKET service. |
api_auth_detail |
ApiAuthDetail object |
API authentication field details. |
broker |
String |
Addresses of the Kafka, MQS and ActiveMQ servers, in the format of IP address:Port number. Use commas (,) to separate multiple IP addresses and port numbers. |
ssl |
Boolean |
Whether to enable SSL authentication. |
ssl_enable |
Boolean |
Whether to enable SSL authentication. |
ssl_username |
String |
SSL user name or application key. |
ssl_password |
String |
SSL password or application secret. |
acl_enable |
Boolean |
Whether to enable access control authentication. |
mq_type |
String |
Message queue type of the IMF data source. |
mongodb_auth_source |
String |
MONGODB authentication source. |
mongodb_cluster_enable |
Boolean |
MONGODB cluster mode. |
mongodb_replica_set |
String |
MongoDB replica set. Mandatory when MongoDB is in non-cluster mode. |
encoding |
String |
Encoding format. |
mysql_timeout |
Integer |
MySQL connection timeout time (seconds). |
trust_store_password |
String |
Password of the public key library. |
trust_store |
String |
Public key library file. |
trust_store_file_type |
String |
Type of a public key library file. |
ssl_auth_method |
String |
Authentication method. This parameter is mandatory when the data source is ACTIVEMQ or ARTEMISMQ and SSL authentication is enabled. |
key_store |
String |
Content of the private key library file. |
key_store_file_type |
String |
Type of the private key library file. |
key_store_password |
String |
Private key library password. |
key_store_key_password |
String |
Private key of the private key library. |
dis_tunnel_name |
String |
DIS tunnel name. |
dis_data_type |
String |
DIS data type. |
dis_setting_type |
String |
DIS configuration type. |
dis_endpoint |
String |
DIS endpoint. This parameter is mandatory when setting_type is set to senior. |
dis_region |
String |
DIS region. This parameter is mandatory when setting_type is set to senior. |
dis_source_project_id |
String |
Project ID of the DIS source. This parameter is mandatory when setting_type is set to senior. |
hl7_position |
String |
HL7 data source direction. |
hl7_whitelist_enable |
Boolean |
Whether to enable the HL7 whitelist setting. |
hl7_whitelist |
String |
HL7 whitelist. IP address of the server that allows data synchronization to the HL7 source end. Set this parameter when HL7 is the source (position set to source) and the whitelist setting is enabled (open_whitelist set to true). |
ldap_security_auth_type |
String |
LDAP security authentication type. |
rabbitmq_virtual_host |
String |
RabbitMQ virtual host. |
rabbitmq_ssl_protocol |
String |
RabbitMQ SSL authentication protocol. |
rocketmq_namesrv_addr |
String |
RocketMQ connection address of the IMF data source. This parameter is mandatory when mq_type is set to RocketMQ. Use commas (,) to separate multiple addresses. |
namesrv_addr |
String |
ROMA 20.0 MQS connection address |
app_id |
String |
ROMA 20.0 MQS APP Key |
app_secret |
String |
ROMA 20.0 APP Secret |
sap_client |
String |
SAP client ID. |
sap_sysnr |
String |
SAP instance ID. |
snmp_network_protocol |
String |
SNMP network protocol. |
snmp_version |
Integer |
SNMP version number. |
snmp_community |
String |
SNMP community name, which is used as an authentication password for access to the SNMP management agent. |
ibmmq_ccs_id |
String |
IBMMQ character set ID. |
ibmmq_queue_manager |
String |
IBMMQ queue manager. |
ibmmq_channel |
String |
IBMMQ channel name. |
ibmmq_cipher_suite |
String |
IBMMQ cipher algorithm suite. |
hdfs_path |
String |
HDFS URL. This parameter is mandatory when the data source is MRSHIVE or MRSHDFS. |
principal_name |
String |
Machine-machine interaction username. This parameter is mandatory when the data source is MRS Hive, MRS HDFS, MRS HBase, MRS Kafka, or MRS Redis. |
config_file_name |
String |
User authentication file. For details about how to obtain the file, see "Appendix" > "Obtaining a Data Source Configuration File" in the API Reference. |
config_file_content |
String |
Content of the user authentication file. Base64-encoded file content corresponding to config_file_name. Mandatory when the data source type is MRS Hive, MRS HDFS, MRS HBase, MRS Kafka, MRS Redis, or MRS ClickHouse. |
connection_instance_id |
String |
Connector instance ID, which is generated when a connector is published |
connector_params |
Object |
Data source parameter corresponding to the connector. Set this parameter based on actual requirements. |
Parameter |
Type |
Description |
---|---|---|
oracle_address |
String |
Oracle address. |
oracle_port |
String |
Oracle port number. |
Parameter |
Type |
Description |
---|---|---|
auth_method |
String |
Authentication mode for accessing the API service. |
app_auth_type |
String |
App authentication mode for accessing the API service. This parameter is mandatory when the authentication mode is apiGateway. |
user_name |
String |
Username for accessing the API service. |
password |
String |
Password for accessing the API service. |
app_key |
String |
AppKey for accessing the API service. |
app_secret |
String |
AppSecret for accessing the API service. |
secret |
String |
Secret for accessing the API service. |
alt_ip |
String |
Alternative IP address for accessing the API service. |
access_token_url |
String |
AccessTokenUrl for accessing the API service. |
client_id |
String |
Client ID for accessing the API service. |
client_id_key |
String |
Client ID for accessing the API service. Set this parameter if the authentication mode is OAuth 2.0. The default value is client_id if not specified. |
client_secret |
String |
Client secret for accessing the API service. |
client_secret_key |
String |
Client key for accessing the API service. Set this parameter if the authentication mode is OAuth 2.0. The default value is client_secret if not specified. |
scope |
String |
Scope for accessing the API service. |
authorization |
String |
Authorization for accessing the API service. |
grant_type |
String |
Authorization type for accessing the API service. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
detail |
String |
Description details. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
-
Create a MySQL data source with the default connection mode.
{ "datasource_name" : "fdi_ds_y3k674", "datasource_type" : "MYSQL", "content" : { "host" : "**.**.**.**", "port" : "3306", "database_name" : "testfdi", "user_name" : "fditest", "password" : "******", "mode" : "default" }, "app_id" : "9dbd2cd2-9622-4a1b-ad47-31018cf44cbd", "description" : "testtesttest" }
-
Create an FTP data source with connection mode as active and protocol type as ftp.
{ "datasource_name" : "fdi_ds_v2frp", "datasource_type" : "FTP", "content" : { "ftp_connect_mode" : "active", "host" : "**.**.**.**", "port" : "21", "user_name" : "ftpuser", "password" : "******", "ftp_protocol" : "ftp" }, "app_id" : "9dbd2cd2-9622-4a1b-ad47-31018cf44cbd", "description" : "testtesttest" }
-
Create an API data source with request method as GET and authentication mode as none.
{ "datasource_name" : "fdi_ds_api_v2", "datasource_type" : "API", "content" : { "url" : "http%3A%2F%2FVM6_ip%3A1080%2F0928njapi", "api_method" : "GET", "api_auth_detail" : { "auth_method" : "none" } }, "description" : "testAPI", "app_id" : "9dbd2cd2-9622-4a1b-ad47-31018cf44cbd" }
Example Responses
Status code: 201
Created
{
"datasource_id" : "123",
"datasource_name" : "fdi_ds_api_v2",
"datasource_type" : "API",
"content" : {
"url" : "http%3A%2F%2FVM6_ip%3A1080%2F0928njapi",
"api_method" : "GET",
"ApiAuthDetail" : {
"auth_method" : "none"
}
},
"description" : "testAPI",
"app_id" : "9dbd2cd2-9622-4a1b-ad47-31018cf44cbd"
}
Status Codes
Status Code |
Description |
---|---|
201 |
Created |
400 |
Bad Request |
500 |
Internal Server Error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot