Coder Social home page Coder Social logo

python-servicenow's Introduction

Python ServiceNow

This is a Python Library to interact and manage the ServiceNow database via JSON web service.

Installation:

Using dpkg

$ dpkg-buildpackage -us -uc -rfakeroot
$ dpkg -i python-servicenow-<version>.deb

Using setup.py

$ python setup.py build
$ python setup.py install

Using pip

$ pip install servicenow 

Usage:

Example

#!/usr/bin/python

from servicenow import ServiceNow
from servicenow import Connection

conn = Connection.Auth(username='edsu', password='bele', instance='servicenowsubdomain')
inc = ServiceNow.Incident(conn)
srv = ServiceNow.Server(conn)
grp = ServiceNow.Group(conn)
chg = ServiceNow.Change(conn)
tkt = ServiceNow.Ticket(conn)

# Custom table
custom = ServiceNow.Base(conn)
custom.__table__ = "custom_table.do"

machine = srv.fetch_one({'name': 'machine0001'})
print machine

inc = inc.fetch_one({'number': 'INC123456'})
print inc

group = grp.fetch_one({'name': 'MY-Team'})
print group

changes = chg.fetch_all({'cmdb_ci': machine['sys_id'], 'review_status': 3})
print changes

# list only sys_ids
changes = chg.list({'cmdb_ci': machine['sys_id'], 'review_status': 3})
print changes

ticket = tkt.fetch_one({'number': 'TICKET0185412'})
print ticket

# Creating a new ticket based on another one
del ticket["number"]
new_ticket = tkt.create(ticket)
print ticket

Dependencies:

  • python-requests
  • python-redis

Contributors:

python-servicenow's People

Contributors

amorphic avatar gleicon avatar ncode avatar optivertimall avatar pothix avatar rogerlz avatar rsampaio avatar wgrcunha avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.