Skip to content

Commit 56a7c2c

Browse files
committed
add openapi spec to manifests and link from element to manifest
1 parent 64f18f2 commit 56a7c2c

4 files changed

Lines changed: 77 additions & 3 deletions

File tree

docs/openapi/openapi_boot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ paths:
13431343
$ref: '#/components/responses/Error'
13441344
operationId: Refresh_secret_v1_nodes_NodeEncryptionKeyUuid_actions_refresh_secret_invoke
13451345
servers:
1346-
- url: http://127.0.0.1:11013
1346+
- url: http://127.0.0.1:36413
13471347
description: ''
13481348
variables:
13491349
version:

docs/openapi/openapi_orch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ paths:
345345
$ref: '#/components/responses/Error'
346346
operationId: Get_payload_v1_agents_UniversalAgentUuid_actions_get_payload
347347
servers:
348-
- url: http://127.0.0.1:11011
348+
- url: http://127.0.0.1:37961
349349
description: ''
350350
variables:
351351
version:

docs/openapi/openapi_status.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ paths:
976976
$ref: '#/components/responses/Error'
977977
operationId: Delete_v1_kind_KindModelKind_resources_ResourceRes_uuid
978978
servers:
979-
- url: http://127.0.0.1:11012
979+
- url: http://127.0.0.1:55615
980980
description: ''
981981
variables:
982982
version:
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Copyright 2016 Eugene Frolov <eugene@frolov.net.ru>
2+
#
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
from restalchemy.storage.sql import migrations
18+
19+
20+
class MigrationStep(migrations.AbstractMigrationStep):
21+
def __init__(self):
22+
self._depends = ["0059-dns-sync-to-ecosystem-secret-len-a7b3c1.py"]
23+
24+
@property
25+
def migration_id(self):
26+
return "02ef0abb-c4ab-4d7b-86a6-e8f847df64d4"
27+
28+
@property
29+
def is_manual(self):
30+
return False
31+
32+
def upgrade(self, session):
33+
expressions = [
34+
"""
35+
ALTER TABLE
36+
em_manifests
37+
ADD COLUMN IF NOT EXISTS
38+
openapi_spec VARCHAR(2048) NULL DEFAULT NULL;
39+
""",
40+
"""
41+
ALTER TABLE
42+
em_elements
43+
ADD COLUMN IF NOT EXISTS
44+
manifest UUID NULL DEFAULT NULL references em_manifests(uuid) ON DELETE RESTRICT;
45+
""",
46+
"""
47+
UPDATE em_elements
48+
SET manifest = em_manifests.uuid
49+
FROM em_manifests
50+
WHERE em_elements.uuid = em_manifests.uuid
51+
AND em_elements.manifest IS NULL;
52+
""",
53+
]
54+
55+
for expression in expressions:
56+
session.execute(expression)
57+
58+
def downgrade(self, session):
59+
expressions = [
60+
"""
61+
ALTER TABLE em_manifests DROP COLUMN IF EXISTS
62+
openapi_spec;
63+
""",
64+
"""
65+
ALTER TABLE em_elements DROP COLUMN IF EXISTS
66+
manifest;
67+
""",
68+
]
69+
70+
for expression in expressions:
71+
session.execute(expression)
72+
73+
74+
migration_step = MigrationStep()

0 commit comments

Comments
 (0)