Skip to content

Commit 1755f91

Browse files
committed
Change path to /storage
1 parent 6ca5bf0 commit 1755f91

3 files changed

Lines changed: 94 additions & 429 deletions

File tree

components/renku_data_services/storage/blueprints.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async def _get_one(_: Request, user: base_models.APIUser, storage_id: ULID, etag
124124
headers=headers,
125125
)
126126

127-
return "/data_connectors/storage/<storage_id:ulid>", ["GET"], _get_one
127+
return "/storage/<storage_id:ulid>", ["GET"], _get_one
128128

129129
def get_storage_to_project(self) -> BlueprintFactoryResponse:
130130
"""List all project storage to a given project."""
@@ -153,7 +153,7 @@ async def _get_project_config(_: Request, user: base_models.APIUser) -> JSONResp
153153
)
154154
return validated_json(apispec.ProjectStorageConfig, result)
155155

156-
return "/data_connectors/storage/config", ["GET"], _get_project_config
156+
return "/storage/config", ["GET"], _get_project_config
157157

158158
def delete_storage(self) -> BlueprintFactoryResponse:
159159
"""Delete a specific project storage."""
@@ -170,7 +170,7 @@ async def _delete_storage(
170170
await self.project_storage_k8s.delete_volume(deleted)
171171
return HTTPResponse(status=204)
172172

173-
return "/data_connectors/storage/<storage_id:ulid>", ["DELETE"], _delete_storage
173+
return "/storage/<storage_id:ulid>", ["DELETE"], _delete_storage
174174

175175
def post_storage(self) -> BlueprintFactoryResponse:
176176
"""Create a new shared project storage."""
@@ -188,7 +188,7 @@ async def _post_storage(
188188
apispec.ProjectStorage, self._dump_project_storage(result), headers=headers, status=201
189189
)
190190

191-
return "/data_connectors/storage", ["POST"], _post_storage
191+
return "/storage", ["POST"], _post_storage
192192

193193
def patch_storage(self) -> BlueprintFactoryResponse:
194194
"""Partially update a project storage entry."""
@@ -219,7 +219,7 @@ async def _patch_storage(
219219
headers=headers,
220220
)
221221

222-
return "/data_connectors/storage/<storage_id:ulid>", ["PATCH"], _patch_storage
222+
return "/storage/<storage_id:ulid>", ["PATCH"], _patch_storage
223223

224224
def get_all_storage_allows(self) -> BlueprintFactoryResponse:
225225
"""List all projects in the storage allow list."""
@@ -246,7 +246,7 @@ async def _get_all_storage_allows(
246246
for a in allows
247247
], total
248248

249-
return "/data_connectors/storage/allow", ["GET"], _get_all_storage_allows
249+
return "/storage/allow", ["GET"], _get_all_storage_allows
250250

251251
def post_storage_allow(self) -> BlueprintFactoryResponse:
252252
"""Add a project to the storage allow list."""
@@ -265,7 +265,7 @@ async def _post_storage_allow(
265265
status=201,
266266
)
267267

268-
return "/data_connectors/storage/allow", ["POST"], _post_storage_allow
268+
return "/storage/allow", ["POST"], _post_storage_allow
269269

270270
def patch_storage_allow(self) -> BlueprintFactoryResponse:
271271
"""Partially update a project storage allow entry."""
@@ -295,7 +295,7 @@ async def _patch(
295295
apispec.ProjectStorageAllow, self._dump_project_storage_allow_detail(pse_update.new), headers=headers
296296
)
297297

298-
return "/data_connectors/storage/allow/<project_id:ulid>", ["PATCH"], _patch
298+
return "/storage/allow/<project_id:ulid>", ["PATCH"], _patch
299299

300300
def get_storage_allow(self) -> BlueprintFactoryResponse:
301301
"""Get the storage allow entry for a project."""
@@ -312,7 +312,7 @@ async def _get_storage_allow(_: Request, user: base_models.APIUser, project_id:
312312
apispec.ProjectStorageAllow, self._dump_project_storage_allow_detail(allow), headers=headers
313313
)
314314

315-
return "/data_connectors/storage/allow/<project_id:ulid>", ["GET"], _get_storage_allow
315+
return "/storage/allow/<project_id:ulid>", ["GET"], _get_storage_allow
316316

317317
def delete_storage_allow(self) -> BlueprintFactoryResponse:
318318
"""Remove a project from the storage allow list."""
@@ -325,7 +325,7 @@ async def _delete_storage_allow(_: Request, user: base_models.APIUser, project_i
325325
await self.project_storage_k8s.delete_volume(deleted)
326326
return HTTPResponse(status=204)
327327

328-
return "/data_connectors/storage/allow/<project_id:ulid>", ["DELETE"], _delete_storage_allow
328+
return "/storage/allow/<project_id:ulid>", ["DELETE"], _delete_storage_allow
329329

330330
@staticmethod
331331
def _dump_project_storage(ps: models.ProjectStorage) -> apispec.ProjectStorage:

test/bases/renku_data_services/data_api/__snapshots__/test_storage.ambr

Lines changed: 0 additions & 235 deletions
Original file line numberDiff line numberDiff line change
@@ -1,239 +1,4 @@
11
# serializer version: 1
2-
# name: test_storage_creation[payload0-201-s3]
3-
dict({
4-
'sensitive_fields': list([
5-
]),
6-
'storage': dict({
7-
'configuration': dict({
8-
'provider': 'AWS',
9-
'region': 'us-east-1',
10-
'type': 's3',
11-
}),
12-
'name': 'mystorage',
13-
'project_id': '123456',
14-
'readonly': True,
15-
'source_path': 'bucket/myfolder',
16-
'storage_type': 's3',
17-
'target_path': 'my/target',
18-
}),
19-
})
20-
# ---
21-
# name: test_storage_creation[payload1-201-s3]
22-
dict({
23-
'sensitive_fields': list([
24-
]),
25-
'storage': dict({
26-
'configuration': dict({
27-
'provider': 'AWS',
28-
'region': 'us-east-1',
29-
'type': 's3',
30-
}),
31-
'name': 'mystorage',
32-
'project_id': '123456',
33-
'readonly': True,
34-
'source_path': 'bucket/myfolder',
35-
'storage_type': 's3',
36-
'target_path': 'my/target',
37-
}),
38-
})
39-
# ---
40-
# name: test_storage_creation[payload10-201-s3]
41-
dict({
42-
'sensitive_fields': list([
43-
dict({
44-
'advanced': False,
45-
'default': '',
46-
'default_str': '',
47-
'exclusive': False,
48-
'help': '''
49-
AWS Secret Access Key (password).
50-
51-
Leave blank for anonymous access or runtime credentials.
52-
''',
53-
'ispassword': False,
54-
'name': 'secret_access_key',
55-
'required': False,
56-
'sensitive': True,
57-
'type': 'string',
58-
}),
59-
]),
60-
'storage': dict({
61-
'configuration': dict({
62-
'provider': 'AWS',
63-
'secret_access_key': '<sensitive>',
64-
'type': 's3',
65-
}),
66-
'name': 'mystorage',
67-
'project_id': '123456',
68-
'readonly': True,
69-
'source_path': 'bucket/myfolder',
70-
'storage_type': 's3',
71-
'target_path': 'my/target',
72-
}),
73-
})
74-
# ---
75-
# name: test_storage_creation[payload2-201-s3]
76-
dict({
77-
'sensitive_fields': list([
78-
]),
79-
'storage': dict({
80-
'configuration': dict({
81-
'provider': 'AWS',
82-
'region': 'us-east-2',
83-
'type': 's3',
84-
}),
85-
'name': 'mystorage',
86-
'project_id': '123456',
87-
'readonly': True,
88-
'source_path': 'mybucket/myfolder',
89-
'storage_type': 's3',
90-
'target_path': 'my/target',
91-
}),
92-
})
93-
# ---
94-
# name: test_storage_creation[payload3-201-s3]
95-
dict({
96-
'sensitive_fields': list([
97-
]),
98-
'storage': dict({
99-
'configuration': dict({
100-
'provider': 'AWS',
101-
'type': 's3',
102-
}),
103-
'name': 'mystorage',
104-
'project_id': '123456',
105-
'readonly': True,
106-
'source_path': 'giab',
107-
'storage_type': 's3',
108-
'target_path': 'my/target',
109-
}),
110-
})
111-
# ---
112-
# name: test_storage_creation[payload4-201-s3]
113-
dict({
114-
'sensitive_fields': list([
115-
]),
116-
'storage': dict({
117-
'configuration': dict({
118-
'provider': 'AWS',
119-
'region': 'us-east-2',
120-
'type': 's3',
121-
}),
122-
'name': 'mystorage',
123-
'project_id': '123456',
124-
'readonly': False,
125-
'source_path': 'mybucket/myfolder',
126-
'storage_type': 's3',
127-
'target_path': 'my/target',
128-
}),
129-
})
130-
# ---
131-
# name: test_storage_creation[payload5-201-s3]
132-
dict({
133-
'sensitive_fields': list([
134-
]),
135-
'storage': dict({
136-
'configuration': dict({
137-
'endpoint': 'my.provider.com',
138-
'type': 's3',
139-
}),
140-
'name': 'mystorage',
141-
'project_id': '123456',
142-
'readonly': True,
143-
'source_path': 'mybucket/myfolder',
144-
'storage_type': 's3',
145-
'target_path': 'my/target',
146-
}),
147-
})
148-
# ---
149-
# name: test_storage_creation[payload6-201-azureblob]
150-
dict({
151-
'sensitive_fields': list([
152-
]),
153-
'storage': dict({
154-
'configuration': dict({
155-
'type': 'azureblob',
156-
}),
157-
'name': 'mystorage',
158-
'project_id': '123456',
159-
'readonly': True,
160-
'source_path': 'mycontainer/myfolder',
161-
'storage_type': 'azureblob',
162-
'target_path': 'my/target',
163-
}),
164-
})
165-
# ---
166-
# name: test_storage_creation[payload7-201-azureblob]
167-
dict({
168-
'sensitive_fields': list([
169-
]),
170-
'storage': dict({
171-
'configuration': dict({
172-
'account': 'myaccount',
173-
'type': 'azureblob',
174-
}),
175-
'name': 'mystorage',
176-
'project_id': '123456',
177-
'readonly': True,
178-
'source_path': 'myfolder',
179-
'storage_type': 'azureblob',
180-
'target_path': 'my/target',
181-
}),
182-
})
183-
# ---
184-
# name: test_storage_creation[payload8-201-azureblob]
185-
dict({
186-
'sensitive_fields': list([
187-
]),
188-
'storage': dict({
189-
'configuration': dict({
190-
'account': 'myaccount',
191-
'type': 'azureblob',
192-
}),
193-
'name': 'mystorage',
194-
'project_id': '123456',
195-
'readonly': True,
196-
'source_path': 'myfolder',
197-
'storage_type': 'azureblob',
198-
'target_path': 'my/target',
199-
}),
200-
})
201-
# ---
202-
# name: test_storage_creation[payload9-201-s3]
203-
dict({
204-
'sensitive_fields': list([
205-
dict({
206-
'advanced': False,
207-
'default': '',
208-
'default_str': '',
209-
'exclusive': False,
210-
'help': '''
211-
AWS Secret Access Key (password).
212-
213-
Leave blank for anonymous access or runtime credentials.
214-
''',
215-
'ispassword': False,
216-
'name': 'secret_access_key',
217-
'required': False,
218-
'sensitive': True,
219-
'type': 'string',
220-
}),
221-
]),
222-
'storage': dict({
223-
'configuration': dict({
224-
'provider': 'AWS',
225-
'secret_access_key': '<sensitive>',
226-
'type': 's3',
227-
}),
228-
'name': 'mystorage',
229-
'project_id': '123456',
230-
'readonly': True,
231-
'source_path': 'bucket/myfolder',
232-
'storage_type': 's3',
233-
'target_path': 'my/target',
234-
}),
235-
})
236-
# ---
2372
# name: test_storage_schema_patches
2383
list([
2394
dict({

0 commit comments

Comments
 (0)