This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SWIS questions re: API deletes

FormerMember
FormerMember

Hi,

Very new to SWIS and have couple questions:

1. Some docs I've read say SWIS is read-only (e.g. can't create, delete, etc.) but other docs say it is not;  which is it?  and perhaps it depends on the SWIS and product versions?

2. If one does delete a Node from the Nodes table via API, does the API layer automatically also delete associated resources (e.g. interfaces, pollers) or does the API have to know/do all of this ?

Thanks in advance,

-Matt

  • Hi,

    ad 1: SWIS, taken as query engine is really read-only, but provide interface for calling the operations, which have Create, update, delete nature. Those operations must be implemented on different layer (not on SWIS side), so this is the reason why typically newer product versions support such operations on more types of objects

    ad 2.Depends on case by case, but e.g. if you delete the Node via API, it deletes also it's interfaces, volumes, pollers. Regarding the historical data, the daily DB maintenance will take care about them.

    H.

  • Have a look at this:

    Orion SDK Information

    I'm using a modified version of one of the sample scripts to copy node information from my old environment to my new one. There may be a sample in the SDK for deletions also.

  • If you mean the powershell example, the deletion syntax is the same for all types of objec. You just need to create connection and know the uri of the object (unique identifier). e.g.:

    $swis = Connect-Swis -hostname 'localhost' -username "admin" -password "123" #create connection

    [System.String]$uri = get-swisdata "select top 1 uri from orion.nodes" #get uri

    Remove-SwisObject $swis $uri #delete object

  • FormerMember
    0 FormerMember

    Many thanks to all who responded.  If, when a node is deleted via API, its interfaces, volumes, etc. are also automatically deleted, that is main reason for my post. 

    Regards,

    Matt