Source Documentation

https://python-netskope.readthedocs.io/en/latest/

exception netskope.netskope.APIKeyFormatError[source]

Exception for API key format mismatch

exception netskope.netskope.IniFileKeyError[source]

Exception for missing key in ini file

exception netskope.netskope.IniFileSectionError[source]

Exception for missing section in ini file

class netskope.netskope.nss(cfg_file='config.ini', api_key='', url='')[source]

Parent Class to simplify access to the Netskope APIs for subclasses Can also be used to genericallly access the API

Raises
create(url, body='')[source]

Generic create object wrapper

Parameters
  • url (str) – Full URL

  • body (str) – JSON formatted data payload

Returns

Requests response object

Return type

response object

delete(url, id='', body='')[source]

Generic delete object wrapper

Parameters
  • url (str) – Full URL

  • id (str) – Object id to delete

  • body (str) – JSON formatted data payload

Returns

Requests response object

Return type

response object

get(url, id='', action='', **params)[source]

Generic get object wrapper

Parameters
  • url (str) – Full URL

  • id (str) – Optional Object ID

  • action (str) – Optional object action

Returns

Requests response object

Return type

response object

post(url, id='', action='', body='', **params)[source]

Generic Post object wrapper

Parameters
  • url (str) – Full URL

  • id (str) – Optional Object ID

  • action (str) – Optional object action

Returns

Requests response object

Return type

response object

replace(url, id='', body='')[source]

Generic create object wrapper

Parameters
  • url (str) – Full URL

  • body (str) – JSON formatted data payload

Returns

Requests response object

Return type

response object

update(url, id='', body='')[source]

Generic create object wrapper

Parameters
  • url (str) – Full URL

  • body (str) – JSON formatted data payload

Returns

Requests response object

Return type

response object

netskope.netskope.read_nss_ini(ini_filename)[source]

Open and parse ini file

Parameters

ini_filename (str) – name of inifile

Returns

Dictionary of Netskope configuration elements

Return type

config (dict)

Raises
netskope.netskope.verify_api_key(apikey)[source]

Verify format of API Key

Parameters

apikey (str) – api key

Returns

True is apikey passes format validation

Return type

bool