universal-mcp 0.1.13rc1__py3-none-any.whl → 0.1.13rc2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {universal_mcp-0.1.13rc1.dist-info → universal_mcp-0.1.13rc2.dist-info}/METADATA +1 -1
- universal_mcp-0.1.13rc2.dist-info/RECORD +38 -0
- universal_mcp/applications/ahrefs/README.md +0 -76
- universal_mcp/applications/ahrefs/__init__.py +0 -0
- universal_mcp/applications/ahrefs/app.py +0 -2291
- universal_mcp/applications/cal_com_v2/README.md +0 -175
- universal_mcp/applications/cal_com_v2/__init__.py +0 -0
- universal_mcp/applications/cal_com_v2/app.py +0 -5390
- universal_mcp/applications/calendly/README.md +0 -78
- universal_mcp/applications/calendly/__init__.py +0 -0
- universal_mcp/applications/calendly/app.py +0 -1195
- universal_mcp/applications/clickup/README.md +0 -160
- universal_mcp/applications/clickup/__init__.py +0 -0
- universal_mcp/applications/clickup/app.py +0 -5009
- universal_mcp/applications/coda/README.md +0 -133
- universal_mcp/applications/coda/__init__.py +0 -0
- universal_mcp/applications/coda/app.py +0 -3671
- universal_mcp/applications/curstdata/README.md +0 -50
- universal_mcp/applications/curstdata/__init__.py +0 -0
- universal_mcp/applications/curstdata/app.py +0 -551
- universal_mcp/applications/e2b/README.md +0 -37
- universal_mcp/applications/e2b/app.py +0 -65
- universal_mcp/applications/elevenlabs/README.md +0 -84
- universal_mcp/applications/elevenlabs/__init__.py +0 -0
- universal_mcp/applications/elevenlabs/app.py +0 -1402
- universal_mcp/applications/falai/README.md +0 -42
- universal_mcp/applications/falai/__init__.py +0 -0
- universal_mcp/applications/falai/app.py +0 -332
- universal_mcp/applications/figma/README.md +0 -74
- universal_mcp/applications/figma/__init__.py +0 -0
- universal_mcp/applications/figma/app.py +0 -1261
- universal_mcp/applications/firecrawl/README.md +0 -45
- universal_mcp/applications/firecrawl/app.py +0 -268
- universal_mcp/applications/github/README.md +0 -47
- universal_mcp/applications/github/app.py +0 -429
- universal_mcp/applications/gong/README.md +0 -88
- universal_mcp/applications/gong/__init__.py +0 -0
- universal_mcp/applications/gong/app.py +0 -2297
- universal_mcp/applications/google_calendar/app.py +0 -442
- universal_mcp/applications/google_docs/README.md +0 -40
- universal_mcp/applications/google_docs/app.py +0 -88
- universal_mcp/applications/google_drive/README.md +0 -44
- universal_mcp/applications/google_drive/app.py +0 -286
- universal_mcp/applications/google_mail/README.md +0 -47
- universal_mcp/applications/google_mail/app.py +0 -664
- universal_mcp/applications/google_sheet/README.md +0 -42
- universal_mcp/applications/google_sheet/app.py +0 -150
- universal_mcp/applications/heygen/README.md +0 -69
- universal_mcp/applications/heygen/__init__.py +0 -0
- universal_mcp/applications/heygen/app.py +0 -956
- universal_mcp/applications/mailchimp/README.md +0 -306
- universal_mcp/applications/mailchimp/__init__.py +0 -0
- universal_mcp/applications/mailchimp/app.py +0 -10937
- universal_mcp/applications/markitdown/app.py +0 -44
- universal_mcp/applications/neon/README.md +0 -99
- universal_mcp/applications/neon/__init__.py +0 -0
- universal_mcp/applications/neon/app.py +0 -1924
- universal_mcp/applications/notion/README.md +0 -55
- universal_mcp/applications/notion/__init__.py +0 -0
- universal_mcp/applications/notion/app.py +0 -527
- universal_mcp/applications/perplexity/README.md +0 -37
- universal_mcp/applications/perplexity/app.py +0 -65
- universal_mcp/applications/reddit/README.md +0 -45
- universal_mcp/applications/reddit/app.py +0 -379
- universal_mcp/applications/replicate/README.md +0 -65
- universal_mcp/applications/replicate/__init__.py +0 -0
- universal_mcp/applications/replicate/app.py +0 -980
- universal_mcp/applications/resend/README.md +0 -38
- universal_mcp/applications/resend/app.py +0 -37
- universal_mcp/applications/retell_ai/README.md +0 -46
- universal_mcp/applications/retell_ai/__init__.py +0 -0
- universal_mcp/applications/retell_ai/app.py +0 -333
- universal_mcp/applications/rocketlane/README.md +0 -42
- universal_mcp/applications/rocketlane/__init__.py +0 -0
- universal_mcp/applications/rocketlane/app.py +0 -194
- universal_mcp/applications/serpapi/README.md +0 -37
- universal_mcp/applications/serpapi/app.py +0 -73
- universal_mcp/applications/shortcut/README.md +0 -153
- universal_mcp/applications/shortcut/__init__.py +0 -0
- universal_mcp/applications/shortcut/app.py +0 -3880
- universal_mcp/applications/spotify/README.md +0 -116
- universal_mcp/applications/spotify/__init__.py +0 -0
- universal_mcp/applications/spotify/app.py +0 -2526
- universal_mcp/applications/supabase/README.md +0 -112
- universal_mcp/applications/supabase/__init__.py +0 -0
- universal_mcp/applications/supabase/app.py +0 -2970
- universal_mcp/applications/tavily/README.md +0 -38
- universal_mcp/applications/tavily/app.py +0 -51
- universal_mcp/applications/wrike/README.md +0 -71
- universal_mcp/applications/wrike/__init__.py +0 -0
- universal_mcp/applications/wrike/app.py +0 -1372
- universal_mcp/applications/youtube/README.md +0 -82
- universal_mcp/applications/youtube/__init__.py +0 -0
- universal_mcp/applications/youtube/app.py +0 -1428
- universal_mcp/applications/zenquotes/README.md +0 -37
- universal_mcp/applications/zenquotes/app.py +0 -31
- universal_mcp-0.1.13rc1.dist-info/RECORD +0 -132
- {universal_mcp-0.1.13rc1.dist-info → universal_mcp-0.1.13rc2.dist-info}/WHEEL +0 -0
- {universal_mcp-0.1.13rc1.dist-info → universal_mcp-0.1.13rc2.dist-info}/entry_points.txt +0 -0
@@ -1,1924 +0,0 @@
|
|
1
|
-
from typing import Any
|
2
|
-
|
3
|
-
from universal_mcp.applications import APIApplication
|
4
|
-
from universal_mcp.integrations import Integration
|
5
|
-
|
6
|
-
|
7
|
-
class NeonApp(APIApplication):
|
8
|
-
def __init__(self, integration: Integration = None, **kwargs) -> None:
|
9
|
-
super().__init__(name='neon', integration=integration, **kwargs)
|
10
|
-
self.base_url = "https://console.neon.tech/api/v2"
|
11
|
-
|
12
|
-
def list_api_keys(self, ) -> list[Any]:
|
13
|
-
"""
|
14
|
-
Retrieves a list of API keys from the server associated with the current client.
|
15
|
-
|
16
|
-
Args:
|
17
|
-
None: This function takes no arguments
|
18
|
-
|
19
|
-
Returns:
|
20
|
-
A list of API key objects parsed from the server's JSON response.
|
21
|
-
|
22
|
-
Raises:
|
23
|
-
requests.HTTPError: Raised if the HTTP response indicates an unsuccessful status code.
|
24
|
-
|
25
|
-
Tags:
|
26
|
-
list, api-keys, management
|
27
|
-
"""
|
28
|
-
url = f"{self.base_url}/api_keys"
|
29
|
-
query_params = {}
|
30
|
-
response = self._get(url, params=query_params)
|
31
|
-
response.raise_for_status()
|
32
|
-
return response.json()
|
33
|
-
|
34
|
-
def create_api_key(self, key_name) -> dict[str, Any]:
|
35
|
-
"""
|
36
|
-
Creates a new API key with the specified name.
|
37
|
-
|
38
|
-
Args:
|
39
|
-
key_name: The name to assign to the new API key. Cannot be None.
|
40
|
-
|
41
|
-
Returns:
|
42
|
-
A dictionary containing the created API key details and metadata.
|
43
|
-
|
44
|
-
Raises:
|
45
|
-
ValueError: Raised when 'key_name' is None.
|
46
|
-
HTTPError: Raised when the API request fails.
|
47
|
-
|
48
|
-
Tags:
|
49
|
-
create, api, authentication, management
|
50
|
-
"""
|
51
|
-
if key_name is None:
|
52
|
-
raise ValueError("Missing required parameter 'key_name'")
|
53
|
-
request_body = {
|
54
|
-
'key_name': key_name,
|
55
|
-
}
|
56
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
57
|
-
url = f"{self.base_url}/api_keys"
|
58
|
-
query_params = {}
|
59
|
-
response = self._post(url, data=request_body, params=query_params)
|
60
|
-
response.raise_for_status()
|
61
|
-
return response.json()
|
62
|
-
|
63
|
-
def revoke_api_key(self, key_id) -> dict[str, Any]:
|
64
|
-
"""
|
65
|
-
Revokes an API key by its identifier.
|
66
|
-
|
67
|
-
Args:
|
68
|
-
key_id: The unique identifier of the API key to be revoked.
|
69
|
-
|
70
|
-
Returns:
|
71
|
-
A dictionary containing the response data from the API after revocation.
|
72
|
-
|
73
|
-
Raises:
|
74
|
-
ValueError: If 'key_id' is None.
|
75
|
-
requests.HTTPError: If the API request fails with a non-success status code.
|
76
|
-
|
77
|
-
Tags:
|
78
|
-
revoke, api-key, management
|
79
|
-
"""
|
80
|
-
if key_id is None:
|
81
|
-
raise ValueError("Missing required parameter 'key_id'")
|
82
|
-
url = f"{self.base_url}/api_keys/{key_id}"
|
83
|
-
query_params = {}
|
84
|
-
response = self._delete(url, params=query_params)
|
85
|
-
response.raise_for_status()
|
86
|
-
return response.json()
|
87
|
-
|
88
|
-
def get_project_operation(self, project_id, operation_id) -> dict[str, Any]:
|
89
|
-
"""
|
90
|
-
Retrieves details of a specific operation for a given project from the API.
|
91
|
-
|
92
|
-
Args:
|
93
|
-
project_id: str. The unique identifier of the project for which the operation details are requested.
|
94
|
-
operation_id: str. The unique identifier of the operation to retrieve.
|
95
|
-
|
96
|
-
Returns:
|
97
|
-
dict[str, Any]: A dictionary containing the operation information returned by the API.
|
98
|
-
|
99
|
-
Raises:
|
100
|
-
ValueError: Raised if 'project_id' or 'operation_id' is None.
|
101
|
-
requests.HTTPError: Raised if the HTTP request to the API fails or returns an error status code.
|
102
|
-
|
103
|
-
Tags:
|
104
|
-
get, operation, project-management, api
|
105
|
-
"""
|
106
|
-
if project_id is None:
|
107
|
-
raise ValueError("Missing required parameter 'project_id'")
|
108
|
-
if operation_id is None:
|
109
|
-
raise ValueError("Missing required parameter 'operation_id'")
|
110
|
-
url = f"{self.base_url}/projects/{project_id}/operations/{operation_id}"
|
111
|
-
query_params = {}
|
112
|
-
response = self._get(url, params=query_params)
|
113
|
-
response.raise_for_status()
|
114
|
-
return response.json()
|
115
|
-
|
116
|
-
def list_projects(self, cursor=None, limit=None, search=None, org_id=None, timeout=None) -> Any:
|
117
|
-
"""
|
118
|
-
Retrieves a list of projects with optional pagination, filtering, and organizational scoping.
|
119
|
-
|
120
|
-
Args:
|
121
|
-
cursor: A string representing the pagination cursor to fetch the next set of results. Optional.
|
122
|
-
limit: An integer specifying the maximum number of projects to return. Optional.
|
123
|
-
search: A string to filter projects by a search term. Optional.
|
124
|
-
org_id: A string representing the organization ID to filter projects belonging to a specific organization. Optional.
|
125
|
-
timeout: An integer representing the request timeout in seconds. Optional.
|
126
|
-
|
127
|
-
Returns:
|
128
|
-
A JSON-decoded Python object containing the list of projects and associated metadata.
|
129
|
-
|
130
|
-
Raises:
|
131
|
-
requests.HTTPError: If the HTTP request to retrieve the projects fails or returns an error status code.
|
132
|
-
|
133
|
-
Tags:
|
134
|
-
list, projects, search, filter, pagination, management, important
|
135
|
-
"""
|
136
|
-
url = f"{self.base_url}/projects"
|
137
|
-
query_params = {k: v for k, v in [('cursor', cursor), ('limit', limit), ('search', search), ('org_id', org_id), ('timeout', timeout)] if v is not None}
|
138
|
-
response = self._get(url, params=query_params)
|
139
|
-
response.raise_for_status()
|
140
|
-
return response.json()
|
141
|
-
|
142
|
-
def create_project(self, project) -> Any:
|
143
|
-
"""
|
144
|
-
Creates a new project by sending a POST request to the projects endpoint with the given project details.
|
145
|
-
|
146
|
-
Args:
|
147
|
-
project: The project data to be created. Must not be None.
|
148
|
-
|
149
|
-
Returns:
|
150
|
-
The JSON response from the server containing the created project's details.
|
151
|
-
|
152
|
-
Raises:
|
153
|
-
ValueError: If the 'project' parameter is None.
|
154
|
-
requests.HTTPError: If the HTTP request to create the project fails with a non-success status code.
|
155
|
-
|
156
|
-
Tags:
|
157
|
-
create, project-management, api
|
158
|
-
"""
|
159
|
-
if project is None:
|
160
|
-
raise ValueError("Missing required parameter 'project'")
|
161
|
-
request_body = {
|
162
|
-
'project': project,
|
163
|
-
}
|
164
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
165
|
-
url = f"{self.base_url}/projects"
|
166
|
-
query_params = {}
|
167
|
-
response = self._post(url, data=request_body, params=query_params)
|
168
|
-
response.raise_for_status()
|
169
|
-
return response.json()
|
170
|
-
|
171
|
-
def list_shared_projects(self, cursor=None, limit=None, search=None) -> Any:
|
172
|
-
"""
|
173
|
-
Retrieves a list of shared projects with optional pagination and search filtering.
|
174
|
-
|
175
|
-
Args:
|
176
|
-
cursor: Optional; a pagination token indicating where to continue retrieving results.
|
177
|
-
limit: Optional; the maximum number of projects to return.
|
178
|
-
search: Optional; a string to filter projects by name or other searchable fields.
|
179
|
-
|
180
|
-
Returns:
|
181
|
-
A JSON-decoded Python object containing the shared projects list and associated metadata.
|
182
|
-
|
183
|
-
Raises:
|
184
|
-
requests.HTTPError: Raised if the HTTP request to the server returns an unsuccessful status code.
|
185
|
-
|
186
|
-
Tags:
|
187
|
-
list, projects, shared, search, api, important
|
188
|
-
"""
|
189
|
-
url = f"{self.base_url}/projects/shared"
|
190
|
-
query_params = {k: v for k, v in [('cursor', cursor), ('limit', limit), ('search', search)] if v is not None}
|
191
|
-
response = self._get(url, params=query_params)
|
192
|
-
response.raise_for_status()
|
193
|
-
return response.json()
|
194
|
-
|
195
|
-
def get_project(self, project_id) -> dict[str, Any]:
|
196
|
-
"""
|
197
|
-
Retrieves detailed information for a specific project by its project ID.
|
198
|
-
|
199
|
-
Args:
|
200
|
-
project_id: The unique identifier of the project to retrieve.
|
201
|
-
|
202
|
-
Returns:
|
203
|
-
A dictionary containing the project's details as returned by the API.
|
204
|
-
|
205
|
-
Raises:
|
206
|
-
ValueError: If 'project_id' is None.
|
207
|
-
requests.HTTPError: If the HTTP request for the project fails with an error status.
|
208
|
-
|
209
|
-
Tags:
|
210
|
-
get, project, management, api, important
|
211
|
-
"""
|
212
|
-
if project_id is None:
|
213
|
-
raise ValueError("Missing required parameter 'project_id'")
|
214
|
-
url = f"{self.base_url}/projects/{project_id}"
|
215
|
-
query_params = {}
|
216
|
-
response = self._get(url, params=query_params)
|
217
|
-
response.raise_for_status()
|
218
|
-
return response.json()
|
219
|
-
|
220
|
-
def update_project(self, project_id, project) -> Any:
|
221
|
-
"""
|
222
|
-
Updates an existing project with new information using a PATCH request.
|
223
|
-
|
224
|
-
Args:
|
225
|
-
project_id: The unique identifier of the project to update.
|
226
|
-
project: A dictionary or object containing the updated project data.
|
227
|
-
|
228
|
-
Returns:
|
229
|
-
A dictionary containing the updated project details as received from the API response.
|
230
|
-
|
231
|
-
Raises:
|
232
|
-
ValueError: Raised if 'project_id' or 'project' is None.
|
233
|
-
requests.HTTPError: Raised if the API request fails or returns an error status code.
|
234
|
-
|
235
|
-
Tags:
|
236
|
-
update, project-management, api, patch
|
237
|
-
"""
|
238
|
-
if project_id is None:
|
239
|
-
raise ValueError("Missing required parameter 'project_id'")
|
240
|
-
if project is None:
|
241
|
-
raise ValueError("Missing required parameter 'project'")
|
242
|
-
request_body = {
|
243
|
-
'project': project,
|
244
|
-
}
|
245
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
246
|
-
url = f"{self.base_url}/projects/{project_id}"
|
247
|
-
query_params = {}
|
248
|
-
response = self._patch(url, data=request_body, params=query_params)
|
249
|
-
response.raise_for_status()
|
250
|
-
return response.json()
|
251
|
-
|
252
|
-
def delete_project(self, project_id) -> dict[str, Any]:
|
253
|
-
"""
|
254
|
-
Deletes a project identified by the given project_id.
|
255
|
-
|
256
|
-
Args:
|
257
|
-
project_id: The unique identifier of the project to be deleted.
|
258
|
-
|
259
|
-
Returns:
|
260
|
-
A dictionary containing the response data from the delete operation.
|
261
|
-
|
262
|
-
Raises:
|
263
|
-
ValueError: If the project_id parameter is None.
|
264
|
-
requests.HTTPError: If the HTTP request to delete the project fails.
|
265
|
-
|
266
|
-
Tags:
|
267
|
-
delete, project-management
|
268
|
-
"""
|
269
|
-
if project_id is None:
|
270
|
-
raise ValueError("Missing required parameter 'project_id'")
|
271
|
-
url = f"{self.base_url}/projects/{project_id}"
|
272
|
-
query_params = {}
|
273
|
-
response = self._delete(url, params=query_params)
|
274
|
-
response.raise_for_status()
|
275
|
-
return response.json()
|
276
|
-
|
277
|
-
def list_project_operations(self, project_id, cursor=None, limit=None) -> Any:
|
278
|
-
"""
|
279
|
-
Retrieves a paginated list of operations for a specified project.
|
280
|
-
|
281
|
-
Args:
|
282
|
-
project_id: The unique identifier of the project whose operations are to be listed.
|
283
|
-
cursor: An optional pagination cursor indicating the position to start retrieving operations from. Defaults to None.
|
284
|
-
limit: An optional maximum number of operations to return in the response. Defaults to None.
|
285
|
-
|
286
|
-
Returns:
|
287
|
-
A JSON-decoded object containing the list of operations and related pagination information.
|
288
|
-
|
289
|
-
Raises:
|
290
|
-
ValueError: If the required parameter 'project_id' is not provided.
|
291
|
-
requests.HTTPError: If the HTTP request to retrieve operations fails.
|
292
|
-
|
293
|
-
Tags:
|
294
|
-
list, project-management, operations, api, async-job, important
|
295
|
-
"""
|
296
|
-
if project_id is None:
|
297
|
-
raise ValueError("Missing required parameter 'project_id'")
|
298
|
-
url = f"{self.base_url}/projects/{project_id}/operations"
|
299
|
-
query_params = {k: v for k, v in [('cursor', cursor), ('limit', limit)] if v is not None}
|
300
|
-
response = self._get(url, params=query_params)
|
301
|
-
response.raise_for_status()
|
302
|
-
return response.json()
|
303
|
-
|
304
|
-
def list_project_permissions(self, project_id) -> dict[str, Any]:
|
305
|
-
"""
|
306
|
-
Retrieves the permissions assigned to a specific project.
|
307
|
-
|
308
|
-
Args:
|
309
|
-
project_id: The unique identifier of the project for which to list permissions.
|
310
|
-
|
311
|
-
Returns:
|
312
|
-
A dictionary containing the project's permissions as returned by the API.
|
313
|
-
|
314
|
-
Raises:
|
315
|
-
ValueError: If 'project_id' is None.
|
316
|
-
requests.HTTPError: If the HTTP request to fetch permissions fails.
|
317
|
-
|
318
|
-
Tags:
|
319
|
-
list, permissions, project, api
|
320
|
-
"""
|
321
|
-
if project_id is None:
|
322
|
-
raise ValueError("Missing required parameter 'project_id'")
|
323
|
-
url = f"{self.base_url}/projects/{project_id}/permissions"
|
324
|
-
query_params = {}
|
325
|
-
response = self._get(url, params=query_params)
|
326
|
-
response.raise_for_status()
|
327
|
-
return response.json()
|
328
|
-
|
329
|
-
def grant_permission_to_project(self, project_id, email) -> dict[str, Any]:
|
330
|
-
"""
|
331
|
-
Grants a user permission to a specified project by sending a POST request with the user's email.
|
332
|
-
|
333
|
-
Args:
|
334
|
-
project_id: The unique identifier of the project to which the permission will be granted. Must not be None.
|
335
|
-
email: The email address of the user to grant permission to. Must not be None.
|
336
|
-
|
337
|
-
Returns:
|
338
|
-
A dictionary containing the JSON response from the permission grant request.
|
339
|
-
|
340
|
-
Raises:
|
341
|
-
ValueError: Raised if 'project_id' or 'email' is None.
|
342
|
-
requests.HTTPError: Raised if the HTTP request for granting permission fails with a non-success status code.
|
343
|
-
|
344
|
-
Tags:
|
345
|
-
grant, permission, project-management, api, post-request
|
346
|
-
"""
|
347
|
-
if project_id is None:
|
348
|
-
raise ValueError("Missing required parameter 'project_id'")
|
349
|
-
if email is None:
|
350
|
-
raise ValueError("Missing required parameter 'email'")
|
351
|
-
request_body = {
|
352
|
-
'email': email,
|
353
|
-
}
|
354
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
355
|
-
url = f"{self.base_url}/projects/{project_id}/permissions"
|
356
|
-
query_params = {}
|
357
|
-
response = self._post(url, data=request_body, params=query_params)
|
358
|
-
response.raise_for_status()
|
359
|
-
return response.json()
|
360
|
-
|
361
|
-
def revoke_permission_from_project(self, project_id, permission_id) -> dict[str, Any]:
|
362
|
-
"""
|
363
|
-
Revokes a specific permission from a project by sending a DELETE request to the appropriate API endpoint.
|
364
|
-
|
365
|
-
Args:
|
366
|
-
project_id: The unique identifier of the project from which the permission will be revoked.
|
367
|
-
permission_id: The unique identifier of the permission to be revoked from the project.
|
368
|
-
|
369
|
-
Returns:
|
370
|
-
A dictionary containing the response data from the API after successfully revoking the permission.
|
371
|
-
|
372
|
-
Raises:
|
373
|
-
ValueError: Raised if either 'project_id' or 'permission_id' is None.
|
374
|
-
HTTPError: Raised if the API request fails with an HTTP error response.
|
375
|
-
|
376
|
-
Tags:
|
377
|
-
revoke, permission, project, api, management
|
378
|
-
"""
|
379
|
-
if project_id is None:
|
380
|
-
raise ValueError("Missing required parameter 'project_id'")
|
381
|
-
if permission_id is None:
|
382
|
-
raise ValueError("Missing required parameter 'permission_id'")
|
383
|
-
url = f"{self.base_url}/projects/{project_id}/permissions/{permission_id}"
|
384
|
-
query_params = {}
|
385
|
-
response = self._delete(url, params=query_params)
|
386
|
-
response.raise_for_status()
|
387
|
-
return response.json()
|
388
|
-
|
389
|
-
def get_project_jwks(self, project_id) -> dict[str, Any]:
|
390
|
-
"""
|
391
|
-
Retrieves the JSON Web Key Set (JWKS) for a specified project from the server.
|
392
|
-
|
393
|
-
Args:
|
394
|
-
project_id: The unique identifier of the project for which to fetch the JWKS.
|
395
|
-
|
396
|
-
Returns:
|
397
|
-
A dictionary representing the project's JWKS as obtained from the server response.
|
398
|
-
|
399
|
-
Raises:
|
400
|
-
ValueError: If 'project_id' is None.
|
401
|
-
requests.HTTPError: If the HTTP request to fetch the JWKS fails with a non-success status code.
|
402
|
-
|
403
|
-
Tags:
|
404
|
-
get, jwks, project, http, fetch
|
405
|
-
"""
|
406
|
-
if project_id is None:
|
407
|
-
raise ValueError("Missing required parameter 'project_id'")
|
408
|
-
url = f"{self.base_url}/projects/{project_id}/jwks"
|
409
|
-
query_params = {}
|
410
|
-
response = self._get(url, params=query_params)
|
411
|
-
response.raise_for_status()
|
412
|
-
return response.json()
|
413
|
-
|
414
|
-
def add_project_jwks(self, project_id, jwks_url, provider_name, branch_id=None, jwt_audience=None, role_names=None) -> dict[str, Any]:
|
415
|
-
"""
|
416
|
-
Adds a JWKS (JSON Web Key Set) provider to the specified project for authentication integration.
|
417
|
-
|
418
|
-
Args:
|
419
|
-
project_id: str. Unique identifier of the project to which the JWKS provider will be added.
|
420
|
-
jwks_url: str. The URL where the JWKS is hosted.
|
421
|
-
provider_name: str. Name of the authentication provider.
|
422
|
-
branch_id: Optional[str]. Identifier for the project branch, if applicable.
|
423
|
-
jwt_audience: Optional[str]. Expected audience (aud) claim for JWT validation.
|
424
|
-
role_names: Optional[list[str]]. List of role names to associate with this provider.
|
425
|
-
|
426
|
-
Returns:
|
427
|
-
dict[str, Any]: Response data from the server as a dictionary representation of the added JWKS provider.
|
428
|
-
|
429
|
-
Raises:
|
430
|
-
ValueError: Raised if any of the required parameters ('project_id', 'jwks_url', or 'provider_name') are missing.
|
431
|
-
requests.HTTPError: Raised if the HTTP request to add the JWKS provider fails with a non-2xx status code.
|
432
|
-
|
433
|
-
Tags:
|
434
|
-
add, jwks, authentication, management
|
435
|
-
"""
|
436
|
-
if project_id is None:
|
437
|
-
raise ValueError("Missing required parameter 'project_id'")
|
438
|
-
if jwks_url is None:
|
439
|
-
raise ValueError("Missing required parameter 'jwks_url'")
|
440
|
-
if provider_name is None:
|
441
|
-
raise ValueError("Missing required parameter 'provider_name'")
|
442
|
-
request_body = {
|
443
|
-
'jwks_url': jwks_url,
|
444
|
-
'provider_name': provider_name,
|
445
|
-
'branch_id': branch_id,
|
446
|
-
'jwt_audience': jwt_audience,
|
447
|
-
'role_names': role_names,
|
448
|
-
}
|
449
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
450
|
-
url = f"{self.base_url}/projects/{project_id}/jwks"
|
451
|
-
query_params = {}
|
452
|
-
response = self._post(url, data=request_body, params=query_params)
|
453
|
-
response.raise_for_status()
|
454
|
-
return response.json()
|
455
|
-
|
456
|
-
def delete_project_jwks(self, project_id, jwks_id) -> dict[str, Any]:
|
457
|
-
"""
|
458
|
-
Deletes a JSON Web Key Set (JWKS) associated with a specific project.
|
459
|
-
|
460
|
-
Args:
|
461
|
-
project_id: The unique identifier of the project containing the JWKS to be deleted.
|
462
|
-
jwks_id: The unique identifier of the JWKS to delete.
|
463
|
-
|
464
|
-
Returns:
|
465
|
-
A dictionary containing the server's response to the delete operation.
|
466
|
-
|
467
|
-
Raises:
|
468
|
-
ValueError: Raised if 'project_id' or 'jwks_id' is not provided.
|
469
|
-
requests.HTTPError: Raised if the HTTP request for deletion fails with an unsuccessful status code.
|
470
|
-
|
471
|
-
Tags:
|
472
|
-
delete, jwks, management
|
473
|
-
"""
|
474
|
-
if project_id is None:
|
475
|
-
raise ValueError("Missing required parameter 'project_id'")
|
476
|
-
if jwks_id is None:
|
477
|
-
raise ValueError("Missing required parameter 'jwks_id'")
|
478
|
-
url = f"{self.base_url}/projects/{project_id}/jwks/{jwks_id}"
|
479
|
-
query_params = {}
|
480
|
-
response = self._delete(url, params=query_params)
|
481
|
-
response.raise_for_status()
|
482
|
-
return response.json()
|
483
|
-
|
484
|
-
def get_connection_uri(self, project_id, database_name, role_name, branch_id=None, endpoint_id=None, pooled=None) -> dict[str, Any]:
|
485
|
-
"""
|
486
|
-
Retrieves the connection URI details for a specified database and role within a project.
|
487
|
-
|
488
|
-
Args:
|
489
|
-
project_id: str. The unique identifier of the project. Required.
|
490
|
-
database_name: str. The name of the database for which to retrieve the connection URI. Required.
|
491
|
-
role_name: str. The name of the role to use for the connection. Required.
|
492
|
-
branch_id: str or None. Optional branch identifier to narrow down the connection URI.
|
493
|
-
endpoint_id: str or None. Optional endpoint identifier for targeted connection URI retrieval.
|
494
|
-
pooled: bool or None. Whether to request a pooled database connection. Optional.
|
495
|
-
|
496
|
-
Returns:
|
497
|
-
dict. A JSON response containing the connection URI and related connection details.
|
498
|
-
|
499
|
-
Raises:
|
500
|
-
ValueError: If any of 'project_id', 'database_name', or 'role_name' is None.
|
501
|
-
HTTPError: If the HTTP request to retrieve the connection URI fails (propagated from the requests library).
|
502
|
-
|
503
|
-
Tags:
|
504
|
-
get, connection-uri, database, management
|
505
|
-
"""
|
506
|
-
if project_id is None:
|
507
|
-
raise ValueError("Missing required parameter 'project_id'")
|
508
|
-
if database_name is None:
|
509
|
-
raise ValueError("Missing required parameter 'database_name'")
|
510
|
-
if role_name is None:
|
511
|
-
raise ValueError("Missing required parameter 'role_name'")
|
512
|
-
url = f"{self.base_url}/projects/{project_id}/connection_uri"
|
513
|
-
query_params = {k: v for k, v in [('branch_id', branch_id), ('endpoint_id', endpoint_id), ('database_name', database_name), ('role_name', role_name), ('pooled', pooled)] if v is not None}
|
514
|
-
response = self._get(url, params=query_params)
|
515
|
-
response.raise_for_status()
|
516
|
-
return response.json()
|
517
|
-
|
518
|
-
def get_project_branch(self, project_id, branch_id) -> Any:
|
519
|
-
"""
|
520
|
-
Retrieves details of a specific branch within a project by project and branch ID.
|
521
|
-
|
522
|
-
Args:
|
523
|
-
project_id: The unique identifier of the project containing the branch.
|
524
|
-
branch_id: The unique identifier of the branch to retrieve.
|
525
|
-
|
526
|
-
Returns:
|
527
|
-
A JSON-decoded object containing information about the specified branch.
|
528
|
-
|
529
|
-
Raises:
|
530
|
-
ValueError: Raised if 'project_id' or 'branch_id' is None.
|
531
|
-
requests.HTTPError: Raised if the HTTP request returns an unsuccessful status code.
|
532
|
-
|
533
|
-
Tags:
|
534
|
-
get, branch, project, management
|
535
|
-
"""
|
536
|
-
if project_id is None:
|
537
|
-
raise ValueError("Missing required parameter 'project_id'")
|
538
|
-
if branch_id is None:
|
539
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
540
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}"
|
541
|
-
query_params = {}
|
542
|
-
response = self._get(url, params=query_params)
|
543
|
-
response.raise_for_status()
|
544
|
-
return response.json()
|
545
|
-
|
546
|
-
def delete_project_branch(self, project_id, branch_id) -> dict[str, Any]:
|
547
|
-
"""
|
548
|
-
Deletes a specific branch from the given project using the API.
|
549
|
-
|
550
|
-
Args:
|
551
|
-
project_id: The unique identifier of the project containing the branch to delete.
|
552
|
-
branch_id: The unique identifier of the branch to be deleted.
|
553
|
-
|
554
|
-
Returns:
|
555
|
-
A dictionary containing the API response data after deleting the branch.
|
556
|
-
|
557
|
-
Raises:
|
558
|
-
ValueError: Raised if 'project_id' or 'branch_id' is None.
|
559
|
-
requests.HTTPError: Raised if the API request fails with an unsuccessful HTTP status code.
|
560
|
-
|
561
|
-
Tags:
|
562
|
-
delete, branch-management, api
|
563
|
-
"""
|
564
|
-
if project_id is None:
|
565
|
-
raise ValueError("Missing required parameter 'project_id'")
|
566
|
-
if branch_id is None:
|
567
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
568
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}"
|
569
|
-
query_params = {}
|
570
|
-
response = self._delete(url, params=query_params)
|
571
|
-
response.raise_for_status()
|
572
|
-
return response.json()
|
573
|
-
|
574
|
-
def update_project_branch(self, project_id, branch_id, branch) -> dict[str, Any]:
|
575
|
-
"""
|
576
|
-
Updates a branch in the specified project.
|
577
|
-
|
578
|
-
Args:
|
579
|
-
project_id: The unique identifier of the project containing the branch to update.
|
580
|
-
branch_id: The unique identifier of the branch to update.
|
581
|
-
branch: The updated branch data to apply.
|
582
|
-
|
583
|
-
Returns:
|
584
|
-
A dictionary containing the updated branch information.
|
585
|
-
|
586
|
-
Raises:
|
587
|
-
ValueError: If any of the required parameters (project_id, branch_id, branch) are None.
|
588
|
-
HTTPError: If the API request fails.
|
589
|
-
|
590
|
-
Tags:
|
591
|
-
update, branch, project, management
|
592
|
-
"""
|
593
|
-
if project_id is None:
|
594
|
-
raise ValueError("Missing required parameter 'project_id'")
|
595
|
-
if branch_id is None:
|
596
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
597
|
-
if branch is None:
|
598
|
-
raise ValueError("Missing required parameter 'branch'")
|
599
|
-
request_body = {
|
600
|
-
'branch': branch,
|
601
|
-
}
|
602
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
603
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}"
|
604
|
-
query_params = {}
|
605
|
-
response = self._patch(url, data=request_body, params=query_params)
|
606
|
-
response.raise_for_status()
|
607
|
-
return response.json()
|
608
|
-
|
609
|
-
def restore_project_branch(self, project_id, branch_id, source_branch_id, source_lsn=None, source_timestamp=None, preserve_under_name=None) -> dict[str, Any]:
|
610
|
-
"""
|
611
|
-
Restores a project branch from a given source branch, allowing optional point-in-time recovery and name preservation.
|
612
|
-
|
613
|
-
Args:
|
614
|
-
project_id: str. The unique identifier of the project containing the branch to be restored.
|
615
|
-
branch_id: str. The unique identifier of the target branch to restore.
|
616
|
-
source_branch_id: str. The identifier of the source branch from which to restore.
|
617
|
-
source_lsn: Optional[int|str]. The log sequence number to restore from. If None, restores from the latest available state.
|
618
|
-
source_timestamp: Optional[str]. The timestamp to restore from (in ISO 8601 format). If None, restores from the latest available state.
|
619
|
-
preserve_under_name: Optional[str]. If specified, preserves the previous branch contents under this name before restoring.
|
620
|
-
|
621
|
-
Returns:
|
622
|
-
dict[str, Any]: The JSON response from the server containing details about the restored branch operation.
|
623
|
-
|
624
|
-
Raises:
|
625
|
-
ValueError: If any of 'project_id', 'branch_id', or 'source_branch_id' is None.
|
626
|
-
requests.HTTPError: If the server responds with an HTTP error status code.
|
627
|
-
|
628
|
-
Tags:
|
629
|
-
restore, branch-management, project
|
630
|
-
"""
|
631
|
-
if project_id is None:
|
632
|
-
raise ValueError("Missing required parameter 'project_id'")
|
633
|
-
if branch_id is None:
|
634
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
635
|
-
if source_branch_id is None:
|
636
|
-
raise ValueError("Missing required parameter 'source_branch_id'")
|
637
|
-
request_body = {
|
638
|
-
'source_branch_id': source_branch_id,
|
639
|
-
'source_lsn': source_lsn,
|
640
|
-
'source_timestamp': source_timestamp,
|
641
|
-
'preserve_under_name': preserve_under_name,
|
642
|
-
}
|
643
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
644
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/restore"
|
645
|
-
query_params = {}
|
646
|
-
response = self._post(url, data=request_body, params=query_params)
|
647
|
-
response.raise_for_status()
|
648
|
-
return response.json()
|
649
|
-
|
650
|
-
def get_project_branch_schema(self, project_id, branch_id, db_name, lsn=None, timestamp=None) -> dict[str, Any]:
|
651
|
-
"""
|
652
|
-
Retrieves the schema information for a specific project branch database, optionally at a given LSN or timestamp.
|
653
|
-
|
654
|
-
Args:
|
655
|
-
project_id: str. The unique identifier of the project whose branch schema is to be retrieved.
|
656
|
-
branch_id: str. The unique identifier of the branch within the project.
|
657
|
-
db_name: str. The name of the database within the specified branch.
|
658
|
-
lsn: Optional[str]. The log sequence number for which to retrieve the schema snapshot. If not provided, the current schema is returned.
|
659
|
-
timestamp: Optional[str]. The timestamp at which to retrieve the schema. If not provided, the current schema is returned.
|
660
|
-
|
661
|
-
Returns:
|
662
|
-
dict[str, Any]: A dictionary containing the branch schema information retrieved from the API.
|
663
|
-
|
664
|
-
Raises:
|
665
|
-
ValueError: If any of the required parameters (project_id, branch_id, db_name) are None.
|
666
|
-
requests.HTTPError: If the underlying HTTP request fails or returns an unsuccessful status code.
|
667
|
-
|
668
|
-
Tags:
|
669
|
-
get, schema, project, branch, database, api, fetch
|
670
|
-
"""
|
671
|
-
if project_id is None:
|
672
|
-
raise ValueError("Missing required parameter 'project_id'")
|
673
|
-
if branch_id is None:
|
674
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
675
|
-
if db_name is None:
|
676
|
-
raise ValueError("Missing required parameter 'db_name'")
|
677
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/schema"
|
678
|
-
query_params = {k: v for k, v in [('db_name', db_name), ('lsn', lsn), ('timestamp', timestamp)] if v is not None}
|
679
|
-
response = self._get(url, params=query_params)
|
680
|
-
response.raise_for_status()
|
681
|
-
return response.json()
|
682
|
-
|
683
|
-
def set_default_project_branch(self, project_id, branch_id) -> dict[str, Any]:
|
684
|
-
"""
|
685
|
-
Sets the specified branch as the default branch for a given project.
|
686
|
-
|
687
|
-
Args:
|
688
|
-
project_id: The unique identifier of the project whose default branch is to be set.
|
689
|
-
branch_id: The unique identifier of the branch to be set as default for the project.
|
690
|
-
|
691
|
-
Returns:
|
692
|
-
A dictionary containing the API response data confirming the operation.
|
693
|
-
|
694
|
-
Raises:
|
695
|
-
ValueError: Raised if 'project_id' or 'branch_id' is None.
|
696
|
-
requests.HTTPError: Raised if the HTTP request to set the default branch fails.
|
697
|
-
|
698
|
-
Tags:
|
699
|
-
set, project-management, branch, api
|
700
|
-
"""
|
701
|
-
if project_id is None:
|
702
|
-
raise ValueError("Missing required parameter 'project_id'")
|
703
|
-
if branch_id is None:
|
704
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
705
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/set_as_default"
|
706
|
-
query_params = {}
|
707
|
-
response = self._post(url, data={}, params=query_params)
|
708
|
-
response.raise_for_status()
|
709
|
-
return response.json()
|
710
|
-
|
711
|
-
def list_project_branch_endpoints(self, project_id, branch_id) -> dict[str, Any]:
|
712
|
-
"""
|
713
|
-
Retrieves a list of endpoint configurations for a specific branch within a project.
|
714
|
-
|
715
|
-
Args:
|
716
|
-
project_id: str. The unique identifier of the project whose branch endpoints are to be listed.
|
717
|
-
branch_id: str. The unique identifier of the branch for which endpoints will be retrieved.
|
718
|
-
|
719
|
-
Returns:
|
720
|
-
dict. A dictionary containing the endpoint configurations for the specified branch.
|
721
|
-
|
722
|
-
Raises:
|
723
|
-
ValueError: Raised if either 'project_id' or 'branch_id' is None.
|
724
|
-
requests.HTTPError: Raised if the HTTP request to retrieve endpoints fails.
|
725
|
-
|
726
|
-
Tags:
|
727
|
-
list, branch, projects, endpoint, api
|
728
|
-
"""
|
729
|
-
if project_id is None:
|
730
|
-
raise ValueError("Missing required parameter 'project_id'")
|
731
|
-
if branch_id is None:
|
732
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
733
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/endpoints"
|
734
|
-
query_params = {}
|
735
|
-
response = self._get(url, params=query_params)
|
736
|
-
response.raise_for_status()
|
737
|
-
return response.json()
|
738
|
-
|
739
|
-
def list_project_branch_databases(self, project_id, branch_id) -> dict[str, Any]:
|
740
|
-
"""
|
741
|
-
Retrieves a list of databases for a specific branch within a project.
|
742
|
-
|
743
|
-
Args:
|
744
|
-
project_id: The unique identifier of the project containing the branch.
|
745
|
-
branch_id: The unique identifier of the branch whose databases are to be listed.
|
746
|
-
|
747
|
-
Returns:
|
748
|
-
A dictionary containing the retrieved list of databases and associated metadata for the specified project branch.
|
749
|
-
|
750
|
-
Raises:
|
751
|
-
ValueError: Raised if 'project_id' or 'branch_id' is None.
|
752
|
-
HTTPError: Raised if the HTTP request to retrieve the databases fails.
|
753
|
-
|
754
|
-
Tags:
|
755
|
-
list, databases, project-management, branch-management
|
756
|
-
"""
|
757
|
-
if project_id is None:
|
758
|
-
raise ValueError("Missing required parameter 'project_id'")
|
759
|
-
if branch_id is None:
|
760
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
761
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/databases"
|
762
|
-
query_params = {}
|
763
|
-
response = self._get(url, params=query_params)
|
764
|
-
response.raise_for_status()
|
765
|
-
return response.json()
|
766
|
-
|
767
|
-
def create_project_branch_database(self, project_id, branch_id, database) -> dict[str, Any]:
|
768
|
-
"""
|
769
|
-
Creates a new database in the specified branch of a project and returns the resulting database object.
|
770
|
-
|
771
|
-
Args:
|
772
|
-
project_id: The unique identifier of the project in which to create the database.
|
773
|
-
branch_id: The unique identifier of the branch within the project where the database will be created.
|
774
|
-
database: A dictionary containing the database configuration and properties to be created.
|
775
|
-
|
776
|
-
Returns:
|
777
|
-
A dictionary representation of the created database object as returned by the API.
|
778
|
-
|
779
|
-
Raises:
|
780
|
-
ValueError: If project_id, branch_id, or database is None.
|
781
|
-
requests.HTTPError: If the HTTP request to create the database fails.
|
782
|
-
|
783
|
-
Tags:
|
784
|
-
create, database, project-management, branch, api
|
785
|
-
"""
|
786
|
-
if project_id is None:
|
787
|
-
raise ValueError("Missing required parameter 'project_id'")
|
788
|
-
if branch_id is None:
|
789
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
790
|
-
if database is None:
|
791
|
-
raise ValueError("Missing required parameter 'database'")
|
792
|
-
request_body = {
|
793
|
-
'database': database,
|
794
|
-
}
|
795
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
796
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/databases"
|
797
|
-
query_params = {}
|
798
|
-
response = self._post(url, data=request_body, params=query_params)
|
799
|
-
response.raise_for_status()
|
800
|
-
return response.json()
|
801
|
-
|
802
|
-
def get_project_branch_database(self, project_id, branch_id, database_name) -> dict[str, Any]:
|
803
|
-
"""
|
804
|
-
Retrieves details of a specific database from a given project branch.
|
805
|
-
|
806
|
-
Args:
|
807
|
-
project_id: The unique identifier of the project containing the branch.
|
808
|
-
branch_id: The unique identifier of the branch within the project.
|
809
|
-
database_name: The name of the database to retrieve information for.
|
810
|
-
|
811
|
-
Returns:
|
812
|
-
A dictionary containing the JSON response with the requested database details.
|
813
|
-
|
814
|
-
Raises:
|
815
|
-
ValueError: Raised if any of the 'project_id', 'branch_id', or 'database_name' parameters are None.
|
816
|
-
requests.HTTPError: Raised if the HTTP request to retrieve the database details fails.
|
817
|
-
|
818
|
-
Tags:
|
819
|
-
get, database, project-management, branch, api
|
820
|
-
"""
|
821
|
-
if project_id is None:
|
822
|
-
raise ValueError("Missing required parameter 'project_id'")
|
823
|
-
if branch_id is None:
|
824
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
825
|
-
if database_name is None:
|
826
|
-
raise ValueError("Missing required parameter 'database_name'")
|
827
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/databases/{database_name}"
|
828
|
-
query_params = {}
|
829
|
-
response = self._get(url, params=query_params)
|
830
|
-
response.raise_for_status()
|
831
|
-
return response.json()
|
832
|
-
|
833
|
-
def update_project_branch_database(self, project_id, branch_id, database_name, database) -> dict[str, Any]:
|
834
|
-
"""
|
835
|
-
Updates the specified database configuration for a given branch in a project.
|
836
|
-
|
837
|
-
Args:
|
838
|
-
project_id: str. Unique identifier of the project.
|
839
|
-
branch_id: str. Identifier of the branch within the project.
|
840
|
-
database_name: str. The name of the database to update.
|
841
|
-
database: Any. The new configuration or content for the database.
|
842
|
-
|
843
|
-
Returns:
|
844
|
-
dict[str, Any]: A dictionary containing the server's JSON response after updating the database.
|
845
|
-
|
846
|
-
Raises:
|
847
|
-
ValueError: Raised if any of the parameters 'project_id', 'branch_id', 'database_name', or 'database' are missing or None.
|
848
|
-
requests.HTTPError: Raised if the HTTP PATCH request fails or returns an unsuccessful status code.
|
849
|
-
|
850
|
-
Tags:
|
851
|
-
update, database, project, branch, api, management
|
852
|
-
"""
|
853
|
-
if project_id is None:
|
854
|
-
raise ValueError("Missing required parameter 'project_id'")
|
855
|
-
if branch_id is None:
|
856
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
857
|
-
if database_name is None:
|
858
|
-
raise ValueError("Missing required parameter 'database_name'")
|
859
|
-
if database is None:
|
860
|
-
raise ValueError("Missing required parameter 'database'")
|
861
|
-
request_body = {
|
862
|
-
'database': database,
|
863
|
-
}
|
864
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
865
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/databases/{database_name}"
|
866
|
-
query_params = {}
|
867
|
-
response = self._patch(url, data=request_body, params=query_params)
|
868
|
-
response.raise_for_status()
|
869
|
-
return response.json()
|
870
|
-
|
871
|
-
def delete_project_branch_database(self, project_id, branch_id, database_name) -> dict[str, Any]:
|
872
|
-
"""
|
873
|
-
Deletes a specific database from a project's branch and returns the response details.
|
874
|
-
|
875
|
-
Args:
|
876
|
-
project_id: The unique identifier of the project containing the database to delete.
|
877
|
-
branch_id: The unique identifier of the branch from which the database will be deleted.
|
878
|
-
database_name: The name of the database to be deleted.
|
879
|
-
|
880
|
-
Returns:
|
881
|
-
A dictionary containing the server's response to the delete operation.
|
882
|
-
|
883
|
-
Raises:
|
884
|
-
ValueError: Raised if 'project_id', 'branch_id', or 'database_name' is None.
|
885
|
-
requests.HTTPError: Raised if the HTTP request to delete the database fails.
|
886
|
-
|
887
|
-
Tags:
|
888
|
-
delete, database, branch, project, management
|
889
|
-
"""
|
890
|
-
if project_id is None:
|
891
|
-
raise ValueError("Missing required parameter 'project_id'")
|
892
|
-
if branch_id is None:
|
893
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
894
|
-
if database_name is None:
|
895
|
-
raise ValueError("Missing required parameter 'database_name'")
|
896
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/databases/{database_name}"
|
897
|
-
query_params = {}
|
898
|
-
response = self._delete(url, params=query_params)
|
899
|
-
response.raise_for_status()
|
900
|
-
return response.json()
|
901
|
-
|
902
|
-
def list_project_branch_roles(self, project_id, branch_id) -> dict[str, Any]:
|
903
|
-
"""
|
904
|
-
Retrieve the list of roles associated with a specific branch in a given project.
|
905
|
-
|
906
|
-
Args:
|
907
|
-
project_id: str. The unique identifier of the project whose branch roles are to be listed.
|
908
|
-
branch_id: str. The unique identifier of the branch within the project.
|
909
|
-
|
910
|
-
Returns:
|
911
|
-
dict[str, Any]: A dictionary containing role information for the specified branch.
|
912
|
-
|
913
|
-
Raises:
|
914
|
-
ValueError: Raised if 'project_id' or 'branch_id' is None.
|
915
|
-
requests.HTTPError: Raised if the HTTP request to retrieve branch roles fails.
|
916
|
-
|
917
|
-
Tags:
|
918
|
-
list, branch, roles, management
|
919
|
-
"""
|
920
|
-
if project_id is None:
|
921
|
-
raise ValueError("Missing required parameter 'project_id'")
|
922
|
-
if branch_id is None:
|
923
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
924
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/roles"
|
925
|
-
query_params = {}
|
926
|
-
response = self._get(url, params=query_params)
|
927
|
-
response.raise_for_status()
|
928
|
-
return response.json()
|
929
|
-
|
930
|
-
def create_project_branch_role(self, project_id, branch_id, role) -> dict[str, Any]:
|
931
|
-
"""
|
932
|
-
Creates a new role for a specific branch within a project and returns the created role information.
|
933
|
-
|
934
|
-
Args:
|
935
|
-
project_id: The unique identifier of the project.
|
936
|
-
branch_id: The unique identifier of the branch within the project.
|
937
|
-
role: The role object or specification to be assigned to the branch.
|
938
|
-
|
939
|
-
Returns:
|
940
|
-
A dictionary containing the details of the created branch role.
|
941
|
-
|
942
|
-
Raises:
|
943
|
-
ValueError: If any of the required parameters ('project_id', 'branch_id', or 'role') are missing.
|
944
|
-
requests.HTTPError: If the HTTP request to create the branch role fails (non-2xx status code).
|
945
|
-
|
946
|
-
Tags:
|
947
|
-
create, role-management, project, branch
|
948
|
-
"""
|
949
|
-
if project_id is None:
|
950
|
-
raise ValueError("Missing required parameter 'project_id'")
|
951
|
-
if branch_id is None:
|
952
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
953
|
-
if role is None:
|
954
|
-
raise ValueError("Missing required parameter 'role'")
|
955
|
-
request_body = {
|
956
|
-
'role': role,
|
957
|
-
}
|
958
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
959
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/roles"
|
960
|
-
query_params = {}
|
961
|
-
response = self._post(url, data=request_body, params=query_params)
|
962
|
-
response.raise_for_status()
|
963
|
-
return response.json()
|
964
|
-
|
965
|
-
def get_project_branch_role(self, project_id, branch_id, role_name) -> dict[str, Any]:
|
966
|
-
"""
|
967
|
-
Retrieves a specific role from a project branch.
|
968
|
-
|
969
|
-
Args:
|
970
|
-
project_id: The unique identifier of the project.
|
971
|
-
branch_id: The unique identifier of the branch within the project.
|
972
|
-
role_name: The name of the role to retrieve.
|
973
|
-
|
974
|
-
Returns:
|
975
|
-
A dictionary containing the role details and attributes.
|
976
|
-
|
977
|
-
Raises:
|
978
|
-
ValueError: Raised when any of the required parameters (project_id, branch_id, or role_name) is None.
|
979
|
-
HTTPError: Raised when the HTTP request fails.
|
980
|
-
|
981
|
-
Tags:
|
982
|
-
get, retrieve, role, management, project, branch
|
983
|
-
"""
|
984
|
-
if project_id is None:
|
985
|
-
raise ValueError("Missing required parameter 'project_id'")
|
986
|
-
if branch_id is None:
|
987
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
988
|
-
if role_name is None:
|
989
|
-
raise ValueError("Missing required parameter 'role_name'")
|
990
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/roles/{role_name}"
|
991
|
-
query_params = {}
|
992
|
-
response = self._get(url, params=query_params)
|
993
|
-
response.raise_for_status()
|
994
|
-
return response.json()
|
995
|
-
|
996
|
-
def delete_project_branch_role(self, project_id, branch_id, role_name) -> dict[str, Any]:
|
997
|
-
"""
|
998
|
-
Deletes a specific role from a branch within a project.
|
999
|
-
|
1000
|
-
Args:
|
1001
|
-
project_id: The unique identifier of the project containing the branch.
|
1002
|
-
branch_id: The identifier of the branch from which the role will be deleted.
|
1003
|
-
role_name: The name of the role to be deleted from the specified branch.
|
1004
|
-
|
1005
|
-
Returns:
|
1006
|
-
A dictionary containing the response data from the server after successfully deleting the role.
|
1007
|
-
|
1008
|
-
Raises:
|
1009
|
-
ValueError: Raised if any of the required parameters ('project_id', 'branch_id', or 'role_name') is None.
|
1010
|
-
requests.HTTPError: Raised if the HTTP request to delete the role fails.
|
1011
|
-
|
1012
|
-
Tags:
|
1013
|
-
delete, role-management, project, branch, api
|
1014
|
-
"""
|
1015
|
-
if project_id is None:
|
1016
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1017
|
-
if branch_id is None:
|
1018
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
1019
|
-
if role_name is None:
|
1020
|
-
raise ValueError("Missing required parameter 'role_name'")
|
1021
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/roles/{role_name}"
|
1022
|
-
query_params = {}
|
1023
|
-
response = self._delete(url, params=query_params)
|
1024
|
-
response.raise_for_status()
|
1025
|
-
return response.json()
|
1026
|
-
|
1027
|
-
def get_project_branch_role_password(self, project_id, branch_id, role_name) -> dict[str, Any]:
|
1028
|
-
"""
|
1029
|
-
Retrieves the revealed password for a specified role within a project branch.
|
1030
|
-
|
1031
|
-
Args:
|
1032
|
-
project_id: The unique identifier of the project whose branch role password is to be retrieved.
|
1033
|
-
branch_id: The unique identifier of the branch within the project.
|
1034
|
-
role_name: The name of the role for which the password should be revealed.
|
1035
|
-
|
1036
|
-
Returns:
|
1037
|
-
A dictionary containing the revealed password and related information for the specified role.
|
1038
|
-
|
1039
|
-
Raises:
|
1040
|
-
ValueError: Raised if any of the required parameters ('project_id', 'branch_id', or 'role_name') are None.
|
1041
|
-
requests.HTTPError: Raised if the HTTP request fails with a non-success status code.
|
1042
|
-
|
1043
|
-
Tags:
|
1044
|
-
get, retrieve, role-management, password, api
|
1045
|
-
"""
|
1046
|
-
if project_id is None:
|
1047
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1048
|
-
if branch_id is None:
|
1049
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
1050
|
-
if role_name is None:
|
1051
|
-
raise ValueError("Missing required parameter 'role_name'")
|
1052
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/roles/{role_name}/reveal_password"
|
1053
|
-
query_params = {}
|
1054
|
-
response = self._get(url, params=query_params)
|
1055
|
-
response.raise_for_status()
|
1056
|
-
return response.json()
|
1057
|
-
|
1058
|
-
def reset_project_branch_role_password(self, project_id, branch_id, role_name) -> dict[str, Any]:
|
1059
|
-
"""
|
1060
|
-
Resets the password for a specific role in a project branch.
|
1061
|
-
|
1062
|
-
Args:
|
1063
|
-
project_id: The unique identifier of the project whose branch role password is to be reset.
|
1064
|
-
branch_id: The unique identifier of the branch within the project.
|
1065
|
-
role_name: The name of the role whose password will be reset.
|
1066
|
-
|
1067
|
-
Returns:
|
1068
|
-
A dictionary containing the response data from the password reset operation.
|
1069
|
-
|
1070
|
-
Raises:
|
1071
|
-
ValueError: Raised if 'project_id', 'branch_id', or 'role_name' is None.
|
1072
|
-
HTTPError: Raised if the HTTP request to reset the password fails.
|
1073
|
-
|
1074
|
-
Tags:
|
1075
|
-
reset, role-management, project, branch, password, api
|
1076
|
-
"""
|
1077
|
-
if project_id is None:
|
1078
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1079
|
-
if branch_id is None:
|
1080
|
-
raise ValueError("Missing required parameter 'branch_id'")
|
1081
|
-
if role_name is None:
|
1082
|
-
raise ValueError("Missing required parameter 'role_name'")
|
1083
|
-
url = f"{self.base_url}/projects/{project_id}/branches/{branch_id}/roles/{role_name}/reset_password"
|
1084
|
-
query_params = {}
|
1085
|
-
response = self._post(url, data={}, params=query_params)
|
1086
|
-
response.raise_for_status()
|
1087
|
-
return response.json()
|
1088
|
-
|
1089
|
-
def list_project_vpcendpoints(self, project_id) -> dict[str, Any]:
|
1090
|
-
"""
|
1091
|
-
Retrieves a list of VPC endpoints associated with a specific project.
|
1092
|
-
|
1093
|
-
Args:
|
1094
|
-
project_id: The unique identifier of the project for which to retrieve VPC endpoints.
|
1095
|
-
|
1096
|
-
Returns:
|
1097
|
-
A dictionary containing the VPC endpoints data for the specified project.
|
1098
|
-
|
1099
|
-
Raises:
|
1100
|
-
ValueError: If 'project_id' is None.
|
1101
|
-
requests.HTTPError: If the HTTP request to retrieve VPC endpoints fails.
|
1102
|
-
|
1103
|
-
Tags:
|
1104
|
-
list, vpc-endpoints, project, management
|
1105
|
-
"""
|
1106
|
-
if project_id is None:
|
1107
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1108
|
-
url = f"{self.base_url}/projects/{project_id}/vpc-endpoints"
|
1109
|
-
query_params = {}
|
1110
|
-
response = self._get(url, params=query_params)
|
1111
|
-
response.raise_for_status()
|
1112
|
-
return response.json()
|
1113
|
-
|
1114
|
-
def assign_project_vpcendpoint(self, project_id, vpc_endpoint_id, label) -> Any:
|
1115
|
-
"""
|
1116
|
-
Assigns a VPC endpoint to a project with a specified label and returns the server response.
|
1117
|
-
|
1118
|
-
Args:
|
1119
|
-
project_id: str. The unique identifier of the project to which the VPC endpoint will be assigned.
|
1120
|
-
vpc_endpoint_id: str. The unique identifier of the VPC endpoint to be assigned to the project.
|
1121
|
-
label: str. The label to associate with the assigned VPC endpoint.
|
1122
|
-
|
1123
|
-
Returns:
|
1124
|
-
dict. The JSON response from the server after assigning the VPC endpoint to the project.
|
1125
|
-
|
1126
|
-
Raises:
|
1127
|
-
ValueError: Raised if any of 'project_id', 'vpc_endpoint_id', or 'label' is None.
|
1128
|
-
requests.HTTPError: Raised if the HTTP request to assign the VPC endpoint fails (non-2xx response).
|
1129
|
-
|
1130
|
-
Tags:
|
1131
|
-
assign, vpc-endpoint, project, management, api
|
1132
|
-
"""
|
1133
|
-
if project_id is None:
|
1134
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1135
|
-
if vpc_endpoint_id is None:
|
1136
|
-
raise ValueError("Missing required parameter 'vpc_endpoint_id'")
|
1137
|
-
if label is None:
|
1138
|
-
raise ValueError("Missing required parameter 'label'")
|
1139
|
-
request_body = {
|
1140
|
-
'label': label,
|
1141
|
-
}
|
1142
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
1143
|
-
url = f"{self.base_url}/projects/{project_id}/vpc-endpoints/{vpc_endpoint_id}"
|
1144
|
-
query_params = {}
|
1145
|
-
response = self._post(url, data=request_body, params=query_params)
|
1146
|
-
response.raise_for_status()
|
1147
|
-
return response.json()
|
1148
|
-
|
1149
|
-
def delete_project_vpcendpoint(self, project_id, vpc_endpoint_id) -> Any:
|
1150
|
-
"""
|
1151
|
-
Deletes a VPC endpoint associated with a given project.
|
1152
|
-
|
1153
|
-
Args:
|
1154
|
-
project_id: The unique identifier of the project containing the VPC endpoint to delete.
|
1155
|
-
vpc_endpoint_id: The unique identifier of the VPC endpoint to be deleted.
|
1156
|
-
|
1157
|
-
Returns:
|
1158
|
-
A dictionary containing the response from the delete operation.
|
1159
|
-
|
1160
|
-
Raises:
|
1161
|
-
ValueError: If 'project_id' or 'vpc_endpoint_id' is None.
|
1162
|
-
requests.HTTPError: If the HTTP request to delete the VPC endpoint fails.
|
1163
|
-
|
1164
|
-
Tags:
|
1165
|
-
delete, vpc-endpoint, management, api
|
1166
|
-
"""
|
1167
|
-
if project_id is None:
|
1168
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1169
|
-
if vpc_endpoint_id is None:
|
1170
|
-
raise ValueError("Missing required parameter 'vpc_endpoint_id'")
|
1171
|
-
url = f"{self.base_url}/projects/{project_id}/vpc-endpoints/{vpc_endpoint_id}"
|
1172
|
-
query_params = {}
|
1173
|
-
response = self._delete(url, params=query_params)
|
1174
|
-
response.raise_for_status()
|
1175
|
-
return response.json()
|
1176
|
-
|
1177
|
-
def create_project_endpoint(self, project_id, endpoint) -> dict[str, Any]:
|
1178
|
-
"""
|
1179
|
-
Creates a new endpoint for the specified project by sending a POST request to the project endpoint API.
|
1180
|
-
|
1181
|
-
Args:
|
1182
|
-
project_id: The unique identifier of the project for which the endpoint will be created.
|
1183
|
-
endpoint: The configuration or name of the endpoint to be created for the project.
|
1184
|
-
|
1185
|
-
Returns:
|
1186
|
-
A dictionary containing the JSON response from the API after creating the endpoint.
|
1187
|
-
|
1188
|
-
Raises:
|
1189
|
-
ValueError: Raised if 'project_id' or 'endpoint' is None.
|
1190
|
-
HTTPError: Raised if the HTTP request to create the endpoint returns an unsuccessful status code.
|
1191
|
-
|
1192
|
-
Tags:
|
1193
|
-
create, endpoint, api, project-management
|
1194
|
-
"""
|
1195
|
-
if project_id is None:
|
1196
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1197
|
-
if endpoint is None:
|
1198
|
-
raise ValueError("Missing required parameter 'endpoint'")
|
1199
|
-
request_body = {
|
1200
|
-
'endpoint': endpoint,
|
1201
|
-
}
|
1202
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
1203
|
-
url = f"{self.base_url}/projects/{project_id}/endpoints"
|
1204
|
-
query_params = {}
|
1205
|
-
response = self._post(url, data=request_body, params=query_params)
|
1206
|
-
response.raise_for_status()
|
1207
|
-
return response.json()
|
1208
|
-
|
1209
|
-
def list_project_endpoints(self, project_id) -> dict[str, Any]:
|
1210
|
-
"""
|
1211
|
-
Retrieves a list of API endpoints associated with a specified project.
|
1212
|
-
|
1213
|
-
Args:
|
1214
|
-
project_id: str. Unique identifier of the project whose endpoints are to be listed.
|
1215
|
-
|
1216
|
-
Returns:
|
1217
|
-
dict. A dictionary representing the JSON response containing the project's endpoints.
|
1218
|
-
|
1219
|
-
Raises:
|
1220
|
-
ValueError: If 'project_id' is None.
|
1221
|
-
HTTPError: If the HTTP request to fetch endpoints fails.
|
1222
|
-
|
1223
|
-
Tags:
|
1224
|
-
list, endpoints, project, api
|
1225
|
-
"""
|
1226
|
-
if project_id is None:
|
1227
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1228
|
-
url = f"{self.base_url}/projects/{project_id}/endpoints"
|
1229
|
-
query_params = {}
|
1230
|
-
response = self._get(url, params=query_params)
|
1231
|
-
response.raise_for_status()
|
1232
|
-
return response.json()
|
1233
|
-
|
1234
|
-
def get_project_endpoint(self, project_id, endpoint_id) -> dict[str, Any]:
|
1235
|
-
"""
|
1236
|
-
Retrieves the details of a specific endpoint within a project.
|
1237
|
-
|
1238
|
-
Args:
|
1239
|
-
project_id: str. The unique identifier of the project containing the endpoint.
|
1240
|
-
endpoint_id: str. The unique identifier of the endpoint to retrieve.
|
1241
|
-
|
1242
|
-
Returns:
|
1243
|
-
dict[str, Any]: A dictionary containing the endpoint details as returned by the API.
|
1244
|
-
|
1245
|
-
Raises:
|
1246
|
-
ValueError: Raised if 'project_id' or 'endpoint_id' is None.
|
1247
|
-
requests.HTTPError: Raised if the HTTP request fails or an HTTP error status is returned.
|
1248
|
-
|
1249
|
-
Tags:
|
1250
|
-
get, endpoint, project, api
|
1251
|
-
"""
|
1252
|
-
if project_id is None:
|
1253
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1254
|
-
if endpoint_id is None:
|
1255
|
-
raise ValueError("Missing required parameter 'endpoint_id'")
|
1256
|
-
url = f"{self.base_url}/projects/{project_id}/endpoints/{endpoint_id}"
|
1257
|
-
query_params = {}
|
1258
|
-
response = self._get(url, params=query_params)
|
1259
|
-
response.raise_for_status()
|
1260
|
-
return response.json()
|
1261
|
-
|
1262
|
-
def delete_project_endpoint(self, project_id, endpoint_id) -> dict[str, Any]:
|
1263
|
-
"""
|
1264
|
-
Deletes a specific endpoint from a given project.
|
1265
|
-
|
1266
|
-
Args:
|
1267
|
-
project_id: The unique identifier of the project containing the endpoint to delete.
|
1268
|
-
endpoint_id: The unique identifier of the endpoint to be deleted.
|
1269
|
-
|
1270
|
-
Returns:
|
1271
|
-
A dictionary containing the server's JSON response to the deletion request.
|
1272
|
-
|
1273
|
-
Raises:
|
1274
|
-
ValueError: Raised if either 'project_id' or 'endpoint_id' is None.
|
1275
|
-
requests.HTTPError: Raised if the HTTP request to delete the endpoint fails.
|
1276
|
-
|
1277
|
-
Tags:
|
1278
|
-
delete, endpoint-management, project-management
|
1279
|
-
"""
|
1280
|
-
if project_id is None:
|
1281
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1282
|
-
if endpoint_id is None:
|
1283
|
-
raise ValueError("Missing required parameter 'endpoint_id'")
|
1284
|
-
url = f"{self.base_url}/projects/{project_id}/endpoints/{endpoint_id}"
|
1285
|
-
query_params = {}
|
1286
|
-
response = self._delete(url, params=query_params)
|
1287
|
-
response.raise_for_status()
|
1288
|
-
return response.json()
|
1289
|
-
|
1290
|
-
def update_project_endpoint(self, project_id, endpoint_id, endpoint) -> dict[str, Any]:
|
1291
|
-
"""
|
1292
|
-
Updates the configuration of a specific endpoint within a project.
|
1293
|
-
|
1294
|
-
Args:
|
1295
|
-
project_id: The unique identifier of the project containing the endpoint to update.
|
1296
|
-
endpoint_id: The unique identifier of the endpoint to update.
|
1297
|
-
endpoint: A dictionary containing the new endpoint configuration data.
|
1298
|
-
|
1299
|
-
Returns:
|
1300
|
-
A dictionary representing the updated endpoint details as returned by the API.
|
1301
|
-
|
1302
|
-
Raises:
|
1303
|
-
ValueError: Raised if any of the required parameters ('project_id', 'endpoint_id', or 'endpoint') are missing or None.
|
1304
|
-
requests.HTTPError: Raised if the HTTP PATCH request fails due to a client or server error.
|
1305
|
-
|
1306
|
-
Tags:
|
1307
|
-
update, endpoint-management, project, api
|
1308
|
-
"""
|
1309
|
-
if project_id is None:
|
1310
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1311
|
-
if endpoint_id is None:
|
1312
|
-
raise ValueError("Missing required parameter 'endpoint_id'")
|
1313
|
-
if endpoint is None:
|
1314
|
-
raise ValueError("Missing required parameter 'endpoint'")
|
1315
|
-
request_body = {
|
1316
|
-
'endpoint': endpoint,
|
1317
|
-
}
|
1318
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
1319
|
-
url = f"{self.base_url}/projects/{project_id}/endpoints/{endpoint_id}"
|
1320
|
-
query_params = {}
|
1321
|
-
response = self._patch(url, data=request_body, params=query_params)
|
1322
|
-
response.raise_for_status()
|
1323
|
-
return response.json()
|
1324
|
-
|
1325
|
-
def start_project_endpoint(self, project_id, endpoint_id) -> dict[str, Any]:
|
1326
|
-
"""
|
1327
|
-
Starts the specified endpoint for a given project by making a POST request to the API.
|
1328
|
-
|
1329
|
-
Args:
|
1330
|
-
project_id: str. The identifier of the project containing the endpoint to start.
|
1331
|
-
endpoint_id: str. The identifier of the endpoint to start within the project.
|
1332
|
-
|
1333
|
-
Returns:
|
1334
|
-
dict[str, Any]: The JSON response from the API after starting the endpoint.
|
1335
|
-
|
1336
|
-
Raises:
|
1337
|
-
ValueError: If 'project_id' or 'endpoint_id' is None.
|
1338
|
-
requests.HTTPError: If the HTTP request to start the endpoint fails.
|
1339
|
-
|
1340
|
-
Tags:
|
1341
|
-
start, endpoint, project-management, api
|
1342
|
-
"""
|
1343
|
-
if project_id is None:
|
1344
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1345
|
-
if endpoint_id is None:
|
1346
|
-
raise ValueError("Missing required parameter 'endpoint_id'")
|
1347
|
-
url = f"{self.base_url}/projects/{project_id}/endpoints/{endpoint_id}/start"
|
1348
|
-
query_params = {}
|
1349
|
-
response = self._post(url, data={}, params=query_params)
|
1350
|
-
response.raise_for_status()
|
1351
|
-
return response.json()
|
1352
|
-
|
1353
|
-
def suspend_project_endpoint(self, project_id, endpoint_id) -> dict[str, Any]:
|
1354
|
-
"""
|
1355
|
-
Suspends a specific endpoint within a project by issuing a POST request to the suspend endpoint API.
|
1356
|
-
|
1357
|
-
Args:
|
1358
|
-
project_id: str. Unique identifier of the project containing the endpoint to be suspended.
|
1359
|
-
endpoint_id: str. Unique identifier of the endpoint to suspend.
|
1360
|
-
|
1361
|
-
Returns:
|
1362
|
-
dict[str, Any]: The parsed JSON response from the API after suspending the endpoint.
|
1363
|
-
|
1364
|
-
Raises:
|
1365
|
-
ValueError: Raised if 'project_id' or 'endpoint_id' is None.
|
1366
|
-
requests.HTTPError: Raised if the POST request to the API fails (non-2xx status code).
|
1367
|
-
|
1368
|
-
Tags:
|
1369
|
-
suspend, endpoint, management, api
|
1370
|
-
"""
|
1371
|
-
if project_id is None:
|
1372
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1373
|
-
if endpoint_id is None:
|
1374
|
-
raise ValueError("Missing required parameter 'endpoint_id'")
|
1375
|
-
url = f"{self.base_url}/projects/{project_id}/endpoints/{endpoint_id}/suspend"
|
1376
|
-
query_params = {}
|
1377
|
-
response = self._post(url, data={}, params=query_params)
|
1378
|
-
response.raise_for_status()
|
1379
|
-
return response.json()
|
1380
|
-
|
1381
|
-
def restart_project_endpoint(self, project_id, endpoint_id) -> dict[str, Any]:
|
1382
|
-
"""
|
1383
|
-
Restarts a specific project endpoint by sending a POST request to the server.
|
1384
|
-
|
1385
|
-
Args:
|
1386
|
-
project_id: str. The unique identifier of the project containing the endpoint to be restarted.
|
1387
|
-
endpoint_id: str. The unique identifier of the endpoint to restart.
|
1388
|
-
|
1389
|
-
Returns:
|
1390
|
-
dict. The server's JSON response containing details of the restarted endpoint operation.
|
1391
|
-
|
1392
|
-
Raises:
|
1393
|
-
ValueError: If 'project_id' or 'endpoint_id' is None.
|
1394
|
-
HTTPError: If the HTTP request to restart the endpoint fails (raised by response.raise_for_status()).
|
1395
|
-
|
1396
|
-
Tags:
|
1397
|
-
restart, endpoint-management, project-management, api
|
1398
|
-
"""
|
1399
|
-
if project_id is None:
|
1400
|
-
raise ValueError("Missing required parameter 'project_id'")
|
1401
|
-
if endpoint_id is None:
|
1402
|
-
raise ValueError("Missing required parameter 'endpoint_id'")
|
1403
|
-
url = f"{self.base_url}/projects/{project_id}/endpoints/{endpoint_id}/restart"
|
1404
|
-
query_params = {}
|
1405
|
-
response = self._post(url, data={}, params=query_params)
|
1406
|
-
response.raise_for_status()
|
1407
|
-
return response.json()
|
1408
|
-
|
1409
|
-
def get_organization(self, org_id) -> dict[str, Any]:
|
1410
|
-
"""
|
1411
|
-
Retrieves the details of a specific organization using its unique organization ID.
|
1412
|
-
|
1413
|
-
Args:
|
1414
|
-
org_id: str. The unique identifier of the organization to retrieve.
|
1415
|
-
|
1416
|
-
Returns:
|
1417
|
-
dict[str, Any]: A dictionary containing the organization's details as returned by the API.
|
1418
|
-
|
1419
|
-
Raises:
|
1420
|
-
ValueError: Raised if the 'org_id' parameter is None.
|
1421
|
-
requests.HTTPError: Raised if the HTTP request to fetch the organization fails (e.g., not found, server error).
|
1422
|
-
|
1423
|
-
Tags:
|
1424
|
-
get, organization, api, management
|
1425
|
-
"""
|
1426
|
-
if org_id is None:
|
1427
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1428
|
-
url = f"{self.base_url}/organizations/{org_id}"
|
1429
|
-
query_params = {}
|
1430
|
-
response = self._get(url, params=query_params)
|
1431
|
-
response.raise_for_status()
|
1432
|
-
return response.json()
|
1433
|
-
|
1434
|
-
def revoke_org_api_key(self, org_id, key_id) -> dict[str, Any]:
|
1435
|
-
"""
|
1436
|
-
Revokes an API key for a specific organization by sending a DELETE request.
|
1437
|
-
|
1438
|
-
Args:
|
1439
|
-
org_id: The unique identifier of the organization whose API key is to be revoked.
|
1440
|
-
key_id: The unique identifier of the API key to revoke.
|
1441
|
-
|
1442
|
-
Returns:
|
1443
|
-
A dictionary containing the response from the API after revoking the key.
|
1444
|
-
|
1445
|
-
Raises:
|
1446
|
-
ValueError: Raised if 'org_id' or 'key_id' is None.
|
1447
|
-
requests.HTTPError: Raised if the HTTP request fails with a non-success status code.
|
1448
|
-
|
1449
|
-
Tags:
|
1450
|
-
revoke, api-key, management, delete
|
1451
|
-
"""
|
1452
|
-
if org_id is None:
|
1453
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1454
|
-
if key_id is None:
|
1455
|
-
raise ValueError("Missing required parameter 'key_id'")
|
1456
|
-
url = f"{self.base_url}/organizations/{org_id}/api_keys/{key_id}"
|
1457
|
-
query_params = {}
|
1458
|
-
response = self._delete(url, params=query_params)
|
1459
|
-
response.raise_for_status()
|
1460
|
-
return response.json()
|
1461
|
-
|
1462
|
-
def get_organization_members(self, org_id) -> dict[str, Any]:
|
1463
|
-
"""
|
1464
|
-
Retrieves the list of members belonging to a specified organization by organization ID.
|
1465
|
-
|
1466
|
-
Args:
|
1467
|
-
org_id: The unique identifier of the organization whose members are to be fetched.
|
1468
|
-
|
1469
|
-
Returns:
|
1470
|
-
A dictionary containing the organization members' details as returned by the API.
|
1471
|
-
|
1472
|
-
Raises:
|
1473
|
-
ValueError: If 'org_id' is None.
|
1474
|
-
HTTPError: If the HTTP request to the API endpoint fails.
|
1475
|
-
|
1476
|
-
Tags:
|
1477
|
-
get, list, organization, members, api
|
1478
|
-
"""
|
1479
|
-
if org_id is None:
|
1480
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1481
|
-
url = f"{self.base_url}/organizations/{org_id}/members"
|
1482
|
-
query_params = {}
|
1483
|
-
response = self._get(url, params=query_params)
|
1484
|
-
response.raise_for_status()
|
1485
|
-
return response.json()
|
1486
|
-
|
1487
|
-
def get_organization_member(self, org_id, member_id) -> dict[str, Any]:
|
1488
|
-
"""
|
1489
|
-
Retrieves information about a specific member within an organization by their identifiers.
|
1490
|
-
|
1491
|
-
Args:
|
1492
|
-
org_id: The unique identifier of the organization. Must not be None.
|
1493
|
-
member_id: The unique identifier of the member within the organization. Must not be None.
|
1494
|
-
|
1495
|
-
Returns:
|
1496
|
-
A dictionary containing the member details as returned by the API.
|
1497
|
-
|
1498
|
-
Raises:
|
1499
|
-
ValueError: Raised if either 'org_id' or 'member_id' is None.
|
1500
|
-
requests.HTTPError: Raised if the HTTP request to retrieve the member fails.
|
1501
|
-
|
1502
|
-
Tags:
|
1503
|
-
get, organization, member, management, api
|
1504
|
-
"""
|
1505
|
-
if org_id is None:
|
1506
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1507
|
-
if member_id is None:
|
1508
|
-
raise ValueError("Missing required parameter 'member_id'")
|
1509
|
-
url = f"{self.base_url}/organizations/{org_id}/members/{member_id}"
|
1510
|
-
query_params = {}
|
1511
|
-
response = self._get(url, params=query_params)
|
1512
|
-
response.raise_for_status()
|
1513
|
-
return response.json()
|
1514
|
-
|
1515
|
-
def update_organization_member(self, org_id, member_id, role) -> dict[str, Any]:
|
1516
|
-
"""
|
1517
|
-
Updates the role of a specific member within an organization.
|
1518
|
-
|
1519
|
-
Args:
|
1520
|
-
org_id: The unique identifier of the organization.
|
1521
|
-
member_id: The unique identifier of the member whose role is to be updated.
|
1522
|
-
role: The new role to assign to the organization member.
|
1523
|
-
|
1524
|
-
Returns:
|
1525
|
-
A dictionary containing the updated member information as returned by the API.
|
1526
|
-
|
1527
|
-
Raises:
|
1528
|
-
ValueError: Raised if 'org_id', 'member_id', or 'role' is None.
|
1529
|
-
requests.HTTPError: Raised if the HTTP PATCH request fails.
|
1530
|
-
|
1531
|
-
Tags:
|
1532
|
-
update, organization, member-management, role, api
|
1533
|
-
"""
|
1534
|
-
if org_id is None:
|
1535
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1536
|
-
if member_id is None:
|
1537
|
-
raise ValueError("Missing required parameter 'member_id'")
|
1538
|
-
if role is None:
|
1539
|
-
raise ValueError("Missing required parameter 'role'")
|
1540
|
-
request_body = {
|
1541
|
-
'role': role,
|
1542
|
-
}
|
1543
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
1544
|
-
url = f"{self.base_url}/organizations/{org_id}/members/{member_id}"
|
1545
|
-
query_params = {}
|
1546
|
-
response = self._patch(url, data=request_body, params=query_params)
|
1547
|
-
response.raise_for_status()
|
1548
|
-
return response.json()
|
1549
|
-
|
1550
|
-
def remove_organization_member(self, org_id, member_id) -> dict[str, Any]:
|
1551
|
-
"""
|
1552
|
-
Removes a specified member from an organization.
|
1553
|
-
|
1554
|
-
Args:
|
1555
|
-
org_id: str. The unique identifier of the organization from which the member will be removed.
|
1556
|
-
member_id: str. The unique identifier of the member to remove from the organization.
|
1557
|
-
|
1558
|
-
Returns:
|
1559
|
-
dict[str, Any]: The response data from the API after attempting to remove the member.
|
1560
|
-
|
1561
|
-
Raises:
|
1562
|
-
ValueError: Raised if 'org_id' or 'member_id' is None.
|
1563
|
-
requests.HTTPError: Raised if the API response contains an HTTP error status.
|
1564
|
-
|
1565
|
-
Tags:
|
1566
|
-
remove, member-management, organization
|
1567
|
-
"""
|
1568
|
-
if org_id is None:
|
1569
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1570
|
-
if member_id is None:
|
1571
|
-
raise ValueError("Missing required parameter 'member_id'")
|
1572
|
-
url = f"{self.base_url}/organizations/{org_id}/members/{member_id}"
|
1573
|
-
query_params = {}
|
1574
|
-
response = self._delete(url, params=query_params)
|
1575
|
-
response.raise_for_status()
|
1576
|
-
return response.json()
|
1577
|
-
|
1578
|
-
def get_organization_invitations(self, org_id) -> dict[str, Any]:
|
1579
|
-
"""
|
1580
|
-
Retrieves the list of invitations for a specified organization.
|
1581
|
-
|
1582
|
-
Args:
|
1583
|
-
org_id: The unique identifier of the organization for which to fetch invitations.
|
1584
|
-
|
1585
|
-
Returns:
|
1586
|
-
A dictionary containing the organization's invitations as returned by the API.
|
1587
|
-
|
1588
|
-
Raises:
|
1589
|
-
ValueError: If 'org_id' is None.
|
1590
|
-
requests.HTTPError: If the HTTP request to the remote API fails with a non-success status code.
|
1591
|
-
|
1592
|
-
Tags:
|
1593
|
-
get, organization, invitations, api
|
1594
|
-
"""
|
1595
|
-
if org_id is None:
|
1596
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1597
|
-
url = f"{self.base_url}/organizations/{org_id}/invitations"
|
1598
|
-
query_params = {}
|
1599
|
-
response = self._get(url, params=query_params)
|
1600
|
-
response.raise_for_status()
|
1601
|
-
return response.json()
|
1602
|
-
|
1603
|
-
def create_organization_invitations(self, org_id, invitations) -> dict[str, Any]:
|
1604
|
-
"""
|
1605
|
-
Creates new invitations for users to join an organization by sending a POST request to the organization's invitations endpoint.
|
1606
|
-
|
1607
|
-
Args:
|
1608
|
-
org_id: The identifier of the organization to which invitations will be sent.
|
1609
|
-
invitations: A list of invitation details to be sent to users (must be serializable to JSON).
|
1610
|
-
|
1611
|
-
Returns:
|
1612
|
-
A dictionary containing the API response data for the created invitations.
|
1613
|
-
|
1614
|
-
Raises:
|
1615
|
-
ValueError: If 'org_id' or 'invitations' is None.
|
1616
|
-
requests.HTTPError: If the HTTP request to the API fails.
|
1617
|
-
|
1618
|
-
Tags:
|
1619
|
-
create, invitations, api, organization-management
|
1620
|
-
"""
|
1621
|
-
if org_id is None:
|
1622
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1623
|
-
if invitations is None:
|
1624
|
-
raise ValueError("Missing required parameter 'invitations'")
|
1625
|
-
request_body = {
|
1626
|
-
'invitations': invitations,
|
1627
|
-
}
|
1628
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
1629
|
-
url = f"{self.base_url}/organizations/{org_id}/invitations"
|
1630
|
-
query_params = {}
|
1631
|
-
response = self._post(url, data=request_body, params=query_params)
|
1632
|
-
response.raise_for_status()
|
1633
|
-
return response.json()
|
1634
|
-
|
1635
|
-
def list_organization_vpcendpoints(self, org_id, region_id) -> dict[str, Any]:
|
1636
|
-
"""
|
1637
|
-
Retrieves a list of VPC endpoints for a specified organization and region.
|
1638
|
-
|
1639
|
-
Args:
|
1640
|
-
org_id: The unique identifier of the organization for which to list VPC endpoints.
|
1641
|
-
region_id: The identifier of the region within the organization to filter VPC endpoints.
|
1642
|
-
|
1643
|
-
Returns:
|
1644
|
-
A dictionary containing the VPC endpoints data for the specified organization and region.
|
1645
|
-
|
1646
|
-
Raises:
|
1647
|
-
ValueError: Raised if 'org_id' or 'region_id' is None.
|
1648
|
-
requests.HTTPError: Raised if the HTTP request to retrieve VPC endpoints results in an error status code.
|
1649
|
-
|
1650
|
-
Tags:
|
1651
|
-
list, vpc, networking, management
|
1652
|
-
"""
|
1653
|
-
if org_id is None:
|
1654
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1655
|
-
if region_id is None:
|
1656
|
-
raise ValueError("Missing required parameter 'region_id'")
|
1657
|
-
url = f"{self.base_url}/organizations/{org_id}/vpc/region/{region_id}/vpc-endpoints"
|
1658
|
-
query_params = {}
|
1659
|
-
response = self._get(url, params=query_params)
|
1660
|
-
response.raise_for_status()
|
1661
|
-
return response.json()
|
1662
|
-
|
1663
|
-
def get_organization_vpcendpoint_details(self, org_id, region_id, vpc_endpoint_id) -> dict[str, Any]:
|
1664
|
-
"""
|
1665
|
-
Retrieves details about a specific VPC endpoint for an organization in a given region.
|
1666
|
-
|
1667
|
-
Args:
|
1668
|
-
org_id: str. The unique identifier of the organization.
|
1669
|
-
region_id: str. The identifier of the region containing the VPC endpoint.
|
1670
|
-
vpc_endpoint_id: str. The unique identifier of the VPC endpoint to retrieve details for.
|
1671
|
-
|
1672
|
-
Returns:
|
1673
|
-
dict[str, Any]: A dictionary containing the details of the specified VPC endpoint.
|
1674
|
-
|
1675
|
-
Raises:
|
1676
|
-
ValueError: If any of 'org_id', 'region_id', or 'vpc_endpoint_id' is None.
|
1677
|
-
requests.HTTPError: If the HTTP request to retrieve details fails with an error status code.
|
1678
|
-
|
1679
|
-
Tags:
|
1680
|
-
get, vpc-endpoint, organization, networking, details
|
1681
|
-
"""
|
1682
|
-
if org_id is None:
|
1683
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1684
|
-
if region_id is None:
|
1685
|
-
raise ValueError("Missing required parameter 'region_id'")
|
1686
|
-
if vpc_endpoint_id is None:
|
1687
|
-
raise ValueError("Missing required parameter 'vpc_endpoint_id'")
|
1688
|
-
url = f"{self.base_url}/organizations/{org_id}/vpc/region/{region_id}/vpc-endpoints/{vpc_endpoint_id}"
|
1689
|
-
query_params = {}
|
1690
|
-
response = self._get(url, params=query_params)
|
1691
|
-
response.raise_for_status()
|
1692
|
-
return response.json()
|
1693
|
-
|
1694
|
-
def assign_organization_vpcendpoint(self, org_id, region_id, vpc_endpoint_id, label) -> Any:
|
1695
|
-
"""
|
1696
|
-
Assigns a label to a specified organization VPC endpoint in a given region.
|
1697
|
-
|
1698
|
-
Args:
|
1699
|
-
org_id: str. Unique identifier of the organization.
|
1700
|
-
region_id: str. Identifier for the region where the VPC endpoint resides.
|
1701
|
-
vpc_endpoint_id: str. Unique identifier of the VPC endpoint to assign the label to.
|
1702
|
-
label: str. The label to assign to the VPC endpoint.
|
1703
|
-
|
1704
|
-
Returns:
|
1705
|
-
dict. JSON response from the API containing details of the labeled VPC endpoint.
|
1706
|
-
|
1707
|
-
Raises:
|
1708
|
-
ValueError: Raised if any of the required parameters ('org_id', 'region_id', 'vpc_endpoint_id', or 'label') are None.
|
1709
|
-
requests.HTTPError: Raised if the HTTP request to the API fails with an error status code.
|
1710
|
-
|
1711
|
-
Tags:
|
1712
|
-
assign, vpc-endpoint, label, management, network, api
|
1713
|
-
"""
|
1714
|
-
if org_id is None:
|
1715
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1716
|
-
if region_id is None:
|
1717
|
-
raise ValueError("Missing required parameter 'region_id'")
|
1718
|
-
if vpc_endpoint_id is None:
|
1719
|
-
raise ValueError("Missing required parameter 'vpc_endpoint_id'")
|
1720
|
-
if label is None:
|
1721
|
-
raise ValueError("Missing required parameter 'label'")
|
1722
|
-
request_body = {
|
1723
|
-
'label': label,
|
1724
|
-
}
|
1725
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
1726
|
-
url = f"{self.base_url}/organizations/{org_id}/vpc/region/{region_id}/vpc-endpoints/{vpc_endpoint_id}"
|
1727
|
-
query_params = {}
|
1728
|
-
response = self._post(url, data=request_body, params=query_params)
|
1729
|
-
response.raise_for_status()
|
1730
|
-
return response.json()
|
1731
|
-
|
1732
|
-
def delete_organization_vpcendpoint(self, org_id, region_id, vpc_endpoint_id) -> Any:
|
1733
|
-
"""
|
1734
|
-
Deletes a specific VPC endpoint associated with an organization and region.
|
1735
|
-
|
1736
|
-
Args:
|
1737
|
-
org_id: The unique identifier of the organization.
|
1738
|
-
region_id: The unique identifier of the region where the VPC endpoint is located.
|
1739
|
-
vpc_endpoint_id: The identifier of the VPC endpoint to delete.
|
1740
|
-
|
1741
|
-
Returns:
|
1742
|
-
The JSON response from the API containing the result of the delete operation.
|
1743
|
-
|
1744
|
-
Raises:
|
1745
|
-
ValueError: Raised if any of 'org_id', 'region_id', or 'vpc_endpoint_id' is None.
|
1746
|
-
requests.HTTPError: Raised if the HTTP request to delete the VPC endpoint fails.
|
1747
|
-
|
1748
|
-
Tags:
|
1749
|
-
delete, vpc-endpoint, organization, management
|
1750
|
-
"""
|
1751
|
-
if org_id is None:
|
1752
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1753
|
-
if region_id is None:
|
1754
|
-
raise ValueError("Missing required parameter 'region_id'")
|
1755
|
-
if vpc_endpoint_id is None:
|
1756
|
-
raise ValueError("Missing required parameter 'vpc_endpoint_id'")
|
1757
|
-
url = f"{self.base_url}/organizations/{org_id}/vpc/region/{region_id}/vpc-endpoints/{vpc_endpoint_id}"
|
1758
|
-
query_params = {}
|
1759
|
-
response = self._delete(url, params=query_params)
|
1760
|
-
response.raise_for_status()
|
1761
|
-
return response.json()
|
1762
|
-
|
1763
|
-
def get_active_regions(self, ) -> dict[str, Any]:
|
1764
|
-
"""
|
1765
|
-
Retrieves a list of active regions available in the system.
|
1766
|
-
|
1767
|
-
Returns:
|
1768
|
-
A dictionary containing information about active regions, with region identifiers as keys and their properties as values.
|
1769
|
-
|
1770
|
-
Raises:
|
1771
|
-
HTTPError: If the HTTP request fails or returns an unsuccessful status code.
|
1772
|
-
|
1773
|
-
Tags:
|
1774
|
-
retrieve, regions, http, get, api, geography
|
1775
|
-
"""
|
1776
|
-
url = f"{self.base_url}/regions"
|
1777
|
-
query_params = {}
|
1778
|
-
response = self._get(url, params=query_params)
|
1779
|
-
response.raise_for_status()
|
1780
|
-
return response.json()
|
1781
|
-
|
1782
|
-
def get_current_user_info(self, ) -> dict[str, Any]:
|
1783
|
-
"""
|
1784
|
-
Retrieves information about the currently authenticated user from the API.
|
1785
|
-
|
1786
|
-
Args:
|
1787
|
-
None: This function takes no arguments
|
1788
|
-
|
1789
|
-
Returns:
|
1790
|
-
A dictionary containing details about the current user as returned by the API.
|
1791
|
-
|
1792
|
-
Raises:
|
1793
|
-
requests.exceptions.HTTPError: Raised if the HTTP request to the API fails or returns an unsuccessful status code.
|
1794
|
-
|
1795
|
-
Tags:
|
1796
|
-
get, user-info, api
|
1797
|
-
"""
|
1798
|
-
url = f"{self.base_url}/users/me"
|
1799
|
-
query_params = {}
|
1800
|
-
response = self._get(url, params=query_params)
|
1801
|
-
response.raise_for_status()
|
1802
|
-
return response.json()
|
1803
|
-
|
1804
|
-
def get_current_user_organizations(self, ) -> dict[str, Any]:
|
1805
|
-
"""
|
1806
|
-
Retrieves a list of organizations associated with the current authenticated user.
|
1807
|
-
|
1808
|
-
Args:
|
1809
|
-
None: This function takes no arguments
|
1810
|
-
|
1811
|
-
Returns:
|
1812
|
-
A dictionary containing details of organizations the current user belongs to.
|
1813
|
-
|
1814
|
-
Raises:
|
1815
|
-
requests.HTTPError: If the HTTP request to fetch organizations fails or returns an error status code.
|
1816
|
-
|
1817
|
-
Tags:
|
1818
|
-
get, organizations, user, api
|
1819
|
-
"""
|
1820
|
-
url = f"{self.base_url}/users/me/organizations"
|
1821
|
-
query_params = {}
|
1822
|
-
response = self._get(url, params=query_params)
|
1823
|
-
response.raise_for_status()
|
1824
|
-
return response.json()
|
1825
|
-
|
1826
|
-
def transfer_projects_from_user_to_org(self, org_id, project_ids) -> dict[str, Any]:
|
1827
|
-
"""
|
1828
|
-
Transfers ownership of specified projects from the authenticated user to a target organization.
|
1829
|
-
|
1830
|
-
Args:
|
1831
|
-
org_id: str. The unique identifier of the target organization to which projects will be transferred.
|
1832
|
-
project_ids: list. A list of project IDs to transfer to the organization.
|
1833
|
-
|
1834
|
-
Returns:
|
1835
|
-
dict. The server's JSON response containing the result of the project transfer operation.
|
1836
|
-
|
1837
|
-
Raises:
|
1838
|
-
ValueError: Raised if 'org_id' or 'project_ids' is None.
|
1839
|
-
requests.HTTPError: Raised if the HTTP request to transfer projects fails.
|
1840
|
-
|
1841
|
-
Tags:
|
1842
|
-
transfer, projects, organization, management
|
1843
|
-
"""
|
1844
|
-
if org_id is None:
|
1845
|
-
raise ValueError("Missing required parameter 'org_id'")
|
1846
|
-
if project_ids is None:
|
1847
|
-
raise ValueError("Missing required parameter 'project_ids'")
|
1848
|
-
request_body = {
|
1849
|
-
'org_id': org_id,
|
1850
|
-
'project_ids': project_ids,
|
1851
|
-
}
|
1852
|
-
request_body = {k: v for k, v in request_body.items() if v is not None}
|
1853
|
-
url = f"{self.base_url}/users/me/projects/transfer"
|
1854
|
-
query_params = {}
|
1855
|
-
response = self._post(url, data=request_body, params=query_params)
|
1856
|
-
response.raise_for_status()
|
1857
|
-
return response.json()
|
1858
|
-
|
1859
|
-
def list_tools(self):
|
1860
|
-
return [
|
1861
|
-
self.list_api_keys,
|
1862
|
-
self.create_api_key,
|
1863
|
-
self.revoke_api_key,
|
1864
|
-
self.get_project_operation,
|
1865
|
-
self.list_projects,
|
1866
|
-
self.create_project,
|
1867
|
-
self.list_shared_projects,
|
1868
|
-
self.get_project,
|
1869
|
-
self.update_project,
|
1870
|
-
self.delete_project,
|
1871
|
-
self.list_project_operations,
|
1872
|
-
self.list_project_permissions,
|
1873
|
-
self.grant_permission_to_project,
|
1874
|
-
self.revoke_permission_from_project,
|
1875
|
-
self.get_project_jwks,
|
1876
|
-
self.add_project_jwks,
|
1877
|
-
self.delete_project_jwks,
|
1878
|
-
self.get_connection_uri,
|
1879
|
-
self.get_project_branch,
|
1880
|
-
self.delete_project_branch,
|
1881
|
-
self.update_project_branch,
|
1882
|
-
self.restore_project_branch,
|
1883
|
-
self.get_project_branch_schema,
|
1884
|
-
self.set_default_project_branch,
|
1885
|
-
self.list_project_branch_endpoints,
|
1886
|
-
self.list_project_branch_databases,
|
1887
|
-
self.create_project_branch_database,
|
1888
|
-
self.get_project_branch_database,
|
1889
|
-
self.update_project_branch_database,
|
1890
|
-
self.delete_project_branch_database,
|
1891
|
-
self.list_project_branch_roles,
|
1892
|
-
self.create_project_branch_role,
|
1893
|
-
self.get_project_branch_role,
|
1894
|
-
self.delete_project_branch_role,
|
1895
|
-
self.get_project_branch_role_password,
|
1896
|
-
self.reset_project_branch_role_password,
|
1897
|
-
self.list_project_vpcendpoints,
|
1898
|
-
self.assign_project_vpcendpoint,
|
1899
|
-
self.delete_project_vpcendpoint,
|
1900
|
-
self.create_project_endpoint,
|
1901
|
-
self.list_project_endpoints,
|
1902
|
-
self.get_project_endpoint,
|
1903
|
-
self.delete_project_endpoint,
|
1904
|
-
self.update_project_endpoint,
|
1905
|
-
self.start_project_endpoint,
|
1906
|
-
self.suspend_project_endpoint,
|
1907
|
-
self.restart_project_endpoint,
|
1908
|
-
self.get_organization,
|
1909
|
-
self.revoke_org_api_key,
|
1910
|
-
self.get_organization_members,
|
1911
|
-
self.get_organization_member,
|
1912
|
-
self.update_organization_member,
|
1913
|
-
self.remove_organization_member,
|
1914
|
-
self.get_organization_invitations,
|
1915
|
-
self.create_organization_invitations,
|
1916
|
-
self.list_organization_vpcendpoints,
|
1917
|
-
self.get_organization_vpcendpoint_details,
|
1918
|
-
self.assign_organization_vpcendpoint,
|
1919
|
-
self.delete_organization_vpcendpoint,
|
1920
|
-
self.get_active_regions,
|
1921
|
-
self.get_current_user_info,
|
1922
|
-
self.get_current_user_organizations,
|
1923
|
-
self.transfer_projects_from_user_to_org
|
1924
|
-
]
|