Skip to main content

Python package for the iTop CMDB/Service Management Rest API

Project description

iTop Library for Python

iTop CMDB/Service Management Rest API library for Python

Todo

  • base (init.yml)
  • models.py

Usage

Authentication

Authentication can be performed two ways:

Form

This method works only when iTop doesn't have the form login disabled (e.g. direct auth when using the itop-saml extension).

Basic

This method can be used if you have the SAML plugin and want users to be automatically forwarded to the IDP when loading the page, but still want to be able to use the API. Make sure that basic is the first authentication method in the list in the configuration file, e.g.

	'allowed_login_types' => 'basic|saml|external',

Examples

from iToppy import iTop, iTopAuth

# Form Authentication (default)
connection = iTop(
    url='https://itop.example.com/webservices/rest.php', 
    username='username', 
    password='password', 
    version='1.3',
    auth=iTopAuth.FORM
)

# Basic Authentication
connection = iTop(
    url='https://itop.example.com/webservices/rest.php', 
    username='username', 
    password='password', 
    version='1.3',
    auth=iTopAuth.BASIC
)

Querying

Get objects

# Get all objects of class UserRequest
user_requests = connection.get('UserRequest')

# Full Get syntax
connection.get(
    
    # The class of object/objects to receive
    itop_class="UserRequest",
    
    # A string representing the key, OQL query in string form or iTopOQLQuery object
    key="1",
    
    # The fields to retrieve
    fields=["title", "description"]
    
    # Limit the number of results per page
    ,limit=10,

    # The page to retrieve
    page=1
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iToppy-0.1.1.tar.gz (17.9 kB view hashes)

Uploaded Source

Built Distribution

iToppy-0.1.1-py3-none-any.whl (18.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page