You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2018/06/14 18:05:30 UTC

[trafficcontrol] 18/20: remove unused profile (for now)

This is an automated email from the ASF dual-hosted git repository.

dewrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 81e0b34c8b5c0d266ca854a961e92c759ce3593a
Author: Dan Kirkwood <da...@apache.org>
AuthorDate: Thu Jun 14 10:49:34 2018 -0600

    remove unused profile (for now)
---
 infrastructure/cdn-in-a-box/traffic_ops/Dockerfile |  1 -
 .../traffic_ops/profile.origin.traffic_ops         | 18 ----------
 infrastructure/cdn-in-a-box/traffic_ops/run.sh     | 40 ----------------------
 3 files changed, 59 deletions(-)

diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
index dd4ea75..36b3c06 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
@@ -65,7 +65,6 @@ RUN echo "{\"user\": \"riakuser\",\"password\": \"$TRAFFIC_VAULT_PASS\"}" > /opt
 EXPOSE 443
 WORKDIR /opt/traffic_ops/app
 ENV MOJO_MODE production
-ADD profile.origin.traffic_ops /
 
 ADD adduser.pl /
 ADD config.sh /
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/profile.origin.traffic_ops b/infrastructure/cdn-in-a-box/traffic_ops/profile.origin.traffic_ops
deleted file mode 100644
index f655f89..0000000
--- a/infrastructure/cdn-in-a-box/traffic_ops/profile.origin.traffic_ops
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-    "parameters": [
-        {
-            "config_file": "CRConfig.json",
-            "name": "domain_name",
-            "value": "{{.Domain}}"
-        },
-        {
-            "config_file": "parent.config",
-            "name": "weight",
-            "value": "1.0"
-        }
-    ],
-    "profile": {
-        "description": "Multi site origin profile 1",
-        "name": "ORG1_CDN1"
-    }
-}
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/run.sh b/infrastructure/cdn-in-a-box/traffic_ops/run.sh
index 7897d02..7126ac7 100755
--- a/infrastructure/cdn-in-a-box/traffic_ops/run.sh
+++ b/infrastructure/cdn-in-a-box/traffic_ops/run.sh
@@ -70,43 +70,3 @@ cd $TO_DIR && \
 
 cd $TO_DIR && $TO_DIR/local/bin/hypnotoad script/cdn
 exec tail -f /var/log/traffic_ops/traffic_ops.log
