"Fossies" - the Fresh Open Source Software Archive

Member "monasca-api-3.1.0/devstack/files/cassandra/monasca_schema.cql" (27 Sep 2019, 2721 Bytes) of package /linux/misc/openstack/monasca-api-3.1.0.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 // (C) Copyright 2017 SUSE LLC
    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
   12 // implied.
   13 // See the License for the specific language governing permissions and
   14 // limitations under the License.
   15 
   16 // version 1.0
   17 
   18 drop schema if exists monasca;
   19 
   20 // replication factor is set to 1 for devstack installation
   21 
   22 create schema monasca with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
   23 
   24 create table monasca.measurements (
   25     metric_id blob,
   26     region text static,
   27     tenant_id text static,
   28     metric_name text static,
   29     dimensions frozen<list<text>> static,
   30     time_stamp timestamp,
   31     value double,
   32     value_meta text,
   33     primary key (metric_id, time_stamp)
   34 )
   35 WITH CLUSTERING ORDER BY (time_stamp ASC);
   36 
   37 create table monasca.metrics (
   38     region text,
   39     tenant_id text,
   40     metric_name text,
   41     dimensions frozen<list<text>>,
   42     dimension_names frozen<list<text>>,
   43     metric_id blob,
   44     created_at timestamp,
   45     updated_at timestamp,
   46     primary key ((region, tenant_id, metric_name), dimensions, dimension_names)
   47 );
   48 
   49 CREATE CUSTOM INDEX metrics_created_at_index ON monasca.metrics (created_at)
   50 USING 'org.apache.cassandra.index.sasi.SASIIndex';
   51 
   52 CREATE CUSTOM INDEX metrics_updated_at_index ON monasca.metrics (updated_at)
   53 USING 'org.apache.cassandra.index.sasi.SASIIndex';
   54 
   55 create table monasca.dimensions (
   56     region text,
   57     tenant_id text,
   58     name text,
   59     value text,
   60     primary key ((region, tenant_id, name), value)
   61 );
   62 
   63 create table monasca.dimensions_metrics (
   64     region text,
   65     tenant_id text,
   66     dimension_name text,
   67     dimension_value text,
   68     metric_name text,
   69     primary key ((region, tenant_id, dimension_name, dimension_value), metric_name)
   70 );
   71 
   72 create table monasca.metrics_dimensions (
   73     region text,
   74     tenant_id text,
   75     dimension_name text,
   76     dimension_value text,
   77     metric_name text,
   78     primary key ((region, tenant_id, metric_name), dimension_name, dimension_value)
   79 );
   80 
   81 create table monasca.alarm_state_history (
   82     tenant_id text,
   83     alarm_id text,
   84     time_stamp timestamp,
   85     metric text,
   86     old_state text,
   87     new_state text,
   88     reason text,
   89     reason_data text,
   90     sub_alarms text,
   91     primary key ((tenant_id, alarm_id), time_stamp)
   92 );
   93