blob: c623e79dee0e0156725c33691b1084b44245a1f6 [file] [log] [blame]
Dennis Dmitriev6f59add2016-10-18 13:45:27 +03001# Copyright 2016 Mirantis, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# 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, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15import collections
16
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030017
18def enum(*values, **kwargs):
19 names = kwargs.get('names')
20 if names:
21 return collections.namedtuple('Enum', names)(*values)
22 return collections.namedtuple('Enum', values)(*values)
23
Dina Belovae6fdffb2017-09-19 13:58:34 -070024
Dennis Dmitriev53d3b772016-10-18 14:31:58 +030025UNDERLAY_NODE_ROLES = enum(
Dennis Dmitrievb5d74242016-10-18 14:05:29 +030026 'salt_master',
27 'salt_minion',
vrovachev99228d32017-06-08 19:46:10 +040028 'k8s_virtlet',
Victor Ryzhenkin66d39372017-09-28 19:25:48 +040029 'k8s_controller',
Dennis Dmitrievf3f90a52017-08-10 14:37:05 +030030 'decapod_mon',
31 'decapod_osd',
32 'decapod_all',
Hanna Arhipova1fc31732020-10-19 17:19:07 +030033 'none'
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030034)
35
Dina Belovae6fdffb2017-09-19 13:58:34 -070036
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030037NETWORK_TYPE = enum(
Dennis Dmitrievb6bcc5c2018-09-26 11:07:53 +000038 'admin',
39 'control',
40 'tenant',
41 'storage',
42 'external',
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030043)
44
Dina Belovae6fdffb2017-09-19 13:58:34 -070045
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030046SNAPSHOT = enum(
47 'hardware',
48 'underlay',
Dennis Dmitriev010f4cd2016-11-01 20:43:51 +020049 'salt_deployed',
Dennis Dmitrievea48cf52018-07-18 18:04:39 +030050 'core_deployed',
Dennis Dmitrieveac3aab2017-07-12 16:36:41 +030051 'oss_deployed',
Dennis Dmitriev6ee7ca82018-03-26 14:14:37 +030052 'drivetrain_deployed',
Dennis Dmitriev010f4cd2016-11-01 20:43:51 +020053 'openstack_deployed',
Dennis Dmitrievea48cf52018-07-18 18:04:39 +030054 'stacklight_deployed',
vrovachevbc2f5ce2017-05-22 19:37:24 +040055 'virtlet_deployed',
Victor Ryzhenkin655587f2017-05-24 20:00:07 +040056 'virtlet_ceph_deployed',
Dennis Dmitrievf3f90a52017-08-10 14:37:05 +030057 'k8s_deployed',
58 'decapod_deployed',
Tatyana Leontovicha754ce52017-11-13 16:46:43 +020059 'ceph_deployed',
Dmitry Tyzhnenko35413c02018-03-05 14:12:37 +020060 'day1_underlay',
61 'cfg_configured',
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030062)
63
Dina Belovae6fdffb2017-09-19 13:58:34 -070064
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030065LOG_LEVELS = enum(
66 'INFO',
67 'WARNING',
68 'ERROR',
69 'CRITICAL',
70 'DEBUG',
71 'NOTE'
72)