v0.5.0: 3 стенда — изоляция состояния, WSGI middleware, OpenAPI server selector, POLYGON_STANDS env
- loader.py: STANDS dict, get_services/get_ops_index per stand, POLYGON_STANDS env
- mock_state.py: get_state(stand_id) — ленивая инициализация
- app.py: StandMiddleware — перезапись PATH_INFO до Flask-роутинга
- Все роуты: LocalProxy(state), LocalProxy(SERVICES/OPS_INDEX) через g.stand_id
- openapi.py: _build_servers() — по одному серверу на стенд
- services/stand{1,2,3}/ — 37 YAML на стенд из STANDS/dev и STANDS/test
- tests/test_api.py: +4 multi-stand теста (изоляция, fail-next, OpenAPI servers)
- Обратная совместимость: /api/v1/svc/... → стенд по умолчанию
This commit is contained in:
@@ -0,0 +1,406 @@
|
||||
name: mariadb
|
||||
service_id: 115
|
||||
service_display_name: Mariadb
|
||||
service_short_name: mariadb
|
||||
service_man: 'Mariadb кластер. Ресурсная платформа: k8s. Автоматизация: k8s operator.<br/>Автоматическое резервное копирование, ручное восстановление.'
|
||||
lifecycle:
|
||||
suspendOnDestroyDefault: true
|
||||
adoptExistingOnCreateDefault: false
|
||||
operations:
|
||||
- svcOperationId: 138
|
||||
operation: create
|
||||
kind: instance
|
||||
action: create
|
||||
- svcOperationId: 242
|
||||
operation: create_database
|
||||
kind: subresource
|
||||
action: create
|
||||
- svcOperationId: 243
|
||||
operation: create_user
|
||||
kind: subresource
|
||||
action: create
|
||||
- svcOperationId: 139
|
||||
operation: delete
|
||||
kind: instance
|
||||
action: delete
|
||||
- svcOperationId: 248
|
||||
operation: delete_database
|
||||
kind: subresource
|
||||
action: delete
|
||||
- svcOperationId: 247
|
||||
operation: delete_user
|
||||
kind: subresource
|
||||
action: delete
|
||||
- svcOperationId: 142
|
||||
operation: modify
|
||||
kind: instance
|
||||
action: modify
|
||||
- svcOperationId: 287
|
||||
operation: reconcile
|
||||
kind: action
|
||||
action: reconcile
|
||||
- svcOperationId: 141
|
||||
operation: resume
|
||||
kind: instance
|
||||
action: resume
|
||||
- svcOperationId: 140
|
||||
operation: suspend
|
||||
kind: instance
|
||||
action: suspend
|
||||
stateOut:
|
||||
databases: {}
|
||||
users: {}
|
||||
cfsParams:
|
||||
- svcOperationCfsParamId: 877
|
||||
svcOperationCfsParam: startupConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: false
|
||||
dataDescriptor:
|
||||
resourceRealm:
|
||||
dataType: string
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- k8s-3-sandbox-nubes-ru
|
||||
- k8s-4-sandbox-nubes-ru
|
||||
- svcOperationCfsParamId: 878
|
||||
svcOperationCfsParam: clusterConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
dataDescriptor:
|
||||
cpu:
|
||||
dataType: integer > 0
|
||||
defaultValue: '500'
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
memory:
|
||||
dataType: integer > 0
|
||||
defaultValue: '512'
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
replicas:
|
||||
dataType: integer > 0
|
||||
defaultValue: '1'
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- '1'
|
||||
disk:
|
||||
dataType: integer > 0
|
||||
defaultValue: '10'
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 879
|
||||
svcOperationCfsParam: accessConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
dataDescriptor:
|
||||
masterAccessList:
|
||||
dataType: json
|
||||
defaultValue: '[]'
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
masterIpSpace:
|
||||
dataType: string
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 880
|
||||
svcOperationCfsParam: mariadbConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
dataDescriptor:
|
||||
version:
|
||||
dataType: string
|
||||
defaultValue: 9.4.0
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- 8.4.0
|
||||
- 9.4.0
|
||||
- svcOperationCfsParamId: 881
|
||||
svcOperationCfsParam: backupConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
dataDescriptor:
|
||||
s3Uid:
|
||||
dataType: uuid
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
retain:
|
||||
dataType: integer > 0
|
||||
defaultValue: '720'
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
schedule:
|
||||
dataType: string
|
||||
defaultValue: 0 0 * * *
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 882
|
||||
svcOperationCfsParam: autoscaleConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
dataDescriptor:
|
||||
enabled:
|
||||
dataType: boolean
|
||||
defaultValue: 'false'
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- 'false'
|
||||
- 'true'
|
||||
schedule:
|
||||
dataType: integer >= 0
|
||||
defaultValue: '0'
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- '0'
|
||||
- '5'
|
||||
- '12'
|
||||
- '23'
|
||||
quota:
|
||||
dataType: integer > 0
|
||||
defaultValue: '100'
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
percent:
|
||||
dataType: integer > 0
|
||||
defaultValue: '10'
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- '10'
|
||||
- '15'
|
||||
- '20'
|
||||
- svcOperationCfsParamId: 734
|
||||
svcOperationCfsParam: dbName
|
||||
dataType: string
|
||||
isRequired: true
|
||||
defaultValue: db-ebbjso21
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 735
|
||||
svcOperationCfsParam: username
|
||||
dataType: string
|
||||
isRequired: true
|
||||
defaultValue: user3vanbmfy
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 736
|
||||
svcOperationCfsParam: password
|
||||
dataType: string
|
||||
isRequired: true
|
||||
defaultValue: p4egnsar
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 737
|
||||
svcOperationCfsParam: dbName
|
||||
dataType: array-map-fixed
|
||||
isRequired: true
|
||||
defaultValue: '[{}]'
|
||||
isModifiable: false
|
||||
dataDescriptor:
|
||||
dbname:
|
||||
dataType: string
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 738
|
||||
svcOperationCfsParam: accessHosts
|
||||
dataType: string
|
||||
isRequired: true
|
||||
defaultValue: '%'
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 456
|
||||
svcOperationCfsParam: deleteS3Bucket
|
||||
dataType: boolean
|
||||
isRequired: true
|
||||
defaultValue: 'true'
|
||||
isModifiable: true
|
||||
valueList:
|
||||
- 'false'
|
||||
- 'true'
|
||||
- svcOperationCfsParamId: 745
|
||||
svcOperationCfsParam: dbName
|
||||
dataType: string
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
- svcOperationCfsParamId: 744
|
||||
svcOperationCfsParam: username
|
||||
dataType: string
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
- svcOperationCfsParamId: 883
|
||||
svcOperationCfsParam: clusterConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
dataDescriptor:
|
||||
cpu:
|
||||
dataType: integer > 0
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
memory:
|
||||
dataType: integer > 0
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
replicas:
|
||||
dataType: integer > 0
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- '1'
|
||||
disk:
|
||||
dataType: integer > 0
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 884
|
||||
svcOperationCfsParam: accessConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
dataDescriptor:
|
||||
masterIpSpace:
|
||||
dataType: string
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
masterAccessList:
|
||||
dataType: json
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 885
|
||||
svcOperationCfsParam: mariadbConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
dataDescriptor:
|
||||
version:
|
||||
dataType: string
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- 8.4.0
|
||||
- 9.4.0
|
||||
- svcOperationCfsParamId: 886
|
||||
svcOperationCfsParam: backupConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
dataDescriptor:
|
||||
schedule:
|
||||
dataType: string
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
s3Uid:
|
||||
dataType: uuid
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
retain:
|
||||
dataType: integer > 0
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
- svcOperationCfsParamId: 887
|
||||
svcOperationCfsParam: autoscaleConfiguration
|
||||
dataType: map-fixed
|
||||
isRequired: true
|
||||
defaultValue: ''
|
||||
isModifiable: true
|
||||
dataDescriptor:
|
||||
percent:
|
||||
dataType: integer > 0
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- '10'
|
||||
- '15'
|
||||
- '20'
|
||||
enabled:
|
||||
dataType: boolean
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- 'false'
|
||||
- 'true'
|
||||
schedule:
|
||||
dataType: integer >= 0
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
valueList:
|
||||
- '0'
|
||||
- '5'
|
||||
- '12'
|
||||
- '23'
|
||||
quota:
|
||||
dataType: integer > 0
|
||||
defaultValue: ''
|
||||
isRequired: true
|
||||
isModifiable: false
|
||||
cfsParamsByOp:
|
||||
138:
|
||||
- 877
|
||||
- 878
|
||||
- 879
|
||||
- 880
|
||||
- 881
|
||||
- 882
|
||||
242:
|
||||
- 734
|
||||
243:
|
||||
- 735
|
||||
- 736
|
||||
- 737
|
||||
- 738
|
||||
139:
|
||||
- 456
|
||||
248:
|
||||
- 745
|
||||
247:
|
||||
- 744
|
||||
142:
|
||||
- 883
|
||||
- 884
|
||||
- 885
|
||||
- 886
|
||||
- 887
|
||||
287: []
|
||||
141: []
|
||||
140: []
|
||||
stateParams:
|
||||
startupConfiguration: '{"resourceRealm": ""}'
|
||||
clusterConfiguration: '{"cpu": 500, "memory": 512, "replicas": 1, "disk": 10}'
|
||||
accessConfiguration: '{"masterAccessList": "[]", "masterIpSpace": ""}'
|
||||
mariadbConfiguration: '{"version": "9.4.0"}'
|
||||
backupConfiguration: '{"s3Uid": "", "retain": 720, "schedule": "0 0 * * *"}'
|
||||
autoscaleConfiguration: '{"enabled": false, "schedule": 0, "quota": 100, "percent": 10}'
|
||||
Reference in New Issue
Block a user