Cloud Datastore v1 API - Class DatastoreAdminClient (2.1.0)

public abstract class DatastoreAdminClient

Reference documentation and code samples for the Cloud Datastore v1 API class DatastoreAdminClient.

DatastoreAdmin client wrapper, for convenient use.

Inheritance

Object > DatastoreAdminClient

Derived Types

Namespace

Google.Cloud.Datastore.Admin.V1

Assembly

Google.Cloud.Datastore.Admin.V1.dll

Remarks

Google Cloud Datastore Admin API

The Datastore Admin API provides several admin services for Cloud Datastore.


Concepts

Project, namespace, kind, and entity as defined in the Google Cloud Datastore API.

Operation: An Operation represents work being performed in the background.

EntityFilter: Allows specifying a subset of entities in a project. This is specified as a combination of kinds and namespaces (either or both of which may be all).


Services

Export/Import

The Export/Import service provides the ability to copy all or a subset of entities to/from Google Cloud Storage.

Exported data may be imported into Cloud Datastore for any Google Cloud Platform project. It is not restricted to the export source project. It is possible to export from one project and then import into another.

Exported data can also be loaded into Google BigQuery for analysis.

Exports and imports are performed asynchronously. An Operation resource is created for each export/import. The state (including any errors encountered) of the export/import may be queried via the Operation resource.

Index

The index service manages Cloud Datastore composite indexes.

Index creation and deletion are performed asynchronously. An Operation resource is created for each such asynchronous operation. The state of the operation (including any errors encountered) may be queried via the Operation resource.

Operation

The Operations collection provides a record of actions performed for the specified project (including any operations in progress). Operations are not created directly but through calls on other collections or resources.

An operation that is not yet done may be cancelled. The request to cancel is asynchronous and the operation may continue to run for some time after the request to cancel is made.

An operation that is done may be deleted so that it is no longer listed as part of the Operation collection.

ListOperations returns all pending operations, but not completed operations.

Operations are created by service DatastoreAdmin, but are accessed via service google.longrunning.Operations.

Properties

CreateIndexOperationsClient

public virtual OperationsClient CreateIndexOperationsClient { get; }

The long-running operations client for CreateIndex.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the DatastoreAdmin service, which is a host of "datastore.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default DatastoreAdmin scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

DeleteIndexOperationsClient

public virtual OperationsClient DeleteIndexOperationsClient { get; }

The long-running operations client for DeleteIndex.

Property Value
TypeDescription
OperationsClient

ExportEntitiesOperationsClient

public virtual OperationsClient ExportEntitiesOperationsClient { get; }

The long-running operations client for ExportEntities.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual DatastoreAdmin.DatastoreAdminClient GrpcClient { get; }

The underlying gRPC DatastoreAdmin client

Property Value
TypeDescription
DatastoreAdmin.DatastoreAdminClient

ImportEntitiesOperationsClient

public virtual OperationsClient ImportEntitiesOperationsClient { get; }

The long-running operations client for ImportEntities.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static DatastoreAdminClient Create()

Synchronously creates a DatastoreAdminClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DatastoreAdminClientBuilder.

Returns
TypeDescription
DatastoreAdminClient

The created DatastoreAdminClient.

CreateAsync(CancellationToken)

public static Task<DatastoreAdminClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a DatastoreAdminClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DatastoreAdminClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<DatastoreAdminClient>

The task representing the created DatastoreAdminClient.

CreateIndex(CreateIndexRequest, CallSettings)

public virtual Operation<Index, IndexOperationMetadata> CreateIndex(CreateIndexRequest request, CallSettings callSettings = null)

Creates the specified index. A newly created index's initial state is CREATING. On completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the state will be READY. If the index already exists, the call will return an ALREADY_EXISTS status.

