<commit_before><config xmlns="http://software.in2p3.fr/lavoisier/config.xsd"
        xmlns:date="http://exslt.org/dates-and-times"
        xmlns:xi="http://www.w3.org/2001/XInclude"
        xmlns:str="http://exslt.org/strings"
        xmlns:e="http://software.in2p3.fr/lavoisier/entries.xsd">

<!-- *******************************************************************
****               CALL TO THE API
****               FOR THE A/R FIGURES
****  methods :group_availability and service_flavor_availabilities
************************************************************************
-->


    <view name="api.availability.call">
        <info>
            <category>API call</category>
            <description>Call the Availability Method for sites or ngi - All options </description>
        </info>

        <argument name="group_type"></argument>
        <argument name="start_time"></argument>
        <argument name="end_time"></argument>
        <argument name="granularity"></argument>
        <argument name="report">Critical</argument>
        <connector type="HTTPConnector">
            <parameter name="url" eval="concat(property('api.group.availability'),$report,'/',upper-case($group_type),
            '?granularity=',$granularity,
            '&amp;start_time=',$start_time,'&amp;end_time=',$end_time)">
            </parameter>
            <parameter name="certificate" eval="property('certificate.path')"/>
            <parameter name="passphrase" eval="property('certificate.password')"/>
            <parameter name="header">
                <entry key="x-api-key" eval="property('argo.api.key')"></entry>
                <entry key="Accept">application/xml</entry>
            </parameter>
        </connector>

        <processors>
            <!-- Remove results from an extra day of the next  month , when date is like 2015-02-30 translated into 2015-03-02 -->
            <elements path="/root/Profile/Site">
                <element-ignore in="Availability" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>
            <elements path="/root/Profile/Ngi">
                <element-ignore in="Availability" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>


            <elements path="/root/root/group">
                <element-ignore in="results" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>
        </processors>

    </view>

    <view name="api.availability.services.call">
        <info>
            <category>API call</category>
            <description>Call the Availability Method for services - All options </description>
        </info>


        <argument name="start_time"></argument>
        <argument name="end_time"></argument>
        <argument name="granularity"></argument>
        <argument name="report"></argument>
        <argument name="site"></argument>
        <argument name="report">Critical</argument>

        <connector type="HTTPConnector">
            <parameter name="url" eval="concat(property('api.service.availability'),$report,'/SITES/',$site,
            '/services?granularity=',$granularity,
            '&amp;start_time=',$start_time,'&amp;end_time=',$end_time)">
            </parameter>
            <parameter name="certificate" eval="property('certificate.path')"/>
            <parameter name="passphrase" eval="property('certificate.password')"/>
            <parameter name="header">
                <entry key="x-api-key" eval="property('argo.api.key')"></entry>
                <entry key="Accept">application/xml</entry>
            </parameter>
        </connector>

        <processors>
            <!-- Remove results from an extra day of the next  month , when date is like 2015-02-30 translated into 2015-03-02 -->

            <elements path="/root/Profile/Site">
                <element-ignore in="Availability" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>

            <elements path="/root/Profile/Ngi">
                <element-ignore in="Availability" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>

            <elements path="/root/root/group">
                <element-ignore in="results" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>


        </processors>

    </view>

    <!-- *******************************************************************
****               ROTATING CACHE TO STORE
****                THE A/R FIGURES
************************************************************************
-->

    <view name="api.availability.rotating.caches">

        <info>
            <category>API results</category>
            <description>Sites and NGI AR results in cache</description>
        </info>

        <argument name="diff">10</argument>

        <argument name="group_type">sites</argument>
        <argument name="report">Critical</argument>
        <argument name="granularity">DAILY</argument>
        <argument name="start_time">0</argument>
        <argument name="end_time">0</argument>
        <argument name="site">false</argument>
        <argument name="delete" eval="false()"></argument>


        <argument name="starttime" eval="choose($diff=10,$start_time,concat(substring(date:add(date:date-time(),concat('-P',$diff+1,'M')), 0,8),'-01T00:00:00Z'))"></argument>
        <argument name="endtime" eval="choose($diff=10,$end_time,concat(substring(date:add(date:date-time(),concat('-P',$diff+1,'M')), 0,8),'-31T23:59:59Z'))"></argument>



        <connector type="RotatingCacheConnector">
            <parameter name="content" eval="
            view(choose($group_type!='service','api.availability.call','api.availability.services.call'),
            entry('report',$report)
            |entry('group_type',$group_type)
            |entry('granularity',$granularity)
            |entry('start_time',$starttime)
             |entry('end_time',$endtime)
             |entry('site',$site)
             )"/>
            <parameter name="key" eval="concat($report,'-',$group_type,'-',$granularity,'-',$starttime,'-',$endtime,'-',$site)"/>
            <parameter name="size">100000</parameter>
            <parameter name="delete" eval="$delete"></parameter>

            <fallback>
                <exception type="java.io.IOException"></exception>
            </fallback>
        </connector>


    </view>

    <!-- *******************************************************************
