@@ -20,7 +20,7 @@ def list(self, queries = None, search = None):
20
20
'content-type' : 'application/json' ,
21
21
}, api_params )
22
22
23
- def create (self , function_id , name , runtime , execute = None , events = None , schedule = None , timeout = None , enabled = None , logging = None , entrypoint = None , commands = None , installation_id = None , provider_repository_id = None , provider_branch = None , provider_silent_mode = None , provider_root_directory = None , template_repository = None , template_owner = None , template_root_directory = None , template_branch = None ):
23
+ def create (self , function_id , name , runtime , execute = None , events = None , schedule = None , timeout = None , enabled = None , logging = None , entrypoint = None , commands = None , scopes = None , installation_id = None , provider_repository_id = None , provider_branch = None , provider_silent_mode = None , provider_root_directory = None , template_repository = None , template_owner = None , template_root_directory = None , template_branch = None ):
24
24
"""Create function"""
25
25
26
26
@@ -47,6 +47,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche
47
47
api_params ['logging' ] = logging
48
48
api_params ['entrypoint' ] = entrypoint
49
49
api_params ['commands' ] = commands
50
+ api_params ['scopes' ] = scopes
50
51
api_params ['installationId' ] = installation_id
51
52
api_params ['providerRepositoryId' ] = provider_repository_id
52
53
api_params ['providerBranch' ] = provider_branch
@@ -88,7 +89,7 @@ def get(self, function_id):
88
89
'content-type' : 'application/json' ,
89
90
}, api_params )
90
91
91
- def update (self , function_id , name , runtime = None , execute = None , events = None , schedule = None , timeout = None , enabled = None , logging = None , entrypoint = None , commands = None , installation_id = None , provider_repository_id = None , provider_branch = None , provider_silent_mode = None , provider_root_directory = None ):
92
+ def update (self , function_id , name , runtime = None , execute = None , events = None , schedule = None , timeout = None , enabled = None , logging = None , entrypoint = None , commands = None , scopes = None , installation_id = None , provider_repository_id = None , provider_branch = None , provider_silent_mode = None , provider_root_directory = None ):
92
93
"""Update function"""
93
94
94
95
@@ -112,6 +113,7 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non
112
113
api_params ['logging' ] = logging
113
114
api_params ['entrypoint' ] = entrypoint
114
115
api_params ['commands' ] = commands
116
+ api_params ['scopes' ] = scopes
115
117
api_params ['installationId' ] = installation_id
116
118
api_params ['providerRepositoryId' ] = provider_repository_id
117
119
api_params ['providerBranch' ] = provider_branch
@@ -247,30 +249,47 @@ def delete_deployment(self, function_id, deployment_id):
247
249
'content-type' : 'application/json' ,
248
250
}, api_params )
249
251
250
- def create_build (self , function_id , deployment_id , build_id ):
251
- """Create build """
252
+ def create_build (self , function_id , deployment_id , build_id = None ):
253
+ """Rebuild deployment """
252
254
253
255
254
- api_path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId} '
256
+ api_path = '/functions/{functionId}/deployments/{deploymentId}/build '
255
257
api_params = {}
256
258
if function_id is None :
257
259
raise AppwriteException ('Missing required parameter: "function_id"' )
258
260
259
261
if deployment_id is None :
260
262
raise AppwriteException ('Missing required parameter: "deployment_id"' )
261
263
262
- if build_id is None :
263
- raise AppwriteException ('Missing required parameter: "build_id"' )
264
-
265
264
api_path = api_path .replace ('{functionId}' , function_id )
266
265
api_path = api_path .replace ('{deploymentId}' , deployment_id )
267
- api_path = api_path .replace ('{buildId}' , build_id )
268
266
267
+ api_params ['buildId' ] = build_id
269
268
270
269
return self .client .call ('post' , api_path , {
271
270
'content-type' : 'application/json' ,
272
271
}, api_params )
273
272
273
+ def update_deployment_build (self , function_id , deployment_id ):
274
+ """Cancel deployment"""
275
+
276
+
277
+ api_path = '/functions/{functionId}/deployments/{deploymentId}/build'
278
+ api_params = {}
279
+ if function_id is None :
280
+ raise AppwriteException ('Missing required parameter: "function_id"' )
281
+
282
+ if deployment_id is None :
283
+ raise AppwriteException ('Missing required parameter: "deployment_id"' )
284
+
285
+ api_path = api_path .replace ('{functionId}' , function_id )
286
+ api_path = api_path .replace ('{deploymentId}' , deployment_id )
287
+
288
+
289
+ return self .client .call ('patch' , api_path , {
290
+ 'content-type' : 'application/json' ,
291
+ }, api_params )
292
+
274
293
def download_deployment (self , function_id , deployment_id ):
275
294
"""Download Deployment"""
276
295
@@ -309,7 +328,7 @@ def list_executions(self, function_id, queries = None, search = None):
309
328
'content-type' : 'application/json' ,
310
329
}, api_params )
311
330
312
- def create_execution (self , function_id , body = None , xasync = None , path = None , method = None , headers = None ):
331
+ def create_execution (self , function_id , body = None , xasync = None , path = None , method = None , headers = None , scheduled_at = None ):
313
332
"""Create execution"""
314
333
315
334
@@ -325,6 +344,7 @@ def create_execution(self, function_id, body = None, xasync = None, path = None,
325
344
api_params ['path' ] = path
326
345
api_params ['method' ] = method
327
346
api_params ['headers' ] = headers
347
+ api_params ['scheduledAt' ] = scheduled_at
328
348
329
349
return self .client .call ('post' , api_path , {
330
350
'content-type' : 'application/json' ,
@@ -350,6 +370,26 @@ def get_execution(self, function_id, execution_id):
350
370
'content-type' : 'application/json' ,
351
371
}, api_params )
352
372
373
+ def delete_execution (self , function_id , execution_id ):
374
+ """Delete execution"""
375
+
376
+
377
+ api_path = '/functions/{functionId}/executions/{executionId}'
378
+ api_params = {}
379
+ if function_id is None :
380
+ raise AppwriteException ('Missing required parameter: "function_id"' )
381
+
382
+ if execution_id is None :
383
+ raise AppwriteException ('Missing required parameter: "execution_id"' )
384
+
385
+ api_path = api_path .replace ('{functionId}' , function_id )
386
+ api_path = api_path .replace ('{executionId}' , execution_id )
387
+
388
+
389
+ return self .client .call ('delete' , api_path , {
390
+ 'content-type' : 'application/json' ,
391
+ }, api_params )
392
+
353
393
def list_variables (self , function_id ):
354
394
"""List variables"""
355
395
0 commit comments