buildgrid.server.request_metadata_utils module

buildgrid.server.request_metadata_utils.printable_request_metadata(metadata_entries)str

Given a metadata object, return a human-readable representation of its RequestMetadata entry.

Parameters

metadata_entries – tuple of entries obtained from a gRPC context with, for example, context.invocation_metadata().

Returns

A string with the metadata contents.

buildgrid.server.request_metadata_utils.extract_request_metadata(metadata_entries)build.bazel.remote.execution.v2.remote_execution_pb2.RequestMetadata

Given a list of string tuples, extract the RequestMetadata header values if they are present. If they were not provided, returns an empty message.

Parameters

metadata_entries – tuple of entries obtained from a gRPC context with, for example, context.invocation_metadata().

Returns

A RequestMetadata proto. If the metadata is not defined in the request, the message will be empty.

buildgrid.server.request_metadata_utils.request_metadata_to_string(request_metadata)
buildgrid.server.request_metadata_utils.request_metadata_from_scheduler_dict(scheduler_request_metadata: dict)build.bazel.remote.execution.v2.remote_execution_pb2.RequestMetadata