if ( defined $input ) {
$response = $soap_service->call($soap_method, @{$input});
} else {
$response = $soap_service->call($soap_method);
}
if ($response->fault) {
print "$service#$method: " . $response->faultcode .": " .
$response->faultstring . "\n";
exit 1;
}
return $response;
}
sub login($$) {
my $username = shift;
my $password = shift;
my @apiLogin = (
SOAP::Data->name('domainName')->value('global'),
SOAP::Data->name('userName')->value($username),
SOAP::Data->name('password')->value($password)
);
my $response = soap_call("SystemService","LoginRequest",\@apiLogin);
my $loginStatus = $response->valueof("//Body/LoginResponse/loginStatus/status");
if ($loginStatus eq "Success" ) {
$main::LOGIN_TOKEN =
$response->valueof("//Body/LoginResponse/authToken/Token");
} elsif ( $loginStatus eq "Failure" ) {
print "Invalid credentials", "\n";
exit 1;
}
}
sub get_all_sds() {
my @token = (
SOAP::Data->name('Token')->value($LOGIN_TOKEN)->prefix('ns1')
);
my @AuthToken = (
SOAP::Data->name('AuthToken')->value(\@token)->prefix('ns1')->uri('http://juniper.net/core')
);
my $response = soap_call("SystemService","GetSystemInfoRequest", \@AuthToken);
return $response;
}
login("super","netscreen");
print $LOGIN_TOKEN, "\n";
get_all_sds;
Copyright © 2010, Juniper Networks, Inc.
78
Network and Security Manager 2010.4 API Guide
Содержание NETWORK AND SECURITY MANAGER 2010.4 - API GUIDE REV 1
Страница 6: ...Copyright 2010 Juniper Networks Inc vi...
Страница 10: ...Copyright 2010 Juniper Networks Inc x Network and Security Manager 2010 4 API Guide...
Страница 12: ...Copyright 2010 Juniper Networks Inc xii Network and Security Manager 2010 4 API Guide...
Страница 20: ...Copyright 2010 Juniper Networks Inc 2 Network and Security Manager 2010 4 API Guide...
Страница 24: ...Copyright 2010 Juniper Networks Inc 6 Network and Security Manager 2010 4 API Guide...
Страница 34: ...Copyright 2010 Juniper Networks Inc 16 Network and Security Manager 2010 4 API Guide...
Страница 58: ...Figure 10 IDP Rulebase Copyright 2010 Juniper Networks Inc 40 Network and Security Manager 2010 4 API Guide...
Страница 92: ...Copyright 2010 Juniper Networks Inc 74 Network and Security Manager 2010 4 API Guide...
Страница 98: ...Copyright 2010 Juniper Networks Inc 80 Network and Security Manager 2010 4 API Guide...
Страница 100: ...Copyright 2010 Juniper Networks Inc 82 Network and Security Manager 2010 4 API Guide...
Страница 112: ...Copyright 2010 Juniper Networks Inc 94 Network and Security Manager 2010 4 API Guide...
Страница 128: ...Copyright 2010 Juniper Networks Inc 110 Network and Security Manager 2010 4 API Guide...
Страница 138: ...Copyright 2010 Juniper Networks Inc 120 Network and Security Manager 2010 4 API Guide...
Страница 152: ...Copyright 2010 Juniper Networks Inc 134 Network and Security Manager 2010 4 API Guide...
Страница 165: ...PART 6 Index Index on page 149 147 Copyright 2010 Juniper Networks Inc...
Страница 166: ...Copyright 2010 Juniper Networks Inc 148 Network and Security Manager 2010 4 API Guide...