/[Intel-AMT]/trunk/lib/Intel/AMT/SOAP.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Intel/AMT/SOAP.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6 by dpavlin, Sat Aug 8 21:57:47 2009 UTC revision 23 by dpavlin, Mon Sep 14 14:15:08 2009 UTC
# Line 10  use Data::Dump qw/dump/; Line 10  use Data::Dump qw/dump/;
10    
11  use lib 'lib';  use lib 'lib';
12    
13  my $amt_host = $ENV{'AMT_HOST'};  sub soap_url {
14  my $amt_port = "16992";          my $amt_host = $ENV{'AMT_HOST'};
15  $main::amt_user = "admin";          my $amt_port = "16992";
16  $main::amt_pass = $ENV{'AMT_PASSWORD'};          "http://$amt_host:$amt_port";
17    }
18    
19  my $amt_debug = 0;  my $amt_debug = 0;
20  $amt_debug = $ENV{'AMT_DEBUG'} if defined($ENV{'AMT_DEBUG'});  $amt_debug = $ENV{'AMT_DEBUG'} if defined($ENV{'AMT_DEBUG'});
21    
22    my $timeout = $ENV{'AMT_TIMEOUT'} || 1;
23    
24  my $amt_version;  my $amt_version;
25    
26  #############################################################################  #############################################################################
# Line 76  my %pt_status = ( Line 80  my %pt_status = (
80  my ($nas, $sas, $rcs);  my ($nas, $sas, $rcs);
81    
82  sub SOAP::Transport::HTTP::Client::get_basic_credentials {  sub SOAP::Transport::HTTP::Client::get_basic_credentials {
83          return $main::amt_user => $main::amt_pass;          return 'admin' => $ENV{AMT_PASSWORD};
84  }  }
85    
86  sub init() {  sub init() {
87          my $proxybase = "http://$amt_host:$amt_port";          my $proxybase = soap_url;
88          my $schemabase = "http://schemas.intel.com/platform/client";          my $schemabase = "http://schemas.intel.com/platform/client";
89    
90          $nas = SOAP::Lite->new(          $nas = SOAP::Lite->new(
# Line 97  sub init() { Line 101  sub init() {
101          $sas->autotype(0);          $sas->autotype(0);
102          $rcs->autotype(0);          $rcs->autotype(0);
103    
104            $nas->transport->timeout($timeout);
105            $sas->transport->timeout($timeout);
106            $rcs->transport->timeout($timeout);
107    
108          warn $proxybase;          warn $proxybase;
109    
110          $amt_version = $sas->GetCoreVersion()->paramsout;          $amt_version = $sas->GetCoreVersion()->paramsout;
# Line 105  sub init() { Line 113  sub init() {
113  sub _soap {  sub _soap {
114          my $name = shift;          my $name = shift;
115    
116          my $proxybase = "http://$amt_host:$amt_port";          my $proxybase = soap_url;
117          my $schemabase = "http://schemas.intel.com/platform/client";          my $schemabase = "http://schemas.intel.com/platform/client";
118    
119          warn "call_soap $proxybase $name ",dump( @_ );          warn "call_soap $proxybase $name ",dump( @_ );
# Line 115  sub _soap { Line 123  sub _soap {
123                  default_ns => "$schemabase/$name/2004/01");                  default_ns => "$schemabase/$name/2004/01");
124    
125          $soap->autotype(0);          $soap->autotype(0);
126            $soap->transport->timeout($timeout);
127    
128          if ( @_ ) {          if ( @_ ) {
129                  do_soap($soap, "RemoteControl", @_)                  do_soap($soap, $name, @_)
130          } else {          } else {
131                  return $soap;                  return $soap;
132          }          }
# Line 233  sub check_amt_version { Line 242  sub check_amt_version {
242  }  }
243    
244  sub print_general_info() {  sub print_general_info() {
         printf "### AMT info on machine '%s' ###\n", $amt_host;  
245    
246          printf "AMT version:  %s\n", $amt_version;          printf "AMT version:  %s\n", $amt_version;
247                    

Legend:
Removed from v.6  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.26