post-private-reports.rst (1978B)
1 .. http:post:: [/instances/$INSTANCE]/private/reports 2 3 This is used to schedule the generation of periodic reports. 4 5 **Required permission:** ``reports-write`` 6 7 **Request:** 8 9 The request must be a `ReportAddRequest`. 10 11 **Response:** 12 13 :http:statuscode:`200 OK`: 14 The backend has successfully added a new report. Returns a `ReportAddedResponse`. 15 16 :http:statuscode:`400 Bad request`: 17 Malformed JSON or missing fields. 18 Returned with ``TALER_EC_GENERIC_PARAMETER_MALFORMED``. 19 :http:statuscode:`404 Not found`: 20 The merchant instance is unknown. 21 :http:statuscode:`500 Internal Server Error`: 22 The server experienced an internal failure. 23 Returned with ``TALER_EC_GENERIC_DB_STORE_FAILED``. 24 :http:statuscode:`501 Not implemented`: 25 The report generator specified in the ``program_section`` is not configured. 26 Returned with ``TALER_EC_MERCHANT_GENERIC_REPORT_GENERATOR_UNCONFIGURED``. 27 28 **Details:** 29 30 .. ts:def:: ReportAddRequest 31 32 interface ReportAddRequest { 33 34 // Description of the report. Possibly included 35 // in the report message. 36 description: string; 37 38 // Merchant backend configuration section specifying 39 // the program to use to transmit the report 40 program_section: string; 41 42 // Mime-type to request from the data source. 43 mime_type: string; 44 45 // URL under the instance to request the data from. 46 // Must start with '/'. The base URL and the instance 47 // prefix will be prefixed to the given data source. 48 data_source: string; 49 50 // Address where the report program should send 51 // the report. 52 target_address: string; 53 54 // Report frequency 55 report_frequency: RelativeTime; 56 57 // Report frequency shift. Defaults to zero if missing. 58 report_frequency_shift?: RelativeTime; 59 60 } 61 62 .. ts:def:: ReportAddedResponse 63 64 interface ReportAddedResponse { 65 66 // Unique ID for the report. 67 report_serial_id: Integer; 68 69 }