4 Replies Latest reply on Apr 1, 2015 7:15 AM by mattwisner

    SWIS questions re: API deletes

    mattwisner

      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

        • Re: SWIS questions re: API deletes
          Jan Pelousek

          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.

          • Re: SWIS questions re: API deletes
            silverbacksays

            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.

              • Re: SWIS questions re: API deletes
                Jan Pelousek

                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
                
              • Re: SWIS questions re: API deletes
                mattwisner

                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