Updated Branches: refs/heads/master d720bd9b5 -> 989975808
Adding rest-api client scripts to deploy partitions, policies, cartridges and to subscribe to services Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/98997580 Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/98997580 Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/98997580 Branch: refs/heads/master Commit: 989975808d52e0381cd79db66791ad35aaca8a9b Parents: d720bd9 Author: Imesh Gunaratne <[email protected]> Authored: Tue Dec 24 17:18:48 2013 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Tue Dec 24 17:18:48 2013 +0530 ---------------------------------------------------------------------- .../rest-api-client/deploy-autoscale-policy.sh | 31 ++++++++++++++++++++ tools/rest-api-client/deploy-cartridge.sh | 31 ++++++++++++++++++++ .../rest-api-client/deploy-deployment-policy.sh | 31 ++++++++++++++++++++ .../deploy-load-balancer-cartridge.sh | 31 ++++++++++++++++++++ tools/rest-api-client/deploy-partition.sh | 31 ++++++++++++++++++++ tools/rest-api-client/subscribe.sh | 31 ++++++++++++++++++++ 6 files changed, 186 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/98997580/tools/rest-api-client/deploy-autoscale-policy.sh ---------------------------------------------------------------------- diff --git a/tools/rest-api-client/deploy-autoscale-policy.sh b/tools/rest-api-client/deploy-autoscale-policy.sh new file mode 100644 index 0000000..da8fd9c --- /dev/null +++ b/tools/rest-api-client/deploy-autoscale-policy.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------- +# This script could be used to deploy autoscale policy definitions via the rest-api. +# + +# Parameter values +stratos_manager_host= +stratos_manager_https_port= +username=admin +password=admin +json_file="/path/to/autoscale-policy.json" + +# Send request +curl -X POST -H "Content-Type: application/json" -d @'${json_file}' -k -v -u ${username}:${password} https://${stratos_manager_host}:${stratos_manager_https_port}/stratos/admin/policy/autoscale \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/98997580/tools/rest-api-client/deploy-cartridge.sh ---------------------------------------------------------------------- diff --git a/tools/rest-api-client/deploy-cartridge.sh b/tools/rest-api-client/deploy-cartridge.sh new file mode 100644 index 0000000..49f13ea --- /dev/null +++ b/tools/rest-api-client/deploy-cartridge.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------- +# This script could be used to deploy cartridge definitions via the rest-api. +# + +# Parameter values +stratos_manager_host= +stratos_manager_https_port= +username=admin +password=admin +json_file="/path/to/cartridge.json" + +# Send request +curl -X POST -H "Content-Type: application/json" -d @'${json_file}' -k -v -u ${username}:${password} https://${stratos_manager_host}:${stratos_manager_https_port}/stratos/admin/cartridge/definition \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/98997580/tools/rest-api-client/deploy-deployment-policy.sh ---------------------------------------------------------------------- diff --git a/tools/rest-api-client/deploy-deployment-policy.sh b/tools/rest-api-client/deploy-deployment-policy.sh new file mode 100644 index 0000000..96e617e --- /dev/null +++ b/tools/rest-api-client/deploy-deployment-policy.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------- +# This script could be used to deploy deployment policy definitions via the rest-api. +# + +# Parameter values +stratos_manager_host= +stratos_manager_https_port= +username=admin +password=admin +json_file="/path/to/deployment-policy.json" + +# Send request +curl -X POST -H "Content-Type: application/json" -d @'${json_file}' -k -v -u ${username}:${password} https://${stratos_manager_host}:${stratos_manager_https_port}/stratos/admin/policy/deployment \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/98997580/tools/rest-api-client/deploy-load-balancer-cartridge.sh ---------------------------------------------------------------------- diff --git a/tools/rest-api-client/deploy-load-balancer-cartridge.sh b/tools/rest-api-client/deploy-load-balancer-cartridge.sh new file mode 100644 index 0000000..82318c7 --- /dev/null +++ b/tools/rest-api-client/deploy-load-balancer-cartridge.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------- +# This script could be used to deploy load balancer cartridge definitions via the rest-api. +# + +# Parameter values +stratos_manager_host= +stratos_manager_https_port= +username=admin +password=admin +json_file="/path/to/load-balancer-cartridge.json" + +# Send request +curl -X POST -H "Content-Type: application/json" -d @'${json_file}' -k -v -u ${username}:${password} https://${stratos_manager_host}:${stratos_manager_https_port}/stratos/admin/cartridge/definition \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/98997580/tools/rest-api-client/deploy-partition.sh ---------------------------------------------------------------------- diff --git a/tools/rest-api-client/deploy-partition.sh b/tools/rest-api-client/deploy-partition.sh new file mode 100644 index 0000000..22a5278 --- /dev/null +++ b/tools/rest-api-client/deploy-partition.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------- +# This script could be used to deploy partition definitions via the rest-api. +# + +# Parameter values +stratos_manager_host= +stratos_manager_https_port= +username=admin +password=admin +json_file="/path/to/partition.json" + +# Send request +curl -X POST -H "Content-Type: application/json" -d @'${json_file}' -k -v -u ${username}:${password} https://${stratos_manager_host}:${stratos_manager_https_port}/stratos/admin/policy/deployment/partition \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/98997580/tools/rest-api-client/subscribe.sh ---------------------------------------------------------------------- diff --git a/tools/rest-api-client/subscribe.sh b/tools/rest-api-client/subscribe.sh new file mode 100644 index 0000000..b7eec10 --- /dev/null +++ b/tools/rest-api-client/subscribe.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------- +# This script could be used to subscribe to a service via the rest-api. +# + +# Parameter values +stratos_manager_host= +stratos_manager_https_port= +username=admin +password=admin +json_file="/path/to/subscribe.json" + +# Send request +curl -X POST -H "Content-Type: application/json" -d @'${json_file}' -k -v -u ${username}:${password} https://${stratos_manager_host}:${stratos_manager_https_port}/stratos/admin/cartridge/subscribe
