Data Delivery C API Library Reference  1.2
Defines | Functions
ddca_admin.h File Reference

Functions

int ddca_admin_register_event_cb (int(*admin_event_cb)(const char *op_id, const ddca_admin_event_t *event))
 register the event callback function
int ddca_admin_request_download (const char *op_id, const char *url, const char *download_path, const ddca_int32_t timeout)
 request to download the file
int ddca_admin_request_upload (const char *op_id, const char *url, const char *upload_file, const char *method)
 request to upload the file
int ddca_admin_respond (const char *op_id, const ddca_bool_t success)
 send status against the action by the data delivery core
int ddca_admin_request_execute (const char *op_id, const char *command, const char *options)
int ddca_admin_emit (const char *op_id, const ddca_event_t *event)
 emit given event data to Data Delivery Core
int ddca_admin_emit_with_data_type (const char *op_id, const ddca_event_t *event)
 emit given event data with data type to Data Delivery Core

Detailed Description


Function Documentation

int ddca_admin_emit ( const char *  op_id,
const ddca_event_t event 
)

emit given event data to Data Delivery Core

This function emits the given event data to Data Delivery Core. The op_id argument can be NULL if the event argument is not related to the event.

Parameters:
[in]*op_idoperation id related to the argument event data
[in]*eventdata to be emitted
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_admin_emit_with_data_type ( const char *  op_id,
const ddca_event_t event 
)

emit given event data with data type to Data Delivery Core

This function emits the given event data with data type to Data Delivery Core. The op_id argument can be NULL if the event argument is not related to the event.

Parameters:
[in]*op_idoperation id related to the argument event data
[in]*eventdata to be emitted
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_admin_register_event_cb ( int(*)(const char *op_id, const ddca_admin_event_t *event)  admin_event_cb)

register the event callback function

This function marks the given function as the event callback function. This event callback function will be called when the new event is notified to this Admin Agent application.

Parameters:
[in]*admin_event_cbfunction pointer to be marked as the event callback function
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_admin_request_download ( const char *  op_id,
const char *  url,
const char *  download_path,
const ddca_int32_t  timeout 
)

request to download the file

This function sends the request to download the uploaded file to the data delivery core. op_id and url parameters will be delivered by the event callback of the file upload notification, and only after it is delivered this API will work successfully. If timeout is 0, wait time for download is default value of data delivery core.

Parameters:
[in]*op_idoperation id
[in]*urlurl to the uploaded file
[in]*download_pathpath which save a download file
[in]timeouttime to wait for download (millisecond)
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_admin_request_upload ( const char *  op_id,
const char *  url,
const char *  upload_file,
const char *  method 
)

request to upload the file

This function sends the request to upload the local file to the data delivery core. op_id and url parameters will be delivered by the event callback of the file upload notification, and only after it is delivered this API will work successfully.

Parameters:
[in]*op_idoperation id
[in]*urlurl to upload file
[in]*upload_filefile which is uploaded
[in]*methodmethod to upload file
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
int ddca_admin_respond ( const char *  op_id,
const ddca_bool_t  success 
)

send status against the action by the data delivery core

This function reply the result status of the request from the data delivery core. This functoin can be called only once by an operation.

Parameters:
[in]*op_idoperation id from the data delivery core
[in]successresult status to send
Return values:
DDCA_SUCCESSoperation success
othersoperation failure
 All Data Structures Files Functions Variables Typedefs Defines