Skip to content

[EDU-6565] fix: replace api v3 in build journey -pt #1678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -77,10 +77,11 @@ Para confirmar se sua imagem está sendo otimizada, [inspecione a página](https
1. Execute a seguinte requisição `PATCH` em seu terminal, substituindo `[TOKEN VALUE]` por seu [personal token](/pt-br/documentacao/produtos/guias/personal-tokens/) e a variável `<edge_application_id>` por [seu ID de edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/) para ativar os módulos [Application Accelerator](/pt-br/documentacao/produtos/build/edge-application/application-accelerator/) e [Image Processor](/pt-br/documentacao/produtos/build/edge-application/image-processor/):

```bash
curl --location --request PATCH 'https://api.azionapi.net/edge_applications/<edge_application_id>' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
curl --request PATCH \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id> \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"application_acceleration": true,
"image_optimization": true
Expand All @@ -91,20 +92,32 @@ curl --location --request PATCH 'https://api.azionapi.net/edge_applications/<edg
3. Execute a seguinte requisição `POST` em seu terminal, substituindo `[TOKEN VALUE]` por seu [personal token](/pt-br/documentacao/produtos/guias/personal-tokens/) e a variável `<edge_application_id>` pelo `id` de sua edge application:

```bash
curl --location 'https://api.azionapi.net/edge_applications/<edge_application_id>/cache_settings' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
curl --request POST \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id>/cache_settings \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"name": "QS15D img",
"browser_cache_settings": "override",
"browser_cache_settings_maximum_ttl": 60,
"cdn_cache_settings": "override",
"cdn_cache_settings_maximum_ttl": 1296000,
"cache_by_query_string": "whitelist",
"query_string_fields": [
"ims"
]
"browser_cache": {
"behavior": "override",
"max_age": 60
},
"edge_cache": {
"behavior": "override",
"max_age": 1296000,
"caching_for_post_enabled": true,
"caching_for_options_enabled": true,
"stale_cache_enabled": true,
"tiered_cache_enabled": true,
"tiered_cache_region": "string"
},
"application_controls": {
"cache_by_query_string": "whitelist",
"query_string_fields": [
"ims"
]
}
}'
```

Expand Down Expand Up @@ -149,15 +162,18 @@ Para mais informações sobre o endpoint de configurações de cache, consulte o
6. Execute a seguinte requisição `POST` para criar uma regra na **Request Phase**, substituindo o valor do ID da edge application e o ID de configuração de cache que você recebeu na resposta anterior:

```bash
curl --location --globoff 'https://api.azionapi.net/edge_applications/<edge_application_id>/rules_engine/request/rules' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
curl --request POST \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id>/rules \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"name": "ImgProcessor",
"behaviors": [
{
"name": "set_cache_policy",
"phase": "request",

"target": "<cache_settings_id>"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,58 +161,72 @@ Para analisar como seu conteúdo está sendo armazenado em cache, você pode ver
1. Execute a seguinte requisição `PATCH` em seu terminal, substituindo `[TOKEN VALUE]` pelo seu [personal token](/pt-br/documentacao/produtos/guias/personal-tokens/) e a variável `<edge_application_id>` pelo [ID da sua edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/) para ativar o módulo [Application Accelerator](/pt-br/documentacao/produtos/build/edge-application/application-accelerator/):

```bash
curl --location --request PATCH 'https://api.azionapi.net/edge_applications/<edge_application_id>' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
curl --request PATCH \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id> \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"application_acceleration": true
"application_acceleration_enabled": true
}'
```

2. Você receberá uma resposta com o valor atualizado.
3. Se você quiser configurar a entrega adaptativa para um dos seus [device groups](/pt-br/documentacao/produtos/guias/build/criar-device-groups/), execute a seguinte requisição `GET` antes:

```bash
curl --location 'https://api.azionapi.net/edge_applications/<edge_application_id>/device_groups' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]'
curl --request GET \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id>/device_groups \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]'
```

4. Copie o ID recebido na resposta.
5. Execute a seguinte requisição `POST` em seu terminal, substituindo `[TOKEN VALUE]` pelo seu [personal token](/pt-br/documentacao/produtos/guias/personal-tokens/), a variável `<edge_application_id>` pelo [ID da sua edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/), e a variável `<device_group_id>` pelo ID do device group da resposta anterior, se necessário:

```bash
curl --location 'https://api.azionapi.net/edge_applications/<edge_application_id>/cache_settings' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
curl --request POST \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id>/cache_settings \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
--data '{
"name": "/cache O60 O13660 Wcity Wcookie_name Wdg POST OPTIONS SLICE",
"browser_cache_settings": "override",
"browser_cache_settings_maximum_ttl": 60,
"cdn_cache_settings": "override",
"cdn_cache_settings_maximum_ttl": 13660,
"cache_by_query_string": "whitelist",
"query_string_fields": [
""browser_cache": {
"behavior": "override",
"max_age": 60
},
"edge_cache": {
"behavior": "override",
"max_age": 13660,
"caching_for_post_enabled": true,
"caching_for_options_enabled": true,
"stale_cache_enabled": false,
"tiered_cache_enabled": false
},
"application_controls": {
"cache_by_query_string": "whitelist",
"query_string_fields": [
"city"
],
"adaptive_delivery_action": "whitelist",
"device_group": [
"query_string_sort_enabled": false,
"cache_by_cookies": "whitelist",
"cookie_names": [
"cookie_name"
],
"adaptive_delivery_action": "whitelist",
"device_group": [
<device_group_id>
],
"enable_query_string_sort": false,
"enable_caching_for_options": true,
"cache_by_cookies": "whitelist",
"cookie_names": [
"cookie_name"
],
"enable_caching_for_post": true,
"l2_caching_enabled": false,
"is_slice_configuration_enabled": true,
"is_slice_edge_caching_enabled": true,
"is_slice_l2_caching_enabled": false
}'
]
},
"slice_controls": {
"slice_configuration_enabled": true,
"slice_edge_caching_enabled": true,
"slice_tiered_caching_enabled": false,
"slice_configuration_range": 1024
}
}'
```

| Chave | Descrição |
Expand Down Expand Up @@ -240,48 +254,60 @@ curl --location 'https://api.azionapi.net/edge_applications/<edge_application_id

```json
{
"results": {
"id": <cache_settings_id>,
"name": "/cache O60 O13660 Wcity Wcookie_name Wdg POST OPTIONS SLICE",
"browser_cache_settings": "override",
"browser_cache_settings_maximum_ttl": 60,
"cdn_cache_settings": "override",
"cdn_cache_settings_maximum_ttl": 13660,
"cache_by_query_string": "whitelist",
"query_string_fields": [
"city"
],
"enable_query_string_sort": true,
"cache_by_cookies": "whitelist",
"cookie_names": [
"cookie_name"
],
"adaptive_delivery_action": "whitelist",
"device_group": [
<device_group_id>
],
"enable_caching_for_post": true,
"l2_caching_enabled": false,
"is_slice_configuration_enabled": true,
"is_slice_edge_caching_enabled": true,
"is_slice_l2_caching_enabled": false,
"slice_configuration_range": 1024,
"enable_caching_for_options": true,
"enable_stale_cache": false,
"l2_region": null
"state": "pending",
"data": {
"id": <cache_settings_id>,
"name": "/cache O60 O13660 Wcity Wcookie_name Wdg POST OPTIONS SLICE",
"browser_cache": {
"behavior": "override",
"max_age": 60
},
"edge_cache": {
"behavior": "override",
"max_age": 13660,
"caching_for_post_enabled": true,
"caching_for_options_enabled": true,
"stale_cache_enabled": false,
"tiered_cache_enabled": false,
"tiered_cache_region": null
},
"application_controls": {
"cache_by_query_string": "whitelist",
"query_string_fields": [
"city"
],
"query_string_sort_enabled": true,
"cache_by_cookies": "whitelist",
"cookie_names": [
"cookie_name"
],
"adaptive_delivery_action": "whitelist",
"device_group": [
<device_group_id>
]
},
"slice_controls": {
"slice_configuration_enabled": true,
"slice_edge_caching_enabled": true,
"slice_tiered_caching_enabled": false,
"slice_configuration_range": 1024
}
}
}
}}

```

7. Execute a seguinte requisição `POST` em seu terminal, substituindo `[TOKEN VALUE]` pelo seu [personal token](/pt-br/documentacao/produtos/guias/personal-tokens/), a variável `<edge_application_id>` pelo [ID da sua edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/), e a variável `<cache_setting_id>` pelo ID da configuração de cache recebido na resposta:

```bash
curl --location 'https://api.azionapi.net/edge_applications/<edge_application_id>/rules_engine/request/rules' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
curl --request POST \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id>/rules \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"name": "Set cache setting /cache",
"phase": "request",
"behaviors": [
{
"name": "set_cache_policy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ Você deve receber uma lista de cabeçalhos incluindo o cabeçalho personalizado
1. Execute a seguinte requisição `POST` no seu terminal, substituindo `[TOKEN VALUE]` pelo seu [personal token](/pt-br/documentacao/produtos/guias/personal-tokens/) e a variável `<edge_application_id>` pelo [ID da sua edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/):

```bash
curl --location 'https://api.azionapi.net/edge_applications/<edge_application_id>/device_groups' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
curl --request POST \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id>/device_groups \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"name": "Mobile",
"user_agent": "(Mobile|iPhone|Android)"
Expand Down Expand Up @@ -96,12 +97,15 @@ O procedimento descrito abaixo é uma solução temporária para verificar a val
3. Execute a seguinte requisição `POST` no seu terminal, substituindo `[TOKEN VALUE]` pelo seu [personal token](/pt-br/documentacao/produtos/guias/personal-tokens/), a variável `<edge_application_id>` pelo [ID da sua edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/), e a variável `input_value` pelo nome do seu device group:

```bash
curl --location 'https://api.azionapi.net/edge_applications/<edge_application_id>/rules_engine/response/rules' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
curl --request POST \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id>/rules \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"name": "DG - Mobile",
"phase": "response",

"behaviors": [
{
"name": "add_response_header",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,24 @@ Para ver sua função em execução, acesse sua aplicação [usando seu domínio
1. Execute a seguinte requisição `PATCH` em seu terminal, substituindo `[TOKEN VALUE]` por seu [personal token](/pt-br/documentacao/produtos/guias/personal-tokens/) e a variável `<edge_application_id>` por [seu ID de edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/) para ativar o módulo [Edge Functions](/pt-br/documentacao/produtos/build/edge-application/edge-functions/):

```bash
curl --location --request PATCH 'https://api.azionapi.net/edge_applications/<edge_application_id>' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
curl --request PATCH \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id> \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"edge_functions": true
"edge_functions_enabled": true
}'
```

2. Você receberá uma resposta com o valor atualizado.
3. Execute a seguinte requisição `GET` para recuperar o `edge_function_id` da função *Hello World*:

```bash
curl --location 'https://api.azionapi.net/edge_functions' \
--header 'Accept: application/json; version=3' \
--header 'Authorization: Token [TOKEN VALUE]'
curl --request GET \
--url https://api.azion.com/v4/edge_functions/functions \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]''
```

4. Você receberá uma resposta semelhante a esta:
Expand Down Expand Up @@ -112,13 +114,14 @@ curl --location 'https://api.azionapi.net/edge_functions' \
6. Execute a seguinte requisição `POST`, substituindo o valor do ID da edge function pelo valor que você recebeu na resposta anterior:

```bash
curl --location 'https://api.azionapi.net/edge_applications/<edge_application_id>/functions_instances' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
curl --request POST \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id>/functions \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \\
--data '{
"name": "Hello World",
"edge_function_id": <edge_function_id>,
"edge_function": <edge_function_id>,
"args": {}
}'
```
Expand Down Expand Up @@ -146,12 +149,15 @@ curl --location 'https://api.azionapi.net/edge_applications/<edge_application_id
8. Execute a seguinte requisição `POST` em seu terminal, substituindo `[TOKEN VALUE]` por seu [personal token](/pt-br/documentacao/produtos/guias/personal-tokens/), a variável `<edge_application_id>` por [seu ID de edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/), e a variável `<edge_function_instance_id>` pelo ID da instância da função recebida na resposta anterior:

```bash
curl --location 'https://api.azionapi.net/edge_applications/<edge_application_id>/rules_engine/request/rules' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
curl --request POST \
--url https://api.azion.com/v4/edge_application/applications/<edge_application_id>/rules \
--header 'Accept: application/json' \
--header 'Authorization: [TOKEN VALUE]' \
--header 'Content-Type: application/json' \
--data '{
"name": "Set cache setting - /cache",
"phase": "request",

"behaviors": [
{
"name": "run_function",
Expand Down
Loading