Skip to content
The perl module SU::API::Infoblox used at Stockholm University.
Perl
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
SU/API
README.pod

README.pod

=head1 NAME SU::API::Infoblox =head1 SYNOPSIS use strict; use warnings; use SU::API::Infoblox; my $infoblox = new SU::API::Infoblox("fqdn","version"); $infoblox->login("username","password") or die $infoblox->login_status; my $params = "network=192.168.0.0/24"; my $get_result = $infoblox->do_request("GET", "network", $params); if (!$get_result) { warn $infoblox->request_code; warn $infoblox->request_status_line; warn $infoblox->request_content; }; my $post_data = { name => "host.example.com", ipv4addr => "func:nextavailableip:192.168.0.0/24", mac => "00:00:5e:00:53:00", }; my $post_result = $infoblox->do_request("POST", "fixedaddress", "", $post_data); if (!$post_result) { warn $infoblox->request_code; warn $infoblox->request_status_line; warn $infoblox->request_content; }; my $delete_result = $infoblox->do_request("DELETE", "fixedaddress/am9jYXIgcGF0bHUgam9jYXIgcGF0bHUgam9jYXIgcGF0bHU"); if (!$delete_result) { warn $infoblox->request_code; warn $infoblox->request_status_line; warn $infoblox->request_content; }; my $request_post_data = [ { method => "GET", object => "record:a", data => { name => "testrecord01.example.com" }, assign_state => { object_ref => "_ref" }, }, { method => "DELETE", object => "##STATE:object_ref:##", enable_substitution => JSON::true, }, ]; my $request_post_result = $infoblox->do_request("POST", "request", "", $request_post_data); if (!$request_post_result) { warn $infoblox->request_code; warn $infoblox->request_status_line; warn $infoblox->request_content; }; $infoblox->logout(); =head1 DESCRIPTION Module used to integrate with the REST API (WAPI) that Infoblox provides. =head1 CONSTRUCTOR =over =item new (FQDN, VERSION) Returns a new SU::API::Infoblox object. =back =head1 METHODS =over =item login (USERNAME, PASSWORD) Configure and validate credantials. The "ibapauth" cookie is saved for further requests. =item logout Destroy the login session. =item login_status Returns a human readable login status of the current session. =item logged_in Returns true when logged in, otherwise returns undef. =item do_request (HTTP METHOD, URI, PARAMS, DATA) Perform the actual request. "PARAMS" is optional and can be any parameters that WAPI supports. "DATA" is optional and is a Perl data structure that will be converted to JSON. Returns the result in a perl reference. =item request_code Returns the last HTTP status code. =item request_status_line Returns the last HTTP status line. =back =head1 DEPENDS L, L, L, L =head1 LICENSE Copyright (c) 2016-, IT Services, Stockholm University All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Stockholm University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =head1 AUTHOR Johan Carlquist - , Patrik Lundin -
You can’t perform that action at this time.