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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file iToppy-0.1.1.tar.gz.

File metadata

  • Download URL: iToppy-0.1.1.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for iToppy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4d4185a56ea426d1ff625e668cc69446642eb59d0ab175053d27d76f17a29d2c
MD5 d1ce1971f17f5bba4502ccea5084a167
BLAKE2b-256 a8e4001b02e691bef0f73f6fca91f48c755601efa898bb543218d83c7ffb5e32

See more details on using hashes here.

File details

Details for the file iToppy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: iToppy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for iToppy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d076e80bb2f77eb662c5ff971fe45f218d7b22f97b530470864465b975a0efa
MD5 c7cb2915705b1b21ec4572fdca073202
BLAKE2b-256 cea5d2969719c54d68778ede1a4c4e27874e6fad9f4ed74c3c2be6cadb684e59

See more details on using hashes here.

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