Esempio n. 1
0
# to load a specific keyID inside of your config file (see config format
# in docs), use this. this only makes sense for config file loads, not
# apiKey loads:
api = NS1(keyID='all-access')

# if you have special needs, build your own Config object and pass it to
# NS1:
config = Config()
config.createFromAPIKey('qACMD09OJXBxT7XOwv9v')
config['verbosity'] = 5
config['transport'] = 'twisted'
api = NS1(config=config)

#  you can get the current config object NS1 is using via
config = api.config

# change config variables
config['verbosity'] = 5

# write out new config files
config.write('/tmp/newconfig.json')

# the config file format supports different apiKeys (see docs) using keyID

# get the current keyID
print(config.getCurrentKeyID())

# use a different keyID
config.useKeyID('read-access')
Esempio n. 2
0
# to load a specific keyID inside of your config file (see config format
# in docs), use this. this only makes sense for config file loads, not
# apiKey loads:
api = NS1(keyID="all-access")

# if you have special needs, build your own Config object and pass it to
# NS1:
config = Config()
config.createFromAPIKey("qACMD09OJXBxT7XOwv9v")
config["verbosity"] = 5
config["transport"] = "twisted"
api = NS1(config=config)

#  you can get the current config object NS1 is using via
config = api.config

# change config variables
config["verbosity"] = 5

# write out new config files
config.write("/tmp/newconfig.json")

# the config file format supports different apiKeys (see docs) using keyID

# get the current keyID
print(config.getCurrentKeyID())

# use a different keyID
config.useKeyID("read-access")