This page last changed on Mar 20, 2013 by tarragon.


API entry point

A SAM API is provided by every MyWLCG/MyEGI instance, accessible at

http://<host>/[mywlcg|myegi]/sam-pi/

SAM's central instance API can be queried at

http://grid-monitoring.cern.ch/mywlcg/sam-pi/

Topology (mywlcg-atp)

Contacts

  • Input
    /sam-pi/contacts?[name]&[dn]&[email]&[output]
    • Optional
      • name: contact name
      • dn: contact certifcate dn
      • email: contact email address
      • output: output format; possible values are: xml, json; default: json
  • Output
    [
        {
            "contact":{
                "name": "abc",
                "dn": "abc",
                "telephone": "123",
                "email": "abc"
             },
             ...
        },
        ...
    ]

Group Contacts

  • Input
    /sam-pi/groupcontacts?[name]&[dn]&[email]&[groupname]&[role]&[output]
    • Optional
      • name: contact name
      • dn: contact certifcate dn
      • email: contact email address
      • groupname: region to which the contact belongs (e.g. NGI_IT)
      • role: contact role
      • output: output format; possible values are: xml, json; default: json
  • Output
    [
        {
            "contact":{
                "name": "abc",
                "dn": "abc",
                "telephone": "123",
                "email": "abc"
            },
            "role": "Regional Staff (ROD)",
            "group": {
                "groupname": "NGI_IT"
            }
        },
        ...
    ]

Site Contacts

  • Input
    /sam-pi/sitecontacts?[name]&[dn]&[email]&[sitename]&[role]&[output]
    • Optional
      • name: contact name
      • dn: contact certifcate dn
      • email: contact email address
      • sitename: site to which the contact belongs (e.g. CERN-PROD)
      • role: contact role
      • output: output format; possible values are: xml, json; default: json
  • Output
    [
        {
            "contact":{
                "name": "abc",
                "dn": "abc",
                "telephone": "123",
                "email": "abc"
            },
            "role": "Site Operations Manager",
            "site": {
                "sitename": "CERN-PROD"
            }
        },
        ...
    ]

VO Contacts

  • Input
    /sam-pi/vocontacts?[name]&[dn]&[email]&[voname]&[role]&[output]
    • Optional
      • name: contact name
      • dn: contact certifcate dn
      • email: contact email address
      • voname: vo to which the contact belongs (e.g. atlas)
      • role: contact role
      • output: output format; possible values are: xml, json; default: json
  • Output
    [
        {
            "contact":{
                "name": "abc",
                "dn": "abc",
                "telephone": "123",
                "email": "abc"
            },
            "role": "",
            "vo": {
                "voname": "lhcb"
            }
        },
        ...
    ]

Services

  • Input
    /sam-pi/servicemap?[site]&[flavourname]&[voname]&[hostname]&[serviceendpoint]&[ismonitored]&[isinproduction]&[output]
    • Optional
      • site: name of the site (e.g. CERN-PROD)
      • flavourname: service flavour name (e.g. CREAM-CE)
      • voname: vo name (e.g. ops)
      • hostname: hostname
      • serviceendpoint: service endpoint
      • ismonitored: if the service is monitored; possible values are: 'Y' or 'N'
      • isinproduction: if the service is in production; possible values are: 'Y' or 'N'
      • output: output format; possible values are: xml, json; default: json
  • Output
    [
        {
            "flavour":{
                "flavourname": "CREAM-CE",
                "id": "3"
            },
            "hostname": "ce203.cern.ch",
            "site": [
                {
                    "sitename": "CERN-PROD"
                }
            ],
            "vo": [
                {
                    "voname": "alice"
                }
            ],
            "ismonitored": "Y",
            "isinproduction": "Y",
            "id": "2751",
            "serviceendpoint": "ce203.cern.ch:8443",
        },
        ...
    ]

Sites

  • Input
    /sam-pi/site?[sitename]&[siteoffname]&[countryname]&[infrastructure]&[infrasttype]&[ismonitored]&[output]
    • Optional
      • sitename: name of the site (e.g. CERN-PROD)
      • siteoffname: official name of the site
      • countryname: name of the country (e.g SWITZERLAND)
      • infrastructure: name of the infrastructure (e.g. EGI)
      • infrasttype:
      • ismonitored: if the service is monitored; possible values are: 'Y' or 'N'
      • output: output format; possible values are: xml, json; default: json
  • Output
    [
        {
            "giisurl": "ldap://prod-bdii.cern.ch:2170/mds-vo-name=CERN-PROD,o=grid",
            "contactemail": "grid-cern-prod-admins@cern.ch",
            "sitename": "CERN-PROD",
            "certifstatus": "Y",
            "longitude": 6.04,
            "infrasttype": "Production",
            "contacttel": "+41(0)76487 0839",
            "infrast": {
                "infrastname": "EGI"
            },
            "ismonitored": "Y",
            "country": {
                "countryname": "Switzerland"
            },
            "latitude": 46.23,
            "sitedesc": "",
        }
        ...
    ]

Sites in Region

  • Input
    /sam-pi/siteregionvo/?[site]&[region]&[output]
    • Optional
      • site: name of the site (e.g. CERN-PROD)
      • region: name of the region (e.g NGI_IT)
      • output: output format; possible values are: xml, json; default: json
  • Output
    [
        {
            "site": "BEIJING-LCG2",
            "atp_site": "BEIJING-LCG2",
            "region": "ROC_Canada",
            "infrast": "EGI",
            "vo": [
                "atlas",
                "biomed",
                "cms",
                "dteam",
                "esr",
                "euchina",
                "ops",
                "vo.france-asia.org"
            ]
        },
        ...
    ]