During index creation, the process could result in an error, in which case the index will move to the ERROR state. The process can be recovered by fixing the data that caused the error, removing the index with [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then re-creating the index with [create] [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].

Indexes with a single property cannot be created.

Parameters
NameDescription
requestCreateIndexRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Index, IndexOperationMetadata>

The RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();
// Initialize request argument(s)
CreateIndexRequest request = new CreateIndexRequest
{
    ProjectId = "",
    Index = new gcdav::Index(),
};
// Make the request
Operation<gcdav::Index, IndexOperationMetadata> response = datastoreAdminClient.CreateIndex(request);

// Poll until the returned long-running operation is complete
Operation<gcdav::Index, IndexOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcdav::Index result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<gcdav::Index, IndexOperationMetadata> retrievedResponse = datastoreAdminClient.PollOnceCreateIndex(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcdav::Index retrievedResult = retrievedResponse.Result;
}

CreateIndexAsync(CreateIndexRequest, CallSettings)

public virtual Task<Operation<Index, IndexOperationMetadata>> CreateIndexAsync(CreateIndexRequest request, CallSettings callSettings = null)

Creates the specified index. A newly created index's initial state is CREATING. On completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the state will be READY. If the index already exists, the call will return an ALREADY_EXISTS status.

During index creation, the process could result in an error, in which case the index will move to the ERROR state. The process can be recovered by fixing the data that caused the error, removing the index with [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then re-creating the index with [create] [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].

Indexes with a single property cannot be created.

Parameters
NameDescription
requestCreateIndexRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Index, IndexOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
CreateIndexRequest request = new CreateIndexRequest
{
    ProjectId = "",
    Index = new gcdav::Index(),
};
// Make the request
Operation<gcdav::Index, IndexOperationMetadata> response = await datastoreAdminClient.CreateIndexAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcdav::Index, IndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcdav::Index result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<gcdav::Index, IndexOperationMetadata> retrievedResponse = await datastoreAdminClient.PollOnceCreateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcdav::Index retrievedResult = retrievedResponse.Result;
}

CreateIndexAsync(CreateIndexRequest, CancellationToken)

public virtual Task<Operation<Index, IndexOperationMetadata>> CreateIndexAsync(CreateIndexRequest request, CancellationToken cancellationToken)

Creates the specified index. A newly created index's initial state is CREATING. On completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the state will be READY. If the index already exists, the call will return an ALREADY_EXISTS status.

During index creation, the process could result in an error, in which case the index will move to the ERROR state. The process can be recovered by fixing the data that caused the error, removing the index with [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then re-creating the index with [create] [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].

Indexes with a single property cannot be created.

Parameters
NameDescription
requestCreateIndexRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Index, IndexOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
CreateIndexRequest request = new CreateIndexRequest
{
    ProjectId = "",
    Index = new gcdav::Index(),
};
// Make the request
Operation<gcdav::Index, IndexOperationMetadata> response = await datastoreAdminClient.CreateIndexAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcdav::Index, IndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcdav::Index result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<gcdav::Index, IndexOperationMetadata> retrievedResponse = await datastoreAdminClient.PollOnceCreateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcdav::Index retrievedResult = retrievedResponse.Result;
}

DeleteIndex(DeleteIndexRequest, CallSettings)

public virtual Operation<Index, IndexOperationMetadata> DeleteIndex(DeleteIndexRequest request, CallSettings callSettings = null)

Deletes an existing index. An index can only be deleted if it is in a READY or ERROR state. On successful execution of the request, the index will be in a DELETING [state][google.datastore.admin.v1.Index.State]. And on completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed.

During index deletion, the process could result in an error, in which case the index will move to the ERROR state. The process can be recovered by fixing the data that caused the error, followed by calling [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.

Parameters
NameDescription
requestDeleteIndexRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Index, IndexOperationMetadata>

The RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();
// Initialize request argument(s)
DeleteIndexRequest request = new DeleteIndexRequest
{
    ProjectId = "",
    IndexId = "",
};
// Make the request
Operation<gcdav::Index, IndexOperationMetadata> response = datastoreAdminClient.DeleteIndex(request);

// Poll until the returned long-running operation is complete
Operation<gcdav::Index, IndexOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcdav::Index result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<gcdav::Index, IndexOperationMetadata> retrievedResponse = datastoreAdminClient.PollOnceDeleteIndex(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcdav::Index retrievedResult = retrievedResponse.Result;
}

DeleteIndexAsync(DeleteIndexRequest, CallSettings)

public virtual Task<Operation<Index, IndexOperationMetadata>> DeleteIndexAsync(DeleteIndexRequest request, CallSettings callSettings = null)

Deletes an existing index. An index can only be deleted if it is in a READY or ERROR state. On successful execution of the request, the index will be in a DELETING [state][google.datastore.admin.v1.Index.State]. And on completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed.

During index deletion, the process could result in an error, in which case the index will move to the ERROR state. The process can be recovered by fixing the data that caused the error, followed by calling [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.

Parameters
NameDescription
requestDeleteIndexRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Index, IndexOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
DeleteIndexRequest request = new DeleteIndexRequest
{
    ProjectId = "",
    IndexId = "",
};
// Make the request
Operation<gcdav::Index, IndexOperationMetadata> response = await datastoreAdminClient.DeleteIndexAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcdav::Index, IndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcdav::Index result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<gcdav::Index, IndexOperationMetadata> retrievedResponse = await datastoreAdminClient.PollOnceDeleteIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcdav::Index retrievedResult = retrievedResponse.Result;
}

DeleteIndexAsync(DeleteIndexRequest, CancellationToken)

public virtual Task<Operation<Index, IndexOperationMetadata>> DeleteIndexAsync(DeleteIndexRequest request, CancellationToken cancellationToken)

Deletes an existing index. An index can only be deleted if it is in a READY or ERROR state. On successful execution of the request, the index will be in a DELETING [state][google.datastore.admin.v1.Index.State]. And on completion of the returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed.

During index deletion, the process could result in an error, in which case the index will move to the ERROR state. The process can be recovered by fixing the data that caused the error, followed by calling [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.

Parameters
NameDescription
requestDeleteIndexRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Index, IndexOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
DeleteIndexRequest request = new DeleteIndexRequest
{
    ProjectId = "",
    IndexId = "",
};
// Make the request
Operation<gcdav::Index, IndexOperationMetadata> response = await datastoreAdminClient.DeleteIndexAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcdav::Index, IndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcdav::Index result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<gcdav::Index, IndexOperationMetadata> retrievedResponse = await datastoreAdminClient.PollOnceDeleteIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    gcdav::Index retrievedResult = retrievedResponse.Result;
}

ExportEntities(ExportEntitiesRequest, CallSettings)

public virtual Operation<ExportEntitiesResponse, ExportEntitiesMetadata> ExportEntities(ExportEntitiesRequest request, CallSettings callSettings = null)

Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

Parameters
NameDescription
requestExportEntitiesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<ExportEntitiesResponse, ExportEntitiesMetadata>

The RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();
// Initialize request argument(s)
ExportEntitiesRequest request = new ExportEntitiesRequest
{
    ProjectId = "",
    Labels = { { "", "" }, },
    EntityFilter = new EntityFilter(),
    OutputUrlPrefix = "",
};
// Make the request
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> response = datastoreAdminClient.ExportEntities(request);

// Poll until the returned long-running operation is complete
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ExportEntitiesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> retrievedResponse = datastoreAdminClient.PollOnceExportEntities(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ExportEntitiesResponse retrievedResult = retrievedResponse.Result;
}

ExportEntities(String, IDictionary<String, String>, EntityFilter, String, CallSettings)

public virtual Operation<ExportEntitiesResponse, ExportEntitiesMetadata> ExportEntities(string projectId, IDictionary<string, string> labels, EntityFilter entityFilter, string outputUrlPrefix, CallSettings callSettings = null)

Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

Parameters
NameDescription
projectIdString

Required. Project ID against which to make the request.

labelsIDictionary<String, String>

Client-assigned labels.

entityFilterEntityFilter

Description of what data from the project is included in the export.

outputUrlPrefixString

Required. Location for the export metadata and data files.

The full resource URL of the external storage location. Currently, only Google Cloud Storage is supported. So output_url_prefix should be of the form: gs://BUCKET_NAME[/NAMESPACE_PATH], where BUCKET_NAME is the name of the Cloud Storage bucket and NAMESPACE_PATH is an optional Cloud Storage namespace path (this is not a Cloud Datastore namespace). For more information about Cloud Storage namespace paths, see Object name considerations.

The resulting files will be nested deeper than the specified URL prefix. The final output URL will be provided in the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That value should be used for subsequent ImportEntities operations.

By nesting the data files deeper, the same Cloud Storage bucket can be used in multiple ExportEntities operations without conflict.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<ExportEntitiesResponse, ExportEntitiesMetadata>

The RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
EntityFilter entityFilter = new EntityFilter();
string outputUrlPrefix = "";
// Make the request
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> response = datastoreAdminClient.ExportEntities(projectId, labels, entityFilter, outputUrlPrefix);

// Poll until the returned long-running operation is complete
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ExportEntitiesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> retrievedResponse = datastoreAdminClient.PollOnceExportEntities(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ExportEntitiesResponse retrievedResult = retrievedResponse.Result;
}

ExportEntitiesAsync(ExportEntitiesRequest, CallSettings)

public virtual Task<Operation<ExportEntitiesResponse, ExportEntitiesMetadata>> ExportEntitiesAsync(ExportEntitiesRequest request, CallSettings callSettings = null)

Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

Parameters
NameDescription
requestExportEntitiesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<ExportEntitiesResponse, ExportEntitiesMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
ExportEntitiesRequest request = new ExportEntitiesRequest
{
    ProjectId = "",
    Labels = { { "", "" }, },
    EntityFilter = new EntityFilter(),
    OutputUrlPrefix = "",
};
// Make the request
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> response = await datastoreAdminClient.ExportEntitiesAsync(request);

// Poll until the returned long-running operation is complete
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ExportEntitiesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> retrievedResponse = await datastoreAdminClient.PollOnceExportEntitiesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ExportEntitiesResponse retrievedResult = retrievedResponse.Result;
}

ExportEntitiesAsync(ExportEntitiesRequest, CancellationToken)

public virtual Task<Operation<ExportEntitiesResponse, ExportEntitiesMetadata>> ExportEntitiesAsync(ExportEntitiesRequest request, CancellationToken cancellationToken)

Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

Parameters
NameDescription
requestExportEntitiesRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<ExportEntitiesResponse, ExportEntitiesMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
ExportEntitiesRequest request = new ExportEntitiesRequest
{
    ProjectId = "",
    Labels = { { "", "" }, },
    EntityFilter = new EntityFilter(),
    OutputUrlPrefix = "",
};
// Make the request
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> response = await datastoreAdminClient.ExportEntitiesAsync(request);

// Poll until the returned long-running operation is complete
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ExportEntitiesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> retrievedResponse = await datastoreAdminClient.PollOnceExportEntitiesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ExportEntitiesResponse retrievedResult = retrievedResponse.Result;
}