****               CALL TO THE API
****               FOR THE STATUS FIGURES and TIMELINES
****  methods : status
************************************************************************
-->

    <view name="api.status.call">
        <info>
            <category>API call</category>
            <description>Call the Availability Method for sites or ngi - All options </description>
        </info>

        <argument name="group_type">SITES</argument>
        <argument name="start_time"></argument>
        <argument name="end_time"></argument>
        <argument name="granularity"></argument>
        <argument name="report">Critical</argument>

        <connector type="HTTPConnector">
            <parameter name="url" eval="concat(property('api.status.url'),$report,'/',upper-case($group_type),
            '/?start_time=',$start_time,'&amp;end_time=',$end_time)">
            </parameter>
            <parameter name="certificate" eval="property('certificate.path')"/>
            <parameter name="passphrase" eval="property('certificate.password')"/>
            <parameter name="header">
                <entry key="x-api-key" eval="property('argo.api.key')"></entry>
                <entry key="Accept">application/xml</entry>
            </parameter>

        </connector>

        <processors><commit_msg>Update apiCalls.xml<commit_after><config xmlns="http://software.in2p3.fr/lavoisier/config.xsd"
        xmlns:date="http://exslt.org/dates-and-times"
        xmlns:xi="http://www.w3.org/2001/XInclude"
        xmlns:str="http://exslt.org/strings"
        xmlns:e="http://software.in2p3.fr/lavoisier/entries.xsd">

<!-- *******************************************************************
****               CALL TO THE API
****               FOR THE A/R FIGURES
****  methods :group_availability and service_flavor_availabilities
************************************************************************
-->


    <view name="api.availability.call">
        <info>
            <category>API call</category>
            <description>Call the Availability Method for sites or ngi - All options </description>
        </info>

        <argument name="group_type"></argument>
        <argument name="start_time"></argument>
        <argument name="end_time"></argument>
        <argument name="granularity"></argument>
        <argument name="report">Critical</argument>
        <connector type="HTTPConnector">
            <parameter name="url" eval="concat(property('api.group.availability'),$report,'/',upper-case($group_type),
            '?granularity=',$granularity,
            '&amp;start_time=',$start_time,'&amp;end_time=',$end_time)">
            </parameter>
            <parameter name="certificate" eval="property('certificate.path')"/>
            <parameter name="passphrase" eval="property('certificate.password')"/>
            <parameter name="header">
                <entry key="x-api-key" eval="property('argo.api.key')"></entry>
                <entry key="Accept">application/xml</entry>
            </parameter>
        </connector>

        <processors>
            <!-- Remove results from an extra day of the next  month , when date is like 2015-02-30 translated into 2015-03-02 -->
            <elements path="/root/Profile/Site">
                <element-ignore in="Availability" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>
            <elements path="/root/Profile/Ngi">
                <element-ignore in="Availability" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>


            <elements path="/root/root/group">
                <element-ignore in="results" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>
        </processors>

    </view>

    <view name="api.availability.services.call">
        <info>
            <category>API call</category>
            <description>Call the Availability Method for services - All options </description>
        </info>


        <argument name="start_time"></argument>
        <argument name="end_time"></argument>
        <argument name="granularity"></argument>
        <argument name="report"></argument>
        <argument name="site"></argument>
        <argument name="report">Critical</argument>

        <connector type="HTTPConnector">
            <parameter name="url" eval="concat(property('api.service.availability'),$report,'/SITES/',$site,
            '/services?granularity=',$granularity,
            '&amp;start_time=',$start_time,'&amp;end_time=',$end_time)">
            </parameter>
            <parameter name="certificate" eval="property('certificate.path')"/>
            <parameter name="passphrase" eval="property('certificate.password')"/>
            <parameter name="header">
                <entry key="x-api-key" eval="property('argo.api.key')"></entry>
                <entry key="Accept">application/xml</entry>
            </parameter>
        </connector>

        <processors>
            <!-- Remove results from an extra day of the next  month , when date is like 2015-02-30 translated into 2015-03-02 -->

            <elements path="/root/Profile/Site">
                <element-ignore in="Availability" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>

            <elements path="/root/Profile/Ngi">
                <element-ignore in="Availability" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>

            <elements path="/root/root/group">
                <element-ignore in="results" if="not(contains(@timestamp,substring($start_time,0,8))) and substring($start_time,0,8)=substring($end_time,0,8)"></element-ignore>
            </elements>


        </processors>

    </view>

    <!-- *******************************************************************
