diff --git a/docs/api.html b/docs/api.html new file mode 100644 index 0000000..77aac10 --- /dev/null +++ b/docs/api.html @@ -0,0 +1,485 @@ + + + +
+ + + + + + + +Retrieves streams.
+Date filters use the first_event
and last_event
attributes on the stream for comparisons.
Query filter parameters:
+first_event
is older than supplied date (in ISO 8601 format). ie: 01-31-2015T13:30last_event
is younger than supplied date (in ISO 8601 format). ie: 01-31-2015T13:30state
is one of:trigger_name
distinguishing_traits
. Trait format is trait_name:trait_value;trait_name:trait_value
mark
. The mark is part of the return value from a previous /streams query. All filter criteria must match the previous query.Note the __type__
keys that give hints to the data type of the return values
+ +curl http://localhost:8000/v1/streams + +[ + { + "_mark": "2", + "distinguishing_traits": { + "instance_id": "8f81562e-70c9-4541-b054-3826121dc75b", + "timestamp": { + "__type__": "timex.TimeRange", + "begin": "2015-02-27T00:00:00", + "end": "2015-02-28T00:00:00" + } + }, + "expire_timestamp": { + "__type__": "datetime", + "datetime": "2015-03-02T00:27:18.603932" + }, + "fire_timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T14:57:32.731196" + }, + "first_event": { + "__type__": "datetime", + "datetime": "2015-02-27T18:27:18.603932" + }, + "id": 2, + "last_event": { + "__type__": "datetime", + "datetime": "2015-02-28T00:27:18.603932" + }, + "name": "test_trigger", + "state": "completed" + }, + { + "_mark": "1", + "distinguishing_traits": { + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "timestamp": { + "__type__": "timex.TimeRange", + "begin": "2015-02-27T00:00:00", + "end": "2015-02-28T00:00:00" + } + }, + "expire_timestamp": { + "__type__": "datetime", + "datetime": "2015-03-02T00:27:18.603932" + }, + "fire_timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T14:57:32.330963" + }, + "first_event": { + "__type__": "datetime", + "datetime": "2015-02-27T15:27:18.603932" + }, + "id": 1, + "last_event": { + "__type__": "datetime", + "datetime": "2015-02-28T00:27:18.603932" + }, + "name": "test_trigger", + "state": "completed" + } +] ++
Retrieves a particular stream. stream_id
is the id of the desired stream.
Optional parameters:
++curl http://localhost:8000/v1/streams/1 + +[ + { + "_mark": "1", + "distinguishing_traits": { + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "timestamp": { + "__type__": "timex.TimeRange", + "begin": "2015-02-27T00:00:00", + "end": "2015-02-28T00:00:00" + } + }, + "expire_timestamp": { + "__type__": "datetime", + "datetime": "2015-03-02T00:27:18.603932" + }, + "fire_timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T14:57:32.330963" + }, + "first_event": { + "__type__": "datetime", + "datetime": "2015-02-27T15:27:18.603932" + }, + "id": 1, + "last_event": { + "__type__": "datetime", + "datetime": "2015-02-28T00:27:18.603932" + }, + "name": "test_trigger", + "state": "completed" + } +] ++ +
And with event details
++curl http://localhost:8000/v1/streams/1?detail=true + +[ + { + "_mark": "1", + "distinguishing_traits": { + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "timestamp": { + "__type__": "timex.TimeRange", + "begin": "2015-02-27T00:00:00", + "end": "2015-02-28T00:00:00" + } + }, + "events": [ + { + "disk_gb": 20, + "ephemeral_gb": 0, + "event_type": "compute.instance.update", + "instance_flavor": "512MB Standard Instance", + "instance_flavor_id": 2, + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "instance_type": "512MB Standard Instance", + "memory_mb": 512, + "message_id": "936a849a-6eb3-4750-a431-7ca1aec9d611", + "os_architecture": "x64", + "os_distro": "com.ubuntu", + "os_version": "12.04", + "request_id": "req-028c51c6-e26e-4fd7-9347-bc1b2a7eb11a", + "root_gb": 20, + "service": "publisher-482147", + "state": "building", + "tenant_id": "408577", + "timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T15:27:18.603932" + }, + "user_id": "863985", + "vcpus": 1 + }, + { + "disk_gb": 20, + "ephemeral_gb": 0, + "event_type": "compute.instance.create.start", + "instance_flavor": "512MB Standard Instance", + "instance_flavor_id": 2, + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "instance_type": "512MB Standard Instance", + "memory_mb": 512, + "message": "", + "message_id": "d359a6db-a488-4522-8b94-2ad17fb7ac38", + "os_architecture": "x64", + "os_distro": "com.ubuntu", + "os_version": "12.04", + "request_id": "req-028c51c6-e26e-4fd7-9347-bc1b2a7eb11a", + "root_gb": 20, + "service": "publisher-482147", + "state": "building", + "tenant_id": "408577", + "timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T15:33:22.667932" + }, + "user_id": "863985", + "vcpus": 1 + }, + { + "disk_gb": 20, + "ephemeral_gb": 0, + "event_type": "compute.instance.update", + "instance_flavor": "512MB Standard Instance", + "instance_flavor_id": 2, + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "instance_type": "512MB Standard Instance", + "launched_at": { + "__type__": "datetime", + "datetime": "2015-02-27T15:31:24.473932" + }, + "memory_mb": 512, + "message_id": "fa6f6302-e35e-4c21-a69d-5322497526ed", + "os_architecture": "x64", + "os_distro": "com.ubuntu", + "os_version": "12.04", + "request_id": "req-028c51c6-e26e-4fd7-9347-bc1b2a7eb11a", + "root_gb": 20, + "service": "publisher-482147", + "state": "active", + "tenant_id": "408577", + "timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T15:33:24.565932" + }, + "user_id": "863985", + "vcpus": 1 + }, + { + "disk_gb": 20, + "ephemeral_gb": 0, + "event_type": "compute.instance.create.end", + "instance_flavor": "512MB Standard Instance", + "instance_flavor_id": 2, + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "instance_type": "512MB Standard Instance", + "launched_at": { + "__type__": "datetime", + "datetime": "2015-02-27T15:31:24.473932" + }, + "memory_mb": 512, + "message": "Success", + "message_id": "379cbd38-cae6-44cd-ae8e-5fb05777d1e0", + "os_architecture": "x64", + "os_distro": "com.ubuntu", + "os_version": "12.04", + "request_id": "req-028c51c6-e26e-4fd7-9347-bc1b2a7eb11a", + "root_gb": 20, + "service": "publisher-482147", + "state": "active", + "tenant_id": "408577", + "timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T15:33:56.771932" + }, + "user_id": "863985", + "vcpus": 1 + }, + { + "disk_gb": 20, + "ephemeral_gb": 0, + "event_type": "compute.instance.update", + "instance_flavor": "512MB Standard Instance", + "instance_flavor_id": 2, + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "instance_type": "512MB Standard Instance", + "memory_mb": 512, + "message_id": "c0784af6-deb7-452d-b09e-5a1dc1ac138f", + "os_architecture": "x64", + "os_distro": "com.ubuntu", + "os_version": "12.04", + "request_id": "req-028c51c6-e26e-4fd7-9347-bc1b2a7eb11a", + "root_gb": 20, + "service": "publisher-482147", + "state": "building", + "tenant_id": "408577", + "timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T15:40:34.186932" + }, + "user_id": "863985", + "vcpus": 1 + }, + { + "disk_gb": 20, + "ephemeral_gb": 0, + "event_type": "compute.instance.update", + "instance_flavor": "512MB Standard Instance", + "instance_flavor_id": 2, + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "instance_type": "512MB Standard Instance", + "memory_mb": 512, + "message_id": "e1c5ec1c-946d-422f-a890-3248fdf58cc0", + "os_architecture": "x64", + "os_distro": "com.ubuntu", + "os_version": "12.04", + "request_id": "req-028c51c6-e26e-4fd7-9347-bc1b2a7eb11a", + "root_gb": 20, + "service": "publisher-482147", + "state": "building", + "tenant_id": "408577", + "timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T15:42:34.939932" + }, + "user_id": "863985", + "vcpus": 1 + }, + { + "disk_gb": 20, + "ephemeral_gb": 0, + "event_type": "compute.instance.update", + "instance_flavor": "512MB Standard Instance", + "instance_flavor_id": 2, + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "instance_type": "512MB Standard Instance", + "memory_mb": 512, + "message_id": "6df0588b-2cf2-4f0b-96f3-98c2046f29ff", + "os_architecture": "x64", + "os_distro": "com.ubuntu", + "os_version": "12.04", + "request_id": "req-028c51c6-e26e-4fd7-9347-bc1b2a7eb11a", + "root_gb": 20, + "service": "publisher-482147", + "state": "building", + "tenant_id": "408577", + "timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T15:43:25.091932" + }, + "user_id": "863985", + "vcpus": 1 + }, + { + "audit_period_beginning": { + "__type__": "datetime", + "datetime": "2015-02-27T00:00:00" + }, + "audit_period_ending": { + "__type__": "datetime", + "datetime": "2015-02-28T00:00:00" + }, + "disk_gb": 620, + "ephemeral_gb": 0, + "event_type": "compute.instance.exists", + "instance_flavor": "15GB Standard Instance", + "instance_flavor_id": 7, + "instance_id": "86def971-f2a2-4b1d-b379-fca1b0ddf0d7", + "instance_type": "15GB Standard Instance", + "launched_at": { + "__type__": "datetime", + "datetime": "2014-12-15T13:22:12.015932" + }, + "memory_mb": 15360, + "message_id": "a16aa892-6e62-47fd-8aee-5183ef71d605", + "os_architecture": "x64", + "os_distro": "com.ubuntu", + "os_version": "12.04", + "request_id": "req-d14c8981-db18-4d1e-b17c-e7931fd2a0e9", + "root_gb": 620, + "service": "publisher-262311", + "state": "active", + "tenant_id": "714200", + "timestamp": { + "__type__": "datetime", + "datetime": "2015-02-28T00:27:18.603932" + }, + "user_id": "960064", + "vcpus": 6 + } + ], + "expire_timestamp": { + "__type__": "datetime", + "datetime": "2015-03-02T00:27:18.603932" + }, + "fire_timestamp": { + "__type__": "datetime", + "datetime": "2015-02-27T14:57:32.330963" + }, + "first_event": { + "__type__": "datetime", + "datetime": "2015-02-27T15:27:18.603932" + }, + "id": 1, + "last_event": { + "__type__": "datetime", + "datetime": "2015-02-28T00:27:18.603932" + }, + "name": "test_trigger", + "state": "completed" + } +] ++ +