NAME

Net::OpenVAS::OMP::Response - Helper class for Net::OpenVAS::OMP

SYNOPSIS

use Net::OpenVAS::OMP::Response;

my $request = Net::OpenVAS::OMP::Request->new(
    command   => 'create_task',
    arguments => { ... }
);

my $response = Net::OpenVAS::OMP::Response->new(
    request => $request,
    response => '<create_task_response>...</create_task_response>'
);

if ($response->is_created) {
    say 'Task created:' . $response->status_text;
}

CONSTRUCTOR

Net::OpenVAS::OMP::Response->new ( request => $request, response => $raw_response )

Create a new instance of Net::Net::OpenVAS::OMP::Response.

Params:

METHODS

$response->status

Return OMP status code.

say $response->status; # 200

$response->status_text

Return OMP status text.

say $response->status_text; # OK, request submitted

$response->command

Return OMP command name.

say $response->command; # get_version

$response->result

Return OMP command hash result.

$response->request

Return Net::OpenVAS::OMP::Request instance.

$response->error

Return Net::OpenVAS::Error instance.

$response->raw

Return RAW OMP response.

STATUS HELPERS

$response->is_ok (200)

$response->is_created (201)

$response->is_accepted (202)

$response->is_forbidden (403)

$response->is_not_found (404)

$response->is_busy (409)

$response->is_server_error (>500)

SUPPORT

Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker at https://github.com/giterlizzi/perl-Net-OpenVAS/issues. You will be notified automatically of any progress on your issue.

Source Code

This is open source software. The code repository is available for public review and contribution under the terms of the license.

https://github.com/giterlizzi/perl-Net-OpenVAS

git clone https://github.com/giterlizzi/perl-Net-OpenVAS.git

AUTHOR

  • Giuseppe Di Terlizzi <gdt@cpan.org>

LICENSE AND COPYRIGHT

This software is copyright (c) 2020 by Giuseppe Di Terlizzi.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.