OOF Integration Changes
[oom.git] / kubernetes / oof / charts / oof-has / charts / oof-has-cassandra / resources / config / cassandra / docker-entrypoint-initdb.d / zzz_conductor.cql
1 # Copyright © 2017 Amdocs, AT&T, Bell Canada, VMware
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15
16 CREATE KEYSPACE conductor WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;
17
18 CREATE TABLE conductor.plans (
19     id text PRIMARY KEY,
20     created bigint,
21     message text,
22     name text,
23     recommend_max int,
24     reservation_counter int,
25     reservation_owner text,
26     solution text,
27     solver_counter int,
28     solver_owner text,
29     status text,
30     template text,
31     timeout int,
32     translation text,
33     translation_counter int,
34     translation_owner text,
35     updated bigint,
36     vector_ts text
37 );
38
39 CREATE INDEX conductor_plans_index ON conductor.plans(status);
40
41 CREATE KEYSPACE conductor_rpc WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;
42
43 CREATE TABLE conductor_rpc.controller (
44     id text PRIMARY KEY,
45     action text,
46     args text,
47     created bigint,
48     ctxt text,
49     failure text,
50     method text,
51     owner text,
52     response text,
53     status text,
54     updated bigint,
55     vector_ts text
56 );
57
58 CREATE TABLE conductor_rpc.data (
59     id text PRIMARY KEY,
60     action text,
61     args text,
62     created bigint,
63     ctxt text,
64     failure text,
65     method text,
66     owner text,
67     response text,
68     status text,
69     updated bigint,
70     vector_ts text
71 );
72
73 INSERT INTO admin.keyspace_master (
74 uuid, application_name, is_aaf, is_api, keyspace_name, password,username)
75 VALUES ( now(), 'conductor', False, True, 'conductor', 'c0nduct0r', 'conductor');
76
77 INSERT INTO admin.keyspace_master (
78 uuid, application_name, is_aaf, is_api, keyspace_name, password, username)
79 VALUES( now(), 'conductor', False, True, 'conductor_rpc', 'c0nduct0r', 'conductor');
80
81 CREATE ROLE IF NOT EXISTS conductor WITH PASSWORD = 'c0nduct0r' AND LOGIN = true;
82
83 GRANT ALL PERMISSIONS on KEYSPACE conductor to 'conductor';
84
85 GRANT ALL PERMISSIONS on KEYSPACE conductor_rpc to 'conductor';
86
87 INSERT INTO conductor.plans (id, created, message, name, recommend_max, solution, status, template,timeout, translation,updated) VALUES('healthcheck',1479482603641,'','foo',1,'{"healthcheck": " healthcheck"}','solved','{"healthcheck": "healthcheck"}',3600,'{"healthcheck": "healthcheck"}',1484324150629);
88
89
90