google.cloud.forseti.services.model.service module

Forseti Server model gRPC service.

class GrpcModeller(modeller_api)[source]

Bases: google.cloud.forseti.services.model.model_pb2_grpc.ModellerServicer

Modeller gRPC implementation.

CreateModel(request, context)[source]

Creates a new model from an import source.

Parameters:
  • request (object) – pb2 object of CreateModelRequest
  • context (object) – gRPC context
Returns:

pb2 object of ModelSimplified

Return type:

object

DeleteModel(request, _)[source]

Deletes a model and all associated data.

Parameters:
  • request (object) – pb2 object of DeleteModelRequest
  • _ (object) – Not used
Returns:

pb2 object of DeleteModelReply

Return type:

object

GetModel(request, _)[source]

Get details of a model.

Parameters:
  • request (object) – pb2 object of GetModelRequest
  • _ (object) – Not used
Returns:

pb2 object of ModelDetails

Return type:

object

HANDLE_KEY = 'handle'
ListModel(request, _)[source]

List all models.

Parameters:
  • request (object) – pb2 object of ListModelRequest
  • _ (object) – Not used
Yields:

object – pb2 object of ModelSimplified

Ping(request, _)[source]

Provides the capability to check for service availability.

Parameters:
  • request (object) – pb2 object of PingRequest
  • _ (object) – Not used
Returns:

pb2 object of the PingReply

Return type:

object

_get_handle(context)[source]

Return the handle associated with the gRPC call.

Parameters:context (object) – GRPC context
Returns:handle of the GRPC call
Return type:str
static _get_model_created_at_str(model)[source]

Get model created_at datetime in human readable string format.

Parameters:model (Model) – Model dao object.
Returns:created_at datetime in string format.
Return type:str
class GrpcModellerFactory(config)[source]

Bases: object

Factory class for model service gRPC interface

create_and_register_service(server)[source]

Create and register the Model service.

Parameters:server (object) – Server to register service to.
Returns:The instantiated gRPC service for model.
Return type:object