****               ROTATING CACHE TO STORE
****                THE A/R FIGURES
************************************************************************
-->

    <view name="api.availability.rotating.caches">

        <info>
            <category>API results</category>
            <description>Sites and NGI AR results in cache</description>
        </info>

        <argument name="diff">10</argument>

        <argument name="group_type">sites</argument>
        <argument name="report">Critical</argument>
        <argument name="granularity">DAILY</argument>
        <argument name="start_time">0</argument>
        <argument name="end_time">0</argument>
        <argument name="site">false</argument>
        <argument name="delete" eval="false()"></argument>


        <argument name="starttime" eval="choose($diff=10,$start_time,concat(substring(date:add(date:date-time(),concat('-P',$diff+1,'M')), 0,8),'-01T00:00:00Z'))"></argument>
        <argument name="endtime" eval="choose($diff=10,$end_time,concat(substring(date:add(date:date-time(),concat('-P',$diff+1,'M')), 0,8),'-31T23:59:59Z'))"></argument>



        <connector type="RotatingCacheConnector">
            <parameter name="content" eval="
            view(choose($group_type!='service','api.availability.call','api.availability.services.call'),
            entry('report',$report)
            |entry('group_type',$group_type)
            |entry('granularity',$granularity)
            |entry('start_time',$starttime)
             |entry('end_time',$endtime)
             |entry('site',$site)
             )"/>
            <parameter name="key" eval="concat($report,'-',$group_type,'-',$granularity,'-',$starttime,'-',$endtime,'-',$site)"/>
            <parameter name="size">100000</parameter>
            <parameter name="delete" eval="$delete"></parameter>

            <fallback>
                <exception type="java.io.IOException"></exception>
            </fallback>
        </connector>


    </view>

    <!-- *******************************************************************
****               CALL TO THE API
****               FOR THE STATUS FIGURES and TIMELINES
****  methods : status
************************************************************************
-->

    <view name="api.status.call">
        <info>
            <category>API call</category>
            <description>Call the Availability Method for sites or ngi - All options </description>
        </info>

        <argument name="group_type">SITES</argument>
        <argument name="start_time"></argument>
        <argument name="end_time"></argument>
        <argument name="granularity"></argument>
        <argument name="report">Critical</argument>

        <connector type="HTTPConnector">
            <parameter name="url" eval="concat(property('api.status.url'),$report,'/',upper-case($group_type),
            '?start_time=',$start_time,'&amp;end_time=',$end_time)">
            </parameter>
            <parameter name="certificate" eval="property('certificate.path')"/>
            <parameter name="passphrase" eval="property('certificate.password')"/>
            <parameter name="header">
                <entry key="x-api-key" eval="property('argo.api.key')"></entry>
                <entry key="Accept">application/xml</entry>
            </parameter>

        </connector>

        <processors>
{'fraction_non_alphanumeric': 0.2133059399359478, 'fraction_numerical': 0.013656414284851048, 'mean_word_length': 2.9386006663493576, 'pattern_counts': {'":': 0, '<': 335, '<?xml version=': 0, '>': 335, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 17}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2811918', 'n_tokens_mistral': 4703, 'n_tokens_neox': 4363, 'n_words': 682}