google.cloud.forseti.services.inventory.service module

Inventory gRPC service.

class GrpcInventory(inventory_api)[source]

Bases: google.cloud.forseti.services.inventory.inventory_pb2_grpc.InventoryServicer

Inventory gRPC handler.

Create()

Wrapper function, checks context state to close stream.

Parameters:*args (list) – All arguments provided to the wrapped function.
Yields:object – Whatever the wrapped function yields to the stream.
Delete(request, _)[source]

Deletes existing inventory.

Parameters:
  • request (object) – gRPC request object.
  • _ (object) – Unused
Returns:

Inventory API object that is deleted.

Return type:

object

Get(request, _)[source]

Gets existing inventory.

Parameters:
  • request (object) – gRPC request object.
  • _ (object) – Unused.
Returns:

Inventory API object that is requested.

Return type:

object

List()

Wrapper function, checks context state to close stream.

Parameters:*args (list) – All arguments provided to the wrapped function.
Yields:object – Whatever the wrapped function yields to the stream.
Ping(request, _)[source]

Ping implemented to check service availability.

Parameters:
  • request (object) – gRPC request object.
  • _ (object) – Unused.
Returns:

PingReply containing echo of data.

Return type:

object

Purge(request, _)[source]

Purge desired inventory data.

Parameters:
  • request (object) – gRPC request object.
  • _ (object) – Unused
Returns:

gRPC reply object.

Return type:

object

class GrpcInventoryFactory(config)[source]

Bases: object

Factory class for Inventory service gRPC interface

create_and_register_service(server)[source]

Creates an inventory service and registers it in the server.

Parameters:server (object) – Server to register service to.
Returns:The instantiated gRPC service for inventory.
Return type:object
inventory_pb_from_object(inventory_index, warning_messages)[source]

Convert internal inventory data structure to protobuf.

Parameters:
  • inventory_index (InventoryIndex) – InventoryIndex class in inventory storage.
  • warning_messages (list) – Warning message(s) from the inventory
Returns:

proto message of InventoryIndex

Return type:

object