Directory

Methods described in this section relate to the directory API. These methods can be accessed at TenableIE.directories.

class DirectoriesAPI(api: APISession)[source]
create(infrastructure_id: int, name: str, ip: str, dns: str, **kwargs) List[Dict][source]

Creates a new directory instance.

Parameters:
  • infrastructure_id (int) – The infrastructure object to bind this directory to.

  • name (str) – Name of the directory instance.

  • ip (str) – The IP Address of the directory server.

  • dns (str) – The DNS domain that this directory is tied to.

  • directory_type (optional, str) – The directory’s type.

  • ldap_port (optional, str) – The port number associated to the LDAP service on the directory server.

  • global_catalog_port (optional, str) – The port number associated to the Global Catalog service running on the directory server.

  • smb_port (optional, str) – The port number associated to the Server Messaging Block (SMB) service running on the directory server.

Returns:

The created directory instance.

Return type:

dict

Examples

>>> tie.directories.create(
...     infrastructure_id=1,
...     name='ExampleServer',
...     ip='172.16.0.1',
...     directory_type='????',
...     dns='company.tld',
...     )
delete(infrastructure_id: int, directory_id: int) None[source]

Deletes the directory instance.

Parameters:
  • infrastructure_id (int) – The infrastructure instance identifier.

  • directory_id (int) – The directory instance identifier.

Return type:

None

Examples

>>> tie.directories.delete(
...     infrastructure_id=2,
...     directory_id='12'
...     )
details(directory_id: str) Dict[source]

Retrieves the details for a specific directory instance.

Parameters:

directory_id (str) – The directory instance identifier.

Returns:

the directory object.

Return type:

dict

Examples

>>> tie.directories.details(directory_id='1')
list() List[Dict][source]

Retrieves all directory instances.

Returns:

The list of directory objects

Return type:

list

Examples

>>> tie.directories.list()
update(infrastructure_id: int, directory_id: int, **kwargs) Dict[source]

Updates the directory instance based on infrastrcture_id and directory_id.

Parameters:
  • infrastructure_id (int) – The infrastructure instance identifier.

  • directory_id (int) – The directory instance identifier.

  • name (optional, str) – Name of the directory instance.

  • ip (optional, str) – The IP Address of the directory server.

  • directory_type (optional, str) – The directory’s type.

  • dns (optional, str) – The DNS domain that this directory is tied to.

  • ldap_port (optional, int) – The port number associated to the LDAP service on the directory server.

  • global_catalog_port (optional, str) – The port number associated to the Global Catalog service running on the directory server.

  • smb_port (optional, str) – The port number associated to the Server Messaging Block (SMB) service running on the directory server.

Returns:

The updated directory object.

Return type:

dict

Examples

>>> tie.directories.update(
...     infrastructure_id=2,
...     directory_id=9,
...     name='updated_new_name'
...     )
>>> tie.directories.update(
...     infrastructure_id=2,
...     directory_id=9,
...     name='updated_new_name',
...     ldap_port=390
...     )