cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 11

Updating Orion.WorldMap.Point via the Perl SDK

Jump to solution

I've been playing with the new world maps with doing the creating, updating and deletion of points via the Perl Orion SDK. I've had success with creating points with the following:

my $data = $self->{_swis}->Create("Orion.WorldMap.Point", {Instance => 'Orion.Nodes', InstanceID => $node_id, Latitude => $lat, Longitude => $long} );

However not having much success with with updates or deletions as both of the following:

my $data = $self->{_swis}->Update($self->{_swis_url} . "/Orion.WorldMap.Point/PointId=$point_id", {Latitude => $lat, Longitude => $long} );

my $data = $self->{_swis}->Delete("swis://localhost/Orion/Orion.WorldMap.Point/Instance=Orion.Nodes,PointId=$point_id");

produce the following error:

Invalid key properties specified for entity Orion.WorldMap.Point.

Anyone got any pointers? I've got quite a large amount of location data to import and then allow updates to be carried out from our CMDB. And I also notice it's create multiple pointers for the same node.

Cheers,

Jon

1 Solution
Level 16

I think you need to specify the primary key to object created  -- what is returned in the URI from a swql Studio query...

eg swis://xxxx/Orion/Orion.WorldMap.Point/Instance="Orion.Nodes",InstanceID=12

leads me to think this might work:

my $data = $self->{_swis}->Update($self->{_swis_url} . "/Orion.WorldMap.Point/Instance="Orion.Nodes",InstanceID=12", {Latitude => $lat, Longitude => $long} );

View solution in original post

0 Kudos
2 Replies
Level 16

I think you need to specify the primary key to object created  -- what is returned in the URI from a swql Studio query...

eg swis://xxxx/Orion/Orion.WorldMap.Point/Instance="Orion.Nodes",InstanceID=12

leads me to think this might work:

my $data = $self->{_swis}->Update($self->{_swis_url} . "/Orion.WorldMap.Point/Instance="Orion.Nodes",InstanceID=12", {Latitude => $lat, Longitude => $long} );

View solution in original post

0 Kudos

Thank you RichardLetts, I was thinking of looking there and it is indeed the needed format for deletes and updates.

0 Kudos