예제 #1
0
async def sample_delete_log():
    # Create a client
    client = logging_v2.LoggingServiceV2AsyncClient()

    # Initialize request argument(s)
    request = logging_v2.DeleteLogRequest(log_name="log_name_value", )

    # Make the request
    await client.delete_log(request=request)
async def sample_delete_log():
    """Snippet for delete_log"""

    # Create a client
    client = logging_v2.LoggingServiceV2AsyncClient()

    # Initialize request argument(s)
    request = logging_v2.DeleteLogRequest()

    # Make the request
    response = await client.delete_log(request=request)
async def sample_list_monitored_resource_descriptors():
    """Snippet for list_monitored_resource_descriptors"""

    # Create a client
    client = logging_v2.LoggingServiceV2AsyncClient()

    # Initialize request argument(s)
    request = logging_v2.ListMonitoredResourceDescriptorsRequest()

    # Make the request
    page_result = client.list_monitored_resource_descriptors(request=request)
    async for response in page_result:
        print("{}".format(response))
async def sample_list_logs():
    # Create a client
    client = logging_v2.LoggingServiceV2AsyncClient()

    # Initialize request argument(s)
    request = logging_v2.ListLogsRequest(parent="parent_value", )

    # Make the request
    page_result = client.list_logs(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
예제 #5
0
async def sample_list_log_entries():
    """Snippet for list_log_entries"""

    # Create a client
    client = logging_v2.LoggingServiceV2AsyncClient()

    # Initialize request argument(s)
    request = logging_v2.ListLogEntriesRequest()

    # Make the request
    page_result = client.list_log_entries(request=request)
    async for response in page_result:
        print("{}".format(response))
예제 #6
0
async def sample_tail_log_entries():
    """Snippet for tail_log_entries"""

    # Create a client
    client = logging_v2.LoggingServiceV2AsyncClient()

    # Initialize request argument(s)
    request = logging_v2.TailLogEntriesRequest()

    # Make the request
    stream = await client.tail_log_entries([])
    async for response in stream:
        print("{}".format(response))
async def sample_list_log_entries():
    # Create a client
    client = logging_v2.LoggingServiceV2AsyncClient()

    # Initialize request argument(s)
    request = logging_v2.ListLogEntriesRequest(
        resource_names=['resource_names_value_1', 'resource_names_value_2'], )

    # Make the request
    page_result = client.list_log_entries(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
예제 #8
0
async def sample_write_log_entries():
    # Create a client
    client = logging_v2.LoggingServiceV2AsyncClient()

    # Initialize request argument(s)
    entries = logging_v2.LogEntry()
    entries.log_name = "log_name_value"

    request = logging_v2.WriteLogEntriesRequest(entries=entries, )

    # Make the request
    response = await client.write_log_entries(request=request)

    # Handle the response
    print(response)
async def sample_write_log_entries():
    """Snippet for write_log_entries"""

    # Create a client
    client = logging_v2.LoggingServiceV2AsyncClient()

    # Initialize request argument(s)
    request = logging_v2.WriteLogEntriesRequest(
    )

    # Make the request
    response = await client.write_log_entries(request=request)

    # Handle response
    print("{}".format(response))
async def sample_tail_log_entries():
    # Create a client
    client = logging_v2.LoggingServiceV2AsyncClient()

    # Initialize request argument(s)
    request = logging_v2.TailLogEntriesRequest(
        resource_names=['resource_names_value_1', 'resource_names_value_2'], )

    # This method expects an iterator which contains
    # 'logging_v2.TailLogEntriesRequest' objects
    # Here we create a generator that yields a single `request` for
    # demonstrative purposes.
    requests = [request]

    def request_generator():
        for request in requests:
            yield request

    # Make the request
    stream = await client.tail_log_entries(requests=request_generator())

    # Handle the response
    async for response in stream:
        print(response)