-
-init() {
-	TRAFFIC_OPS_URI="https://localhost"
-
-	COOKIE="$(curl -v -s -k -X POST --data '{ "u":"'"$ADMIN_USER"'", "p":"'"$ADMIN_PASS"'" }' $TRAFFIC_OPS_URI/api/1.2/user/login 2>&1 | grep 'Set-Cookie' | sed -e 's/.*mojolicious=\(.*\); expires.*/\1/')"
-	echo "Got cookie: $COOKIE"
-
-	TMP_DOMAIN=$DOMAIN
-	sed -i -- "s/{{.Domain}}/$TMP_DOMAIN/g" /profile.origin.traffic_ops
-	echo "Got domain: $TMP_DOMAIN"
-
-	echo "Importing origin"
-	curl -v -k -X POST -H "Cookie: mojolicious=$COOKIE" -F "filename=profile.origin.traffic_ops" -F "profile_to_import=@/profile.origin.traffic_ops" $TRAFFIC_OPS_URI/profile/doImport
-
-	curl -v -k -X POST -H "Cookie: mojolicious=$COOKIE" --data-urlencode "division.name=East" $TRAFFIC_OPS_URI/division/create
-	TMP_DIVISION_ID="$(curl -s -k -X GET -H "Cookie: mojolicious=$COOKIE" $TRAFFIC_OPS_URI/region/add | grep --color=never -oE "<option value=\"[0-9]+\">East</option>" | grep --color=never -oE "[0-9]+")"
-	echo "Got division ID: $TMP_DIVISION_ID"
-
-	curl -v -k -X POST -H "Cookie: mojolicious=$COOKIE" --data-urlencode "region.name=Eastish" --data-urlencode "region.division_id=$TMP_DIVISION_ID" $TRAFFIC_OPS_URI/region/create
-	TMP_REGION_ID="$(curl -s -k -X GET -H "Cookie: mojolicious=$COOKIE" $TRAFFIC_OPS_URI/api/1.2/regions.json | python -c 'import json,sys;obj=json.load(sys.stdin);match=[x["id"] for x in obj["response"] if x["name"]=="Eastish"]; print match[0]')"
-	echo "Got region ID: $TMP_REGION_ID"
-
-	TMP_CACHEGROUP_TYPE="$(curl -s -k -X GET -H "Cookie: mojolicious=$COOKIE" $TRAFFIC_OPS_URI/api/1.2/types.json | python -c 'import json,sys;obj=json.load(sys.stdin);match=[x["id"] for x in obj["response"] if x["name"]=="MID_LOC"]; print match[0]')"
-	echo "Got cachegroup type ID: $TMP_CACHEGROUP_TYPE"
-
-	curl -v -k -X POST -H "Cookie: mojolicious=$COOKIE" --data-urlencode "cg_data.name=mid-east" --data-urlencode "cg_data.short_name=east" --data-urlencode "cg_data.latitude=0" --data-urlencode "cg_data.longitude=0" --data-urlencode "cg_data.parent_cachegroup_id=-1" --data-urlencode "cg_data.type=$TMP_CACHEGROUP_TYPE" $TRAFFIC_OPS_URI/cachegroup/create
-	TMP_CACHEGROUP_ID="$(curl -s -k -X GET -H "Cookie: mojolicious=$COOKIE" $TRAFFIC_OPS_URI/api/1.2/cachegroups.json | python -c 'import json,sys;obj=json.load(sys.stdin);match=[x["id"] for x in obj["response"] if x["name"]=="mid-east"]; print match[0]')"
-	echo "Got cachegroup ID: $TMP_CACHEGROUP_ID"
-
-	TMP_CACHEGROUP_EDGE_TYPE="$(curl -s -k -X GET -H "Cookie: mojolicious=$COOKIE" $TRAFFIC_OPS_URI/api/1.2/types.json | python -c 'import json,sys;obj=json.load(sys.stdin);match=[x["id"] for x in obj["response"] if x["name"]=="EDGE_LOC"]; print match[0]')"
-	echo "Got cachegroup type ID: $TMP_CACHEGROUP_EDGE_TYPE"
-
-	curl -v -k -X POST -H "Cookie: mojolicious=$COOKIE" --data-urlencode "cg_data.name=edge-east" --data-urlencode "cg_data.short_name=eeast" --data-urlencode "cg_data.latitude=0" --data-urlencode "cg_data.longitude=0" --data-urlencode "cg_data.parent_cachegroup_id=$TMP_CACHEGROUP_ID" --data-urlencode "cg_data.type=$TMP_CACHEGROUP_EDGE_TYPE" $TRAFFIC_OPS_URI/cachegroup/create
-	TMP_CACHEGROUP_EDGE_ID="$(curl -s -k -X GET -H "Cookie: mojolicious=$COOKIE" $TRAFFIC_OPS_URI/api/1.2/cachegroups.json | python -c 'import json,sys;obj=json.load(sys.stdin);match=[x["id"] for x in obj["response"] if x["name"]=="edge-east"]; print match[0]')"
-	echo "Got cachegroup edge ID: $TMP_CACHEGROUP_EDGE_ID"
-
-	curl -v -k -X POST -H "Cookie: mojolicious=$COOKIE" --data-urlencode "location.name=plocation-nyc-1" --data-urlencode "location.short_name=nyc" --data-urlencode "location.address=1 Main Street" --data-urlencode "location.city=nyc" --data-urlencode "location.state=NY" --data-urlencode "location.zip=12345" --data-urlencode "location.poc=" --data-urlencode "location.phone=" --data-urlencode "location.email=no@no.no" --data-urlencode "location.comments=" --data-urlencode "location.region=$T [...]
-
-	echo "INITIALIZED=1" >> /etc/environment
-}

-- 
To stop receiving notification emails like this one, please contact
dewrich@apache.org.