From 8be1ce90a5201061a823b7d8481ab74f3a20d7ad Mon Sep 17 00:00:00 2001 From: Luiza Vargas do Santos Date: Wed, 28 May 2025 13:23:13 -0300 Subject: [PATCH] fix: replace api v3 in build journey -pt --- .../processar-imagens.mdx | 56 +++--- .../edite-edge-app/cache-settings.mdx | 160 ++++++++++-------- .../edite-edge-app/device-groups.mdx | 20 ++- .../edite-edge-app/functions-instances.mdx | 40 +++-- .../edite-edge-app/main-settings.mdx | 15 +- .../edite-edge-app/rules-engine.mdx | 19 ++- 6 files changed, 183 insertions(+), 127 deletions(-) diff --git a/src/content/docs/pt-br/pages/build-jornada/configuracoes-avancadas/processar-imagens.mdx b/src/content/docs/pt-br/pages/build-jornada/configuracoes-avancadas/processar-imagens.mdx index e964a8c8af..8dc6467cf3 100644 --- a/src/content/docs/pt-br/pages/build-jornada/configuracoes-avancadas/processar-imagens.mdx +++ b/src/content/docs/pt-br/pages/build-jornada/configuracoes-avancadas/processar-imagens.mdx @@ -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 `` 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/' \ ---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/ \ + --header 'Accept: application/json' \ + --header 'Authorization: [TOKEN VALUE]' \ + --header 'Content-Type: application/json' \ --data '{ "application_acceleration": true, "image_optimization": true @@ -91,20 +92,32 @@ curl --location --request PATCH 'https://api.azionapi.net/edge_applications/` pelo `id` de sua edge application: ```bash -curl --location 'https://api.azionapi.net/edge_applications//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//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" + ] + } }' ``` @@ -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//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//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": "" }, { diff --git a/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/cache-settings.mdx b/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/cache-settings.mdx index 8154ad0a82..ee455710df 100644 --- a/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/cache-settings.mdx +++ b/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/cache-settings.mdx @@ -161,12 +161,13 @@ 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 `` 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/' \ ---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/ \ + --header 'Accept: application/json' \ + --header 'Authorization: [TOKEN VALUE]' \ + --header 'Content-Type: application/json' \ --data '{ - "application_acceleration": true + "application_acceleration_enabled": true }' ``` @@ -174,45 +175,58 @@ curl --location --request PATCH 'https://api.azionapi.net/edge_applications//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//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 `` pelo [ID da sua edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/), e a variável `` pelo ID do device group da resposta anterior, se necessário: ```bash -curl --location 'https://api.azionapi.net/edge_applications//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//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": [ - ], - "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 | @@ -240,48 +254,60 @@ curl --location 'https://api.azionapi.net/edge_applications/, - "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": [ - - ], - "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": , + "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": [ + + ] + }, + "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 `` pelo [ID da sua edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/), e a variável `` pelo ID da configuração de cache recebido na resposta: ```bash -curl --location 'https://api.azionapi.net/edge_applications//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//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", diff --git a/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/device-groups.mdx b/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/device-groups.mdx index acd071efc1..fb4ca3979d 100644 --- a/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/device-groups.mdx +++ b/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/device-groups.mdx @@ -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 `` pelo [ID da sua edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/): ```bash -curl --location 'https://api.azionapi.net/edge_applications//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//device_groups \ + --header 'Accept: application/json' \ + --header 'Authorization: [TOKEN VALUE]' \ + --header 'Content-Type: application/json' \ --data '{ "name": "Mobile", "user_agent": "(Mobile|iPhone|Android)" @@ -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 `` 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//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//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", diff --git a/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/functions-instances.mdx b/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/functions-instances.mdx index a1a7dcf88c..5b43fea03d 100644 --- a/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/functions-instances.mdx +++ b/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/functions-instances.mdx @@ -64,12 +64,13 @@ 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 `` 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/' \ ---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/ \ + --header 'Accept: application/json' \ + --header 'Authorization: [TOKEN VALUE]' \ + --header 'Content-Type: application/json' \ --data '{ - "edge_functions": true + "edge_functions_enabled": true }' ``` @@ -77,9 +78,10 @@ curl --location --request PATCH 'https://api.azionapi.net/edge_applications//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//functions \ + --header 'Accept: application/json' \ + --header 'Authorization: [TOKEN VALUE]' \ + --header 'Content-Type: application/json' \\ --data '{ "name": "Hello World", - "edge_function_id": , + "edge_function": , "args": {} }' ``` @@ -146,12 +149,15 @@ curl --location 'https://api.azionapi.net/edge_applications/` por [seu ID de edge application](/pt-br/documentacao/produtos/guias/build/definir-configuracoes-principais/), e a variável `` pelo ID da instância da função recebida na resposta anterior: ```bash -curl --location 'https://api.azionapi.net/edge_applications//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//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", diff --git a/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/main-settings.mdx b/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/main-settings.mdx index 52cc0b6be1..4456bf7493 100644 --- a/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/main-settings.mdx +++ b/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/main-settings.mdx @@ -102,19 +102,20 @@ Ainda não tem uma edge application? [Comece com um template](/pt-br/documentaca 1. Execute a seguinte requisição `GET` no seu terminal, substituindo `[TOKEN VALUE]` pelo seu [personal token](/pt-br/documentacao/produtos/guias/personal-tokens/) para recuperar seu ``: ```bash - curl --location 'https://api.azionapi.net/edge_applications \ - --header 'Accept: application/json; version=3' \ - --header 'Authorization: Token [TOKEN VALUE]' + curl --request GET \ + --url https://api.azion.com/v4/edge_application/applications \ + --header 'Accept: application/json' \ + --header 'Authorization: [TOKEN VALUE]' ``` 2. Você receberá uma resposta com todas sua edge applications existentes. Copie o valor do `` que você deseja configurar. 3. Execute uma requisição `PATCH` para modificar a aplicação da seguinte forma: ```bash - curl --location --request PATCH 'https://api.azionapi.net/edge_applications/' \ - --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/ \ + --header 'Accept: application/json' \ + --header 'Authorization: [TOKEN VALUE]' \ --data '{ "delivery_protocol": "http", "http_port": [80, 8008], diff --git a/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/rules-engine.mdx b/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/rules-engine.mdx index e4450fe15b..4cb7d7e214 100644 --- a/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/rules-engine.mdx +++ b/src/content/docs/pt-br/pages/build-jornada/edite-edge-app/rules-engine.mdx @@ -60,10 +60,11 @@ Para remover o cabeçalho `Server`: 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 `` por [seu ID de edge application(/pt-br/documentacao/produtos/guias/build/ajustar-cache-settings/) 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/' \ ---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/ \ + --header 'Accept: application/json' \ + --header 'Authorization: [TOKEN VALUE]' \ + --header 'Content-Type: application/json' \ --data '{ "application_acceleration": true }' @@ -73,12 +74,14 @@ curl --location --request PATCH 'https://api.azionapi.net/edge_applications/` pelo valor `id` que você recebeu na resposta anterior: ```bash -curl --location 'https://api.azionapi.net/edge_applications//rules_engine/response/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//rules \ + --header 'Accept: application/json' \ + --header 'Authorization: [TOKEN VALUE]' \ + --header 'Content-Type: application/json' \ --data '{ "name": "FilterRespHeader Server", + "phase": "response", "behaviors": [ { "name": "filter_response_header",