taler-docs

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

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


      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:`401 Unauthorized`:
     20     The request is unauthorized.
     21   :http:statuscode:`404 Not found`:
     22     The instance is unknown to the backend.
     23 
     24   **Details:**
     25 
     26   .. ts:def:: MerchantStatisticsAmountResponse
     27 
     28     interface MerchantStatisticsAmountResponse {
     29 
     30       // Statistics kept for a particular fixed time window.
     31       buckets: MerchantStatisticAmountByBucket[];
     32 
     33       // Human-readable bucket statistic description.
     34       // Unset if no buckets returned
     35       buckets_description?: string;
     36 
     37       // Statistics kept for a particular sliding interval.
     38       intervals: MerchantStatisticAmountByInterval[];
     39 
     40       // Human-readable interval statistic description.
     41       // Unset if no buckets returned
     42       intervals_description?: string;
     43     }
     44 
     45   .. ts:def:: MerchantStatisticAmountByBucket
     46 
     47     interface MerchantStatisticAmountByBucket {
     48 
     49        // Start time of the bucket (inclusive)
     50        start_time: Timestamp;
     51 
     52        // End time of the bucket (exclusive)
     53        end_time: Timestamp;
     54 
     55        // Range of the bucket
     56        range: StatisticBucketRange;
     57 
     58        // Sum of all amounts falling under the given
     59        // SLUG within this timeframe.
     60        cumulative_amounts: Amount[];
     61 
     62     }
     63 
     64   .. ts:def:: MerchantStatisticAmountByInterval
     65 
     66     interface MerchantStatisticAmountByInterval {
     67 
     68        // Start time of the interval.
     69        // The interval always ends at the response
     70        // generation time.
     71        start_time: Timestamp;
     72 
     73        // Sum of all amounts falling under the given
     74        // SLUG within this timeframe.
     75        cumulative_amounts: Amount[];
     76 
     77     }