From f0bd7f421948415b1c2f05cb39674f57f72218e0 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Mon, 26 Oct 2020 09:59:09 -0400 Subject: Submit Policy Tutorials So app developers can more easily download and test client code etc. Issue-ID: POLICY-2876 Change-Id: I360cd0d637150cd0c2353c6284803f4438e96556 Signed-off-by: Pamela Dragosh --- .../src/main/docker/config/db/db.conf | 20 +++++++++++++++++ .../src/main/docker/config/db/db.sh | 26 ++++++++++++++++++++++ .../src/main/docker/config/sim/simParameters.json | 15 +++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 tutorials/tutorial-xacml-application/src/main/docker/config/db/db.conf create mode 100644 tutorials/tutorial-xacml-application/src/main/docker/config/db/db.sh create mode 100644 tutorials/tutorial-xacml-application/src/main/docker/config/sim/simParameters.json (limited to 'tutorials/tutorial-xacml-application/src/main/docker/config') diff --git a/tutorials/tutorial-xacml-application/src/main/docker/config/db/db.conf b/tutorials/tutorial-xacml-application/src/main/docker/config/db/db.conf new file mode 100644 index 00000000..42f35844 --- /dev/null +++ b/tutorials/tutorial-xacml-application/src/main/docker/config/db/db.conf @@ -0,0 +1,20 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +MYSQL_ROOT_PASSWORD=secret +MYSQL_USER=policy_user +MYSQL_PASSWORD=policy_user \ No newline at end of file diff --git a/tutorials/tutorial-xacml-application/src/main/docker/config/db/db.sh b/tutorials/tutorial-xacml-application/src/main/docker/config/db/db.sh new file mode 100644 index 00000000..499764df --- /dev/null +++ b/tutorials/tutorial-xacml-application/src/main/docker/config/db/db.sh @@ -0,0 +1,26 @@ +#!/bin/bash -xv +# ============LICENSE_START======================================================= +# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +for db in policyadmin operationshistory +do + mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};" + mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;" +done + +mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;" diff --git a/tutorials/tutorial-xacml-application/src/main/docker/config/sim/simParameters.json b/tutorials/tutorial-xacml-application/src/main/docker/config/sim/simParameters.json new file mode 100644 index 00000000..bd435201 --- /dev/null +++ b/tutorials/tutorial-xacml-application/src/main/docker/config/sim/simParameters.json @@ -0,0 +1,15 @@ +{ + "dmaapProvider": { + "name": "DMaaP simulator", + "topicSweepSec": 300 + }, + "restServers": [ + { + "name": "DMaaP simulator", + "providerClass": "org.onap.policy.models.sim.dmaap.rest.DmaapSimRestControllerV1", + "host": "0.0.0.0", + "port": 3904, + "https": false + } + ] +} \ No newline at end of file -- cgit 1.2.3-korg