How to create an edge service
You can create an edge service by using:
To create an edge service, proceed as follows:
- Access Azion Console > Edge Services.
- Click on the + Service button.
- Give a name for your service.
- Define the variables, if necessary.
- The variables must be in the format
Variable = Value
.
- The variables must be in the format
- Click the Save button.
- Go to the Resources tab.
- Click the + Resource button.
- Provide the path where the resource will be saved on the edge node.
- Select the type of resource: Text or Shell Script.
- In case of selecting Shell Script, configure the resources you need for your service, using the triggers: Install, Reload, and Uninstall.
- Add the content of the resource.
- Click the Save button.
- Go to Real-Time Manager (RTM).
- On the top-left corner, select the Products menu, represented by three horizontal lines, and then Edge Libraries > Edge Services.
- Click on the Add Service button.
- Your service will be created automatically. You can change the name of the service by clicking on My New Service in the name bar.
- Go to the Resources tab and click Add Resource.
- Configure the resources you need for your service, using the triggers: Install, Reload, and Uninstall.
- Optional: where you’ve used variables in the content of one or more resources, you can set the default values for them in the Environment tab.
- The variables must be in the format
Variable = Value
, whereVariable
has been used in the content of resources that are already registered.
- The variables must be in the format
- Activate the service and click on the Save button.
- Run the following
POST
request in your terminal, replacing[TOKEN VALUE]
with your personal token and informing the name of the service being created:
curl --location 'https://api.azionapi.net/edge_services/' \--header 'Accept: application/json; version=3' \--header 'Authorization: Token [TOKEN VALUE]' \--header 'Content-Type: application/json' \--data '{ "name": "string"}'
Now, the service is available and able to be deployed onto the edge nodes.
Watch a video tutorial on how to create an edge service on Azion’s YouTube channel: