print "[\n" if @$content>0;
my $count = 0;
for my $id (@$content) {
- next if $URL eq '/ip' and $id !~ /\d+\./;
+ $id = check_row($URL,$id);
+ next unless defined $id;
$id =~ s,/.*$,,;
$response = $Api->rawCall(path=>$URL.'/'.$id,method=>$Opt{method},body=>{});
print "$content\n";
}
+sub sql {
+my $pref = 'ovh_';
+my @tables = (
+ {
+ name => 'ip',
+ url => '/ip',
+ sql => 'CREATE TABLE IF NOT EXISTS '.$pref.'ip ('
+ .');',
+ },
+ {
+ name => 'server',
+ url => '/server',
+ sql => 'CREATE TABLE IF NOT EXISTS '.$pref.'server ('
+ .'serverid INT,'
+ .');',
+ },
+);
+}
+
+sub check_row {
+ my ($URL,$id) = @_;
+ return undef if $URL eq '/ip' and $id !~ /\d+\./;
+ $id =~ s,/.*$,,;
+ return $id;
+}
+
sub help {
#------------------------------------------------------------------------------
# Print help and exit
4. Use the api
$NAME applicationKey:applicationSecret:consumerKey /PATH
$NAME /PATH
+ $NAME --rows /PATH
=head1 OPTIONS