VO Feeds

  • Input
    /sam-pi/vofeeds?[atp_site]&[hostname]&[flavourname]&[vo]&[vogroups]&[vogrouptype]&[ismonitored]&[isinproduction]&[output]
    • Optional
      • atp_site: name of the site (e.g. CERN-PROD)
      • hostname: hostname
      • flavourname: service flavour name (e.g. CREAM-CE)
      • vo: vo name (e.g. ops)
      • vogroups: group name for given vo (e.g. T0-CERN)
      • vogrouptype: group type for given vo (e.g. Tier-1)
      • ismonitored: if the service is monitored; possible values are: 'Y' or 'N'
      • isinproduction: if the service is in production; possible values are: 'Y' or 'N'
      • output: output format; possible values are: xml, json; default: json
  • Output
    [
        {
            "grouptype": "LHCb_Site",
            "atp_site": "ARAGRID-CIENCIAS",
            "infrastructure": "EGI",
            "spacetoken_name": "",
            "hostname": "creamc-iber.bifi.unizar.es",
            "service_id": "2556",
            "service_flavour": "CREAM-CE",
            "service_flavour_id": "3",
            "vo": [
                    "lhcb"
            ],
            "roc": "NGI_IBERGRID",
            "groupname": "LCG.ARAGRID-CIENCIAS.es",
            "service_type": "CE",
            "serviceendpoint": "creamc-iber.bifi.unizar.es:8443",
            "spacetoken_path": "",
            "ismonitored": "Y",
            "isinproduction": "Y"
        },
        ...
    ]

Topology (mywlcg-old)

Sites in Topology

  • Name: Site Names
  • Input:
    /sam-pi/site_names?[infrast_type]&[is_certified]&[infrast_name]&[output]
    • infrast_name: Optional but may appear more than once. Possible values are: EGI, NDGF, OSG.
    • infrast_type: Optional. Possible values are: PPS, Production, SC, Test. Default: Production.
    • is_certified: Optional. Possible values are: Y, N. Default: Y.
    • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: The list of sites defined in the topology database.
    • DB Tables
      • infrastructure: To extract the IDs of the infrastructure names passed by parameters.
      • site: To extract the list of sites.
  • Output format:
    <root>
       <Site name="BEgrid-UniversiteitAntwerpen" infrast_name="EGI"/>
       <Site name="FI-LCG2" infrast_name="EGI"/>
       <Site name="GR-07-UOI-HEPLAB" infrast_name="EGI"/>
       <Site name="GUP-CERTIF-TB" infrast_name="EGI"/>
       <Site name="IFJ-PAN-BG" infrast_name="EGI"/>
       <Site name="INFN-BOLOGNA-CMS" infrast_name="EGI"/>
       <Site name="KMU-PRI-LCG2" infrast_name="EGI"/>
       <Site name="MCGILL-LCG2" infrast_name="EGI"/>
       <Site name="NGS-LEEDS" infrast_name="EGI"/>
    </root>
    

Service Types and Flavours

  • Name: Service Types and Flavours
  • Input:
    /sam-pi/service_types_and_flavours?[output]
    • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: The different service types and flavours defined in the topology database.
    • DB Tables
      • service_type: To extract the service types' abbreviations. NOTE: service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
      • service_type_flavour: To extract the service type flavours and the IDs to the corresponding service types.
  • Output format:
    <root>
       <Service type="APEL" flavour="APEL"/>
       <Service type="APEL" flavour="gLite-APEL"/>
       <Service type="BDII" flavour="Site-BDII"/>
       <Service type="BDII" flavour="Top-BDII"/>
       <Service type="CE" flavour="ARC-CE"/>
       <Service type="CE" flavour="CREAM-CE"/>
       <Service type="CE" flavour="gLite-CE"/>
       <Service type="SRM" flavour="SRMv2"/>
       <Service type="LFC" flavour="Central-LFC"/>
       <Service type="LFC" flavour="Local-LFC"/>
       <Service type="MyProxy" flavour="MyProxy"/>
       <Service type="RB" flavour="RB"/>
       <Service type="RGMA" flavour="RGMA-IC"/>
    </root>
    

Services in Maintenance

  • Name: Services in maintenance
  • Input:
    /sam-pi/service_maintenance?[host_name]&[output]
    • host_name: Mandatory and may appear more than once. Eg: srm.cern.ch
    • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: Returns 'Y' or 'N' if the host_names passed by parameters are currently under a scheduled maintenance.
    • DB Tables
      • service: To extract the IDs of the services passed by parameters.
      • downtime: To extract the current downtime IDs considering the request execution time and the columns starttimestamp, endtimestamp, inserttimestamp, isdeleted (='N') and classification (='SCHEDULED').
      • service_downtime: To map services with possible downtimes.
  • Output format:
    <root>
       <Service hostname="cmsboce.bo.infn.it">
          <inMaintenance>N</inMaintenance>
       </Service>
       <Service hostname="srm.cern.ch">
          <inMaintenance>N</inMaintenance>
       </Service>
    </root>
    