ExportEntitiesAsync(String, IDictionary<String, String>, EntityFilter, String, CallSettings)

public virtual Task<Operation<ExportEntitiesResponse, ExportEntitiesMetadata>> ExportEntitiesAsync(string projectId, IDictionary<string, string> labels, EntityFilter entityFilter, string outputUrlPrefix, CallSettings callSettings = null)

Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

Parameters
NameDescription
projectIdString

Required. Project ID against which to make the request.

labelsIDictionary<String, String>

Client-assigned labels.

entityFilterEntityFilter

Description of what data from the project is included in the export.

outputUrlPrefixString

Required. Location for the export metadata and data files.

The full resource URL of the external storage location. Currently, only Google Cloud Storage is supported. So output_url_prefix should be of the form: gs://BUCKET_NAME[/NAMESPACE_PATH], where BUCKET_NAME is the name of the Cloud Storage bucket and NAMESPACE_PATH is an optional Cloud Storage namespace path (this is not a Cloud Datastore namespace). For more information about Cloud Storage namespace paths, see Object name considerations.

The resulting files will be nested deeper than the specified URL prefix. The final output URL will be provided in the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That value should be used for subsequent ImportEntities operations.

By nesting the data files deeper, the same Cloud Storage bucket can be used in multiple ExportEntities operations without conflict.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<ExportEntitiesResponse, ExportEntitiesMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
EntityFilter entityFilter = new EntityFilter();
string outputUrlPrefix = "";
// Make the request
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> response = await datastoreAdminClient.ExportEntitiesAsync(projectId, labels, entityFilter, outputUrlPrefix);

