pub struct Functions { /* private fields */ }Implementations§
Source§impl Functions
impl Functions
pub fn new(client: &Client) -> Self
Sourcepub fn list(
&self,
search: Option<&str>,
limit: Option<i64>,
offset: Option<i64>,
cursor: Option<&str>,
cursor_direction: Option<&str>,
order_type: Option<&str>,
) -> Result<FunctionList, AppwriteException>
pub fn list( &self, search: Option<&str>, limit: Option<i64>, offset: Option<i64>, cursor: Option<&str>, cursor_direction: Option<&str>, order_type: Option<&str>, ) -> Result<FunctionList, AppwriteException>
Get a list of all the project’s functions. You can use the query params to filter your results.
Sourcepub fn create(
&self,
function_id: &str,
name: &str,
execute: &[&str],
runtime: &str,
vars: Option<Option<HashMap<String, ParamType>>>,
events: Option<&[&str]>,
schedule: Option<&str>,
timeout: Option<i64>,
) -> Result<Function, AppwriteException>
pub fn create( &self, function_id: &str, name: &str, execute: &[&str], runtime: &str, vars: Option<Option<HashMap<String, ParamType>>>, events: Option<&[&str]>, schedule: Option<&str>, timeout: Option<i64>, ) -> Result<Function, AppwriteException>
Create a new function. You can pass a list of permissions to allow different project users or team with access to execute the function using the client API.
Sourcepub fn list_runtimes(&self) -> Result<RuntimeList, AppwriteException>
pub fn list_runtimes(&self) -> Result<RuntimeList, AppwriteException>
Get a list of all runtimes that are currently active on your instance.
Sourcepub fn get(&self, function_id: &str) -> Result<Function, AppwriteException>
pub fn get(&self, function_id: &str) -> Result<Function, AppwriteException>
Get a function by its unique ID.
Sourcepub fn update(
&self,
function_id: &str,
name: &str,
execute: &[&str],
vars: Option<Option<HashMap<String, ParamType>>>,
events: Option<&[&str]>,
schedule: Option<&str>,
timeout: Option<i64>,
) -> Result<Function, AppwriteException>
pub fn update( &self, function_id: &str, name: &str, execute: &[&str], vars: Option<Option<HashMap<String, ParamType>>>, events: Option<&[&str]>, schedule: Option<&str>, timeout: Option<i64>, ) -> Result<Function, AppwriteException>
Update function by its unique ID.
Sourcepub fn delete(&self, function_id: &str) -> Result<Value, AppwriteException>
pub fn delete(&self, function_id: &str) -> Result<Value, AppwriteException>
Delete a function by its unique ID.
Sourcepub fn list_deployments(
&self,
function_id: &str,
search: Option<&str>,
limit: Option<i64>,
offset: Option<i64>,
cursor: Option<&str>,
cursor_direction: Option<&str>,
order_type: Option<&str>,
) -> Result<DeploymentList, AppwriteException>
pub fn list_deployments( &self, function_id: &str, search: Option<&str>, limit: Option<i64>, offset: Option<i64>, cursor: Option<&str>, cursor_direction: Option<&str>, order_type: Option<&str>, ) -> Result<DeploymentList, AppwriteException>
Get a list of all the project’s code deployments. You can use the query params to filter your results.
Sourcepub fn create_deployment(
&self,
function_id: &str,
entrypoint: &str,
code: PathBuf,
activate: bool,
) -> Result<Deployment, AppwriteException>
pub fn create_deployment( &self, function_id: &str, entrypoint: &str, code: PathBuf, activate: bool, ) -> Result<Deployment, AppwriteException>
Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you’ll need to update the function’s deployment to use your new deployment UID.
This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the Appwrite Cloud Functions tutorial.
Use the “command” param to set the entry point used to execute your code.
Sourcepub fn get_deployment(
&self,
function_id: &str,
deployment_id: &str,
) -> Result<DeploymentList, AppwriteException>
pub fn get_deployment( &self, function_id: &str, deployment_id: &str, ) -> Result<DeploymentList, AppwriteException>
Get a code deployment by its unique ID.
Sourcepub fn update_deployment(
&self,
function_id: &str,
deployment_id: &str,
) -> Result<Function, AppwriteException>
pub fn update_deployment( &self, function_id: &str, deployment_id: &str, ) -> Result<Function, AppwriteException>
Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.
Sourcepub fn delete_deployment(
&self,
function_id: &str,
deployment_id: &str,
) -> Result<Value, AppwriteException>
pub fn delete_deployment( &self, function_id: &str, deployment_id: &str, ) -> Result<Value, AppwriteException>
Delete a code deployment by its unique ID.
pub fn retry_build( &self, function_id: &str, deployment_id: &str, build_id: &str, ) -> Result<Value, AppwriteException>
Sourcepub fn list_executions(
&self,
function_id: &str,
limit: Option<i64>,
offset: Option<i64>,
search: Option<&str>,
cursor: Option<&str>,
cursor_direction: Option<&str>,
) -> Result<ExecutionList, AppwriteException>
pub fn list_executions( &self, function_id: &str, limit: Option<i64>, offset: Option<i64>, search: Option<&str>, cursor: Option<&str>, cursor_direction: Option<&str>, ) -> Result<ExecutionList, AppwriteException>
Get a list of all the current user function execution logs. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project’s executions. Learn more about different API modes.
Sourcepub fn create_execution(
&self,
function_id: &str,
data: Option<&str>,
xasync: Option<bool>,
) -> Result<Execution, AppwriteException>
pub fn create_execution( &self, function_id: &str, data: Option<&str>, xasync: Option<bool>, ) -> Result<Execution, AppwriteException>
Trigger a function execution. The returned object will return you the
current execution status. You can ping the Get Execution endpoint to get
updates on the current execution status. Once this endpoint is called, your
function execution process will start asynchronously.
Sourcepub fn get_execution(
&self,
function_id: &str,
execution_id: &str,
) -> Result<Execution, AppwriteException>
pub fn get_execution( &self, function_id: &str, execution_id: &str, ) -> Result<Execution, AppwriteException>
Get a function execution log by its unique ID.