@@ -3169,7 +3169,7 @@ def create_action(
31693169 secret_id : Optional [str ] = None ,
31703170 ) -> Dict :
31713171
3172- """Get action, calls the POST /actions endpoint.
3172+ """Create action, calls the POST /actions endpoint.
31733173
31743174 :param function_id: Id of the function to run
31753175 :type function_id: str
@@ -3293,7 +3293,7 @@ def list_action_runs(
32933293 return self ._make_request (requests .get , f'/actions/{ action_id } /runs' , params = dictstrip (params ))
32943294
32953295 def get_action_run (self , action_id : str , run_id : str ) -> Dict :
3296- """Get action, calls the GET /actions/{actionId}/runs/{runId} endpoint.
3296+ """Get action run , calls the GET /actions/{actionId}/runs/{runId} endpoint.
32973297
32983298 :param action_id: Id of the action
32993299 :type action_id: str
@@ -3306,3 +3306,35 @@ def get_action_run(self, action_id: str, run_id: str) -> Dict:
33063306 :py:class:`~cradl.LimitExceededException`, :py:class:`requests.exception.RequestException`
33073307 """
33083308 return self ._make_request (requests .get , f'/actions/{ action_id } /runs/{ run_id } ' )
3309+
3310+ def create_action_run (
3311+ self ,
3312+ action_id : str ,
3313+ input : dict ,
3314+ * ,
3315+ agent_run_id : Optional [str ] = None ,
3316+ metadata : Optional [dict ] = None ,
3317+ ) -> Dict :
3318+ """Create action run, calls the POST /actions/{actionId}/runs endpoint.
3319+
3320+ :param action_id: Id of the action
3321+ :type action_id: str
3322+ :param input: Dictionary with input to the run
3323+ :type input: dict
3324+ :param agent_run_id: Id of an agent run to associate with the action run
3325+ :type agent_run_id: str, optional
3326+ :param metadata: Dictionary that can be used to store additional information
3327+ :type metadata: dict, optional
3328+ :return: Action response from REST API
3329+ :rtype: dict
3330+
3331+ :raises: :py:class:`~cradl.InvalidCredentialsException`, :py:class:`~cradl.TooManyRequestsException`,\
3332+ :py:class:`~cradl.LimitExceededException`, :py:class:`requests.exception.RequestException`
3333+ """
3334+ body = dictstrip ({
3335+ 'agentRunId' : agent_run_id ,
3336+ 'input' : input ,
3337+ 'metadata' : metadata ,
3338+ })
3339+ return self ._make_request (requests .post , f'/actions/{ action_id } /runs' , body = body )
3340+
0 commit comments