Quantcast
Channel: THWACK: Popular Discussions - Orion SDK
Viewing all articles
Browse latest Browse all 3719

Unable to unmanage application using orion API

$
0
0

Hi All, I am trying to unmanage an application using orion API. I took python script to unmanage a node as a reference and modified it to also support for application.

 

Script was able to execute with no errors and exceptions but application didnt get unamanaged. I am kind of stuck here as don't have any errors to check and logs to find the root cause.

 

Please help if anyone has faced this issue before.

 

import requests

from orionsdk import SwisClient

from datetime import datetime, timedelta

 

 

def main():

    hostname = 'localhost'

    username = 'test'

    password = 'dadasdd'

    print("i am running")

    swis = SwisClient(hostname, username, password)

    results = swis.query('SELECT ApplicationID, ApplicationTemplateID FROM Orion.APM.Application WHERE ApplicationID = @ApplicationID', ApplicationID='28')

    if results['results']:

        ApplicationID = results['results'][0]['ApplicationID']

        ApplicationTemplateID = results['results'][0]['ApplicationTemplateID']

        netObjectId = 'AA:{}'.format(ApplicationID)

        now = datetime.utcnow()

      

        tomorrow = now + timedelta(days=1)

        response = swis.invoke('Orion.APM.Application', 'Unmanage', netObjectId, now, tomorrow, False)

        print('Done...{} will be Remanage until {}'.format(ApplicationID, tomorrow))

        print('Response - {} '.format(response))

    else:

        print("Device doesn't Exist")

 

 

requests.packages.urllib3.disable_warnings()

 

 

if __name__ == '__main__':

    main()

 

 

 

 

 

 

 

 

 

 

 

Thanks in advance for checking.

 

Regards

Devraj S


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>