Skip to content

eheimwbn/idoitapiclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

i- doit API client

api client for the i-doit cmdb JSON RPC API in python3

quite early state ...

Usage:

import the client

from idoitapiclient import IdoitApiClient as idoit

set up the connection to the api

url = 'https://demo.i-doit.com/src/jsonrpc.php'
auth = ('admin', 'admin')
apikey = 'c1ia5q'

# create instance 
call = idoit(url, auth, apikey)

# build a dictionary with the needed params  
params = {
             "jsonrpc": "2.0",
             "method": "cmdb.object.create",
             "params":  {
                 "type": "C__OBJTYPE__SERVER", 
                 "title": "FancyName", 
                        },
             }
             
# call the generic request method
call.generic_request(params)

returns the (error)message from API

Objects

Find object by its name

call.retrieve_object_id(name)

given name as string
method returns id as int or false if object is not found

Delete object by its id

❗ careful object ist deleted not archived ❗

call.delete_object_by_id(object_id)

given object_id as int
method returns True if object is deleted and false if object_id is not found

Links

About

Python3 API client for the i-doit cmdb

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages