How to provision files

To be able to orchestrate services on your device, you need to configure all the resources. These resources can be:

  • Text: for content being copied as plain text to the edge node.
  • Shell Script: for resources that will be installed and run according to the selected trigger.

You can create a resource using:


  1. Go to Azion Console > Edge Libraries > Edge Services.
  2. Select the edge service to which you want to add a resource.
  3. Go to the Resources tab.
  4. Click on Add Resource.
  5. Enter the filepath of the resource.
  6. Choose the type Text.
  7. Add the following content to the content block:
Terminal window
My name is {{name}}, and this is my first added resource
go to work with variable
  1. Run the following GET request in your terminal, replacing [TOKEN VALUE] with your personal token and retrieve the edge service ID:
Terminal window
curl --location 'https://api.azionapi.net/edge_services/' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]'
  1. Run the following POST request in your terminal:
Terminal window
curl --location 'https://api.azionapi.net/edge_services/:id/resources' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"content_type": "Text",
"name": "/resource",
"content": "My name is {{name}}, and this is my first added resource"
}'

Replace [TOKEN VALUE] with your personal token, :id with the ID of the edge service and inform the following parameters in the request body:

PropertyDescriptionRequired
content_typeContent type of the resource being createdYes
nameName of the resource being createdYes
contentContent that defines actions performed when the resource state changes in the edge nodeYes

Now, your resource is created and able to work with the edge nodes related to the service in specific.


Contributors