.. Warning: this file is automatically generated. Edits will be lost .. list-table:: Functions defined in :mod:`CNDiagnostic` :widths: 3 3 10 10 30 :header-rows: 1 * - Tier - Version - REST - Function - Parameters * - Tier 2 - 2.0 - ``GET /diag/subject`` - :func:`echoCredentials` - (:class:`session`) ``->`` :class:`Types.SubjectInfo` * - Tier 1 - 2.0 - ``POST /diag/sysmeta`` - :func:`echoSystemMetadata` - (:class:`session`, :class:`sysmeta`) ``->`` :class:`Types.SystemMetadata` * - Tier 1 - 2.0 - ``POST /diag/object`` - :func:`echoIndexedObject` - (:class:`session`, ``queryEngine``, :class:`sysmeta`, ``object``) ``->`` :class:`Types.OctetStream` .. function:: echoCredentials(session) -> SubjectInfo Echo the credentials used to make the call. This method can be used to verify the client certificate is valid and contains the expected information. v2.0: This method was added to the Version 2.0 API. :Version: 2.0 :REST URL: ``GET /diag/subject`` :param session: Session information that contains the identity of the calling user as retrieved from the X.509 certificate. Transmitted as part of the SSL handshake process. :type session: :class:`Types.Session` :returns: The subjects and groups parsed from the supplied session information. :rtype: :class:`Types.SubjectInfo` :raises Exceptions.NotImplemented: ``(errorCode=501, detailCode=4965)`` The service is not implemented. :raises Exceptions.ServiceFailure: ``(errorCode=500, detailCode=4966)`` An internal failure prevented a successful response. :raises Exceptions.InvalidToken: ``(errorCode=401, detailCode=4967)`` The supplied session information could not be parsed. .. function:: echoSystemMetadata(session,sysmeta) -> SystemMetadata Parse and echo the provided system metadata On successful parsing, a copy of the system metadata is returned, otherwise an exception is returned indicating an error condition. v2.0: This operation is new to version 2.0. :Version: 2.0 :REST URL: ``POST /diag/sysmeta`` :param session: Session information that contains the identity of the calling user as retrieved from the x.509 certificate. The service MAY choose to limit access to only authorized users. Transmitted as part of the SSL handshake process. :type session: :class:`Types.Session` :param sysmeta: A SystemMetadata object to be examined. The object is parsed and error conditions reported by an exception response. On successful parsing, the SystemMetadata object is echoed back with a HTTP 200 status. Transmitted as an UTF-8 encoded XML structure for the respective type as defined in the DataONE types schema, as a *File part* of the MIME multipart/mixed message. :type sysmeta: :class:`Types.SystemMetadata` :returns: A copy of the supplied System Metadata. :rtype: :class:`Types.SystemMetadata` :raises Exceptions.NotImplemented: ``(errorCode=501, detailCode=4970)`` :raises Exceptions.ServiceFailure: ``(errorCode=500, detailCode=4971)`` :raises Exceptions.NotAuthorized: ``(errorCode=401, detailCode=4972)`` :raises Exceptions.InvalidToken: ``(errorCode=401, detailCode=4973)`` :raises Exceptions.InvalidRequest: ``(errorCode=400, detailCode=4974)`` :raises Exceptions.IdentifierNotUnique: ``(errorCode=409, detailCode=4975)`` :raises Exceptions.InvalidSystemMetadata: ``(errorCode=400, detailCode=4976)`` .. function:: echoIndexedObject(session,queryEngine,sysmeta,object) -> OctetStream Parse and echo the provided science metadata or resource map document. The response is governed by the type of object provided in the request, and on success is one or more documents that are the result of parsing for indexing. Since DataONE supports multiple types of query engine, the query engine to be used for parsing is specified in the request. The servce may terminate the POST operation if the size of the object is beyond a reasonable size. v2.0: This operation is new to version 2.0. :Version: 2.0 :REST URL: ``POST /diag/object`` :param session: Session information that contains the identity of the calling user as retrieved from the x.509 certificate. The service MAY choose to limit access to only authorized users. Transmitted as part of the SSL handshake process. :type session: :class:`Types.Session` :param queryEngine: A valid query engine name as reported by :func:`listQueryEngines` Transmitted as a UTF-8 String as a *Param part* of the MIME multipart/mixed message. :type queryEngine: string :param sysmeta: A SystemMetadata object that passes the echoSystemMetadata diagnostic. Transmitted as an UTF-8 encoded XML structure for the respective type as defined in the DataONE types schema, as a *File part* of the MIME multipart/mixed message. :type sysmeta: :class:`Types.SystemMetadata` :param object: A document (e.g. science metadata or resource map) that is to be evalauted for indexing. :type object: bytes :returns: A document representing the parsed object as it would be prior to being added to a search index. For the solr query engine for example, this would be the equivalent of a * .. .. * structure with possibly multiple documents. :rtype: :class:`Types.OctetStream` :raises Exceptions.NotImplemented: ``(errorCode=501, detailCode=4980)`` The service is not implemented. :raises Exceptions.ServiceFailure: ``(errorCode=500, detailCode=4981)`` An internal failure prevented a successful response. :raises Exceptions.NotAuthorized: ``(errorCode=401, detailCode=4982)`` The supplied credentials are not authorized for this operation. :raises Exceptions.InvalidToken: ``(errorCode=401, detailCode=4983)`` The supplied session information could not be parsed. :raises Exceptions.InvalidRequest: ``(errorCode=400, detailCode=4984)`` The structure of the request is invalid. :raises Exceptions.InvalidSystemMetadata: ``(errorCode=400, detailCode=4985)`` The system metadata could not be parsed. :raises Exceptions.UnsupportedType: ``(errorCode=400, detailCode=4986)`` The supplied object was not of a supported type. :raises Exceptions.UnsupportedMetadataType: ``(errorCode=400, detailCode=4987)`` The provided metadata format is not supported by the query engine. :raises Exceptions.InsufficientResources: ``(errorCode=413, detailCode=4988)`` Insufficient resources could be allocated to support the request. The provided object may be too large to process.