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:
- 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.
- Select the edge service to which you want to add a resource.
- Go to the Resources tab and click on Add Resource.
- Click on Add Resource.
- Enter the Filepath of the resource.
- Choose the type Text.
- Add the following content to the content block:
My name is {{name}}, and this is my first added resource
- Click the Save button.
- Access Azion Console.
- On the top-left corner, select the Products menu, represented by three horizontal lines, and then Edge Services.
- Select the edge service to which you want to add a resource.
- Go to the Resources tab and click on the + Resource button.
- Enter the Path of the resource.
- Choose the type Text.
- Add the following content to the content block:
My name is {{name}}, and this is my first added resource
- Click the Save button.
- Run the following
GET
request in your terminal, replacing[TOKEN VALUE]
with your personal token and retrieve the edge service ID:
curl --location 'https://api.azionapi.net/edge_services/' \--header 'Accept: application/json; version=3' \--header 'Authorization: Token [TOKEN VALUE]'
- Run the following
POST
request in your terminal:
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:
Property | Description | Required |
---|---|---|
content_type | Content type of the resource being created | Yes |
name | Name of the resource being created | Yes |
content | Content that defines actions performed when the resource state changes in the edge node | Yes |
Now, your resource is created and able to work with the edge nodes related to the service in specific.
Contributors