Ejemplo n.º 1
0
    def test_get_meta(self):
        result = q.get_meta_keys(self.session, ['argo'])
        self.assertEqual(len(result), 8)
        self.assertIn("Type of float", result)

        result = q.get_meta_values(self.session, ['argo'], "Type of float")
        self.assertEqual(len(result), 1)
        self.assertIn("PROVOR_III", result)
Ejemplo n.º 2
0
def observation_values_v1_0(platform_types: str, key: str):
    """
    API Format: /api/v1.0/observation/meta_values/<string:platform_types>.json

    <string:platform_types> : Comma seperated list of platform types
    <string:key> : Metadata key

    Gets the set of metadata values for a list of platform types and key

    **Used in ObservationSelector**
    """
    max_age = 86400
    data = ob_queries.get_meta_values(DB.session, platform_types.split(","), key)
    resp = jsonify(data)
    resp.cache_control.max_age = max_age
    return resp