Service Types and Flavours running in Services or Sites

  • Name: Service Types and Flavours running in Services or Sites
  • Input:
    /sam-pi/service_types_and_flavours_per_service?[host_name]&[site_name]&[infrast_name]&[output]
    • host_name: Optional but may appear more than once. Eg: srm.cern.ch
    • site_name: Optional but may appear more than once. Eg: CERN-PROD
    • infrast_name: Optional but may appear more than once. Possible values are: EGI, NDGF, OSG
    • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: returns the Service Types and Service Flavours defined in each hostname or site passed by parameters.
    • DB Tables
      • infrastructure: To extract the IDs that map to the infrastructure names passed by parameters.
      • site: To extract the IDs of the sites passed by parameters (taking into account the infrast_id if infrast_name was specified).
      • site_service: To extract the IDs of the services defined in those sites.
      • service: To extract the IDs of the hostnames passed by parameters together with the ID of the service type flavours.
      • service_type_flavour: To extract the service type flavour names together with the IDs of the corresponding service types.
      • service_type: To extract the service type abbreviation name.  NOTE: service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
  • Output format:
    <root>
       <Site name="CERN-PROD" infrast_name="EGI">
          <Service hostname="lxdpm101.cern.ch" type="SRM" flavour="SRMv2"/>
          <Service hostname="lxdpm101.cern.ch" type="SRM" flavour="SRM"/>
       </Site>
       <Site name="INFN-BOLOGNA-CMS" infrast_name="EGI">
          <Service hostname="cmsboce.bo.infn.it" type="CE" flavour="gLite-CE"/>
          <Service hostname="cmsboce.bo.infn.it" type="BDII" flavour="Site-BDII"/>
       </Site>
    </root>
    

VO Names

  • Name: VO Names
  • Input:
    /sam-pi/vo_names?[output]
    • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: returns the list of VOs defined in the topology database.
    • DB Tables
      • vo: To extract the vo names.
  • Output format:
    <root>
       <VO name="Alice"/>
       <VO name="Atlas"/>
       <VO name="BaBar"/>
       <VO name="Biomed"/>
       <VO name="CMS"/>
       <VO name="DTeam"/>
    </root>
    

VOs supported by each Service or Site

  • Name: VOs supported by each Service or Site
  • Input:
    /sam-pi/vos_per_service?[vo_name]&[site_name]&[infrast_name]&[service_type]&[output]
    • vo_name: Optional but may appear more than once. Eg: Alice
    • site_name: Optional but may appear more than once. Eg: CERN-PROD
    • infrast_name: Optional but may appear more than once. Possible values are: EGI, NDGF, OSG
    • service_type: Optional but may appear more than once. Eg: LFC NOTE: service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
    • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: returns a list of VOs supported by each Service or Service type, in each Site.
    • DB Tables
      • vo: To extract the vo names.
      • service: To extract the hostname and flavour.
      • service_vo: To map service IDs with VO IDs.
      • service_type_flavour: To map service_types with services.
      • service_type: To extract the service abbreviation. NOTE: service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
      • infrastructure: To extract the IDs that map to the infrastructure names passed by parameters.
      • site: To extract the IDs of the sites passed by parameters (taking into account the infrast_id if infrast_name was specified).
      • service_site: To map service IDs with site IDs.
  • Output format:
    <root>
       <Site name="CERN-PROD" infrast_name="EGI">
          <Service hostname="prod-lfc-alice-local.cern.ch" type="LFC">
             <supportsVO>Alice</supportsVO>
          </Service>
          <Service hostname="prod-lfc-atlas-central.cern.ch" type="LFC">
             <supportsVO>Atlas</supportsVO>
          </Service>
          <Service hostname="prod-lfc-atlas-local.cern.ch" type="LFC">
             <supportsVO>Atlas</supportsVO>
          </Service>
          <Service hostname="prod-lfc-cms-central.cern.ch" type="LFC">
             <supportsVO>CMS</supportsVO>
          </Service>
          <Service hostname="prod-lfc-lhcb-central.cern.ch" type="LFC">
             <supportsVO>LHCb</supportsVO>
          </Service>
          <Service hostname="prod-lfc-lhcb-ro.cern.ch" type="LFC">
             <supportsVO>LHCb</supportsVO>
          </Service>
          <Service hostname="prod-lfc-shared-central.cern.ch" type="LFC">
             <supportsVO>DTeam</supportsVO>
             <supportsVO>OPS</supportsVO>
          </Service>
       </Site>
    </root>
    

Groups defined by VOs

  • Name: Groups defined by VOs
  • Input:
    /sam-pi/groups_defined_by_vos?[vo_name]&[group_type]&[output]
    • vo_name: Optional but may appear more than once. Eg: Alice
    • group_type: Optional but may appear more than once. Eg: LHCb_Site, LHCb_Tier1
    • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: returns a list of group types (all if no group_type is specified) and group names defined by each VO (all if no vo_name is specified).
    • DB Tables
      • vo: To extract the vo names.
      • vo_group: To map VOs to groups.
      • groups: To extract the groupname and description, and map it to group_type.
      • group_type: To extract the group type name and description.
  • Output format:
    <root>
       <VO name="lhcb">
          <Group_type name="LHCb_Site" description="Group of sites for LHCb VO">
            <Group name="LCG.ACAD.bg" description="lhcb:LCG.ACAD.bg"/>
            <Group name="LCG.APC.fr" description="lhcb:LCG.APC.fr"/>
            <Group name="LCG.AUVER.fr" description="lhcb:LCG.AUVER.fr"/>
            <Group name="LCG.Barcelona.es" description="lhcb:LCG.Barcelona.es"/>
            <Group name="LCG.BHAM-HEP.uk" description="lhcb:LCG.BHAM-HEP.uk"/>
          </Group_type>
        </VO>
    </root>
    
  • DB query:
    select b.typename, b.description group_type_desc, a.groupname, a.description group_desc
    from groups a, group_type b
    where a.id IN (select groups_id from vo_group where vo_id IN (select id from vo where voname='lhcb')) and a.group_type_id=b.id
    order by lower(typename), lower(groupname);
    

