Skip to content

Instantly share code, notes, and snippets.

@EricWittmann
Created February 11, 2015 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EricWittmann/86864fd897a6f7496fd4 to your computer and use it in GitHub Desktop.
Save EricWittmann/86864fd897a6f7496fd4 to your computer and use it in GitHub Desktop.
GET /apiman_manager/auditEntry/_mapping
----
{
"apiman_manager": {
"mappings": {
"auditEntry": {
"properties": {
"createdOn": {
"type": "long"
},
"data": {
"type": "string",
"index": "not_analyzed"
},
"entityId": {
"type": "string",
"index": "not_analyzed"
},
"entityType": {
"type": "string",
"index": "not_analyzed"
},
"entityVersion": {
"type": "string",
"index": "not_analyzed"
},
"id": {
"type": "long"
},
"organizationId": {
"type": "string",
"index": "not_analyzed"
},
"what": {
"type": "string",
"index": "not_analyzed"
},
"who": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
----
GET /apiman_manager/auditEntry/_search
{
"from" : 0,
"size" : 20,
"sort" : [ {
"id" : {
"order" : "desc"
}
} ]
}
----
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 1,
"failed": 4,
"failures": [
{
"index": "apiman_manager",
"shard": 0,
"status": 500,
"reason": "QueryPhaseExecutionException[[apiman_manager][0]: query[ConstantScore(cache(_type:auditEntry))],from[0],size[20],sort[<custom:\"id\": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@730c1326>!]: Query Failed [Failed to execute main query]]; nested: ClassCastException[org.elasticsearch.index.fielddata.AtomicFieldData$WithOrdinals$1 cannot be cast to org.elasticsearch.index.fielddata.AtomicNumericFieldData]; "
},
{
"index": "apiman_manager",
"shard": 1,
"status": 500,
"reason": "QueryPhaseExecutionException[[apiman_manager][1]: query[ConstantScore(cache(_type:auditEntry))],from[0],size[20],sort[<custom:\"id\": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@1dbd5ecc>!]: Query Failed [Failed to execute main query]]; nested: ClassCastException[org.elasticsearch.index.fielddata.AtomicFieldData$WithOrdinals$1 cannot be cast to org.elasticsearch.index.fielddata.AtomicNumericFieldData]; "
},
{
"index": "apiman_manager",
"shard": 2,
"status": 500,
"reason": "QueryPhaseExecutionException[[apiman_manager][2]: query[ConstantScore(cache(_type:auditEntry))],from[0],size[20],sort[<custom:\"id\": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@8a17750>!]: Query Failed [Failed to execute main query]]; nested: ClassCastException[org.elasticsearch.index.fielddata.AtomicFieldData$WithOrdinals$1 cannot be cast to org.elasticsearch.index.fielddata.AtomicNumericFieldData]; "
},
{
"index": "apiman_manager",
"shard": 4,
"status": 500,
"reason": "QueryPhaseExecutionException[[apiman_manager][4]: query[ConstantScore(cache(_type:auditEntry))],from[0],size[20],sort[<custom:\"id\": org.elasticsearch.index.fielddata.fieldcomparator.LongValuesComparatorSource@20a0299d>!]: Query Failed [Failed to execute main query]]; nested: ClassCastException[org.elasticsearch.index.fielddata.AtomicFieldData$WithOrdinals$1 cannot be cast to org.elasticsearch.index.fielddata.AtomicNumericFieldData]; "
}
]
},
"hits": {
"total": 7,
"max_score": null,
"hits": [
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683094384126",
"_score": null,
"_source": {
"id": 1423683094384126,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": null,
"who": "admin",
"what": "Publish",
"createdOn": 1423683094384
},
"sort": [
1423683094384126
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093621111",
"_score": null,
"_source": {
"id": 1423683093621111,
"organizationId": "Organization1",
"entityId": "Plan1",
"entityType": "Plan",
"entityVersion": "1.0",
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093621
},
"sort": [
1423683093621111
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093605110",
"_score": null,
"_source": {
"id": 1423683093605110,
"organizationId": "Organization1",
"entityId": "Plan2",
"entityType": "Plan",
"entityVersion": null,
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093605
},
"sort": [
1423683093605110
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093437107",
"_score": null,
"_source": {
"id": 1423683093437107,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "2.0",
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093437
},
"sort": [
1423683093437107
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093327106",
"_score": null,
"_source": {
"id": 1423683093327106,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093327
},
"sort": [
1423683093327106
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683092912102",
"_score": null,
"_source": {
"id": 1423683092912102,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": null,
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683092912
},
"sort": [
1423683092912102
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683092677100",
"_score": null,
"_source": {
"id": 1423683092677100,
"organizationId": "Organization1",
"entityId": null,
"entityType": "Organization",
"entityVersion": null,
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683092677
},
"sort": [
1423683092677100
]
}
]
}
}
----
GET /apiman_manager/auditEntry/_search
{
"from" : 0,
"size" : 20,
"sort" : [ {
"createdOn" : {
"order" : "desc"
}
} ]
}
----
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 25,
"max_score": null,
"hits": [
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683094384126",
"_score": null,
"_source": {
"id": 1423683094384126,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": null,
"who": "admin",
"what": "Publish",
"createdOn": 1423683094384
},
"sort": [
1423683094384
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683094340125",
"_score": null,
"_source": {
"id": 1423683094340125,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": "{\"policyDefId\":\"PolicyDef\"}",
"who": "admin",
"what": "RemovePolicy",
"createdOn": 1423683094340
},
"sort": [
1423683094340
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683094313124",
"_score": null,
"_source": {
"id": 1423683094313124,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": "{\"policyDefId\":\"PolicyDef\"}",
"who": "admin",
"what": "UpdatePolicy",
"createdOn": 1423683094313
},
"sort": [
1423683094313
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683094281123",
"_score": null,
"_source": {
"id": 1423683094281123,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": "{\"policyDefId\":\"PolicyDef\"}",
"who": "admin",
"what": "AddPolicy",
"createdOn": 1423683094281
},
"sort": [
1423683094281
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683094052121",
"_score": null,
"_source": {
"id": 1423683094052121,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": "{\"policyDefId\":\"PolicyDef\"}",
"who": "admin",
"what": "AddPolicy",
"createdOn": 1423683094039
},
"sort": [
1423683094039
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093746119",
"_score": null,
"_source": {
"id": 1423683093746119,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": "{\"changes\":[{\"name\":\"plans\",\"before\":\"Plan2:1.1, Plan1:1.0\",\"after\":\"Plan2:1.1\"}]}",
"who": "admin",
"what": "Update",
"createdOn": 1423683093746
},
"sort": [
1423683093746
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093715118",
"_score": null,
"_source": {
"id": 1423683093715118,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": "{\"changes\":[{\"name\":\"plans\",\"before\":\"Plan1:1.0\",\"after\":\"Plan2:1.1, Plan1:1.0\"}]}",
"who": "admin",
"what": "Update",
"createdOn": 1423683093715
},
"sort": [
1423683093715
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093699117",
"_score": null,
"_source": {
"id": 1423683093699117,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": "{\"changes\":[{\"name\":\"plans\",\"before\":\"\",\"after\":\"Plan1:1.0\"}]}",
"who": "admin",
"what": "Update",
"createdOn": 1423683093699
},
"sort": [
1423683093699
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093684116",
"_score": null,
"_source": {
"id": 1423683093684116,
"organizationId": "Organization1",
"entityId": "Plan2",
"entityType": "Plan",
"entityVersion": "1.1",
"data": null,
"who": "admin",
"what": "Lock",
"createdOn": 1423683093684
},
"sort": [
1423683093684
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093668114",
"_score": null,
"_source": {
"id": 1423683093668114,
"organizationId": "Organization1",
"entityId": "Plan1",
"entityType": "Plan",
"entityVersion": "1.0",
"data": null,
"who": "admin",
"what": "Lock",
"createdOn": 1423683093668
},
"sort": [
1423683093668
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093684115",
"_score": null,
"_source": {
"id": 1423683093684115,
"organizationId": "Organization1",
"entityId": "Plan1",
"entityType": "Plan",
"entityVersion": "2.0",
"data": null,
"who": "admin",
"what": "Lock",
"createdOn": 1423683093668
},
"sort": [
1423683093668
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093652113",
"_score": null,
"_source": {
"id": 1423683093652113,
"organizationId": "Organization1",
"entityId": "Plan2",
"entityType": "Plan",
"entityVersion": "1.1",
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093652
},
"sort": [
1423683093652
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093637112",
"_score": null,
"_source": {
"id": 1423683093637112,
"organizationId": "Organization1",
"entityId": "Plan1",
"entityType": "Plan",
"entityVersion": "2.0",
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093637
},
"sort": [
1423683093637
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093621111",
"_score": null,
"_source": {
"id": 1423683093621111,
"organizationId": "Organization1",
"entityId": "Plan1",
"entityType": "Plan",
"entityVersion": "1.0",
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093621
},
"sort": [
1423683093621
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093605110",
"_score": null,
"_source": {
"id": 1423683093605110,
"organizationId": "Organization1",
"entityId": "Plan2",
"entityType": "Plan",
"entityVersion": null,
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093605
},
"sort": [
1423683093605
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093590109",
"_score": null,
"_source": {
"id": 1423683093590109,
"organizationId": "Organization1",
"entityId": "Plan1",
"entityType": "Plan",
"entityVersion": null,
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093590
},
"sort": [
1423683093590
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093574108",
"_score": null,
"_source": {
"id": 1423683093574108,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": "{\"changes\":[{\"name\":\"endpoint\",\"before\":null,\"after\":\"http://localhost:8080/ping\"},{\"name\":\"endpointType\",\"before\":null,\"after\":\"rest\"}]}",
"who": "admin",
"what": "Update",
"createdOn": 1423683093574
},
"sort": [
1423683093574
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093437107",
"_score": null,
"_source": {
"id": 1423683093437107,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "2.0",
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093437
},
"sort": [
1423683093437
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093327106",
"_score": null,
"_source": {
"id": 1423683093327106,
"organizationId": "Organization1",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": "1.0",
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093327
},
"sort": [
1423683093327
]
},
{
"_index": "apiman_manager",
"_type": "auditEntry",
"_id": "1423683093208105",
"_score": null,
"_source": {
"id": 1423683093208105,
"organizationId": "Organization2",
"entityId": "Service1",
"entityType": "Service",
"entityVersion": null,
"data": null,
"who": "admin",
"what": "Create",
"createdOn": 1423683093208
},
"sort": [
1423683093208
]
}
]
}
}
----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment