Esempio n. 1
0
async def sample_get_index():
    # Create a client
    client = aiplatform_v1.IndexServiceAsyncClient()

    # Initialize request argument(s)
    request = aiplatform_v1.GetIndexRequest(name="name_value", )

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

    # Handle the response
    print(response)
async def sample_list_indexes():
    # Create a client
    client = aiplatform_v1.IndexServiceAsyncClient()

    # Initialize request argument(s)
    request = aiplatform_v1.ListIndexesRequest(parent="parent_value", )

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

    # Handle the response
    async for response in page_result:
        print(response)
async def sample_delete_index():
    # Create a client
    client = aiplatform_v1.IndexServiceAsyncClient()

    # Initialize request argument(s)
    request = aiplatform_v1.DeleteIndexRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_index(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)
async def sample_update_index():
    # Create a client
    client = aiplatform_v1.IndexServiceAsyncClient()

    # Initialize request argument(s)
    index = aiplatform_v1.Index()
    index.display_name = "display_name_value"

    request = aiplatform_v1.UpdateIndexRequest(index=index, )

    # Make the request
    operation = client.update_index(request=request)

    print("Waiting for operation to complete...")

    response = await operation.result()

    # Handle the response
    print(response)