Services defined in groups

  • Name: Services defined in groups
  • Input:
    /sam-pi/services_defined_in_groups?[vo_name]&[group_name]&[group_type]&[output]
    • vo_name: Mandatory and may appear more than once. Eg: lhcb
    • group_name: Optional and may appear more than once. Eg: LCG.BHAM-HEP.uk
    • group_type: Optional and may appear more than once. Eg: LHCb_Site
    • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: returns the list of services defined in one or more VO' groups.
    • DB Tables
      • vo: To extract the id of the vo.
      • vo_service_group: To map VOs to groups and services.
      • groups: To extract the groupname and description, and map it to group_type (if not group_type name specified) & to the vo_service_group table.
      • group_type: To extract the group type name and description (if no group_type name specified).
      • service: To extract the service hostname and flavour_id and to map services to vo_service_group table.
      • service_type_flavour: To extract the flavourname and map it to service & service_type tables.
      • service_type: To extract the serviceabbr NOTE: service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
  • Output format:
    <root>
       <VO name="lhcb">
          <Group_type name="LHCb_Site" description="Group of sites for LHCb VO">
             <Group name="LCG.ACAD.bg" description="lhcb:LCG.ACAD.bg">
                <Service hostname="ce02.grid.acad.bg" flavour="CE" type="CE"/>
             </Group>
             <Group name="LCG.APC.fr" description="lhcb:LCG.APC.fr">
                <Service hostname="apcce01.in2p3.fr" flavour="CE" type="CE"/>
             </Group>
             <Group name="LCG.AUVER.fr" description="lhcb:LCG.AUVER.fr">
                <Service hostname="cirigridce01.univ-bpclermont.fr" type="CE" flavour="CE"/>
                <Service hostname="iut03auvergridce01.univ-bpclermont.fr" type="CE" flavour="CE"/>
                <Service hostname="iut15auvergridce01.univ-bpclermont.fr" type="CE" flavour="CE"/>
                <Service hostname="iut43auvergridce01.univ-bpclermont.fr" type="CE" flavour="CE"/>
                <Service hostname="obsauvergridce01.univ-bpclermont.fr" type="CE" flavour="CE"/>
             </Group>
          </Group_type>
       </VO>
    </root>
    
  • DB query:
    SELECT a.voname, b.typename, c.groupname, d.hostname, g.serviceabbr service_type, e.flavourname service_flavour
    FROM vo a, group_type b, groups c, service d, service_type_flavour e, vo_service_group f, service_type g
    WHERE a.voname='lhcb' and a.id=f.vo_id and c.id=f.groups_id and c.group_type_id=b.id and f.service_id=d.id and d.flavour_id=e.id and e.service_type_id=g.id
    ORDER BY lower(b.typename), lower(c.groupname), hostname, lower(g.serviceabbr), lower(e.flavourname);
    

Service types & flavours defined in groups

  • Name: Service types & flavours defined in groups
  • Input:
    /sam-pi/service_types_and_flavours_defined_in_groups?[vo_name]&[group_name]&[group_type]&[output]
    • vo_name: Mandatory and may appear more than once. Eg: lhcb
    • group_name: Optional and may appear more than once. Eg: LCG.BHAM-HEP.uk
    • group_type: Optional and may appear more than once. Eg: LHCb_Site
    • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: returns the list of service types and flavours defined in one or more VO' groups.
    • DB Tables
      • vo: To extract the id of the vo.
      • vo_service_group: To map VOs to groups and services.
      • groups: To extract the groupname and description, and map it to group_type (if not group_type name specified) & to the vo_service_group table.
      • group_type: To extract the group type name and description (if no group_type name specified).
      • service: To extract distinct flavours while mapping service_id to vo_service_group table and flavour_id to service_type_flavour table.
      • service_type_flavour: To extract the flavourname and to map service_type_ids to service_type table.
      • service_type: To extract the serviceabbr NOTE: service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
  • Output format:
    <root>
       <VO name="lhcb">
          <Group_type name="LHCb_Site" description="Group of sites for LHCb VO">
             <Group name="LCG.ACAD.bg" description="lhcb:LCG.ACAD.bg">
                <Service type="CE" flavour="CE"/>
             </Group>
             <Group name="LCG.APC.fr" description="lhcb:LCG.APC.fr">
                <Service type="CE" flavour="CE"/>
             </Group>
             <Group name="LCG.AUVER.fr" description="lhcb:LCG.AUVER.fr">
                <Service type="CE" flavour="CE"/>
             </Group>
          </Group_type>
        </VO>
    </root>
    
  • DB query:
    SELECT f.voname, f.typename, f.groupname, g.serviceabbr servce_type, h.flavourname service_flavour
    FROM (SELECT a.voname, b.typename, c.groupname, d.flavour_id
          FROM vo a, group_type b, groups c, service d, vo_service_group e
          WHERE a.voname='lhcb' AND a.id=e.vo_id AND c.id=e.groups_id AND c.group_type_id=b.id AND e.service_id=d.id
          GROUP BY (a.voname, b.typename, c.groupname, d.flavour_id)
         ) f, service_type g, service_type_flavour h
    WHERE f.flavour_id=h.id AND h.service_type_id=g.id
    ORDER BY lower(f.typename), lower(f.groupname), lower(g.serviceabbr), lower(h.flavourname);
    

Downtimes

  • Summary: it will output all service downtimes for a concrete profile and time window. A downtime is considered to be in that time window if its start time is less or equal than the end time window or if its end time is greater or equal than the start time window. NOTE: service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
  • Input:
    /sam-pi/downtimes?[start_time]&[end_time]&[output]
    • start_time: Mandatory. UTC time in W3C format: 'YYYY-MM-DDThh:mm:ssZ'. Eg: 2010-10-01T13:22:15Z
    • end_time: Mandatory. UTC time in W3C format: 'YYYY-MM-DDThh:mm:ssZ'. Eg: 2010-10-02T00:00:00Z
    • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output format:
    <root>
       <Downtime start_time="09-DEC-10 03.00.00.000000000 PM" end_time="06-JAN-11 01.59.59.000000000 PM" insert_time="03-JAN-11 01.59.59.000000000 PM" classification="SCHEDULED" gocdowntimeid="555555" osgdowntimeid="" severity="OUTAGE" description="blah blah">
          <Service hostname="agh2.atlas.unimelb.edu.au" type="CE" flavour="CE" />
       </Downtime>
    </root>
    

