NAME
Kernel::GenericInterface::Mapping – GenericInterface data mapping interface
PUBLIC INTERFACE
has DebuggerObject
Attribute that holds the debugger object.
has Operation
Attribute that holds the operation information.
has OperationType
Attribute that holds the operation type information.
has Invoker
Attribute that holds the invoker information.
has InvokerType
Attribute that holds the invoker type information.
has BackendObject
Attribute that holds the backend object.
new()
create an object.
use Kernel::GenericInterface::Debugger;
use Kernel::GenericInterface::Mapping;
my $DebuggerObject = Kernel::GenericInterface::Debugger->new(
DebuggerConfig => {
DebugThreshold => 'debug',
TestMode => 0, # optional, in testing mode the data will not be written to the DB
# ...
},
WebserviceID => 12,
CommunicationType => Requester, # Requester or Provider
RemoteIP => 192.168.1.1, # optional
);
my $MappingObject = Kernel::GenericInterface::Mapping->new(
DebuggerObject => $DebuggerObject,
Invoker => 'TicketLock', # the name of the invoker in the web service
InvokerType => 'Nagios::TicketLock', # the Invoker backend to use
Operation => 'TicketCreate', # the name of the operation in the web service
OperationType => 'Ticket::TicketCreate', # the local operation backend to use
MappingConfig => {
Type => 'MappingSimple',
Config => {
# ...
},
},
);
Map()
perform data mapping in backend
my $Result = $MappingObject->Map(
Data => { # data payload before mapping
...
},
);
$Result = {
Success => 1, # 0 or 1
ErrorMessage => '', # in case of error
Data => { # data payload of after mapping
...
},
};