Azion Application module
The Azion Application module provides a comprehensive interface to interact with the Azion Edge Application API. This module allows you to manage edge applications and their components including cache settings, device groups, function instances, origins, and Rules Engine configurations.
Go to Azion Libraries OverviewYou can interact with the API using a client
or calling the methods directly from the library. When making direct calls, you can use the environment variables to configure the client
without passing the token and debug parameters directly.
This is an example of how a .env
file with your environment variables may look like:
AZION_TOKEN=your-api-tokenAZION_DEBUG=true
Variable | Description |
---|---|
AZION_TOKEN | Your Azion API token. |
AZION_DEBUG | Enable debug mode (true/false). |
Usage
createClient
TypeScript example:
import createClient from '@azion/applications';
const client = createClient({ token: 'your-api-token', options: { debug: true }});
Usage with Edge Application
createApplication
Creates a new edge application.
TypeScript example:
import { createApplication } from '@azion/applications';
// Create a new applicationconst { data: newApp, error } = await createApplication({ data: { name: "My Edge Application", delivery_protocol: "http,https", application_acceleration: true }});
Parameters:
Parameter | Type | Description |
---|---|---|
data | { name: string; delivery_protocol: string; application_acceleration: boolean; } | The data for the new application. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionApplication>> | The created application object or error if creation failed. |
getApplications
Lists all edge applications.
TypeScript example:
import { getApplications } from '@azion/applications';
// List all applicationsconst { data: apps, error } = await getApplications({ params: { page: 1, page_size: 20 }});
Parameters:
Parameter | Type | Description |
---|---|---|
params? | { page?: number; page_size?: number; order?: 'id'} | 'name'; sort?: 'asc' | 'desc'; } | Optional parameters for filtering and pagination. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationCollectionResponse<AzionApplication>> | A collection of applications or error if retrieval failed. |
getApplication
Retrieves a specific edge application.
TypeScript example:
import { getApplication } from '@azion/applications';
// Retrieve a specific applicationconst applicationId = 12345; // Replace with the actual application ID
const { data: app, error } = await getApplication(applicationId, { debug: true });
if (error) { console.error("Error retrieving application:", error);} else { console.log("Application details:", app);}
Parameters:
Parameter | Type | Description |
---|---|---|
applicationId | Number | The ID of the application to retrieve. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionApplication>> | The retrieved application object or error if not found. |
updateApplication
Updates an existing edge application.
TypeScript example:
import { updateApplication } from '@azion/applications';
// Update an existing applicationconst applicationId = 12345; // Replace with the actual application ID
const updateData = { name: "Updated Edge Application", delivery_protocol: "https", application_acceleration: false};
const { data: updatedApp, error } = await updateApplication(applicationId, updateData, { debug: true });
if (error) { console.error("Error updating application:", error);} else { console.log("Updated application details:", updatedApp);}
Parameters:
Parameter | Type | Description |
---|---|---|
applicationId | Number | The ID of the application to update. |
data | { name?: string; delivery_protocol?: string; application_acceleration?: boolean; } | The updated data for the application. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionApplication>> | The updated application object or error if the update failed. |
deleteApplication
Deletes an edge application.
TypeScript example:
import { deleteApplication } from '@azion/applications';
// Delete an existing applicationconst applicationId = 12345; // Replace with the actual application ID
const { data: deletedApp, error } = await deleteApplication(applicationId, { debug: true });
if (error) { console.error("Error deleting application:", error);} else { console.log("Application deleted successfully:", deletedApp);}
Parameters:
Parameter | Type | Description |
---|---|---|
applicationId | Number | The ID of the application to delete. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionDeletedApplication>> | Confirmation of deletion or error if the operation failed. |
Cache Settings
createCacheSetting
Creates a new cache setting.
TypeScript example:
import { createCacheSetting } from '@azion/applications';
// Create a new cache settingconst cacheSettingData = { name: "My Cache Setting", browser_cache_settings: "private", cdn_cache_settings: "public"};
const { data: newCacheSetting, error } = await createCacheSetting(cacheSettingData, { debug: true });
if (error) { console.error("Error creating cache setting:", error);} else { console.log("Cache setting created successfully:", newCacheSetting);}
Parameters:
Parameter | Type | Description |
---|---|---|
data | { name: string; browser_cache_settings: string; cdn_cache_settings: string; } | The data for the new cache setting. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionCacheSetting>> | The created cache setting object or error if creation failed. |
getCacheSetting
Retrieve a specific cache setting.
TypeScript example:
import { getCacheSetting } from '@azion/applications';
// Retrieve a specific cache settingconst cacheSettingId = 12345; // Replace with the actual cache setting ID
const { data: cacheSetting, error } = await getCacheSetting(cacheSettingId, { debug: true });
if (error) { console.error("Error retrieving cache setting:", error);} else { console.log("Cache setting details:", cacheSetting);}
Parameters:
Parameter | Type | Description |
---|---|---|
cacheSettingId | Number | The ID of the cache setting to retrieve. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionCacheSetting>> | The retrieved cache setting object or error if not found. |
getCacheSettings
Lists all cache settings.
TypeScript example:
import { getCacheSettings } from '@azion/applications';
// List all cache settings with optional pagination and sortingconst { data: cacheSettings, error } = await getCacheSettings({ params: { page: 1, page_size: 20, order: 'name', sort: 'asc' }, debug: true});
if (error) { console.error("Error retrieving cache settings:", error);} else { console.log("Cache settings list:", cacheSettings);}
Parameters:
Parameter | Type | Description |
---|---|---|
params? | { page?: number; page_size?: number; order?: 'id' | 'name'; sort?: 'asc' | 'desc'; } | Optional parameters for filtering and pagination. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationCollectionResponse<AzionCacheSetting>> | A collection of cache settings or error if retrieval failed. |
updateCacheSetting
Updates an existing cache setting.
TypeScript example:
import { updateCacheSetting } from '@azion/applications';
// Update an existing cache settingconst cacheSettingId = 12345; // Replace with the actual cache setting ID
const updateData = { name: "Updated Cache Setting", browser_cache_settings: "no-cache", cdn_cache_settings: "private"};
const { data: updatedCacheSetting, error } = await updateCacheSetting(cacheSettingId, updateData, { debug: true });
if (error) { console.error("Error updating cache setting:", error);} else { console.log("Updated cache setting details:", updatedCacheSetting);}
Parameters:
Parameter | Type | Description |
---|---|---|
cacheSettingId | Number | The ID of the cache setting to update. |
data | { name?: string; browser_cache_settings?: string; cdn_cache_settings?: string; } | The updated data for the cache setting. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionCacheSetting>> | The updated cache setting object or error if the update failed. |
deleteCacheSetting
Deletes a cache setting.
TypeScript example:
import { deleteCacheSetting } from '@azion/applications';
// Delete an existing cache settingconst cacheSettingId = 12345; // Replace with the actual cache setting ID
const { data: deletedCacheSetting, error } = await deleteCacheSetting(cacheSettingId, { debug: true });
if (error) { console.error("Error deleting cache setting:", error);} else { console.log("Cache setting deleted successfully:", deletedCacheSetting);}
Parameters:
Parameter | Type | Description |
---|---|---|
cacheSettingId | Number | The ID of the cache setting to delete. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionDeletedCacheSetting>> | Confirmation of deletion or error if the operation failed. |
Device Groups
createDeviceGroup
Creates a new device group.
TypeScript example:
import { createDeviceGroup } from '@azion/applications';
// Create a new device groupconst deviceGroupData = { name: "Mobile Devices", user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"};
const { data: newDeviceGroup, error } = await createDeviceGroup(deviceGroupData, { debug: true });
if (error) { console.error("Error creating device group:", error);} else { console.log("Device group created successfully:", newDeviceGroup);}
Parameters:
Parameter | Type | Description |
---|---|---|
data | { name: string; user_agent: string; } | The data for the new device group. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionDeviceGroup>> | The created device group object or error if creation failed. |
getDeviceGroup
Retrieves a specific device group.
TypeScript example:
import { getDeviceGroup } from '@azion/applications';
// Retrieve a specific device groupconst deviceGroupId = 12345; // Replace with the actual device group ID
const { data: deviceGroup, error } = await getDeviceGroup(deviceGroupId, { debug: true });
if (error) { console.error("Error retrieving device group:", error);} else { console.log("Device group details:", deviceGroup);}
Parameters:
Parameter | Type | Description |
---|---|---|
deviceGroupId | Number | The ID of the device group to retrieve. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionDeviceGroup>> | The retrieved device group object or error if not found. |
getDeviceGroups
Lists all device groups.
TypeScript example:
import { getDeviceGroups } from '@azion/applications';
// List all device groups with optional pagination and sortingconst { data: deviceGroups, error } = await getDeviceGroups({ params: { page: 1, page_size: 20, order: 'name', sort: 'asc' }, debug: true});
if (error) { console.error("Error retrieving device groups:", error);} else { console.log("Device groups list:", deviceGroups);}
Parameters:
Parameter | Type | Description |
---|---|---|
params? | { page?: number; page_size?: number; order?: 'id' | 'name'; sort?: 'asc' | 'desc'; } | Optional parameters for filtering and pagination. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationCollectionResponse<AzionDeviceGroup>> | The retrieved device group object or error if not found. |
updateDeviceGroup
Updates an existing device group.
TypeScript example:
import { updateDeviceGroup } from '@azion/applications';
// Update an existing device groupconst deviceGroupId = 12345; // Replace with the actual device group IDconst updatedName = "Updated Device Group Name"; // Using a variable for the name
const updateData = { name: updatedName};
const { data: updatedDeviceGroup, error } = await updateDeviceGroup(deviceGroupId, updateData, { debug: true });
if (error) { console.error("Error updating device group:", error);} else { console.log("Updated device group details:", updatedDeviceGroup);}
Parameters:
Parameter | Type | Description |
---|---|---|
deviceGroupId | Number | The ID of the device group to update. |
data | { name?: string; user_agent?: string; } | The updated data for the device group. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionDeviceGroup>> | The updated device group object or error if the update failed. |
deleteDeviceGroup
Deletes a device group.
TypeScript example:
import { deleteDeviceGroup } from '@azion/applications';
// Delete a specific device groupconst deviceGroupId = 12345; // Replace with the actual device group ID
const { data: deletedDeviceGroup, error } = await deleteDeviceGroup(deviceGroupId, { debug: true });
if (error) { console.error("Error deleting device group:", error);} else { console.log("Device group deleted successfully:", deletedDeviceGroup);}
Parameters:
Parameter | Type | Description |
---|---|---|
deviceGroupId | Number | The ID of the device group to delete. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionDeletedDeviceGroup>> | Confirmation of deletion or error if the operation failed. |
Function Instances
createFunctionInstance
Creates a new function instance.
TypeScript example:
import { createFunctionInstance } from '@azion/applications';
// Define the data for the new function instanceconst functionInstanceData = { name: "MyFunctionInstance", entry_point: "index.handler", // Replace with the entry point of your function timeout: 30 // Adjust the timeout as needed};
// Create a new function instanceconst { data: newFunctionInstance, error } = await createFunctionInstance(functionInstanceData, { debug: true });
if (error) { console.error("Error creating function instance:", error);} else { console.log("Function instance created successfully:", newFunctionInstance);}
Parameters:
Parameter | Type | Description |
---|---|---|
data | ApiCreateFunctionInstancePayload | The data for the new function instance. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionFunctionInstance>> | The created function instance object or error if creation failed. |
getFunctionInstance
Retrieves a specific function instance.
TypeScript example:
import { getFunctionInstance } from '@azion/applications';
// Retrieve a specific function instanceconst functionInstanceId = 12345; // Replace with the actual function instance ID
const { data: functionInstance, error } = await getFunctionInstance(functionInstanceId, { debug: true });
if (error) { console.error("Error retrieving function instance:", error);} else { console.log("Function instance details:", functionInstance);}
Parameters:
Parameter | Type | Description |
---|---|---|
functionInstanceId | Number | The ID of the function instance to retrieve. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionFunctionInstance>> | The retrieved function instance object or error if not found. |
getFunctionInstances
Lists all function instances.
TypeScript example:
import { getFunctionInstances } from '@azion/applications';
// List all function instances with optional parameters for paginationconst params = { page: 1, // Page number for pagination page_size: 20, // Number of items per page order: 'name', // Order by name sort: 'asc' // Sort in ascending order};
const { data: functionInstances, error } = await getFunctionInstances(params, { debug: true });
if (error) { console.error("Error retrieving function instances:", error);} else { console.log("List of function instances:", functionInstances);}
Parameters:
Parameter | Type | Description |
---|---|---|
params? | ApiListFunctionInstancesParams | Optional parameters for filtering and pagination. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationCollectionResponse<AzionFunctionInstance>> | A collection of function instances or error if retrieval failed. |
updateFunctionInstance
Updates an existing function instance.
TypeScript example:
import { updateFunctionInstance } from '@azion/applications';
// Define the ID of the function instance and the updated dataconst functionInstanceId = 12345; // Replace with the actual function instance IDconst updatedData = { name: "Updated Function Instance Name", // New name for the function instance entry_point: "newIndex.handler", // Updated entry point (example)
};
// Update the function instanceconst { data: updatedFunctionInstance, error } = await updateFunctionInstance(functionInstanceId, updatedData, { debug: true });
if (error) { console.error("Error updating function instance:", error);} else { console.log("Updated function instance details:", updatedFunctionInstance);}
Parameters:
Parameter | Type | Description |
---|---|---|
functionInstanceId | Number | The ID of the function instance to update. |
data | ApiUpdateFunctionInstancePayload | The updated data for the function instance. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionFunctionInstance>> | The updated function instance object or error if the update failed. |
deleteFunctionInstance
Deletes a function instance.
TypeScript example:
import { deleteFunctionInstance } from '@azion/applications';
// Define the ID of the function instance to deleteconst functionInstanceId = 12345; // Replace with the actual function instance ID
// Delete the function instanceconst { data: deletedFunctionInstance, error } = await deleteFunctionInstance(functionInstanceId, { debug: true });
if (error) { console.error("Error deleting function instance:", error);} else { console.log("Function instance deleted successfully:", deletedFunctionInstance);}
Parameters:
Parameter | Type | Description |
---|---|---|
functionInstanceId | Number | The ID of the function instance to delete. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionDeletedFunctionInstance>> | Confirmation of deletion or error if the operation failed. |
Origins
createOrigin
Creates a new origin.
TypeScript example:
import { createOrigin } from '@azion/applications';
// Define the data for the new originconst newOriginData = { name: "My New Origin", // Name of the origin url: "https://example.com" // URL of the origin};
// Create a new originconst { data: newOrigin, error } = await createOrigin(newOriginData, { debug: true });
if (error) { console.error("Error creating origin:", error);} else { console.log("Created origin:", newOrigin);}
Parameters:
Parameter | Type | Description |
---|---|---|
data | { name: string; url: string; } | The data for the new origin. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionOrigin>> | The created origin object or error if creation failed. |
getOrigin
Retrieves a specific origin.
TypeScript example:
import { getOrigin } from '@azion/applications';
// Define the ID of the origin to retrieveconst originId = 12345; // Replace with the actual origin ID
// Retrieve the specific originconst { data: origin, error } = await getOrigin(originId, { debug: true });
if (error) { console.error("Error retrieving origin:", error);} else { console.log("Retrieved origin:", origin);}
Parameters:
Parameter | Type | Description |
---|---|---|
originId | Number | The ID of the origin to retrieve. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionOrigin>> | The retrieved origin object or error if not found. |
getOrigins
Lists all origins.
TypeScript example:
import { getOrigins } from '@azion/applications';
// Define the optional parameters for filtering and paginationconst params = { page: 1, // Page number page_size: 20, // Number of items per page order: 'name', // Sort order by name or id sort: 'asc' // Sorting direction (ascending)};
// Retrieve all origins with optional pagination and sortingconst { data: origins, error } = await getOrigins(params, { debug: true });
if (error) { console.error("Error retrieving origins:", error);} else { console.log("List of origins:", origins);}
Parameters:
Parameter | Type | Description |
---|---|---|
params? | { page?: number; page_size?: number; order?: 'id' | 'name'; sort?: 'asc' | 'desc'; } | Optional parameters for filtering and pagination. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationCollectionResponse<AzionOrigin>> | A collection of origins or error if retrieval failed. |
updateOrigin
Updates an existing origin.
TypeScript example:
import { updateOrigin } from '@azion/applications';
// Define the origin ID and updated dataconst originId = 12345; // Replace with the actual origin IDconst updatedData = { name: "Updated Origin Name", // New name for the origin url: "https://new-url.com" // New URL for the origin};
// Update the origin with the specified IDconst { data: updatedOrigin, error } = await updateOrigin(originId, updatedData, { debug: true });
if (error) { console.error("Error updating origin:", error);} else { console.log("Updated origin:", updatedOrigin);}
Parameters:
Parameter | Type | Description |
---|---|---|
originId | Number | The ID of the origin to update. |
data | { name?: string; url?: string; } | The updated data for the origin. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionOrigin>> | The updated origin object or error if the update failed. |
deleteOrigin
Deletes an origin.
TypeScript example:
import { deleteOrigin } from '@azion/applications';
// Define the origin ID to deleteconst originId = 12345; // Replace with the actual origin ID
// Delete the origin with the specified IDconst { data: deletedOrigin, error } = await deleteOrigin(originId, { debug: true });
if (error) { console.error("Error deleting origin:", error);} else { console.log("Deleted origin:", deletedOrigin);}
Parameters:
Parameter | Type | Description |
---|---|---|
originId | Number | The ID of the origin to delete. |
options? | { debug?: boolean } | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionDeletedOrigin>> | Confirmation of deletion or error if the operation failed. |
Rules Engine
createRule
Creates a new rule.
TypeScript example:
import { createRule } from '@azion/applications';
// Define the data for the new ruleconst ruleData = { name: "Example Rule", conditions: { path: "/example-path" }, actions: { redirect: { url: "https://example.com" } }};
// Create a new ruleconst { data: newRule, error } = await createRule(ruleData, { debug: true });
if (error) { console.error("Error creating rule:", error);} else { console.log("Created rule:", newRule);}
Parameters:
Parameter | Type | Description |
---|---|---|
data | {ApiCreateRulePayload | The data for the new rule. |
options? | AzionClientOptions | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionRule>> | The created rule object or error if creation failed. |
getRule
Retrieves a specific rule.
TypeScript example:
import { getRule } from '@azion/applications';
// Define the rule ID to retrieveconst ruleId = 123;
// Retrieve the specific ruleconst { data: rule, error } = await getRule(ruleId, { debug: true });
if (error) { console.error("Error retrieving rule:", error);} else { console.log("Retrieved rule:", rule);}
Parameters:
Parameter | Type | Description |
---|---|---|
ruleId | Number | The ID of the rule to retrieve. |
options? | AzionClientOptions | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionRule>> | The retrieved rule object or error if not found. |
getRules
Lists all rules.
TypeScript example:
import { getRules } from '@azion/applications';
// Optional parameters for filtering and paginationconst params = { page: 1, page_size: 10, order: 'id', sort: 'asc',};
// Fetch the collection of rules with optional parametersconst { data: rules, error } = await getRules(params, { debug: true });
if (error) { console.error("Error retrieving rules:", error);} else { console.log("Retrieved rules:", rules);}
Parameters:
Parameter | Type | Description |
---|---|---|
params? | ApiListRulesParams | Optional parameters for filtering and pagination. |
options? | AzionClientOptions | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationCollectionResponse<AzionRule>> | A collection of rules or error if retrieval failed. |
updateRule
Updates an existing rule.
TypeScript example:
import { updateRule } from '@azion/applications';
// The ID of the rule to updateconst ruleId = 123;
// The updated data for the ruleconst data = { name: "Updated Rule Name", condition: "new_condition_expression", action: "new_action_to_perform",};
// Optional parameters including debug modeconst options = { debug: true };
// Update the rule with the specified ID and dataconst { data: updatedRule, error } = await updateRule(ruleId, data, options);
if (error) { console.error("Error updating the rule:", error);} else { console.log("Updated rule:", updatedRule);}
Parameters:
Parameter | Type | Description |
---|---|---|
ruleId | Number | The ID of the rule to update. |
data | ApiUpdateRulePayload | The updated data for the rule. |
options? | AzionClientOptions | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionRule>> | The updated rule object or error if the update failed. |
deleteRule
Deletes a rule.
TypeScript example:
import { deleteRule } from '@azion/applications';
// The ID of the rule to deleteconst ruleId = 123;
// Optional parameters including debug modeconst options = { debug: true };
// Delete the rule with the specified IDconst { data: deletionConfirmation, error } = await deleteRule(ruleId, options);
if (error) { console.error("Error deleting the rule:", error);} else { console.log("Rule deleted successfully:", deletionConfirmation);}
Parameters:
Parameter | Type | Description |
---|---|---|
ruleId | Number | The ID of the rule to delete. |
options? | AzionClientOptions | Optional parameters including debug mode. |
Returns:
Return Type | Description |
---|---|
Promise<AzionApplicationResponse<AzionDeletedRule>> | Confirmation of deletion or error if the operation failed. |
Contributors