http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/CacheDataModel.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/CacheDataModel.java b/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/CacheDataModel.java index 345ac92..6ad1170 100644 --- a/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/CacheDataModel.java +++ b/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/CacheDataModel.java @@ -1,5 +1,25 @@ package com.comcast.cdn.traffic_control.traffic_monitor.wicket.models; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import org.apache.wicket.model.Model; public class CacheDataModel extends Model<String> {
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/CacheStateModel.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/CacheStateModel.java b/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/CacheStateModel.java index 8cb34e5..20287f2 100644 --- a/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/CacheStateModel.java +++ b/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/CacheStateModel.java @@ -1,5 +1,25 @@ package com.comcast.cdn.traffic_control.traffic_monitor.wicket.models; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.health.CacheStateRegistry; public class CacheStateModel extends StateModel { http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/DsStateModel.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/DsStateModel.java b/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/DsStateModel.java index e8b5f65..bc5ffde 100644 --- a/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/DsStateModel.java +++ b/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/DsStateModel.java @@ -1,5 +1,25 @@ package com.comcast.cdn.traffic_control.traffic_monitor.wicket.models; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.health.DeliveryServiceStateRegistry; public class DsStateModel extends StateModel { http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/StateModel.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/StateModel.java b/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/StateModel.java index 3c6ebe7..2096bee 100644 --- a/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/StateModel.java +++ b/traffic_monitor/src/main/java/com/comcast/cdn/traffic_control/traffic_monitor/wicket/models/StateModel.java @@ -1,5 +1,25 @@ package com.comcast.cdn.traffic_control.traffic_monitor.wicket.models; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.health.AbstractState; import org.apache.wicket.model.Model; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/opt/tomcat/conf/server.xml ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/opt/tomcat/conf/server.xml b/traffic_monitor/src/main/opt/tomcat/conf/server.xml index 3cdc7f2..a342763 100644 --- a/traffic_monitor/src/main/opt/tomcat/conf/server.xml +++ b/traffic_monitor/src/main/opt/tomcat/conf/server.xml @@ -1,6 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> <!-- - Copyright 2015 Comcast Cable Communications Management, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/resources/log4j.properties b/traffic_monitor/src/main/resources/log4j.properties index f3cfc8c..0f83890 100644 --- a/traffic_monitor/src/main/resources/log4j.properties +++ b/traffic_monitor/src/main/resources/log4j.properties @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + log4j.appender.Stdout=org.apache.log4j.ConsoleAppender log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/scripts/postinstall.sh ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/scripts/postinstall.sh b/traffic_monitor/src/main/scripts/postinstall.sh index 7ce73c9..ebab902 100644 --- a/traffic_monitor/src/main/scripts/postinstall.sh +++ b/traffic_monitor/src/main/scripts/postinstall.sh @@ -1,6 +1,5 @@ # # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/scripts/postremove.sh ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/scripts/postremove.sh b/traffic_monitor/src/main/scripts/postremove.sh index d522932..713e722 100644 --- a/traffic_monitor/src/main/scripts/postremove.sh +++ b/traffic_monitor/src/main/scripts/postremove.sh @@ -1,5 +1,21 @@ #!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. # Get rid of exploded war file directory, but leave everything else untouched because this runs after the install # steps during an upgrade (http://www.ibm.com/developerworks/library/l-rpm2/) -rm -rf /opt/traffic_monitor/webapps/ROOT \ No newline at end of file +rm -rf /opt/traffic_monitor/webapps/ROOT http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/scripts/preinstall.sh ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/scripts/preinstall.sh b/traffic_monitor/src/main/scripts/preinstall.sh index 39d8b82..de01cbf 100644 --- a/traffic_monitor/src/main/scripts/preinstall.sh +++ b/traffic_monitor/src/main/scripts/preinstall.sh @@ -1,6 +1,5 @@ #!/bin/bash# # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/scripts/preremove.sh ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/scripts/preremove.sh b/traffic_monitor/src/main/scripts/preremove.sh index e0b7505..8039254 100644 --- a/traffic_monitor/src/main/scripts/preremove.sh +++ b/traffic_monitor/src/main/scripts/preremove.sh @@ -1,6 +1,5 @@ # # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/webapp/WEB-INF/web.xml b/traffic_monitor/src/main/webapp/WEB-INF/web.xml index dbdb174..79a83f2 100644 --- a/traffic_monitor/src/main/webapp/WEB-INF/web.xml +++ b/traffic_monitor/src/main/webapp/WEB-INF/web.xml @@ -1,4 +1,24 @@ <?xml version="1.0" encoding="ISO-8859-1"?> + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/webapp/js/main.js ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/webapp/js/main.js b/traffic_monitor/src/main/webapp/js/main.js index bc48fd3..1cd66fe 100644 --- a/traffic_monitor/src/main/webapp/js/main.js +++ b/traffic_monitor/src/main/webapp/js/main.js @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + function updateAjaxComponents(arg) { for ( var key in arg) { if (arg.hasOwnProperty(key)) { http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/webapp/style.css ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/webapp/style.css b/traffic_monitor/src/main/webapp/style.css index 978e037..38958ef 100644 --- a/traffic_monitor/src/main/webapp/style.css +++ b/traffic_monitor/src/main/webapp/style.css @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + @CHARSET "ISO-8859-1"; body { http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/main/webapp/test.html ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/main/webapp/test.html b/traffic_monitor/src/main/webapp/test.html index 57975c9..a6d4f9c 100644 --- a/traffic_monitor/src/main/webapp/test.html +++ b/traffic_monitor/src/main/webapp/test.html @@ -1,3 +1,22 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + <html> <head> @@ -73,4 +92,4 @@ function worker() { </div> </div> </body> -</html> \ No newline at end of file +</html> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/application/MonitorApplicationTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/application/MonitorApplicationTest.java b/traffic_monitor/src/test/java/application/MonitorApplicationTest.java index 3b9e551..1dc467f 100644 --- a/traffic_monitor/src/test/java/application/MonitorApplicationTest.java +++ b/traffic_monitor/src/test/java/application/MonitorApplicationTest.java @@ -1,5 +1,25 @@ package application; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.MonitorApplication; import com.comcast.cdn.traffic_control.traffic_monitor.config.ConfigHandler; import org.junit.Before; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/com/comcast/cdn/traffic_control/traffic_monitor/Start.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/com/comcast/cdn/traffic_control/traffic_monitor/Start.java b/traffic_monitor/src/test/java/com/comcast/cdn/traffic_control/traffic_monitor/Start.java index 98d0e68..67c8f74 100644 --- a/traffic_monitor/src/test/java/com/comcast/cdn/traffic_control/traffic_monitor/Start.java +++ b/traffic_monitor/src/test/java/com/comcast/cdn/traffic_control/traffic_monitor/Start.java @@ -1,5 +1,4 @@ /* - * Copyright 2015 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/com/comcast/cdn/traffic_control/traffic_monitor/TestHomePage.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/com/comcast/cdn/traffic_control/traffic_monitor/TestHomePage.java b/traffic_monitor/src/test/java/com/comcast/cdn/traffic_control/traffic_monitor/TestHomePage.java index 30fef7d..eacf331 100644 --- a/traffic_monitor/src/test/java/com/comcast/cdn/traffic_control/traffic_monitor/TestHomePage.java +++ b/traffic_monitor/src/test/java/com/comcast/cdn/traffic_control/traffic_monitor/TestHomePage.java @@ -1,5 +1,4 @@ /* - * Copyright 2015 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/config/CacheTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/config/CacheTest.java b/traffic_monitor/src/test/java/config/CacheTest.java index 8c9ca24..7f1ffc9 100644 --- a/traffic_monitor/src/test/java/config/CacheTest.java +++ b/traffic_monitor/src/test/java/config/CacheTest.java @@ -1,5 +1,25 @@ package config; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.config.Cache; import com.comcast.cdn.traffic_control.traffic_monitor.health.CacheState; import com.comcast.cdn.traffic_control.traffic_monitor.health.HealthDeterminer; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/config/ConfigHandlerTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/config/ConfigHandlerTest.java b/traffic_monitor/src/test/java/config/ConfigHandlerTest.java index c6b7bc5..4b56b3d 100644 --- a/traffic_monitor/src/test/java/config/ConfigHandlerTest.java +++ b/traffic_monitor/src/test/java/config/ConfigHandlerTest.java @@ -1,5 +1,25 @@ package config; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.config.ConfigHandler; import org.apache.commons.io.IOUtils; import org.junit.Before; @@ -79,4 +99,4 @@ public class ConfigHandlerTest { public void itReturnsCorrectPathToDbFile() { assertThat(configHandler.getDbFile("health-config.json").toString(), equalTo("/opt/traffic_monitor/db/health-config.json")); } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/config/ConfigTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/config/ConfigTest.java b/traffic_monitor/src/test/java/config/ConfigTest.java index bc8472a..68e66b2 100644 --- a/traffic_monitor/src/test/java/config/ConfigTest.java +++ b/traffic_monitor/src/test/java/config/ConfigTest.java @@ -1,5 +1,25 @@ package config; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.config.Config; import org.apache.wicket.ajax.json.JSONException; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/config/MonitorConfigTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/config/MonitorConfigTest.java b/traffic_monitor/src/test/java/config/MonitorConfigTest.java index eab5540..0149862 100644 --- a/traffic_monitor/src/test/java/config/MonitorConfigTest.java +++ b/traffic_monitor/src/test/java/config/MonitorConfigTest.java @@ -1,5 +1,25 @@ package config; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.config.MonitorConfig; import org.apache.wicket.ajax.json.JSONObject; import org.junit.Test; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/config/RouterConfigTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/config/RouterConfigTest.java b/traffic_monitor/src/test/java/config/RouterConfigTest.java index 0c6dad0..0031750 100644 --- a/traffic_monitor/src/test/java/config/RouterConfigTest.java +++ b/traffic_monitor/src/test/java/config/RouterConfigTest.java @@ -1,5 +1,25 @@ package config; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.config.Cache; import com.comcast.cdn.traffic_control.traffic_monitor.config.Peer; import com.comcast.cdn.traffic_control.traffic_monitor.config.RouterConfig; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/data/DataPointTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/data/DataPointTest.java b/traffic_monitor/src/test/java/data/DataPointTest.java index c51f365..05588bb 100644 --- a/traffic_monitor/src/test/java/data/DataPointTest.java +++ b/traffic_monitor/src/test/java/data/DataPointTest.java @@ -1,5 +1,25 @@ package data; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.data.DataPoint; import org.junit.Test; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/data/StatisticsLogTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/data/StatisticsLogTest.java b/traffic_monitor/src/test/java/data/StatisticsLogTest.java index 968e560..835dd5d 100644 --- a/traffic_monitor/src/test/java/data/StatisticsLogTest.java +++ b/traffic_monitor/src/test/java/data/StatisticsLogTest.java @@ -1,5 +1,25 @@ package data; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.data.DataPoint; import com.comcast.cdn.traffic_control.traffic_monitor.data.StatisticsLog; import com.comcast.cdn.traffic_control.traffic_monitor.health.DeliveryServiceStateRegistry; @@ -302,4 +322,4 @@ class TimeGetter implements Runnable { e.printStackTrace(); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/health/CacheStateUpdaterTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/health/CacheStateUpdaterTest.java b/traffic_monitor/src/test/java/health/CacheStateUpdaterTest.java index 9316cf5..f0dd1be 100644 --- a/traffic_monitor/src/test/java/health/CacheStateUpdaterTest.java +++ b/traffic_monitor/src/test/java/health/CacheStateUpdaterTest.java @@ -1,5 +1,25 @@ package health; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.config.Cache; import com.comcast.cdn.traffic_control.traffic_monitor.health.CacheState; import com.comcast.cdn.traffic_control.traffic_monitor.health.CacheStateUpdater; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/health/CacheStatisticsClientTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/health/CacheStatisticsClientTest.java b/traffic_monitor/src/test/java/health/CacheStatisticsClientTest.java index caaf24b..53958e9 100644 --- a/traffic_monitor/src/test/java/health/CacheStatisticsClientTest.java +++ b/traffic_monitor/src/test/java/health/CacheStatisticsClientTest.java @@ -1,5 +1,25 @@ package health; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.config.Cache; import com.comcast.cdn.traffic_control.traffic_monitor.health.CacheStateUpdater; import com.comcast.cdn.traffic_control.traffic_monitor.health.CacheStatisticsClient; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/health/DeletemeTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/health/DeletemeTest.java b/traffic_monitor/src/test/java/health/DeletemeTest.java index 46bc636..eb51c35 100644 --- a/traffic_monitor/src/test/java/health/DeletemeTest.java +++ b/traffic_monitor/src/test/java/health/DeletemeTest.java @@ -1,4 +1,24 @@ package health; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + public class DeletemeTest { } http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/java/health/HealthDeterminerTest.java ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/java/health/HealthDeterminerTest.java b/traffic_monitor/src/test/java/health/HealthDeterminerTest.java index ee1d58d..be0e094 100644 --- a/traffic_monitor/src/test/java/health/HealthDeterminerTest.java +++ b/traffic_monitor/src/test/java/health/HealthDeterminerTest.java @@ -1,5 +1,25 @@ package health; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + import com.comcast.cdn.traffic_control.traffic_monitor.config.Cache; import com.comcast.cdn.traffic_control.traffic_monitor.health.HealthDeterminer; import org.apache.wicket.ajax.json.JSONObject; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_monitor/src/test/resources/var/health-params.js ---------------------------------------------------------------------- diff --git a/traffic_monitor/src/test/resources/var/health-params.js b/traffic_monitor/src/test/resources/var/health-params.js index 30617ed..cc34841 100644 --- a/traffic_monitor/src/test/resources/var/health-params.js +++ b/traffic_monitor/src/test/resources/var/health-params.js @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + { "deliveryServices": { "omg-08": { http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/checks/ToCDUCheck.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/checks/ToCDUCheck.pl b/traffic_ops/app/bin/checks/ToCDUCheck.pl index ab3631b..95b6aa5 100755 --- a/traffic_ops/app/bin/checks/ToCDUCheck.pl +++ b/traffic_ops/app/bin/checks/ToCDUCheck.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/checks/ToCHRCheck.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/checks/ToCHRCheck.pl b/traffic_ops/app/bin/checks/ToCHRCheck.pl index a55d2e5..10bf0e6 100755 --- a/traffic_ops/app/bin/checks/ToCHRCheck.pl +++ b/traffic_ops/app/bin/checks/ToCHRCheck.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/checks/ToDSCPCheck.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/checks/ToDSCPCheck.pl b/traffic_ops/app/bin/checks/ToDSCPCheck.pl index 459fdf8..0ff2626 100755 --- a/traffic_ops/app/bin/checks/ToDSCPCheck.pl +++ b/traffic_ops/app/bin/checks/ToDSCPCheck.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/checks/ToDnssecRefresh.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/checks/ToDnssecRefresh.pl b/traffic_ops/app/bin/checks/ToDnssecRefresh.pl index 01f27ee..fad097d 100755 --- a/traffic_ops/app/bin/checks/ToDnssecRefresh.pl +++ b/traffic_ops/app/bin/checks/ToDnssecRefresh.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/checks/ToFQDNCheck.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/checks/ToFQDNCheck.pl b/traffic_ops/app/bin/checks/ToFQDNCheck.pl index a33f2a4..9c1106a8 100644 --- a/traffic_ops/app/bin/checks/ToFQDNCheck.pl +++ b/traffic_ops/app/bin/checks/ToFQDNCheck.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/checks/ToMTUCheck.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/checks/ToMTUCheck.pl b/traffic_ops/app/bin/checks/ToMTUCheck.pl index 40767b5..89c92e8 100755 --- a/traffic_ops/app/bin/checks/ToMTUCheck.pl +++ b/traffic_ops/app/bin/checks/ToMTUCheck.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/checks/ToORTCheck.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/checks/ToORTCheck.pl b/traffic_ops/app/bin/checks/ToORTCheck.pl index 76150be..deb71bb 100755 --- a/traffic_ops/app/bin/checks/ToORTCheck.pl +++ b/traffic_ops/app/bin/checks/ToORTCheck.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/checks/ToPingCheck.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/checks/ToPingCheck.pl b/traffic_ops/app/bin/checks/ToPingCheck.pl index 752c839..b03a19b 100755 --- a/traffic_ops/app/bin/checks/ToPingCheck.pl +++ b/traffic_ops/app/bin/checks/ToPingCheck.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/checks/ToRTRCheck.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/checks/ToRTRCheck.pl b/traffic_ops/app/bin/checks/ToRTRCheck.pl index 42475c0..6e43ba1 100755 --- a/traffic_ops/app/bin/checks/ToRTRCheck.pl +++ b/traffic_ops/app/bin/checks/ToRTRCheck.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/db/setup_kabletown.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/db/setup_kabletown.pl b/traffic_ops/app/bin/db/setup_kabletown.pl index 882551b..f8f6c72 100755 --- a/traffic_ops/app/bin/db/setup_kabletown.pl +++ b/traffic_ops/app/bin/db/setup_kabletown.pl @@ -2,7 +2,6 @@ package main; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/extensions ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/extensions b/traffic_ops/app/bin/extensions index 95f9693..b3d53ae 100755 --- a/traffic_ops/app/bin/extensions +++ b/traffic_ops/app/bin/extensions @@ -1,6 +1,5 @@ #!/usr/bin/perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/routes.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/routes.pl b/traffic_ops/app/bin/routes.pl index 55ac76d..efd2904 100755 --- a/traffic_ops/app/bin/routes.pl +++ b/traffic_ops/app/bin/routes.pl @@ -1,6 +1,5 @@ #!/usr/bin/env perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/start.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/start.pl b/traffic_ops/app/bin/start.pl index 0596b9a..cdd800a 100755 --- a/traffic_ops/app/bin/start.pl +++ b/traffic_ops/app/bin/start.pl @@ -2,7 +2,6 @@ # # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/tests/run_integration_tests.sh ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/tests/run_integration_tests.sh b/traffic_ops/app/bin/tests/run_integration_tests.sh index e10a36b..6f4b878 100755 --- a/traffic_ops/app/bin/tests/run_integration_tests.sh +++ b/traffic_ops/app/bin/tests/run_integration_tests.sh @@ -1,6 +1,5 @@ #!/bin/bash # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/bin/tests/run_unit_tests.sh ---------------------------------------------------------------------- diff --git a/traffic_ops/app/bin/tests/run_unit_tests.sh b/traffic_ops/app/bin/tests/run_unit_tests.sh index 49caded..6ff1c0f 100755 --- a/traffic_ops/app/bin/tests/run_unit_tests.sh +++ b/traffic_ops/app/bin/tests/run_unit_tests.sh @@ -1,6 +1,5 @@ #!/bin/bash # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/conf/misc/riak_search/sslkeys.xml ---------------------------------------------------------------------- diff --git a/traffic_ops/app/conf/misc/riak_search/sslkeys.xml b/traffic_ops/app/conf/misc/riak_search/sslkeys.xml index 90eae37..245b8bc 100644 --- a/traffic_ops/app/conf/misc/riak_search/sslkeys.xml +++ b/traffic_ops/app/conf/misc/riak_search/sslkeys.xml @@ -1,4 +1,24 @@ <?xml version="1.0" encoding="UTF-8" ?> + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + <schema name="schedule" version="1.5"> <fields> <field name="cdn" type="string" indexed="true" stored="true" /> @@ -32,4 +52,4 @@ <!-- Used for the catch all field --> <fieldtype name="ignored" stored="false" indexed="false" multiValued="true" class="solr.StrField" /> </types> -</schema> \ No newline at end of file +</schema> http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/cpanfile ---------------------------------------------------------------------- diff --git a/traffic_ops/app/cpanfile b/traffic_ops/app/cpanfile index 5bd1e0a..a57ea0e 100644 --- a/traffic_ops/app/cpanfile +++ b/traffic_ops/app/cpanfile @@ -1,5 +1,4 @@ # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/db/admin.pl ---------------------------------------------------------------------- diff --git a/traffic_ops/app/db/admin.pl b/traffic_ops/app/db/admin.pl index 968c089..324044e 100755 --- a/traffic_ops/app/db/admin.pl +++ b/traffic_ops/app/db/admin.pl @@ -1,6 +1,5 @@ #!/usr/bin/env perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/db/dbconf.yml ---------------------------------------------------------------------- diff --git a/traffic_ops/app/db/dbconf.yml b/traffic_ops/app/db/dbconf.yml index 99ded75..ed624e7 100755 --- a/traffic_ops/app/db/dbconf.yml +++ b/traffic_ops/app/db/dbconf.yml @@ -1,6 +1,5 @@ #!/usr/bin/env perl # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/db/migration_readme.txt ---------------------------------------------------------------------- diff --git a/traffic_ops/app/db/migration_readme.txt b/traffic_ops/app/db/migration_readme.txt index febe4fe..7318d33 100644 --- a/traffic_ops/app/db/migration_readme.txt +++ b/traffic_ops/app/db/migration_readme.txt @@ -1,5 +1,4 @@ # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/db/reset.sh ---------------------------------------------------------------------- diff --git a/traffic_ops/app/db/reset.sh b/traffic_ops/app/db/reset.sh index 2c40dd1..751fad7 100644 --- a/traffic_ops/app/db/reset.sh +++ b/traffic_ops/app/db/reset.sh @@ -1,6 +1,5 @@ mysql twelve_monkeys_test -utwelve_monkeys -ptwelve -e 'drop database twelve_monkeys_test; create database twelve_monkeys_test;'; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/db/seeds.sql ---------------------------------------------------------------------- diff --git a/traffic_ops/app/db/seeds.sql b/traffic_ops/app/db/seeds.sql index 1ba2700..f76a63a 100644 --- a/traffic_ops/app/db/seeds.sql +++ b/traffic_ops/app/db/seeds.sql @@ -1,5 +1,4 @@ /* - Copyright 2015 Comcast Cable Communications Management, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -159,6 +158,21 @@ insert into parameter (name, config_file, value) select * from (select 'DsStats' insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'tps_total') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'tps_total') limit 1 ON CONFLICT DO NOTHING; +insert into parameter (name, config_file, value) select * from (select 'CacheStats', 'traffic_stats.config', 'bandwidth') as temp where not exists (select name from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'bandwidth') limit 1; +insert into parameter (name, config_file, value) select * from (select 'CacheStats', 'traffic_stats.config', 'maxKbps') as temp where not exists (select name from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'maxKbps') limit 1; +insert into parameter (name, config_file, value) select * from (select 'CacheStats', 'traffic_stats.config', 'ats.proxy.process.http.current_client_connections') as temp where not exists (select name from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'ats.proxy.process.http.current_client_connections') limit 1; +insert into parameter (name, config_file, value) select * from (select 'CacheStats', 'traffic_stats.config', 'ats.proxy.process.cache.volume_1.wrap_count') as temp where not exists (select name from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'ats.proxy.process.cache.volume_1.wrap_count') limit 1; +insert into parameter (name, config_file, value) select * from (select 'CacheStats', 'traffic_stats.config', 'ats.proxy.process.cache.volume_2.wrap_count') as temp where not exists (select name from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'ats.proxy.process.cache.volume_2.wrap_count') limit 1; +insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'kbps') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'kbps') limit 1; +insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'tps_2xx') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'tps_2xx') limit 1; +insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'status_4xx') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'status_4xx') limit 1; +insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'status_5xx') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'status_5xx') limit 1; +insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'tps_3xx') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'tps_3xx') limit 1; +insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'tps_4xx') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'tps_4xx') limit 1; +insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'tps_5xx') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'tps_5xx') limit 1; +insert into parameter (name, config_file, value) select * from (select 'DsStats', 'traffic_stats.config', 'tps_total') as temp where not exists (select name from parameter where name = 'DsStats' and config_file = 'traffic_stats.config' and value = 'tps_total') limit 1; + + insert into profile_parameter (profile, parameter) values ( (select id from profile where name = 'TRAFFIC_STATS'), (select id from parameter where name = 'CacheStats' and config_file = 'traffic_stats.config' and value = 'bandwidth') http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/db/setup_migrations.sql ---------------------------------------------------------------------- diff --git a/traffic_ops/app/db/setup_migrations.sql b/traffic_ops/app/db/setup_migrations.sql index fabfb9b..84ff88d 100644 --- a/traffic_ops/app/db/setup_migrations.sql +++ b/traffic_ops/app/db/setup_migrations.sql @@ -1,5 +1,4 @@ /* - Copyright 2015 Comcast Cable Communications Management, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/ApiDocs.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/ApiDocs.pm b/traffic_ops/app/lib/API/ApiDocs.pm index bd54fab..927c29a 100644 --- a/traffic_ops/app/lib/API/ApiDocs.pm +++ b/traffic_ops/app/lib/API/ApiDocs.pm @@ -1,6 +1,5 @@ package API::ApiDocs; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Asn.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Asn.pm b/traffic_ops/app/lib/API/Asn.pm index 2ec4b53..080099a 100644 --- a/traffic_ops/app/lib/API/Asn.pm +++ b/traffic_ops/app/lib/API/Asn.pm @@ -1,6 +1,5 @@ package API::Asn; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Cachegroup.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Cachegroup.pm b/traffic_ops/app/lib/API/Cachegroup.pm index b8a5752..7066b6c 100644 --- a/traffic_ops/app/lib/API/Cachegroup.pm +++ b/traffic_ops/app/lib/API/Cachegroup.pm @@ -1,6 +1,5 @@ package API::Cachegroup; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -300,7 +299,7 @@ sub delete { if ( defined($parent_cgs) ) { return $self->alert("This cachegroup is currently used as a parent cachegroup."); } - + my $secondary_parent_cgs = $self->db->resultset('Cachegroup')->find( { secondary_parent_cachegroup_id => $cg->id } ); if ( defined($secondary_parent_cgs) ) { return $self->alert("This cachegroup is currently used as a secondary parent cachegroup."); @@ -310,7 +309,7 @@ sub delete { if ( defined($asns) ) { return $self->alert("This cachegroup is currently used by one or more ASNs."); } - + my $rs = $cg->delete(); if ($rs) { return $self->success_message("Cachegroup deleted."); http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Cachegroup2.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Cachegroup2.pm b/traffic_ops/app/lib/API/Cachegroup2.pm index a1184fb..fa6b1ab 100644 --- a/traffic_ops/app/lib/API/Cachegroup2.pm +++ b/traffic_ops/app/lib/API/Cachegroup2.pm @@ -1,6 +1,5 @@ package API::Cachegroup2; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/CachegroupParameter.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/CachegroupParameter.pm b/traffic_ops/app/lib/API/CachegroupParameter.pm index 3cf3c84..8111309 100644 --- a/traffic_ops/app/lib/API/CachegroupParameter.pm +++ b/traffic_ops/app/lib/API/CachegroupParameter.pm @@ -1,6 +1,5 @@ package API::CachegroupParameter; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Cdn.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Cdn.pm b/traffic_ops/app/lib/API/Cdn.pm index 320ac43..e8cfd8c 100644 --- a/traffic_ops/app/lib/API/Cdn.pm +++ b/traffic_ops/app/lib/API/Cdn.pm @@ -1,7 +1,6 @@ package API::Cdn; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -109,7 +108,7 @@ sub create { my $value = { name => $params->{name}, }; if ( defined( $params->{dnssecEnabled} ) ) { - $value->{dnssec_enabled} = $params->{dnssecEnabled}; + $value->{dnssec_enabled} = lc( $params->{dnssecEnabled} ) ne 'false' ? 1 : 0; } my $insert = $self->db->resultset('Cdn')->create($value); @@ -120,7 +119,7 @@ sub create { my $response; $response->{id} = $rs->id; $response->{name} = $rs->name; - $response->{dnssecEnabled} = $rs->dnssec_enabled; + $response->{dnssecEnabled} = \$rs->dnssec_enabled; &log( $self, "Created CDN with id: " . $rs->id . " and name: " . $rs->name, "APICHANGE" ); return $self->success( $response, "cdn was created." ); } @@ -157,7 +156,7 @@ sub update { my $value = { name => $params->{name}, }; if ( defined( $params->{dnssecEnabled} ) ) { - $value->{dnssec_enabled} = $params->{dnssecEnabled}; + $value->{dnssec_enabled} = lc( $params->{dnssecEnabled} ) ne 'false' ? 1 : 0; } my $rs = $cdn->update($value); @@ -165,7 +164,7 @@ sub update { my $response; $response->{id} = $rs->id; $response->{name} = $rs->name; - $response->{dnssecEnabled} = $rs->dnssec_enabled; + $response->{dnssecEnabled} = \$rs->dnssec_enabled; &log( $self, "Updated CDN name '" . $rs->name . "' for id: " . $rs->id, "APICHANGE" ); return $self->success( $response, "CDN update was successful." ); } @@ -203,6 +202,37 @@ sub delete { return $self->success_message("cdn was deleted."); } +sub delete_by_name { + my $self = shift; + my $cdn_name = $self->param('name'); + + if ( !&is_oper($self) ) { + return $self->forbidden(); + } + + my $cdn = $self->db->resultset('Cdn')->find( { name => $cdn_name } ); + if ( !defined($cdn) ) { + return $self->not_found(); + } + my $id = $cdn->id; + + my $rs = $self->db->resultset('Server')->search( { cdn_id => $id } ); + if ( $rs->count() > 0 ) { + $self->app->log->error("Failed to delete cdn id = $id has servers"); + return $self->alert("Failed to delete cdn id = $id has servers"); + } + + $rs = $self->db->resultset('Deliveryservice')->search( { cdn_id => $id } ); + if ( $rs->count() > 0 ) { + $self->app->log->error("Failed to delete cdn id = $id has delivery services"); + return $self->alert("Failed to delete cdn id = $id has delivery services"); + } + + $cdn->delete(); + &log( $self, "Delete cdn " . $cdn_name, "APICHANGE" ); + return $self->success_message("cdn was deleted."); +} + sub configs_monitoring { my $self = shift; my $cdn_name = $self->param('name'); http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/ChangeLog.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/ChangeLog.pm b/traffic_ops/app/lib/API/ChangeLog.pm index 770bbbb..c5816b7 100644 --- a/traffic_ops/app/lib/API/ChangeLog.pm +++ b/traffic_ops/app/lib/API/ChangeLog.pm @@ -1,6 +1,5 @@ package API::ChangeLog; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm b/traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm index cd6d983..d7e7197 100644 --- a/traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm +++ b/traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm @@ -1,6 +1,5 @@ package API::DeliveryService::KeysUrlSig; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/DeliveryService/SslKeys.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/DeliveryService/SslKeys.pm b/traffic_ops/app/lib/API/DeliveryService/SslKeys.pm index a09b816..e7cf456 100644 --- a/traffic_ops/app/lib/API/DeliveryService/SslKeys.pm +++ b/traffic_ops/app/lib/API/DeliveryService/SslKeys.pm @@ -1,6 +1,5 @@ package API::DeliveryService::SslKeys; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/DeliveryService/Steering.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/DeliveryService/Steering.pm b/traffic_ops/app/lib/API/DeliveryService/Steering.pm index 6f6f350..c8f08f4 100644 --- a/traffic_ops/app/lib/API/DeliveryService/Steering.pm +++ b/traffic_ops/app/lib/API/DeliveryService/Steering.pm @@ -1,6 +1,5 @@ package API::DeliveryService::Steering; # -# Copyright 2016 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/DeliveryServiceMatches.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/DeliveryServiceMatches.pm b/traffic_ops/app/lib/API/DeliveryServiceMatches.pm index 9d1553d..3234667 100644 --- a/traffic_ops/app/lib/API/DeliveryServiceMatches.pm +++ b/traffic_ops/app/lib/API/DeliveryServiceMatches.pm @@ -1,6 +1,5 @@ package API::DeliveryServiceMatches; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/DeliveryServiceRegexes.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/DeliveryServiceRegexes.pm b/traffic_ops/app/lib/API/DeliveryServiceRegexes.pm index a3ebf60..4688f3a 100644 --- a/traffic_ops/app/lib/API/DeliveryServiceRegexes.pm +++ b/traffic_ops/app/lib/API/DeliveryServiceRegexes.pm @@ -1,6 +1,5 @@ package API::DeliveryServiceRegexes; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/DeliveryServiceServer.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/DeliveryServiceServer.pm b/traffic_ops/app/lib/API/DeliveryServiceServer.pm index d15d438..0aec9cd 100644 --- a/traffic_ops/app/lib/API/DeliveryServiceServer.pm +++ b/traffic_ops/app/lib/API/DeliveryServiceServer.pm @@ -1,6 +1,5 @@ package API::DeliveryServiceServer; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Deliveryservice.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Deliveryservice.pm b/traffic_ops/app/lib/API/Deliveryservice.pm index 8a69e00..27ee53c 100644 --- a/traffic_ops/app/lib/API/Deliveryservice.pm +++ b/traffic_ops/app/lib/API/Deliveryservice.pm @@ -1,6 +1,5 @@ package API::Deliveryservice; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,19 +49,6 @@ sub index { my $rs_data = $self->db->resultset("Deliveryservice")->search( \%criteria, { order_by => 'me.' . $orderby } ); while ( my $row = $rs_data->next ) { - my $ds_regexes = $row->deliveryservice_regexes; - my @matchlist = (); - - while ( my $ds_regex = $ds_regexes->next ) { - push( - @matchlist, { - type => $ds_regex->regex->type->name, - pattern => $ds_regex->regex->pattern, - setNumber => $ds_regex->set_number - } - ); - } - my $cdn_domain = $self->get_cdn_domain_by_ds_id( $row->id ); my $regexp_set = &UI::DeliveryService::get_regexp_set( $self, $row->id ); my @example_urls = &UI::DeliveryService::get_example_urls( $self, $row->id, $regexp_set, $row, $cdn_domain, $row->protocol ); @@ -99,7 +85,6 @@ sub index { "longDesc" => $row->long_desc, "longDesc1" => $row->long_desc_1, "longDesc2" => $row->long_desc_2, - "matchList" => \@matchlist, "maxDnsAnswers" => $row->max_dns_answers, "midHeaderRewrite" => $row->mid_header_rewrite, "missLat" => $row->miss_lat, http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Deliveryservice2.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Deliveryservice2.pm b/traffic_ops/app/lib/API/Deliveryservice2.pm index bd78959..946b415 100644 --- a/traffic_ops/app/lib/API/Deliveryservice2.pm +++ b/traffic_ops/app/lib/API/Deliveryservice2.pm @@ -1,6 +1,5 @@ package API::Deliveryservice2; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Division.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Division.pm b/traffic_ops/app/lib/API/Division.pm index c59e345..492be47 100644 --- a/traffic_ops/app/lib/API/Division.pm +++ b/traffic_ops/app/lib/API/Division.pm @@ -1,5 +1,23 @@ package API::Division; +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + use UI::Utils; use UI::Division; use Mojo::Base 'Mojolicious::Controller'; @@ -24,6 +42,25 @@ sub index { $self->success( \@data ); } +sub index_by_name { + my $self = shift; + my $name = $self->param('name'); + + my $rs_data = $self->db->resultset("Division")->search( { name => $name } ); + my @data = (); + while ( my $row = $rs_data->next ) { + push( + @data, { + "id" => $row->id, + "name" => $row->name, + "lastUpdated" => $row->last_updated + } + ); + } + $self->success( \@data ); +} + + sub show { my $self = shift; my $id = $self->param('id'); @@ -142,5 +179,33 @@ sub delete { } } +sub delete_by_name { + my $self = shift; + my $name = $self->param('name'); + + if ( !&is_oper($self) ) { + return $self->forbidden(); + } + + my $division = $self->db->resultset('Division')->find( { name => $name } ); + if ( !defined($division) ) { + return $self->not_found(); + } + + my $regions = $self->db->resultset('Region')->find( { division => $division->id } ); + if ( defined($regions) ) { + return $self->alert("This division is currently used by regions."); + } + + + my $rs = $division->delete(); + if ($rs) { + return $self->success_message("Division deleted."); + } else { + return $self->alert( "Division delete failed." ); + } +} + + 1; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Federation.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Federation.pm b/traffic_ops/app/lib/API/Federation.pm index fc8cbd1..557de3a 100644 --- a/traffic_ops/app/lib/API/Federation.pm +++ b/traffic_ops/app/lib/API/Federation.pm @@ -1,6 +1,5 @@ package API::Federation; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/HwInfo.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/HwInfo.pm b/traffic_ops/app/lib/API/HwInfo.pm index c34518a..43495fc 100644 --- a/traffic_ops/app/lib/API/HwInfo.pm +++ b/traffic_ops/app/lib/API/HwInfo.pm @@ -1,6 +1,5 @@ package API::HwInfo; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Job.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Job.pm b/traffic_ops/app/lib/API/Job.pm index e171660..cf2608e 100644 --- a/traffic_ops/app/lib/API/Job.pm +++ b/traffic_ops/app/lib/API/Job.pm @@ -1,7 +1,6 @@ package API::Job; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Keys.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Keys.pm b/traffic_ops/app/lib/API/Keys.pm index c1f5788..967c126 100644 --- a/traffic_ops/app/lib/API/Keys.pm +++ b/traffic_ops/app/lib/API/Keys.pm @@ -1,6 +1,5 @@ package API::Keys; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Parameter.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Parameter.pm b/traffic_ops/app/lib/API/Parameter.pm index 216c09b..218d003 100644 --- a/traffic_ops/app/lib/API/Parameter.pm +++ b/traffic_ops/app/lib/API/Parameter.pm @@ -1,6 +1,5 @@ package API::Parameter; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/PhysLocation.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/PhysLocation.pm b/traffic_ops/app/lib/API/PhysLocation.pm index ab9dc22..6e2de39 100644 --- a/traffic_ops/app/lib/API/PhysLocation.pm +++ b/traffic_ops/app/lib/API/PhysLocation.pm @@ -1,6 +1,5 @@ package API::PhysLocation; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -249,7 +248,7 @@ sub create { } } -sub create_for_reg { +sub create_for_region { my $self = shift; my $region_name = $self->param('region_name'); my $params = $self->req->json; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Profile.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Profile.pm b/traffic_ops/app/lib/API/Profile.pm index 1dc6cdc..34b4a02 100644 --- a/traffic_ops/app/lib/API/Profile.pm +++ b/traffic_ops/app/lib/API/Profile.pm @@ -1,6 +1,5 @@ package API::Profile; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/ProfileParameter.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/ProfileParameter.pm b/traffic_ops/app/lib/API/ProfileParameter.pm index 2495c3f..c94c897 100644 --- a/traffic_ops/app/lib/API/ProfileParameter.pm +++ b/traffic_ops/app/lib/API/ProfileParameter.pm @@ -1,6 +1,5 @@ package API::ProfileParameter; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Region.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Region.pm b/traffic_ops/app/lib/API/Region.pm index 77f370a..a871a2b 100644 --- a/traffic_ops/app/lib/API/Region.pm +++ b/traffic_ops/app/lib/API/Region.pm @@ -1,6 +1,5 @@ package API::Region; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,6 +43,27 @@ sub index { $self->success( \@data ); } +sub index_by_name { + my $self = shift; + my $name = $self->param('name'); + + my $rs_data = $self->db->resultset("Region")->search( { 'me.name' => $name }, { prefetch => ['division'] } ); + my @data = (); + while ( my $row = $rs_data->next ) { + my $division = { "id" => $row->division->id, + "name" => $row->division->name + }; + push( + @data, { + "id" => $row->id, + "name" => $row->name, + "division" => $division, + } + ); + } + $self->success( \@data ); +} + sub show { my $self = shift; my $id = $self->param('id'); @@ -159,7 +179,7 @@ sub create { } -sub create_for_div { +sub create_for_division { my $self = shift; my $division_name = $self->param('division_name'); my $params = $self->req->json; @@ -221,5 +241,26 @@ sub delete { } } +sub delete_by_name { + my $self = shift; + my $name = $self->param('name'); + + if ( !&is_oper($self) ) { + return $self->forbidden(); + } + + my $region = $self->db->resultset('Region')->find( { name => $name } ); + if ( !defined($region) ) { + return $self->not_found(); + } + + my $rs = $region->delete(); + if ($rs) { + return $self->success_message("Region deleted."); + } else { + return $self->alert( "Region delete failed." ); + } +} + 1; http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Riak.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Riak.pm b/traffic_ops/app/lib/API/Riak.pm index 5ae55fd..cfa1c4a 100644 --- a/traffic_ops/app/lib/API/Riak.pm +++ b/traffic_ops/app/lib/API/Riak.pm @@ -1,6 +1,5 @@ package API::Riak; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Role.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Role.pm b/traffic_ops/app/lib/API/Role.pm index c76880f..9cd0c5b 100644 --- a/traffic_ops/app/lib/API/Role.pm +++ b/traffic_ops/app/lib/API/Role.pm @@ -1,6 +1,5 @@ package API::Role; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Server.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Server.pm b/traffic_ops/app/lib/API/Server.pm index c9b762c..c7c7cab 100644 --- a/traffic_ops/app/lib/API/Server.pm +++ b/traffic_ops/app/lib/API/Server.pm @@ -1,6 +1,5 @@ package API::Server; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/Server2.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/Server2.pm b/traffic_ops/app/lib/API/Server2.pm index b706e59..b13fba5 100644 --- a/traffic_ops/app/lib/API/Server2.pm +++ b/traffic_ops/app/lib/API/Server2.pm @@ -1,6 +1,5 @@ package API::Server2; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/ServerCheck.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/ServerCheck.pm b/traffic_ops/app/lib/API/ServerCheck.pm index 1ac194f..34dd6a7 100644 --- a/traffic_ops/app/lib/API/ServerCheck.pm +++ b/traffic_ops/app/lib/API/ServerCheck.pm @@ -1,7 +1,6 @@ package API::ServerCheck; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/StaticDnsEntry.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/StaticDnsEntry.pm b/traffic_ops/app/lib/API/StaticDnsEntry.pm index 69d8a4f..938c2b4 100644 --- a/traffic_ops/app/lib/API/StaticDnsEntry.pm +++ b/traffic_ops/app/lib/API/StaticDnsEntry.pm @@ -1,6 +1,5 @@ package API::StaticDnsEntry; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/be5ab888/traffic_ops/app/lib/API/StatsSummary.pm ---------------------------------------------------------------------- diff --git a/traffic_ops/app/lib/API/StatsSummary.pm b/traffic_ops/app/lib/API/StatsSummary.pm index ddf6e1c..afe2c97 100644 --- a/traffic_ops/app/lib/API/StatsSummary.pm +++ b/traffic_ops/app/lib/API/StatsSummary.pm @@ -1,6 +1,5 @@ package API::StatsSummary; # -# Copyright 2015 Comcast Cable Communications Management, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.