@@ -20,7 +20,7 @@ def list(self, queries = None, search = None):
2020 'content-type' : 'application/json' ,
2121 }, api_params )
2222
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_version = 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_version = None , specification = None ):
2424 """Create function"""
2525
2626
@@ -57,6 +57,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche
5757 api_params ['templateOwner' ] = template_owner
5858 api_params ['templateRootDirectory' ] = template_root_directory
5959 api_params ['templateVersion' ] = template_version
60+ api_params ['specification' ] = specification
6061
6162 return self .client .call ('post' , api_path , {
6263 'content-type' : 'application/json' ,
@@ -73,6 +74,17 @@ def list_runtimes(self):
7374 'content-type' : 'application/json' ,
7475 }, api_params )
7576
77+ def list_specifications (self ):
78+ """List available function runtime specifications"""
79+
80+
81+ api_path = '/functions/specifications'
82+ api_params = {}
83+
84+ return self .client .call ('get' , api_path , {
85+ 'content-type' : 'application/json' ,
86+ }, api_params )
87+
7688 def list_templates (self , runtimes = None , use_cases = None , limit = None , offset = None ):
7789 """List function templates"""
7890
@@ -121,7 +133,7 @@ def get(self, function_id):
121133 'content-type' : 'application/json' ,
122134 }, api_params )
123135
124- 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 ):
136+ 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 , specification = None ):
125137 """Update function"""
126138
127139
@@ -151,6 +163,7 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non
151163 api_params ['providerBranch' ] = provider_branch
152164 api_params ['providerSilentMode' ] = provider_silent_mode
153165 api_params ['providerRootDirectory' ] = provider_root_directory
166+ api_params ['specification' ] = specification
154167
155168 return self .client .call ('put' , api_path , {
156169 'content-type' : 'application/json' ,
@@ -360,7 +373,7 @@ def list_executions(self, function_id, queries = None, search = None):
360373 'content-type' : 'application/json' ,
361374 }, api_params )
362375
363- def create_execution (self , function_id , body = None , xasync = None , path = None , method = None , headers = None , scheduled_at = None , on_progress = None ):
376+ def create_execution (self , function_id , body = None , xasync = None , path = None , method = None , headers = None , scheduled_at = None ):
364377 """Create execution"""
365378
366379
@@ -372,18 +385,15 @@ def create_execution(self, function_id, body = None, xasync = None, path = None,
372385 api_path = api_path .replace ('{functionId}' , function_id )
373386
374387 api_params ['body' ] = body
375- api_params ['async' ] = str ( xasync ). lower () if type ( xasync ) is bool else xasync
388+ api_params ['async' ] = xasync
376389 api_params ['path' ] = path
377390 api_params ['method' ] = method
378- api_params ['headers' ] = str ( headers ). lower () if type ( headers ) is bool else headers
391+ api_params ['headers' ] = headers
379392 api_params ['scheduledAt' ] = scheduled_at
380393
381-
382- upload_id = ''
383-
384- return self .client .chunked_upload (api_path , {
385- 'content-type' : 'multipart/form-data' ,
386- }, api_params , param_name , on_progress , upload_id )
394+ return self .client .call ('post' , api_path , {
395+ 'content-type' : 'application/json' ,
396+ }, api_params )
387397
388398 def get_execution (self , function_id , execution_id ):
389399 """Get execution"""
0 commit comments