taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

get-private-statistics-amount-SLUG.rst (2575B)


      1 .. http:get:: /management/instances/$INSTANCE/statistics-amount/$SLUG
      2 .. http:get:: [/instances/$INSTANCE]/private/statistics-amount/$SLUG
      3 
      4   This request will return be used to statistics where the
      5   values are amounts.  All available values for the given
      6   SLUG will be returned.
      7   Since protocol **v25**.
      8 
      9   **Required permission:** ``statistics-read``
     10 
     11   **Request:**
     12 
     13   :query by: *Optional*. If set to "BUCKET", only statistics by bucket will be returned. If set to "INTERVAL", only statistics kept by interval will be returned. If not set or set to "ANY", both will be returned.
     14 
     15   **Response:**
     16 
     17   :http:statuscode:`200 Ok`:
     18     The body will be a `MerchantStatisticsAmountResponse`
     19   :http:statuscode:`400 Bad Request`:
     20     The ``by`` parameter is malformed.
     21     Returned with ``TALER_EC_GENERIC_PARAMETER_MALFORMED``.
     22   :http:statuscode:`401 Unauthorized`:
     23     The request is unauthorized.
     24   :http:statuscode:`404 Not found`:
     25     The instance is unknown to the backend.
     26   :http:statuscode:`500 Internal Server Error`:
     27     The server experienced an internal failure.
     28     Returned with ``TALER_EC_GENERIC_DB_FETCH_FAILED``.
     29 
     30   **Details:**
     31 
     32   .. ts:def:: MerchantStatisticsAmountResponse
     33 
     34     interface MerchantStatisticsAmountResponse {
     35 
     36       // Statistics kept for a particular fixed time window.
     37       buckets: MerchantStatisticAmountByBucket[];
     38 
     39       // Human-readable bucket statistic description.
     40       // Unset if no buckets returned
     41       buckets_description?: string;
     42 
     43       // Statistics kept for a particular sliding interval.
     44       intervals: MerchantStatisticAmountByInterval[];
     45 
     46       // Human-readable interval statistic description.
     47       // Unset if no buckets returned
     48       intervals_description?: string;
     49     }
     50 
     51   .. ts:def:: MerchantStatisticAmountByBucket
     52 
     53     interface MerchantStatisticAmountByBucket {
     54 
     55        // Start time of the bucket (inclusive)
     56        start_time: Timestamp;
     57 
     58        // End time of the bucket (exclusive)
     59        end_time: Timestamp;
     60 
     61        // Range of the bucket
     62        range: StatisticBucketRange;
     63 
     64        // Sum of all amounts falling under the given
     65        // SLUG within this timeframe.
     66        cumulative_amounts: Amount[];
     67 
     68     }
     69 
     70   .. ts:def:: MerchantStatisticAmountByInterval
     71 
     72     interface MerchantStatisticAmountByInterval {
     73 
     74        // Start time of the interval.
     75        // The interval always ends at the response
     76        // generation time.
     77        start_time: Timestamp;
     78 
     79        // Sum of all amounts falling under the given
     80        // SLUG within this timeframe.
     81        cumulative_amounts: Amount[];
     82 
     83     }