// Poll until the returned long-running operation is complete
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ExportEntitiesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> retrievedResponse = await datastoreAdminClient.PollOnceExportEntitiesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ExportEntitiesResponse retrievedResult = retrievedResponse.Result;
}

ExportEntitiesAsync(String, IDictionary<String, String>, EntityFilter, String, CancellationToken)

public virtual Task<Operation<ExportEntitiesResponse, ExportEntitiesMetadata>> ExportEntitiesAsync(string projectId, IDictionary<string, string> labels, EntityFilter entityFilter, string outputUrlPrefix, CancellationToken cancellationToken)

Exports a copy of all or a subset of entities from Google Cloud Datastore to another storage system, such as Google Cloud Storage. Recent updates to entities may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.

Parameters
NameDescription
projectIdString

Required. Project ID against which to make the request.

labelsIDictionary<String, String>

Client-assigned labels.

entityFilterEntityFilter

Description of what data from the project is included in the export.

outputUrlPrefixString

Required. Location for the export metadata and data files.

The full resource URL of the external storage location. Currently, only Google Cloud Storage is supported. So output_url_prefix should be of the form: gs://BUCKET_NAME[/NAMESPACE_PATH], where BUCKET_NAME is the name of the Cloud Storage bucket and NAMESPACE_PATH is an optional Cloud Storage namespace path (this is not a Cloud Datastore namespace). For more information about Cloud Storage namespace paths, see Object name considerations.

