in reply to Get data from file and loop
Thanks,#!/usr/bin/perl + use SOAP::Lite; my $cucmip = "192.168.10.30"; #Home Lab my $axl_port = "8443"; my $user = "PerlAXL"; my $password = "Pa$$word"; my $axltoolkit = "AXLAPI.wsdl"; $start=time(); BEGIN { sub SOAP::Transport::HTTP::Client::get_basic_credentials { return ($user => $password) }; } my $cm = new SOAP::Lite encodingStyle => '', uri => "$axltoolkit", proxy => "https://$cucmip:$axl_port/axl/" ; open (FILE, 'CUCM.txt'); while (<FILE>){ chomp; ($name, $description) = split ("\t"); { my $res = $cm->updatePhone( SOAP::Data->name('name' => "$name"), SOAP::Data->name('lines' => SOAP::Data->name('line' => SOAP:: +Data->name('index' => '1'), SOAP: +:Data->name('description' => "$description") ) ) ); unless ($res->fault) { } else { print join ', ', $res->faultcode, $res->faultstring; }}} close (FILE); $end = time(); print "That took Perl ", ($end - $start), " second(s) to update\n"; exit;
|
|---|