Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ curl --location 'https://api.azionapi.net/edge_nodes/' \
2. Run the following `POST` request in your terminal:

```bash
curl --location 'https://api.azionapi.net/edge_nodes/:id/services' \
curl --location 'https://api.azionapi.net/edge_nodes/:node_id/services' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"service_id": :id,
"service_id": 1196,
"variables": [
{
"name": "string",
Expand All @@ -261,12 +261,12 @@ curl --location 'https://api.azionapi.net/edge_nodes/:id/services' \
}'
```

Replace `[TOKEN VALUE]` with your [personal token](/en/documentation/guides/platform/account-and-billing/personal-tokens/), `:id` with the ID of the edge node and inform the ID of the service in the request body:
Replace `[TOKEN VALUE]` with your [personal token](/en/documentation/guides/platform/account-and-billing/personal-tokens/), `:node_id` with the ID of the edge node, and `1196` in the request body with the ID of the edge service you kept when you created it:

| Property | Description | Required |
| - | - | - |
| `service_id` | ID of the edge service being bound to the edge node | Yes |
| `variables` | Variables to be replaced during the processing on the edge node | No (requires checking) |
| `service_id` | ID of the edge service being bound to the edge node, as a number | Yes |
| `variables` | Variables to be replaced during the processing on the edge node | No |
</Fragment>

</Tabs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ You can create an edge service in Azion Console or with the Azion API.
3. Give a name for your service.
4. Define the variables, if necessary.
- The variables must be in the format `Variable = Value`.
5. Click the **Save** button.
6. Go to the **Resources** tab and [provide resources](/en/documentation/guides/application-development/automation/provision-files/) for your service.
5. Set the status as **Active**.
6. Click the **Save** button.
7. Go to the **Resources** tab and [provide resources](/en/documentation/guides/application-development/automation/provision-files/) for your service.
</Fragment>

<Fragment slot="panel.api">
Expand All @@ -52,7 +53,42 @@ curl --location 'https://api.azionapi.net/edge_services/' \
}'
```

Now, the service is available and able to be deployed onto the edge nodes.
2. Keep the `id` returned in the response body. The API creates the service with `"active": false`:

```json
{
"id": 1196,
"name": "string",
"updated_at": "2024-01-18T17:24:33Z",
"last_editor": "xxxxx",
"active": false,
"bound_nodes": 0,
"permissions": [
"read",
"write"
]
}
```

3. To set the service as active, run the following `PATCH` request:

```bash
curl --location --request PATCH 'https://api.azionapi.net/edge_services/:id' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"active": true
}'
```

Replace `[TOKEN VALUE]` with your personal token and `:id` with the ID of the edge service.

Now, the service is active and you can bind it to your edge nodes.

:::note
If an edge service is not active, it is not available for binding to an edge node.
:::

:::tip
Check the [Azion API documentation](https://api.azion.com/) and the [OpenAPI specification](https://github.com/aziontech/azionapi-openapi/) to know more about all features available via API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ curl --location 'https://api.azionapi.net/edge_nodes/' \
2. Execute a seguinte requisição `POST` no seu terminal:

```bash
curl --location 'https://api.azionapi.net/edge_nodes/:id/services' \
curl --location 'https://api.azionapi.net/edge_nodes/:node_id/services' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"service_id": :id,
"service_id": 1196,
"variables": [
{
"name": "string",
Expand All @@ -260,11 +260,11 @@ curl --location 'https://api.azionapi.net/edge_nodes/:id/services' \
}'
```

Substitua [TOKEN VALUE] pelo seu [personal token](/pt-br/documentacao/guias/plataforma/conta-e-billing/personal-tokens/), `:id` pelo ID do edge node e informe os seguintes parâmetros no corpo da requisição:
Substitua `[TOKEN VALUE]` pelo seu [personal token](/pt-br/documentacao/guias/plataforma/conta-e-billing/personal-tokens/), `:node_id` pelo ID do edge node e, no corpo da requisição, `1196` pelo ID do edge service que você guardou ao criá-lo:

| Propriedade | Descrição | Obrigatório |
| - | - | - |
| `service_id` | ID do edge service a ser vinculado ao edge node | Sim |
| `service_id` | ID do edge service a ser vinculado ao edge node, como número | Sim |
| `variables` | Variáveis a serem substituídas durante o processamento no edge node| Não |
</Fragment>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ Você pode criar um edge service no Azion Console ou com a Azion API.
3. Nomeie seu serviço.
4. Defina as variáveis a usar, se necessário.
- As variáveis devem seguir o padrão "Variável = Valor".
5. Clique no botão **Save**.
6. Selecione a aba **Resources** e [forneça recursos](/pt-br/documentacao/guias/desenvolvimento-de-aplicacoes/automacao/provisionar-arquivos/) para seu serviço.
5. Defina o status como **Active**.
6. Clique no botão **Save**.
7. Selecione a aba **Resources** e [forneça recursos](/pt-br/documentacao/guias/desenvolvimento-de-aplicacoes/automacao/provisionar-arquivos/) para seu serviço.
</Fragment>

<Fragment slot="panel.api">
Expand All @@ -51,7 +52,42 @@ curl --location 'https://api.azionapi.net/edge_services/' \
}'
```

Agora, o serviço está disponível e pronto para ser implantado nos edge nodes disponíveis.
2. Guarde o `id` retornado no corpo da resposta. A API cria o serviço com `"active": false`:

```json
{
"id": 1196,
"name": "string",
"updated_at": "2024-01-18T17:24:33Z",
"last_editor": "xxxxx",
"active": false,
"bound_nodes": 0,
"permissions": [
"read",
"write"
]
}
```

3. Para definir o serviço como ativo, execute a seguinte requisição `PATCH`:

```bash
curl --location --request PATCH 'https://api.azionapi.net/edge_services/:id' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"active": true
}'
```

Substitua `[TOKEN VALUE]` pelo seu token pessoal e `:id` pelo ID do edge service.

Agora, o serviço está ativo e você pode vinculá-lo aos seus edge nodes.

:::note[nota]
Se um edge service não estiver definido como ativo, ele não estará disponível para vinculação a um edge node.
:::

:::tip[dica]
Confira a [documentação da API da Azion](https://api.azion.com/) e a [especificação OpenAPI](https://github.com/aziontech/azionapi-openapi/) para saber mais sobre todos os recursos disponíveis via API.
Expand Down
Loading