The resulting files will be nested deeper than the specified URL prefix. The final output URL will be provided in the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That value should be used for subsequent ImportEntities operations.

By nesting the data files deeper, the same Cloud Storage bucket can be used in multiple ExportEntities operations without conflict.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<ExportEntitiesResponse, ExportEntitiesMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
EntityFilter entityFilter = new EntityFilter();
string outputUrlPrefix = "";
// Make the request
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> response = await datastoreAdminClient.ExportEntitiesAsync(projectId, labels, entityFilter, outputUrlPrefix);

// Poll until the returned long-running operation is complete
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ExportEntitiesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ExportEntitiesResponse, ExportEntitiesMetadata> retrievedResponse = await datastoreAdminClient.PollOnceExportEntitiesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ExportEntitiesResponse retrievedResult = retrievedResponse.Result;
}

GetIndex(GetIndexRequest, CallSettings)

public virtual Index GetIndex(GetIndexRequest request, CallSettings callSettings = null)

Gets an index.

Parameters
NameDescription
requestGetIndexRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Index

The RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();
// Initialize request argument(s)
GetIndexRequest request = new GetIndexRequest
{
    ProjectId = "",
    IndexId = "",
};
// Make the request
gcdav::Index response = datastoreAdminClient.GetIndex(request);

GetIndexAsync(GetIndexRequest, CallSettings)

public virtual Task<Index> GetIndexAsync(GetIndexRequest request, CallSettings callSettings = null)

Gets an index.

Parameters
NameDescription
requestGetIndexRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Index>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
GetIndexRequest request = new GetIndexRequest
{
    ProjectId = "",
    IndexId = "",
};
// Make the request
gcdav::Index response = await datastoreAdminClient.GetIndexAsync(request);

