with 'APKPM::Config';
with 'APKPM::Gearman';
+with 'APKPM::Gearman::Client';
-require RPC::XML;
-require RPC::XML::Client;
-use Encode;
-
-#$RPC::XML::ENCODING = "utf-8"; # FIXME really used?
+use H1::ZTEDSLAM;
+use H1::ZTEMSAN;
sub prefix { 'DSLAM_' }
return { error => 'invalid workload', expected => 'OPT_82:%' };
}
- my $cli = RPC::XML::Client->new($self->config('crmxml'));
- warn "RPC::XML $field $value";
- my $resp = $cli->send_request('ports',RPC::XML::array->new( $field => $value ));
- return ref $resp ? $resp->value->[0] : { error => $resp };
-}
+ my $crm_results = $self->do_high('CRM_search' => $workload);
+
+ my $crm = $crm_results->[0];
+ warn "ERROR: more than one result from CRM, using first ", dump($crm_results)
+ if $#$crm_results > 0;
+
+ warn "# crm ",dump $crm;
+
+ my $hash = $self->do_high( $crm->{TIP_UREDJAJA} . '_' . $crm->{IP_UREDAJA}, $self->e_json( $crm ) );
+
+ warn "# hash ",dump $hash;
-sub e_json_encode {
- my ($self,$data) = @_;
- my $json = $self->e_json($data);
- $json = Encode::decode('utf-8', $json);
- Encode::from_to($json,'cp1250', 'utf-8');
- return $json;
+ return $hash;
}
1;