Metrics

Status

  • Name: Status
  • Input:
    /sam-pi/status?[output]
    • Optional
      • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: returns the list of metric statuses.
    • Fields
      • description - description of the metric status (in the database)
      • description_nagios - description of the metric status (in Nagios)
  • Example:
    [http://grid-monitoring.cern.ch/mywlcg/sam-pi/status?output=json]
    
    \[
    {
            "description": "OK",
            "description_nagios": "OK"
        },
    {
            "description": "WARNING",
            "description_nagios": "WARNING"
        },
    {
            "description": "CRITICAL",
            "description_nagios": "CRITICAL"
        },
    {
            "description": "UNKNOWN",
            "description_nagios": "UNKNOWN"
        },
    {
            "description": "MISSING",
            "description_nagios": "MISSING"
        },{
            "description": "REMOVED",
            "description_nagios": ""
        }
    \]

History of metrics in a profile

  • Name: History of metrics in profile
  • Input:
    /sam-pi/metrics_history_in_profile?[vo_name]&[namespace]&[profile_name]&[start_time]&[end_time]&[service_flavour]&[service_hostname]&[output]
    • Mandatory
      • vo_name: name of the VO, may appear more than once. (Eg: alice)
      • profile_name: name of the profile, may appear more than once. (Eg: ALICE_CRITICAL)
      • start_time: UTC time (start time) in W3C format: 'YYYY-MM-DDThh:mm:ssZ'. (Eg: 2012-07-01T00:00:00Z)
      • end_time: UTC time (end time) in W3C format: 'YYYY-MM-DDThh:mm:ssZ'. (Eg: 2012-07-20T00:00:00Z)
    • Optional
      • namespace: profile namespace, may appear more than once. (Eg: ch.cern.sam)
      • service_flavour: service flavour, may appear more than once. (Eg: CREAM-CE)
      • service_hostname: service hostname, may appear more than once. (Eg: alice16.spbu.ru)
      • metric_name: name of the metric, may appear more than once. (Eg: hr.srce.CADist-Check)
      • output: Optional. Possible values are: XML, JSON. Default: XML.
    • Note: range between start_time and end_time should be limited to one month.
  • Output: for a given VO and profile in a time range, returns all the metric results, for metrics executed by each service defined in the profile.
    • Fields
      • name - name of the profile
      • defined_by_vo_name - vo defining the services listed
      • services - list of service dictionaries containing
        • hostname - service endpoint
        • type - service type
        • flavour - service type flavour
        • metrics - list of metric dictionaries containing
          • exec_time - execution time of this metric
          • name - name of the metric
          • fqan - name used to execute the metric
          • tested_by_vo_name - VO name
          • status - status of the metric
          • output_summary - output summary
          • gathered_at - name of the host from where the metric was executed
          • db_insert_time - insertion time of the metric in the database
  • Changes
    • NOTE: service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
  • Example
    [http://grid-monitoring.cern.ch/mywlcg/sam-pi/metrics_history_in_profile?output=json&amp;vo_name=alice&amp;profile_name=ALICE_CRITICAL&amp;start_time=2012-07-01T00:00:00Z&amp;end_time=2012-07-20T00:00:00Z]
    
    \[
    {
    "name": "ALICE_CRITICAL",
    "defined_by_vo_name": "alice",
    "services" : \[
    {
    "hostname": "abaddon.hec.lancs.ac.uk",
    "type": "CE",
    "flavour": "CREAM-CE",
    "metrics": \[
    {
    					"exec_time": "2012-07-01T00:00:44Z",
    					"name": "org.sam.WN-SoftVer",
    					"fqan": "/ops/Role=lcgadmin",
    					"tested_by_vo_name": "alice",
    					"status": "OK",
    					"output_summary": "comp225.private.dns.zone: OK: 3.2.0",
    					"gathered_at": "gridppnagios.physics.ox.ac.uk",
    					"db_insert_time": "2012-07-01T00:01:29Z"
    				},...
    \]
    },...
    \]
    }
    \]

Detailed output of a service metric

  • Name: Detailed output of a service metric
  • Input:
    /sam-pi/metric_output_details?[vo_name]&[metric_name]&[service_flavour]&[service_hostname]&[check_time]&[output]
    • Mandatory
      • vo_name: name of the VO, may appear more than once. (Eg: alice)
      • metric_name: name of the metric. (Eg: org.sam.CE-JobSubmit)
      • service_flavour: service flavour. (Eg: CE)
      • service_hostname: service hostname. (Eg: alice19.spbu.ru)
      • check_time: UTC time in W3C format: 'YYYY-MM-DDThh:mm:ssZ'. (Eg: 2012-07-01T00:00:00Z)
    • Optional
      • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: for a given VO, service, metric and timestamp, return the status and detailed output.
    • Fields
      • service_hostname - service hostname (same as input: service_hostname)
      • service_type - service type
      • servive_flavour - service type flavour
      • metric_exec_time - execution time of this metric (same as input: check_time)
      • metric_name - name of the metric (same as input: metric_name)
      • metric_fqan - name used to execute the metric
      • metric_details - detailed output
      • metric_tested_by_vo_name - VO name (same as input: vo_name)
  • Changes
    • NOTE: service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
  • Example:
    [http://grid-monitoring.cern.ch/mywlcg/sam-pi/metric_output_details/?vo_name=alice&amp;metric_name=org.sam.CREAMCE-JobSubmit&amp;service_flavour=CREAM-CE&amp;service_hostname=boce.bo.infn.it&amp;check_time=2012-07-14T16:50:37Z&amp;output=json]
    
    {
        "service_hostname": "boce.bo.infn.it",
        "service_type": "CE",
        "servive_flavour": "CREAM-CE",
        "metric_exec_time": "2012-07-14T16:50:37Z",
        "metric_name": "org.sam.CREAMCE-JobSubmit",
        "metric_fqan": "alice",
        "metric_details": "OK: success.\n\nTesting from: samnag032.cern.ch\nDN: /DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=maarten/CN=410032/CN=Maarten Litmaath/CN=proxy/CN=proxy/CN=proxy/CN=proxy\nVOMS FQANs: /alice/Role=NULL/Capability=NULL, /alice/alarm/Role=NULL/Capability=NULL, /alice/lcg1/Role=NULL/Capability=NULL, /alice/team/Role=NULL/Capability=NULL\nglite-wms-job-status https://wms305.cern.ch:9000/PwC7d_SZRJhtYm78cbb_Uw\n\n\n======================= glite-wms-job-status Success =====================\nBOOKKEEPING INFORMATION:\n\nStatus info for the Job : https://wms305.cern.ch:9000/PwC7d_SZRJhtYm78cbb_Uw\nCurrent Status:     Done (Success)\nLogged Reason(s):\n    - job completed\n    - Job Terminated Successfully\nExit code:          0\nStatus Reason:      Job Terminated Successfully\nDestination:        boce.bo.infn.it:8443/cream-pbs-alice\nSubmitted:          Sat Jul 14 18:35:13 2012 CEST\n==========================================================================\nGetting job output: OK.\n",
        "metric_tested_by_vo_name": "alice"
    }

Latest metric results in a profile

  • Name: Latest metric results in a profile
  • Input:
    /sam-pi/latest_metric_results_in_profile?[vo_name]&[namespace]&[profile_name]&[service_flavour]&[service_hostname]&[group_type]&[group_name]&[output]
    • Mandatory
      • vo_name: name of the VO, may appear more than once. (Eg: alice)
      • profile_name: name of the profile, may appear more than once. (Eg: ALICE_CRITICAL)
    • Optional
      • namespace: profile namespace, may appear more than once. (Eg: ch.cern.sam)
      • service_flavour: service flavour, may appear more than once. (Eg: CREAM-CE)
      • service_hostname: service hostname, may appear more than once. (Eg: alice16.spbu.ru)
      • group_type: group type,may appear more than once. Default: Site group_type defined for that VO (Eg: ATLAS_Site for vo ATLAS)
      • group_name: group name, may appear more than once. (Eg: Bologna)
      • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: for a given VO, profile, group and group_type returns the latest metric results executed by each service defined in the profile.
    • Fields
      • name - name of the profile
      • namespace - profile namespace
      • defined_by_vo_name - vo defining the services listed
      • groups - list of groups dictionaries containing
        • group_name - name of the group
        • group_type - group type
        • services - list of service dictionaries containing
          • hostname - service endpoint
          • type - service type
          • flavour - service type flavour
          • status - service status
          • metrics - list of metric dictionaries containing
            • exec_time - execution time of this metric
            • name - name of the metric
            • fqan - name used to execute the metric
            • tested_by_vo_name - VO name
            • status - status of the metric
            • output_summary - output summary
            • gathered_at - name of the host from where the metric was executed
            • db_insert_time - insertion time of the metric in the database
  • Changes
    • NOTE: service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
  • Example:
    http://grid-monitoring.cern.ch/mywlcg/sam-pi/latest_metric_results_in_profile/?vo_name=alice&amp;profile_name=ALICE_CRITICAL&amp;output=json
    
    [
        {
            "name": "ALICE_CRITICAL",
            "namespace": "ch.cern.sam",
            "defined_by_vo_name": "alice",
            "groups": [{
                 "group_name": "GRIF_IRFU",
                 "group_type": "ALICE_Site",
                  "services": [
                   {
                     "hostname": "node74.datagrid.cea.fr",
                     "type": "CE",
                     "flavour": "CREAM-CE",
                     "status": "WARNING",
                     "metrics": [
                        {
                            "exec_time": "2012-07-30T11:44:47Z",
                            "name": "org.sam.WN-SoftVer",
                            "fqan": "alice",
                            "tested_by_vo_name": "alice",
                            "status": "OK",
                            "output_summary": "wn216.datagrid.cea.fr: OK: 3.2.0",
                            "gathered_at": "samnag032.cern.ch",
                            "db_insert_time": "2012-07-30T11:45:12Z"
                        }, ...
                      ]
                    }, ...
                  ]
                 }, ...
            ]
        }
    ]

Profiles

Metrics defined in profiles

  • Name: Metrics defined in profiles
  • Input:
    /sam-pi/metrics_in_profiles?[vo_name]&[namespace]&[profile_name]&[service_type_flavour]&[service_type]&[output]
    • Mandatory
      • vo_name: Mandatory and may appear more than once. Eg: lhcb
    • Optional
      • namespace: Optional and may appear more than once. Eg: ch.cern.sam
      • profile_name: Optional and may appear more than once. Eg: ALICE_CRITICAL
      • service_type_flavour: Optional and may appear more than once. Eg: CREAM-CE
      • service_type: Optional and may appear more than once. Eg: CE
      • output: Optional. Possible values are: XML, JSON. Default: XML.
  • Output: returns the list of profiles defined by the VO passed as parameter. For each profile returns the metrics configured and the vo executing each metric.
    • Fields
      • profile.name, profile.namespace - name and corresponding namespace of the profile
      • profile.tags - comma separated list of tags for a given profile (new from UP-19)
      • profile.description - description of a given profile (new from UP-19)
      • profile.metrics - set of metrics for a given profile
      • metric.name - name of the metric
      • metric.description - description of the metric
      • metric.service_flavour - service flavour of the metric (determines the set of services where metric will be executed)
      • metric.testing_vo_name - VO used to execute the metric
      • metric.fqan - FQAN used to execute the metric
  • Changes:
    • NOTE: metric fields: version, description, service_type, created_at, insert_time, deletion_time and defining_vo are deprecated and kept only for backward compatiblity
  • Example:
    http://grid-monitoring.cern.ch/mywlcg/sam-pi/metrics_in_profiles/?vo_name=ops&amp;output=json&amp;profile_name=GLEXEC
    
    [
    
        {
            "name": "ops",
            "profiles": [
                {
                    "name": "GLEXEC",
                    "namespace": "ch.cern.sam",
                    "tags": "nagios",
                    "description": "",
                    "metrics": [
                        {
                            "name": "org.sam.glexec.CE-JobSubmit",
                            "version": "1.0",
                            "description": "org.sam.glexec.CE-JobSubmit",
                            "created_at": "Nov. 11, 2011, 11:59 a.m.",
                            "insert_time": "Nov. 11, 2011, 11:59 a.m.",
                            "deletion_time": "None",
                            "service_type": "gLExec",
                            "service_flavour": "gLExec",
                            "testing_vo_name": "ops",
                            "fqan": "/ops/Role=pilot"
                        },, ...
                }
        }
    ]

Status and Availability

Status of Services in a Profile

  • Supported only on the central instance (grid-monitoring)
  • service_type has been deprecated from SAM-Gridmon Update-19 and will be mapped to service_type_flavour
  • Input:
    /sam-pi/status_of_service_in_profile?vo_name=&profile_name=&[namespace]&[service_type_flavour]&[service_type]&[isdeleted]&[isinproduction]&[output]
    • Mandatory
      • vo_name: name of the vo (eg: lhcb)
      • profile_name: name of the profile; may appear more than once. (eg: ATLAS_CRITICAL)
    • Optional
      • namespace: profile namespace; may appear more than once. (eg: ch.cern.sam)
      • service_type_flavour: service type flavour; may appear more than once. (eg: CREAM-CE)
      • service_type: (deprecated) service type; may appear more than once. (eg: CE)
      • isdeleted: deletion flag; default value: N; possible values: N,Y
      • isinproduction: production flag; default value: Y; possible values: N,Y
      • output: output format; default: XML; possible values: XML, JSON
  • Output: The status of one or more services according to the specified profile.
    • name: name of the profile
    • namespace: profile namespace
    • defined_by_vo_name: vo defining the services listed
    • services: list of service dictionaries containing
      • hostname: service endpoint
      • type: service type
      • flavour: service type flavour
      • status: status of the service
      • status_start_time: start time of validity for this status
      • status_end_time: end time of validity for this status
  • Example
    http://grid-monitoring.cern.ch/mywlcg/sam-pi/status_of_service_in_profile/?vo_name=atlas&amp;profile_name=ATLAS_CRITICAL&amp;service_type_flavour=CREAM-CE&amp;output=json
    
    [
        {
            "name": "ATLAS_CRITICAL",
            "namespace": "ch.cern.sam",
            "defined_by_vo_name": "atlas",
            "services": [
                {
                    "hostname": "ce0004.m45.ihep.su",
                    "type": "CREAM-CE",
                    "flavour": "CREAM-CE",
                    "status": "OK",
                    "status_start_time": "2012-07-14 03:43:48",
                    "status_end_time": "2012-07-17 09:24:59"
                },
                {
                    "hostname": "ce08-lcg.cr.cnaf.infn.it",
                    "type": "CREAM-CE",
                    "flavour": "CREAM-CE",
                    "status": "OK",
                    "status_start_time": "2012-07-10 15:02:40",
                    "status_end_time": "2012-07-17 09:24:59"
                },
                ...
            ]
        }
    ]

Status of Sites in a Profile

  • Supported only on the central instance (grid-monitoring)
  • Input:
    /sam-pi/status_of_site_in_profile?vo_name=&profile_name=&group_type=&[namespace]&[group_name]&[output]
    • Mandatory
      • vo_name: vo name (eg: alice)
      • profile_name: profile name (eg: ALICE_CRITICAL)
      • group_type: group type name as defined in topology. (eg: Site, LHCb_Site, Atlas_Site, CMS_Site, Alice_Site)
    • Optional
      • namespace: profile namespace; may appear more than once. (eg: ch.cern.sam)
      • group_name: profile namespace; may appear more than once. (eg: AEGIS01-IPB-SCL)
      • output: default: XML; possible values: XML, JSON.
  • Output: The status of one or more sites covered by the profile.
    • name: name of the profile
    • namespace: profile namespace
    • defined_by_vo_name: vo defining the services listed
    • services: list of site dictionaries containing
      • name: site name
      • status: status of the site
      • status_start_time: start time of validity for this status
      • status_end_time: end time of validity for this status
  • Example
    http://grid-monitoring.cern.ch/mywlcg/sam-pi/status_of_site_in_profile/?vo_name=lhcb&amp;profile_name=LHCb_CRITICAL&amp;group_type=LHCb_Site&amp;output=json
    
    [
        {
            "name": "LHCb_CRITICAL",
            "namespace": "ch.cern.sam",
            "defined_by_vo_name": "lhcb",
            "services": [
                {
                    "name": "LCG.Cambridge.uk",
                    "status": "OK",
                    "status_start_time": "2012-07-13 15:10:58",
                    "status_end_time": "2012-07-17 09:24:59"
                },
                {
                    "name": "LCG.LPN.fr",
                    "status": "REMOVED",
                    "status_start_time": "2011-12-22 00:00:00",
                    "status_end_time": "2012-07-17 09:24:58"
                },
                ...
            ]
        }
    ]

Service Availability in Profile

  • Input:
    /sam-pi/service_availability_in_profile?vo_name=&profile_name=&group_type=&start_time=&end_time=&type=&[namespace]&[group_name]&[service_flavour]&[service_hostname]&[output]
    • Mandatory
      • vo_name: may appear more than once. (eg: cms)
      • profile_name: may appear more than once. (eg: CMS_CRITICAL)
      • group_type: may appear more than once. (eg: CMS_Site)
      • start_time: UTC time in W3C format: 'YYYY-MM-DDThh:mm:ssZ'. (eg: 2010-10-01T13:22:15Z)
      • end_time: UTC time in W3C format: 'YYYY-MM-DDThh:mm:ssZ'. (eg: 2010-10-02T00:00:00Z)
      • type: availability period; possible values: 'HOURLY', 'DAILY', 'WEEKLY', 'MONTHLY'.
    • Optional
      • namespace: profile namespace; may appear more than once. (eg: ch.cern.sam)
      • group_name: site name; may appear more than once.
      • service_flavour: service flavour name; may appear more than once. (eg: SRMv2)
      • service_hostname: service hostnamel may appear more than once. (eg: ce202.cern.ch)
      • output: default XML; possible values are: XML, JSON.
  • Output
    • name: profile name.
    • namespace: profile namespace.
    • defined_by_vo_name: name of the vo defining the profile.
    • services: availability values for all services matching the provided parameters.
      • hostname: service hostname.
      • type: service type flavour.
      • flavour: (deprecated) service type flavour.
      • availabilities: values for the hostname and flavour between the provided dates.
        • timestamp: start timestamp of the value (validity depends on 'type' parameter: hourly, daily, etc.)
        • availability: availability value.
        • reliability: reliability value.
        • maintenance: service is in scheduled downtime.
  • Example:
    http://grid-monitoring.cern.ch/mywlcg/sam-pi/service_availability_in_profile/?vo_name=atlas&amp;profile_name=ATLAS_CRITICAL&amp;group_type=Site&amp;start_time=2012-07-16T00:00:00Z&amp;end_time=2012-07-16T12:00:00Z&amp;type=HOURLY&amp;output=json
    
    [
        {
            "name": "ATLAS_CRITICAL",
            "namespace": "ch.cern.sam",
            "defined_by_vo_name": "atlas",
            "services": [
                {                "hostname": "ce09-lcg.cr.cnaf.infn.it",
                    "type": "CE",
                    "flavour": "CREAM-CE",
                    "availabilities": [
                        {
                            "timestamp": "2012-07-16T00:00:00Z",
                            "availability": "1.0",
                            "reliability": "1.0",
                            "maintenance": "0.0"
                        },
                        ...
                   ]
                },
                ...
            ]
        }
    ]

Group Availability in Profile

  • Input:
    /sam-pi/group_availability_in_profile?vo_name=&profile_name=group_type=&start_time=&end_time=&type=[namespace]&[group_name]&[output]
    • Mandatory
      • vo_name: and may appear more than once. (eg: cms)
      • profile_name: may appear more than once. (eg: CMS_CRITICAL)
      • group_type: may appear more than once. (eg: Site)
      • start_time: UTC time in W3C format: 'YYYY-MM-DDThh:mm:ssZ'. (eg: 2010-10-01T13:22:15Z)
      • end_time: UTC time in W3C format: 'YYYY-MM-DDThh:mm:ssZ'. (eg: 2010-10-02T00:00:00Z)
      • type: availability period; possible values: 'HOURLY', 'DAILY', 'WEEKLY', 'MONTHLY'.
    • Optional
      • namespace: profile namespace; may appear more than once. (eg: ch.cern.sam)
      • group_name: site name; may appear more than once.
      • output: default: XML; possible values: XML, JSON.
  • Output:
    • name: profile name.
    • namespace: profile namespace.
    • defined_by_vo_name: name of the vo defining the profile.
    • groups: availability values for all groups matching the provided parameters.
      • name: group name.
      • type: group type (Site for ops, <vo>_Site for VOs).
      • availabilities: values for the sites.
        • timestamp: start timestamp of the value (validity depends on 'type' parameter: hourly, daily, etc.)
        • availability: availability value.
        • reliability: reliability value.
        • maintenance: site is in scheduled downtime.
  • Example:
  • http://grid-monitoring.cern.ch/mywlcg/sam-pi/group_availability_in_profile/?vo_name=cms&amp;profile_name=CMS_CRITICAL&amp;group_type=CMS_Site&amp;start_time=2012-07-16T10:00:00Z&amp;end_time=2012-07-16T10:00:00Z&amp;type=HOURLY&amp;output=json
    
    [
        {
            "name": "CMS_CRITICAL",
            "namespace": "ch.cern.sam",
            "defined_by_vo_name": "cms",
            "groups": [
                {
                    "name": "T1_IT_CNAF",
                    "type": "CMS_Site",
                    "availabilities": [
                        {
                            "timestamp": "2012-07-16T10:00:00Z",
                            "availability": "1.0",
                            "reliability": "1.0",
                            "maintenance": "0.0"
                        }
    
                    ]
                },
                ...
            ]
        }
    ]
Document generated by Confluence on Feb 27, 2014 10:19