GetIndexAsync(GetIndexRequest, CancellationToken)

public virtual Task<Index> GetIndexAsync(GetIndexRequest request, CancellationToken cancellationToken)

Gets an index.

Parameters
NameDescription
requestGetIndexRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Index>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
GetIndexRequest request = new GetIndexRequest
{
    ProjectId = "",
    IndexId = "",
};
// Make the request
gcdav::Index response = await datastoreAdminClient.GetIndexAsync(request);

ImportEntities(ImportEntitiesRequest, CallSettings)

public virtual Operation<Empty, ImportEntitiesMetadata> ImportEntities(ImportEntitiesRequest request, CallSettings callSettings = null)

Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.

Parameters
NameDescription
requestImportEntitiesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, ImportEntitiesMetadata>

The RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();
// Initialize request argument(s)
ImportEntitiesRequest request = new ImportEntitiesRequest
{
    ProjectId = "",
    Labels = { { "", "" }, },
    InputUrl = "",
    EntityFilter = new EntityFilter(),
};
// Make the request
Operation<Empty, ImportEntitiesMetadata> response = datastoreAdminClient.ImportEntities(request);

// Poll until the returned long-running operation is complete
Operation<Empty, ImportEntitiesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ImportEntitiesMetadata> retrievedResponse = datastoreAdminClient.PollOnceImportEntities(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

ImportEntities(String, IDictionary<String, String>, String, EntityFilter, CallSettings)

public virtual Operation<Empty, ImportEntitiesMetadata> ImportEntities(string projectId, IDictionary<string, string> labels, string inputUrl, EntityFilter entityFilter, CallSettings callSettings = null)

Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.

Parameters
NameDescription
projectIdString

Required. Project ID against which to make the request.

labelsIDictionary<String, String>

Client-assigned labels.

inputUrlString

Required. The full resource URL of the external storage location. Currently, only Google Cloud Storage is supported. So input_url should be of the form: gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE, where BUCKET_NAME is the name of the Cloud Storage bucket, NAMESPACE_PATH is an optional Cloud Storage namespace path (this is not a Cloud Datastore namespace), and OVERALL_EXPORT_METADATA_FILE is the metadata file written by the ExportEntities operation. For more information about Cloud Storage namespace paths, see Object name considerations.

For more information, see [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].

entityFilterEntityFilter

Optionally specify which kinds/namespaces are to be imported. If provided, the list must be a subset of the EntityFilter used in creating the export, otherwise a FAILED_PRECONDITION error will be returned. If no filter is specified then all entities from the export are imported.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, ImportEntitiesMetadata>

The RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
string inputUrl = "";
EntityFilter entityFilter = new EntityFilter();
// Make the request
Operation<Empty, ImportEntitiesMetadata> response = datastoreAdminClient.ImportEntities(projectId, labels, inputUrl, entityFilter);

// Poll until the returned long-running operation is complete
Operation<Empty, ImportEntitiesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ImportEntitiesMetadata> retrievedResponse = datastoreAdminClient.PollOnceImportEntities(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

ImportEntitiesAsync(ImportEntitiesRequest, CallSettings)

public virtual Task<Operation<Empty, ImportEntitiesMetadata>> ImportEntitiesAsync(ImportEntitiesRequest request, CallSettings callSettings = null)

Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.

Parameters
NameDescription
requestImportEntitiesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, ImportEntitiesMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
ImportEntitiesRequest request = new ImportEntitiesRequest
{
    ProjectId = "",
    Labels = { { "", "" }, },
    InputUrl = "",
    EntityFilter = new EntityFilter(),
};
// Make the request
Operation<Empty, ImportEntitiesMetadata> response = await datastoreAdminClient.ImportEntitiesAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, ImportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ImportEntitiesMetadata> retrievedResponse = await datastoreAdminClient.PollOnceImportEntitiesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

ImportEntitiesAsync(ImportEntitiesRequest, CancellationToken)

public virtual Task<Operation<Empty, ImportEntitiesMetadata>> ImportEntitiesAsync(ImportEntitiesRequest request, CancellationToken cancellationToken)

Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.

Parameters
NameDescription
requestImportEntitiesRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, ImportEntitiesMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
ImportEntitiesRequest request = new ImportEntitiesRequest
{
    ProjectId = "",
    Labels = { { "", "" }, },
    InputUrl = "",
    EntityFilter = new EntityFilter(),
};
// Make the request
Operation<Empty, ImportEntitiesMetadata> response = await datastoreAdminClient.ImportEntitiesAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, ImportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ImportEntitiesMetadata> retrievedResponse = await datastoreAdminClient.PollOnceImportEntitiesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

ImportEntitiesAsync(String, IDictionary<String, String>, String, EntityFilter, CallSettings)

public virtual Task<Operation<Empty, ImportEntitiesMetadata>> ImportEntitiesAsync(string projectId, IDictionary<string, string> labels, string inputUrl, EntityFilter entityFilter, CallSettings callSettings = null)

Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.

Parameters
NameDescription
projectIdString

Required. Project ID against which to make the request.

labelsIDictionary<String, String>

Client-assigned labels.

inputUrlString

Required. The full resource URL of the external storage location. Currently, only Google Cloud Storage is supported. So input_url should be of the form: gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE, where BUCKET_NAME is the name of the Cloud Storage bucket, NAMESPACE_PATH is an optional Cloud Storage namespace path (this is not a Cloud Datastore namespace), and OVERALL_EXPORT_METADATA_FILE is the metadata file written by the ExportEntities operation. For more information about Cloud Storage namespace paths, see Object name considerations.

For more information, see [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].

entityFilterEntityFilter

Optionally specify which kinds/namespaces are to be imported. If provided, the list must be a subset of the EntityFilter used in creating the export, otherwise a FAILED_PRECONDITION error will be returned. If no filter is specified then all entities from the export are imported.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, ImportEntitiesMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
string inputUrl = "";
EntityFilter entityFilter = new EntityFilter();
// Make the request
Operation<Empty, ImportEntitiesMetadata> response = await datastoreAdminClient.ImportEntitiesAsync(projectId, labels, inputUrl, entityFilter);

// Poll until the returned long-running operation is complete
Operation<Empty, ImportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ImportEntitiesMetadata> retrievedResponse = await datastoreAdminClient.PollOnceImportEntitiesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

ImportEntitiesAsync(String, IDictionary<String, String>, String, EntityFilter, CancellationToken)

public virtual Task<Operation<Empty, ImportEntitiesMetadata>> ImportEntitiesAsync(string projectId, IDictionary<string, string> labels, string inputUrl, EntityFilter entityFilter, CancellationToken cancellationToken)

Imports entities into Google Cloud Datastore. Existing entities with the same key are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportEntities operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Datastore.

Parameters
NameDescription
projectIdString

Required. Project ID against which to make the request.

labelsIDictionary<String, String>

Client-assigned labels.

inputUrlString

Required. The full resource URL of the external storage location. Currently, only Google Cloud Storage is supported. So input_url should be of the form: gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE, where BUCKET_NAME is the name of the Cloud Storage bucket, NAMESPACE_PATH is an optional Cloud Storage namespace path (this is not a Cloud Datastore namespace), and OVERALL_EXPORT_METADATA_FILE is the metadata file written by the ExportEntities operation. For more information about Cloud Storage namespace paths, see Object name considerations.

For more information, see [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].

entityFilterEntityFilter

Optionally specify which kinds/namespaces are to be imported. If provided, the list must be a subset of the EntityFilter used in creating the export, otherwise a FAILED_PRECONDITION error will be returned. If no filter is specified then all entities from the export are imported.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, ImportEntitiesMetadata>>

A Task containing the RPC response.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
string inputUrl = "";
EntityFilter entityFilter = new EntityFilter();
// Make the request
Operation<Empty, ImportEntitiesMetadata> response = await datastoreAdminClient.ImportEntitiesAsync(projectId, labels, inputUrl, entityFilter);

// Poll until the returned long-running operation is complete
Operation<Empty, ImportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ImportEntitiesMetadata> retrievedResponse = await datastoreAdminClient.PollOnceImportEntitiesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

ListIndexes(ListIndexesRequest, CallSettings)

public virtual PagedEnumerable<ListIndexesResponse, Index> ListIndexes(ListIndexesRequest request, CallSettings callSettings = null)

Lists the indexes that match the specified filters. Datastore uses an eventually consistent query to fetch the list of indexes and may occasionally return stale results.

Parameters
NameDescription
requestListIndexesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListIndexesResponse, Index>

A pageable sequence of Index resources.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = DatastoreAdminClient.Create();
// Initialize request argument(s)
ListIndexesRequest request = new ListIndexesRequest
{
    ProjectId = "",
    Filter = "",
};
// Make the request
PagedEnumerable<ListIndexesResponse, gcdav::Index> response = datastoreAdminClient.ListIndexes(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (gcdav::Index item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListIndexesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gcdav::Index item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcdav::Index> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcdav::Index item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListIndexesAsync(ListIndexesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListIndexesResponse, Index> ListIndexesAsync(ListIndexesRequest request, CallSettings callSettings = null)

Lists the indexes that match the specified filters. Datastore uses an eventually consistent query to fetch the list of indexes and may occasionally return stale results.

Parameters
NameDescription
requestListIndexesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListIndexesResponse, Index>

A pageable asynchronous sequence of Index resources.

Example
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
ListIndexesRequest request = new ListIndexesRequest
{
    ProjectId = "",
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListIndexesResponse, gcdav::Index> response = datastoreAdminClient.ListIndexesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gcdav::Index item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListIndexesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (gcdav::Index item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcdav::Index> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcdav::Index item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PollOnceCreateIndex(String, CallSettings)

public virtual Operation<Index, IndexOperationMetadata> PollOnceCreateIndex(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of CreateIndex.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Index, IndexOperationMetadata>

The result of polling the operation.

PollOnceCreateIndexAsync(String, CallSettings)

public virtual Task<Operation<Index, IndexOperationMetadata>> PollOnceCreateIndexAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of CreateIndex.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Index, IndexOperationMetadata>>

A task representing the result of polling the operation.

PollOnceDeleteIndex(String, CallSettings)

public virtual Operation<Index, IndexOperationMetadata> PollOnceDeleteIndex(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of DeleteIndex.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Index, IndexOperationMetadata>

The result of polling the operation.

PollOnceDeleteIndexAsync(String, CallSettings)

public virtual Task<Operation<Index, IndexOperationMetadata>> PollOnceDeleteIndexAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of DeleteIndex.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Index, IndexOperationMetadata>>

A task representing the result of polling the operation.

PollOnceExportEntities(String, CallSettings)

public virtual Operation<ExportEntitiesResponse, ExportEntitiesMetadata> PollOnceExportEntities(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of ExportEntities.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<ExportEntitiesResponse, ExportEntitiesMetadata>

The result of polling the operation.

PollOnceExportEntitiesAsync(String, CallSettings)

public virtual Task<Operation<ExportEntitiesResponse, ExportEntitiesMetadata>> PollOnceExportEntitiesAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of ExportEntities.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<ExportEntitiesResponse, ExportEntitiesMetadata>>

A task representing the result of polling the operation.

PollOnceImportEntities(String, CallSettings)

public virtual Operation<Empty, ImportEntitiesMetadata> PollOnceImportEntities(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of ImportEntities.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, ImportEntitiesMetadata>

The result of polling the operation.

PollOnceImportEntitiesAsync(String, CallSettings)

public virtual Task<Operation<Empty, ImportEntitiesMetadata>> PollOnceImportEntitiesAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of ImportEntities.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, ImportEntitiesMetadata>>

A task representing the result of polling the operation.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.