google.cloud.forseti.services.inventory.base.storage module

Crawler implementation.

class Memory(session=None)[source]

Bases: google.cloud.forseti.services.inventory.base.storage.Storage

The storage in memory

__enter__()[source]

To support with statement for auto closing.

Returns:The memory storage object
Return type:Storage
__exit__(type_p, value, tb)[source]

To support with statement for auto closing.

Parameters:
  • type_p (object) – Unused.
  • value (object) – Unused.
  • tb (object) – Unused.
close()[source]

close the memory storage

commit()[source]

No need to commit when using a memory storage

error(message)[source]

Ignore the error message

Parameters:message (str) – Error message describing the problem.
open(handle=None)[source]

Open the memory storage

Parameters:handle (str) – If None, create a new index instead of opening an existing one.
Returns:inventory index
Return type:str
read(key)[source]

Read a resource object from storage

Parameters:key (str) – key of the resource object
Returns:the resource object being read
Return type:object
rollback()[source]

No rollback when using a memory storage

update(resource)[source]

Update a existing resource object in memory

Parameters:resource (object) – the resource object to update
warning(message)[source]

Ignore the warning message

Parameters:message (str) – Warning message describing the problem.
write(resource)[source]

Write a resource object into storage

Parameters:resource (object) – the resource object to write
class Storage[source]

Bases: object

The inventory storage interface

close()[source]

Not Implemented.

Raises:NotImplementedError – Because not implemented.
commit()[source]

Not Implemented.

Raises:NotImplementedError – Because not implemented.
error(message)[source]

Not Implemented.

Parameters:message (str) – Error message describing the problem.
Raises:NotImplementedError – Because not implemented.
open(handle=None)[source]

Not Implemented.

Parameters:handle (str) – If None, create a new index instead of opening an existing one.
Raises:NotImplementedError – Because not implemented.
rollback()[source]

Not Implemented.

Raises:NotImplementedError – Because not implemented.
update(resource)[source]

Not Implemented.

Parameters:resource (object) – the resource object to update
Raises:NotImplementedError – Because not implemented.
warning(message)[source]

Not Implemented.

Parameters:message (str) – Warning message describing the problem.
Raises:NotImplementedError – Because not implemented.
write(resource)[source]

Not Implemented.

Parameters:resource (object) – the resource object to write
Raises:NotImplementedError – Because not implemented.