diff --git a/all-in-one-apim/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_request_seq_.xml b/all-in-one-apim/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_request_seq_.xml deleted file mode 100644 index 962f96147b..0000000000 --- a/all-in-one-apim/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_request_seq_.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - -
- - - - - diff --git a/all-in-one-apim/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_response_seq_.xml b/all-in-one-apim/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_response_seq_.xml deleted file mode 100644 index c3c99d97d3..0000000000 --- a/all-in-one-apim/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_response_seq_.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/all-in-one-apim/modules/distribution/resources/api_templates/ai_api_endpoints_seq_template.xml b/all-in-one-apim/modules/distribution/resources/api_templates/ai_api_endpoints_seq_template.xml new file mode 100644 index 0000000000..435b2f1961 --- /dev/null +++ b/all-in-one-apim/modules/distribution/resources/api_templates/ai_api_endpoints_seq_template.xml @@ -0,0 +1,87 @@ + + ##################### Define the macros ###################### + + #macro ( print_string_if_exist $field $default) + #if($field && "$field" !="") + "$field" + #else + "$default" + #end + #end + + #macro ( draw_endpoint $type $endpoint ) + #if($endpoint.endpointSecurityEnabled) + + + + + + #end + + #if( $endpoint && $endpoint.endpointUuid ) + #set( $ep_key = "${endpointKey}_API_LLMEndpoint_${endpoint.endpointUuid}" ) + #else + #set( $ep_key = "${endpointKey}_API${deploymentStage}Endpoint") + #end + + + + #end + + #macro ( fail_scenario ) + + + + + #end + + +#if( $defaultEndpoint ) + + + #fail_scenario + + + + + #foreach( $endpoint in $!endpoints ) + + #draw_endpoint($type, $endpoint) + + #end + + #draw_endpoint($type, $defaultEndpoint) + + + #fail_scenario + + + + + + + + + + + + + +#end + \ No newline at end of file diff --git a/all-in-one-apim/modules/distribution/resources/api_templates/ai_api_template.xml b/all-in-one-apim/modules/distribution/resources/api_templates/ai_api_template.xml index fd652879de..810ec498c3 100644 --- a/all-in-one-apim/modules/distribution/resources/api_templates/ai_api_template.xml +++ b/all-in-one-apim/modules/distribution/resources/api_templates/ai_api_template.xml @@ -1,7 +1,7 @@ + ##################### Define the macros ###################### + + #macro ( print_string_if_exist $field $default) + #if($field && "$field" !="") + "$field" + #else + "$default" + #end + #end + + #macro ( draw_endpoint $type $endpoint ) + #if($endpoint.endpointSecurityEnabled) + + + + + + #end + + #if( $endpoint && $endpoint.endpointUuid ) + #set( $ep_key = "${endpointKey}_API_LLMEndpoint_${endpoint.endpointUuid}" ) + #else + #set( $ep_key = "${endpointKey}_API${deploymentStage}Endpoint") + #end + + + + #end + + #macro ( fail_scenario ) + + + + + #end + + +#if( $defaultEndpoint ) + + + #fail_scenario + + + + + #foreach( $endpoint in $!endpoints ) + + #draw_endpoint($type, $endpoint) + + #end + + #draw_endpoint($type, $defaultEndpoint) + + + #fail_scenario + + + + + + + + + + + + + +#end + \ No newline at end of file diff --git a/api-control-plane/modules/distribution/resources/api_templates/ai_api_template.xml b/api-control-plane/modules/distribution/resources/api_templates/ai_api_template.xml index 7f8913409b..3224dc642b 100644 --- a/api-control-plane/modules/distribution/resources/api_templates/ai_api_template.xml +++ b/api-control-plane/modules/distribution/resources/api_templates/ai_api_template.xml @@ -26,26 +26,6 @@ #end #end - #macro ( draw_endpoint $type $endpoint ) - #if($endpoint.endpointSecurityEnabled) - - - - - - #end - - #if( $endpoint && $endpoint.endpointUuid ) - #set( $ep_key = "${endpointKey}_API_LLMEndpoint_${endpoint.endpointUuid}" ) - #else - #set( $ep_key = "${endpointKey}_API${type}Endpoint") - #end - - - - - #end - ######################## End of Macros ###################################### @@ -56,26 +36,26 @@ transports="$!transport" version-type="context" > -#set( $originalEndPointConfig = $endpoint_config ) -#if( $apiIsBlocked ) -## if API is blocked send the API Block message - - - - - - 700700 - API blocked - This API has been blocked temporarily. Please try again later or contact the system administrators. - - - - - - -
- - + #set( $originalEndPointConfig = $endpoint_config ) + #if( $apiIsBlocked ) + ## if API is blocked send the API Block message + + + + + + 700700 + API blocked + This API has been blocked temporarily. Please try again later or contact the system administrators. + + + + + + +
+ + #else ## api not blocked @@ -102,8 +82,13 @@ faultSequence=#print_string_if_exist($faultSequence "fault")> +
- + + + + + ############## define the filter based on environment type production only, sandbox only , hybrid ############ @@ -139,41 +124,11 @@ #if( ($environmentType == 'sandbox') || ($environmentType == 'hybrid' && !$defaultProductionEndpoint)) ) #if( $defaultSandboxEndpoint ) - - #foreach( $endpoint in $!sandboxEndpoints ) - - #draw_endpoint("sandbox", $endpoint) - - #end - - #draw_endpoint("sandbox", $defaultSandboxEndpoint) - - - - - - - - + #end #else #if( $defaultProductionEndpoint ) - - #foreach( $endpoint in $!productionEndpoints ) - - #draw_endpoint("production", $endpoint) - - #end - - #draw_endpoint("production", $defaultProductionEndpoint) - - - - - - - - + #end #end @@ -181,22 +136,7 @@ #if( $environmentType !='hybrid' ) #if( $resource.getAuthType() == 'None' && $environmentType == 'sandbox' && $defaultSandboxEndpoint)) ) #if( $defaultSandboxEndpoint ) - - #foreach( $endpoint in $!sandboxEndpoints ) - - #draw_endpoint("sandbox", $endpoint) - - #end - - #draw_endpoint("sandbox", $defaultSandboxEndpoint) - - - - - - - - + #end #else @@ -219,42 +159,12 @@ #end #else #if( $defaultSandboxEndpoint && $defaultProductionEndpoint ) - - #foreach( $endpoint in $!sandboxEndpoints ) - - #draw_endpoint("sandbox", $endpoint) - - #end - - #draw_endpoint("sandbox", $defaultSandboxEndpoint) - - - - - - - - + #elseif( $defaultProductionEndpoint ) #elseif( $defaultSandboxEndpoint ) #if( $resource.getAuthType() == 'None' ) - - #foreach( $endpoint in $!sandboxEndpoints ) - - #draw_endpoint("sandbox", $endpoint) - - #end - - #draw_endpoint("sandbox", $defaultSandboxEndpoint) - > - - - - - - - + #else #end @@ -265,7 +175,6 @@ #end - diff --git a/api-control-plane/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 b/api-control-plane/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 index cef5085e1c..f56c6b810d 100644 --- a/api-control-plane/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 +++ b/api-control-plane/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 @@ -1 +1,3 @@ - + + + diff --git a/api-control-plane/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json b/api-control-plane/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json index cc334c2f83..8602ca711c 100644 --- a/api-control-plane/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json +++ b/api-control-plane/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json @@ -3,7 +3,7 @@ "name": "modelFailover", "version": "v1", "displayName": "Model Failover", - "description": "This policy allows you to route traffic to a different model(s) when the primary model fails", + "description": "This policy enables traffic rerouting to one or more fallback models if the target model fails, ensuring continued availability", "policyAttributes": [ { "name": "failoverConfigs", diff --git a/gateway/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_request_seq_.xml b/gateway/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_request_seq_.xml deleted file mode 100644 index 962f96147b..0000000000 --- a/gateway/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_request_seq_.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - -
- - - - - diff --git a/gateway/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_response_seq_.xml b/gateway/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_response_seq_.xml deleted file mode 100644 index c3c99d97d3..0000000000 --- a/gateway/modules/distribution/product/src/main/conf/synapse-configs/default/sequences/_ai_api_response_seq_.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/gateway/modules/distribution/resources/api_templates/ai_api_endpoints_seq_template.xml b/gateway/modules/distribution/resources/api_templates/ai_api_endpoints_seq_template.xml new file mode 100644 index 0000000000..aba25c979c --- /dev/null +++ b/gateway/modules/distribution/resources/api_templates/ai_api_endpoints_seq_template.xml @@ -0,0 +1,87 @@ + + ##################### Define the macros ###################### + + #macro ( print_string_if_exist $field $default) + #if($field && "$field" !="") + "$field" + #else + "$default" + #end + #end + + #macro ( draw_endpoint $type $endpoint ) + #if($endpoint.endpointSecurityEnabled) + + + + + + #end + + #if( $endpoint && $endpoint.endpointUuid ) + #set( $ep_key = "${endpointKey}_API_LLMEndpoint_${endpoint.endpointUuid}" ) + #else + #set( $ep_key = "${endpointKey}_API${deploymentStage}Endpoint") + #end + + + + #end + + #macro ( fail_scenario ) + + + + + #end + + +#if( $defaultEndpoint ) + + + #fail_scenario + + + + + #foreach( $endpoint in $!endpoints ) + + #draw_endpoint($type, $endpoint) + + #end + + #draw_endpoint($type, $defaultEndpoint) + + + #fail_scenario + + + + + + + + + + + + + +#end + \ No newline at end of file diff --git a/gateway/modules/distribution/resources/api_templates/ai_api_template.xml b/gateway/modules/distribution/resources/api_templates/ai_api_template.xml index 7f8913409b..3224dc642b 100644 --- a/gateway/modules/distribution/resources/api_templates/ai_api_template.xml +++ b/gateway/modules/distribution/resources/api_templates/ai_api_template.xml @@ -26,26 +26,6 @@ #end #end - #macro ( draw_endpoint $type $endpoint ) - #if($endpoint.endpointSecurityEnabled) - - - - - - #end - - #if( $endpoint && $endpoint.endpointUuid ) - #set( $ep_key = "${endpointKey}_API_LLMEndpoint_${endpoint.endpointUuid}" ) - #else - #set( $ep_key = "${endpointKey}_API${type}Endpoint") - #end - - - - - #end - ######################## End of Macros ###################################### @@ -56,26 +36,26 @@ transports="$!transport" version-type="context" > -#set( $originalEndPointConfig = $endpoint_config ) -#if( $apiIsBlocked ) -## if API is blocked send the API Block message - - - - - - 700700 - API blocked - This API has been blocked temporarily. Please try again later or contact the system administrators. - - - - - - -
- - + #set( $originalEndPointConfig = $endpoint_config ) + #if( $apiIsBlocked ) + ## if API is blocked send the API Block message + + + + + + 700700 + API blocked + This API has been blocked temporarily. Please try again later or contact the system administrators. + + + + + + +
+ + #else ## api not blocked @@ -102,8 +82,13 @@ faultSequence=#print_string_if_exist($faultSequence "fault")> +
- + + + + + ############## define the filter based on environment type production only, sandbox only , hybrid ############ @@ -139,41 +124,11 @@ #if( ($environmentType == 'sandbox') || ($environmentType == 'hybrid' && !$defaultProductionEndpoint)) ) #if( $defaultSandboxEndpoint ) - - #foreach( $endpoint in $!sandboxEndpoints ) - - #draw_endpoint("sandbox", $endpoint) - - #end - - #draw_endpoint("sandbox", $defaultSandboxEndpoint) - - - - - - - - + #end #else #if( $defaultProductionEndpoint ) - - #foreach( $endpoint in $!productionEndpoints ) - - #draw_endpoint("production", $endpoint) - - #end - - #draw_endpoint("production", $defaultProductionEndpoint) - - - - - - - - + #end #end @@ -181,22 +136,7 @@ #if( $environmentType !='hybrid' ) #if( $resource.getAuthType() == 'None' && $environmentType == 'sandbox' && $defaultSandboxEndpoint)) ) #if( $defaultSandboxEndpoint ) - - #foreach( $endpoint in $!sandboxEndpoints ) - - #draw_endpoint("sandbox", $endpoint) - - #end - - #draw_endpoint("sandbox", $defaultSandboxEndpoint) - - - - - - - - + #end #else @@ -219,42 +159,12 @@ #end #else #if( $defaultSandboxEndpoint && $defaultProductionEndpoint ) - - #foreach( $endpoint in $!sandboxEndpoints ) - - #draw_endpoint("sandbox", $endpoint) - - #end - - #draw_endpoint("sandbox", $defaultSandboxEndpoint) - - - - - - - - + #elseif( $defaultProductionEndpoint ) #elseif( $defaultSandboxEndpoint ) #if( $resource.getAuthType() == 'None' ) - - #foreach( $endpoint in $!sandboxEndpoints ) - - #draw_endpoint("sandbox", $endpoint) - - #end - - #draw_endpoint("sandbox", $defaultSandboxEndpoint) - > - - - - - - - + #else #end @@ -265,7 +175,6 @@ #end - diff --git a/gateway/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 b/gateway/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 index cef5085e1c..f56c6b810d 100644 --- a/gateway/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 +++ b/gateway/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 @@ -1 +1,3 @@ - + + + diff --git a/gateway/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json b/gateway/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json index cc334c2f83..8602ca711c 100644 --- a/gateway/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json +++ b/gateway/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json @@ -3,7 +3,7 @@ "name": "modelFailover", "version": "v1", "displayName": "Model Failover", - "description": "This policy allows you to route traffic to a different model(s) when the primary model fails", + "description": "This policy enables traffic rerouting to one or more fallback models if the target model fails, ensuring continued availability", "policyAttributes": [ { "name": "failoverConfigs", diff --git a/traffic-manager/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 b/traffic-manager/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 index cef5085e1c..f56c6b810d 100644 --- a/traffic-manager/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 +++ b/traffic-manager/modules/distribution/resources/operation_policies/definitions/modelFailover_v1.j2 @@ -1 +1,3 @@ - + + + diff --git a/traffic-manager/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json b/traffic-manager/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json index cc334c2f83..8602ca711c 100644 --- a/traffic-manager/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json +++ b/traffic-manager/modules/distribution/resources/operation_policies/specifications/modelFailover_v1.json @@ -3,7 +3,7 @@ "name": "modelFailover", "version": "v1", "displayName": "Model Failover", - "description": "This policy allows you to route traffic to a different model(s) when the primary model fails", + "description": "This policy enables traffic rerouting to one or more fallback models if the target model fails, ensuring continued availability", "policyAttributes": [ { "name": "failoverConfigs",