Loader Connection Datasources ============================= .. code-block:: http /api/repositories/{repository}/loaderconnections/{loaderconnection}/datasources .. csv-table:: :header: Parameter, Type, Purpose :widths: 20, 20, 60 :stub-columns: 1 repository, string, the name of the :doc:`repository` loaderconnection, string, the ID of the loader connection .. _lcd_show_all: Get ~~~ .. http:get:: /api/repositories/(string:repository)/loaderconnections/(int:loaderconnection)/datasources :synopsis: Lists the datasources of the corresponding loader connection Lists the datasources of the :doc:`loaderconnection` .. code-block:: http GET /api/repositories/jupiter/loaderconnections/1/datasources HTTP/1.1 Accept: application/json .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 500, Server error The response will be a :doc:`standard-response`, with a list of loader connections in the corresponding :doc:`repository`. The ``columns`` array will contain the list of columns for each data row. .. csv-table:: :header: Human Name, Column Name, Description :widths: 25, 25, 50 Filename, Filename, Name of the datasource Size, Size, Size of the datasource The ``size`` column is applicable only to flat-file loader connections. The ``rows`` array will contain the list of datasources of the corresponding :doc:`loaderconnection`: .. code-block:: json "rows": [ { "dataRow": [ "sample.dat", "12500" ] } If there are no datasources in the :doc:`loaderconnection`, ``rows`` will be an empty string. .. _lcd_show_some: Post ~~~~ .. http:post:: /api/repositories/(string:repository)/loaderconnections/(int:loaderconnection)/datasources :synopsis: Get the list of datasources in a loader connection which matches the criteria passed in the post body Get the list of datasources in a :doc:`loaderconnection` which matches the criteria passed in the post body .. code-block:: http POST /api/repositories/jupiter/loaderconnections/1/datasources HTTP/1.1 Content-Type: application/json { "command": "get", "data": { "filter": "d*", "username": "uname", "password": "passwd" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 204, No error 400, Invalid data passed with request 500, Server error The request packet must contain the ``command`` and ``data`` elements. The ``options`` element is not required. The response will be as described for all :ref:`datasources `. .. _lcd_show_schemas: Show Data Schemas ~~~~~~~~~~~~~~~~~ .. http:get:: /api/repositories/(string:repository)/loaderconnections/(int:loaderconnection)/dataschemas :synopsis: Lists the dataschemas of the corresponding loader connection where username and password is not required Lists the datasources of the :doc:`loaderconnection` where username and password is not required .. code-block:: http GET /api/repositories/jupiter/loaderconnections/1/dataschemas HTTP/1.1 Accept: application/json .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 500, Server error .. http:post:: /api/repositories/(string:repository)/loaderconnections/(int:loaderconnection)/dataschemas :synopsis: Get the list of dataschemas in a loader connection where username and password is required Get the list of dataschemas in a :doc:`loaderconnection` which requires username and password .. code-block:: http POST /api/repositories/jupiter/loaderconnections/1/dataschemas HTTP/1.1 Content-Type: application/json { "command": "get", "data": { "username": "uname", "password": "passwd" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 204, No error 400, Invalid data passed with request 500, Server error The request packet must contain the ``command`` and ``data`` elements. The ``options`` element is not required. The response for get and post will be a :doc:`standard-response`, with a list of dataschemas in the corresponding :doc:`loaderconnection`. The ``columns`` array will contain the list of columns for each data row. .. csv-table:: :header: Human Name, Column Name, Description :widths: 25, 25, 50 Filename, Filename, Name of the datasource Size, Size, Size of the datasource The ``size`` column is applicable only to flat-file loader connections. The ``rows`` array will contain the list of dataschemas of the corresponding :doc:`loaderconnection`: .. code-block:: json "rows": [ { "dataRow": [ "e3.ddx", "12738" ] } If there are no dataschemas in the :doc:`loaderconnection`, ``rows`` will be an empty string. .. _lcd_show_preview: Show Schema Preview ~~~~~~~~~~~~~~~~~ .. http:post:: /api/repositories/(string:repository)/loaderconnections/(int:loaderconnection)/dataschemas :synopsis: Get the preview of the dataschema file Get the preview of dataschemafile .. code-block:: http POST /api/repositories/jupiter/loaderconnections/1/dataschemas HTTP/1.1 Content-Type: application/json { "command": "preview", "data": { "username": "uname", "password": "passwd", "filename":"filename" } } filename is the mandatory parameter .. csv-table:: :header: Response Code, Reason :widths: 25, 75 204, No error 400, Invalid data passed with request 500, Server error The request packet must contain the ``command`` and ``data`` elements. The ``options`` element is not required. The response will be the preview of the schema file