![]() |
T4S4
19.1 C8540 A23673
Teamcenter Gateway for SAP S/4HANA API Reference
|
Functions | |
createLogChannel LogChannel | |
This functions initializes the search index for the specified log channel. More... | |
getBinLogFile logchannel target zip | |
This function downloads a binary logfile from the BGS server and stores this in the local filesystem. More... | |
setSecurityContext4LogChannel LogChannel SecurityContext | |
Sets the security context of a given logchannel. More... | |
storeBinLogFile src logchannel | |
This function upload a binary logfile to the BGS server. More... | |
testLogPattern logchannel pattern | |
Test the last line of a logfile for a keyword. More... | |
tpco_getListOfValues | |
This function returns all occurring values for a certain key (without duplicates) as well as the number of absolute occurrences for each found value. More... | |
tpco_getLogIndex | |
This function returns the key attribute list of a specified log channel, matching the given patterns for key and value. More... | |
tpco_removeLogIndex | |
This function removes an attribute entry from the specified log channel. More... | |
tpco_searchGlobLogIndex | |
This function simply searches globally for all terms defined in searchlist within the whole log index. It returns a list of matching log index entries. More... | |
tpco_searchLogIndex | |
This function can search for several specific keys and values at once. It returns a list of matching log index entries, which can be used to get the corresponding log files. If the key is defined as “*” and the value is defined as “*”, all entries are returned. More... | |
tpco_setdlogchannel | |
This function sets the default logchannel for logmessages. Do not use this function in the server environment. More... | |
tpco_setLogIndex | |
This function adds an attribute entry (key and value) to the index of the specified log channel. More... | |
tpco_udpDumpLogFile | |
This function exports a logfile from the logserver. The tpco_udpDumpLogFile function works only in the BGS environment. For an external usage, use the TPRPC call ::LOGSRV::dumpLogFile. More... | |
tpco_udpReadAttachment | |
This function reads a logfile attachment. More... | |
tpco_udpWriteAttachment | |
This function writes a logfile attachment. More... | |
tpco_udpWriteRemoteAttachment2 | |
This function writes a logfile attachment from remote. More... | |
tpwrite | |
This function writes a logmessage to the BGS log server. More... | |
writeLogMessageWithAttachment strLogChannel strLogLine strLinkName strAttachmentData ?strAttachmentMType? ?strMessageType? ?strAttachmentName? ?strAttachmentSecurityContext? ?strMessageSecurityContext? | |
Creates an attachment on the log server (BGS) and adds the link to the specified log line. If a security context for the attachment is specfied, the attachement is created with the assigned security context. If a security context for the log message is specified, the message is created with the assigned security context. More... | |
LogTools::createLogChannel | LogChannel | ||
This functions initializes the search index for the specified log channel.
LogChannel | the log channel path |
Sample code sequence including definition of security context
LogTools::getBinLogFile | logchannel target zip | ||
This function downloads a binary logfile from the BGS server and stores this in the local filesystem.
logchannel | the relative path to the logfile |
target | the file name in the local file system |
zip | (optional) "zip" compress the download |
download the logfile /sys/nihil/BGS_20120717-043049/tpbgs64_netd.log and store the compressed content in the file test.log.
LogTools::setSecurityContext4LogChannel | LogChannel SecurityContext | ||
Sets the security context of a given logchannel.
LogChannel | the logchannel path |
SecurityContext | the new security context of the log channel, which can be:
|
It is only possible to increase the security context, that means setting the SecurityContext to UNRESTRICTED has no effect, if the log channel is already assigned to the security context STRICTLYCONFIDENTIAL.
LogTools::storeBinLogFile | src logchannel | ||
This function upload a binary logfile to the BGS server.
src | the file name in the local file system |
logchannel | the relative path to the logfile |
uploads the logfile test.log to the BGS server (/tmp/test.log).
LogTools::testLogPattern | logchannel pattern | ||
Test the last line of a logfile for a keyword.
logchannel | the relative path to the logfile |
pattern | TCL string pattern (keyword) |
Test, if the last logile in the logfile /sys/nihil/BGS_20120717-043049/tpbgs64_netd.log contains the pattern "*TEST*"
tpco_getListOfValues |
This function returns all occurring values for a certain key (without duplicates) as well as the number of absolute occurrences for each found value.
key | Attribute key for which all existing values and number of occurrences should be returned. |
rrange | The result range of the corresponding searchresult (default [list 0 9]) |
rsortd | sort direction of the result list. The sortkey is absolute number of occurrences. |
loglist | previous result of any search to be searched, if the loglist is not provided, all index entries will be searched. |
<occurrences>
<occurrences> ..}
tpco_getLogIndex |
This function returns the key attribute list of a specified log channel, matching the given patterns for key and value.
logchannel | string of the log channel |
keypattern | pattern to match the key of the attribute as string |
valuepattern | pattern to match the value of the attribute |
usesctx | define the security context of this call, should be higher than the used security context in the log index
|
tpco_removeLogIndex |
This function removes an attribute entry from the specified log channel.
logchannel | string of the log channel |
key | the name for the key |
tpco_searchGlobLogIndex |
This function simply searches globally for all terms defined in searchlist within the whole log index. It returns a list of matching log index entries.
searchlist | List of search terms as strings |
rrange | The result range of the corresponding searchresult (default [list 0 9]) |
rsort | sort key and direction for the searchresult. (default CTIME decreasing) |
link | the logical link between the search patterns (default OR) |
case | defines whether this search should be case-sensitive or not true: to search case-sensitive false: to ignore any case (DEFAULT) |
keylov | Attribute key for which all existing values and number of occurrences should be returned. |
klovrange | The result range of the corresponding result for keylov (default [list 0 9]) |
tpco_searchLogIndex |
This function can search for several specific keys and values at once. It returns a list of matching log index entries, which can be used to get the corresponding log files. If the key is defined as “*” and the value is defined as “*”, all entries are returned.
pattern | tcl dictionary containing any number of key-value-pairs, where each value con-sists of a list, where the first entry represents the submitted data type and the second value contains the searched value pattern. e.g. [ <key1> {<type1> <valuepattern1>} <key2> {<type2> <valuepattern2>} …] key pattern to match the key of an attribute as string type data type of the valuepattern (STR - string, STRLIST – a list of strings, UINTRNAGE – a range of interger values e.g. [list 4711 9192]) valuepattern: pattern to be searched for in the according key, needs to match the re-quirements of the previously defined data type. |
rrange | The result range of the corresponding searchresult (default [list 0 9]) |
rsort | sort key and direction for the searchresult. (default CTIME decreasing) |
link | the logical link between the search patterns (default OR) |
case | defines whether this search should be case-sensitive or no true: to search case-sensitive false: to ignore any case (DEFAULT) |
keylov | Attribute key for which all existing values and number of occurrences should be returned. |
klovrange | The result range of the corresponding result for keylov (default [list 0 9]) |
tpco_setdlogchannel |
This function sets the default logchannel for logmessages. Do not use this function in the server environment.
logchannel | the default logchannel |
tpco_setLogIndex |
This function adds an attribute entry (key and value) to the index of the specified log channel.
logchannel | string of the log channel |
key | the name for the key |
value | value for the previously defined key to be set |
mode | overwrite: The data will be overwritten (default setting) exclusive: if this entry has been defined before nothing will happen, else it will be exclusively set once to the index append: the data will be appended, regardless if the entry does already exist or not |
tpco_udpDumpLogFile |
This function exports a logfile from the logserver. The tpco_udpDumpLogFile function works only in the BGS environment. For an external usage, use the TPRPC call ::LOGSRV::dumpLogFile.
outtype | string (logfile translate to a UTF-8 string) html (logfile translate to a HTML string) native (internal use only) |
size | the last n-lines of the logfile. -1 = all lines |
filename | the name and path of the logfile |
Examples:
Dump the last 10 lines of a logfile in the BGS environment as text output:
Dump the last 10 lines of a logfile via the network as text output:
tpco_udpReadAttachment |
This function reads a logfile attachment.
tpco_udpReadAttachment
works only in the BGS environment. For external usage, use the ::LOGSRV::readAttachment
function.
id | the attachment ID |
tpco_udpWriteAttachment |
This function writes a logfile attachment.
tpco_udpWriteAttachment
works only in the BGS environment. For external usage, use the tpco_udpWriteRemoteAttachment2
function. The download URL for the attachment is: http(s)://<bgs-server>:<port>/dcx/attach?<attachment-id>. The returned attachment ID can be used to create an HTTP link using TPHAP::setAttaLink
.
name | name of the attachment |
mtype | MIME type of the attachment |
data | content of the attachment |
sctx | (optional) security context of the attachment, which can be:
|
tpco_udpWriteRemoteAttachment2 |
This function writes a logfile attachment from remote.
The download URL for the attachment is: http(s)://<bgs-server>:<port>/dcx/attach?<attachment-id>. The returned attachment ID can be used to create an HTTP link using TPHAP::setAttaLink
.
mtype | MIME type of the attachment |
name | name of the attachment |
data | content of the attachment |
sctx | (optional) security context of the attachment, which can be:
|
tpwrite |
This function writes a logmessage to the BGS log server.
logmessage | the logmessage (max. size of the logmessage is 32 KByte) |
-logchannel | (optional) logchannel the message is written to. The default logchannel can be defined using tpco_setdlogchannel. The logchannel is a relative path to the logroot. |
-stacklevel | (optional) indentation of the logmessage, defined by a number between 0 (default) and 63. |
-mtype | (optional) the type of message (DEBUG is the default). Types are indicated by the color of log lines:
|
-sctx | (optional) security context of this message, which can be
|
Examples:
Writing a logmessage to the default logchannel
Writing an error logmessage to the default logchannel
Writing a logmessage of type "NOTE" to the logchannel /tmp/my_user_logchannel.log
Writing a warning logmessage to the logchannel /tmp/my_user_logchannel.log with security context RESTRICTED
LogTools::writeLogMessageWithAttachment | strLogChannel strLogLine strLinkName strAttachmentData ?strAttachmentMType? ?strMessageType? ?strAttachmentName? ?strAttachmentSecurityContext? ?strMessageSecurityContext? | ||
Creates an attachment on the log server (BGS) and adds the link to the specified log line. If a security context for the attachment is specfied, the attachement is created with the assigned security context. If a security context for the log message is specified, the message is created with the assigned security context.
strLogChannel | Defines the logchannel in the log server |
strLogLine | Message in the logchannel where the attachment will be added as a link |
strLinkName | The name of the link |
strAttachmentData | The content/payload of the attachment |
strAttachmentMType | (optional) Mime type of the attachment (default text/xml) |
strMessageType | (optional) Message type (default DEBUG). Types are indicated by the color of log lines:
|
strAttachmentName | (optional) The name of the attachment (default Attachment_timestamp + valid file extension for text/plain (.txt) and text/xml (.xml)) |
strAttachmentSecurityContext | (optional) Security context of the specified attachment data (default is no security context)
|
strMessageSecurityContext | (optional) Security context of the specified strLogLine (log message) parameter (default is no security context)
|