forked from cf-toolsuite/cf-butler-sample-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
query-policy-mysql-sample-QP.json
46 lines (46 loc) · 2.73 KB
/
query-policy-mysql-sample-QP.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"description":"Sample query policy that will run seven queries and email the results as per the template configuration.",
"queries":[
{
"name":"docker-images",
"description":"Find all running Docker image based containers",
"sql":"select * from application_detail where running_instances > 0 and requested_state = 'started' and image is not null"
},
{
"name":"all-apps-pushed-and-still-running-in-the-last-week",
"description":"Find all running applications pushed in the last week excluding the system organization",
"sql":"select * from application_detail where running_instances > 0 and requested_state = 'started' and week(last_pushed) = week(current_date) -1 AND year(last_pushed) = year(current_date) and organization not in ('system')"
},
{
"name":"all-single-instance-apps",
"description":"Find all running single instance applications",
"sql":"select * from application_detail where running_instances = 1 and requested_state = 'started'"
},
{
"name":"all-stopped-instances-excluding-system-org",
"description":"Find all stopped applications excluding the system organization",
"sql":"select * from application_detail where running_instances = 0 and requested_state = 'stopped' and organization not in ('system')"
},
{
"name":"all-mysql-service-instances-excluding-system-org",
"description":"Find all MySQL service instances excluding the system organization",
"sql":"select * from service_instance_detail where service = 'p.mysql' and organization not in ('system')"
},
{
"name":"apps-last-pushed-more-than-six-months-ago-excluding-system-org",
"description":"Find applications that were last pushed more than six months ago excluding the system organization",
"sql":"select * from application_detail where last_pushed <= (current_timestamp - interval 6 month) and organization not in ('system')"
},
{
"name":"service-instances-last-updated-more-than-six-months-ago-excluding-system-org",
"description":"Find service instances that were last updated more than six months ago excluding the system organization",
"sql":"select * from service_instance_detail where last_updated <= (current_timestamp - interval 6 month) and organization not in ('system')"
}
],
"email-notification-template":{
"from":"admin@pcf.demo.ironleg.me",
"to":[ "cphillipson@pivotal.io" ],
"subject":"Query Policy Sample Report",
"body":"Results are herewith attached for your consideration."
}
}