Cloudify support for OOM
[oom.git] / cloudify-onap / plugins / onap-installation-plugin / k8s_installer / environment.py
1 ########
2 # Copyright (c) 2017 GigaSpaces Technologies Ltd. All rights reserved
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #        http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 #    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #    * See the License for the specific language governing permissions and
14 #    * limitations under the License.
15
16
17 from cloudify import ctx
18 from cloudify.decorators import operation
19
20 from common import constants
21 from common import helm
22 from common import init_pod, namespace
23
24
25 @operation
26 def create_init_pod(**kwargs):
27     init_pod.do_create_init_pod()
28     pass
29
30
31 @operation
32 def create_namespace(**kwargs):
33     namespace.do_create_namespace()
34
35
36 @operation
37 def delete_init_pod(**kwargs):
38     init_pod.do_delete_init_pod()
39
40
41 @operation
42 def delete_namespace(**kwargs):
43     namespace.do_delete_namespace()
44
45
46 @operation
47 def setup_helm_templates(**kwargs):
48     helm_url = constants.HELM_URL
49     ctx.instance.runtime_properties[constants.RT_HELM_CLI_PATH] = helm.get_helm_path(helm_url)
50     ctx.logger.debug('Helm cli path = {}'.format(ctx.instance.runtime_properties[constants.RT_HELM_CLI_PATH]))
51
52     oom_git_url = constants.OOM_GIT_URL
53     ctx.instance.runtime_properties[constants.RT_APPS_ROOT_PATH] = helm.get_apps_root_path(oom_git_url)
54     ctx.logger.debug('Apps root path = {}'.format(ctx.instance.runtime_properties[constants.RT_APPS_ROOT_PATH]))
55
56
57
58