public abstract class DatastoreAdminClient
Reference documentation and code samples for the Cloud Datastore v1 API class DatastoreAdminClient.
DatastoreAdmin client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Datastore.Admin.V1Assembly
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).
Export/Import Service:
- 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 Service:
- 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 Service:
- 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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default DatastoreAdmin scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default DatastoreAdmin scopes are:
DeleteIndexOperationsClient
public virtual OperationsClient DeleteIndexOperationsClient { get; }
The long-running operations client for DeleteIndex
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
ExportEntitiesOperationsClient
public virtual OperationsClient ExportEntitiesOperationsClient { get; }
The long-running operations client for ExportEntities
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
GrpcClient
public virtual DatastoreAdmin.DatastoreAdminClient GrpcClient { get; }
The underlying gRPC DatastoreAdmin client
Property Value | |
---|---|
Type | Description |
DatastoreAdminDatastoreAdminClient |
ImportEntitiesOperationsClient
public virtual OperationsClient ImportEntitiesOperationsClient { get; }
The long-running operations client for ImportEntities
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
DatastoreAdminClient |
The created DatastoreAdminClient. |
CreateAsync(CancellationToken)
public static Task<DatastoreAdminClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a DatastoreAdminClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DatastoreAdminClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken |
CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskDatastoreAdminClient |
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 | |
---|---|
Name | Description |
request |
CreateIndexRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationIndexIndexOperationMetadata |
The RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = gcdav::DatastoreAdminClient.Create();
// Initialize request argument(s)
gcdav::CreateIndexRequest request = new gcdav::CreateIndexRequest
{
ProjectId = "",
Index = new gcdav::Index(),
};
// Make the request
Operation<gcdav::Index, gcdav::IndexOperationMetadata> response = datastoreAdminClient.CreateIndex(request);
// Poll until the returned long-running operation is complete
Operation<gcdav::Index, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
request |
CreateIndexRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationIndexIndexOperationMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::CreateIndexRequest request = new gcdav::CreateIndexRequest
{
ProjectId = "",
Index = new gcdav::Index(),
};
// Make the request
Operation<gcdav::Index, gcdav::IndexOperationMetadata> response = await datastoreAdminClient.CreateIndexAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcdav::Index, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
request |
CreateIndexRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationIndexIndexOperationMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::CreateIndexRequest request = new gcdav::CreateIndexRequest
{
ProjectId = "",
Index = new gcdav::Index(),
};
// Make the request
Operation<gcdav::Index, gcdav::IndexOperationMetadata> response = await datastoreAdminClient.CreateIndexAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcdav::Index, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
request |
DeleteIndexRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationIndexIndexOperationMetadata |
The RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = gcdav::DatastoreAdminClient.Create();
// Initialize request argument(s)
gcdav::DeleteIndexRequest request = new gcdav::DeleteIndexRequest
{
ProjectId = "",
IndexId = "",
};
// Make the request
Operation<gcdav::Index, gcdav::IndexOperationMetadata> response = datastoreAdminClient.DeleteIndex(request);
// Poll until the returned long-running operation is complete
Operation<gcdav::Index, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
request |
DeleteIndexRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationIndexIndexOperationMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::DeleteIndexRequest request = new gcdav::DeleteIndexRequest
{
ProjectId = "",
IndexId = "",
};
// Make the request
Operation<gcdav::Index, gcdav::IndexOperationMetadata> response = await datastoreAdminClient.DeleteIndexAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcdav::Index, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
request |
DeleteIndexRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationIndexIndexOperationMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::DeleteIndexRequest request = new gcdav::DeleteIndexRequest
{
ProjectId = "",
IndexId = "",
};
// Make the request
Operation<gcdav::Index, gcdav::IndexOperationMetadata> response = await datastoreAdminClient.DeleteIndexAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcdav::Index, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
request |
ExportEntitiesRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationExportEntitiesResponseExportEntitiesMetadata |
The RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = gcdav::DatastoreAdminClient.Create();
// Initialize request argument(s)
gcdav::ExportEntitiesRequest request = new gcdav::ExportEntitiesRequest
{
ProjectId = "",
Labels = { { "", "" }, },
EntityFilter = new gcdav::EntityFilter(),
OutputUrlPrefix = "",
};
// Make the request
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> response = datastoreAdminClient.ExportEntities(request);
// Poll until the returned long-running operation is complete
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcdav::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<gcdav::ExportEntitiesResponse, gcdav::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
gcdav::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 | |
---|---|
Name | Description |
projectId |
string Required. Project ID against which to make the request. |
labels |
IDictionarystringstring Client-assigned labels. |
entityFilter |
EntityFilter Description of what data from the project is included in the export. |
outputUrlPrefix |
string 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: 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. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationExportEntitiesResponseExportEntitiesMetadata |
The RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = gcdav::DatastoreAdminClient.Create();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
gcdav::EntityFilter entityFilter = new gcdav::EntityFilter();
string outputUrlPrefix = "";
// Make the request
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> response = datastoreAdminClient.ExportEntities(projectId, labels, entityFilter, outputUrlPrefix);
// Poll until the returned long-running operation is complete
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcdav::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<gcdav::ExportEntitiesResponse, gcdav::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
gcdav::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 | |
---|---|
Name | Description |
request |
ExportEntitiesRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationExportEntitiesResponseExportEntitiesMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::ExportEntitiesRequest request = new gcdav::ExportEntitiesRequest
{
ProjectId = "",
Labels = { { "", "" }, },
EntityFilter = new gcdav::EntityFilter(),
OutputUrlPrefix = "",
};
// Make the request
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> response = await datastoreAdminClient.ExportEntitiesAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcdav::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<gcdav::ExportEntitiesResponse, gcdav::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
gcdav::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 | |
---|---|
Name | Description |
request |
ExportEntitiesRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationExportEntitiesResponseExportEntitiesMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::ExportEntitiesRequest request = new gcdav::ExportEntitiesRequest
{
ProjectId = "",
Labels = { { "", "" }, },
EntityFilter = new gcdav::EntityFilter(),
OutputUrlPrefix = "",
};
// Make the request
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> response = await datastoreAdminClient.ExportEntitiesAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcdav::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<gcdav::ExportEntitiesResponse, gcdav::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
gcdav::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 | |
---|---|
Name | Description |
projectId |
string Required. Project ID against which to make the request. |
labels |
IDictionarystringstring Client-assigned labels. |
entityFilter |
EntityFilter Description of what data from the project is included in the export. |
outputUrlPrefix |
string 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: 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. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationExportEntitiesResponseExportEntitiesMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
gcdav::EntityFilter entityFilter = new gcdav::EntityFilter();
string outputUrlPrefix = "";
// Make the request
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> response = await datastoreAdminClient.ExportEntitiesAsync(projectId, labels, entityFilter, outputUrlPrefix);
// Poll until the returned long-running operation is complete
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcdav::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<gcdav::ExportEntitiesResponse, gcdav::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
gcdav::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 | |
---|---|
Name | Description |
projectId |
string Required. Project ID against which to make the request. |
labels |
IDictionarystringstring Client-assigned labels. |
entityFilter |
EntityFilter Description of what data from the project is included in the export. |
outputUrlPrefix |
string 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: 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. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationExportEntitiesResponseExportEntitiesMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
gcdav::EntityFilter entityFilter = new gcdav::EntityFilter();
string outputUrlPrefix = "";
// Make the request
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> response = await datastoreAdminClient.ExportEntitiesAsync(projectId, labels, entityFilter, outputUrlPrefix);
// Poll until the returned long-running operation is complete
Operation<gcdav::ExportEntitiesResponse, gcdav::ExportEntitiesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcdav::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<gcdav::ExportEntitiesResponse, gcdav::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
gcdav::ExportEntitiesResponse retrievedResult = retrievedResponse.Result;
}
GetIndex(GetIndexRequest, CallSettings)
public virtual Index GetIndex(GetIndexRequest request, CallSettings callSettings = null)
Gets an index.
Parameters | |
---|---|
Name | Description |
request |
GetIndexRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Index |
The RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = gcdav::DatastoreAdminClient.Create();
// Initialize request argument(s)
gcdav::GetIndexRequest request = new gcdav::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 | |
---|---|
Name | Description |
request |
GetIndexRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskIndex |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::GetIndexRequest request = new gcdav::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 | |
---|---|
Name | Description |
request |
GetIndexRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskIndex |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::GetIndexRequest request = new gcdav::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 | |
---|---|
Name | Description |
request |
ImportEntitiesRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationEmptyImportEntitiesMetadata |
The RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = gcdav::DatastoreAdminClient.Create();
// Initialize request argument(s)
gcdav::ImportEntitiesRequest request = new gcdav::ImportEntitiesRequest
{
ProjectId = "",
Labels = { { "", "" }, },
InputUrl = "",
EntityFilter = new gcdav::EntityFilter(),
};
// Make the request
Operation<Empty, gcdav::ImportEntitiesMetadata> response = datastoreAdminClient.ImportEntities(request);
// Poll until the returned long-running operation is complete
Operation<Empty, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
projectId |
string Required. Project ID against which to make the request. |
labels |
IDictionarystringstring Client-assigned labels. |
inputUrl |
string 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:
For more information, see [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. |
entityFilter |
EntityFilter 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. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationEmptyImportEntitiesMetadata |
The RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = gcdav::DatastoreAdminClient.Create();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
string inputUrl = "";
gcdav::EntityFilter entityFilter = new gcdav::EntityFilter();
// Make the request
Operation<Empty, gcdav::ImportEntitiesMetadata> response = datastoreAdminClient.ImportEntities(projectId, labels, inputUrl, entityFilter);
// Poll until the returned long-running operation is complete
Operation<Empty, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
request |
ImportEntitiesRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationEmptyImportEntitiesMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::ImportEntitiesRequest request = new gcdav::ImportEntitiesRequest
{
ProjectId = "",
Labels = { { "", "" }, },
InputUrl = "",
EntityFilter = new gcdav::EntityFilter(),
};
// Make the request
Operation<Empty, gcdav::ImportEntitiesMetadata> response = await datastoreAdminClient.ImportEntitiesAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
request |
ImportEntitiesRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationEmptyImportEntitiesMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::ImportEntitiesRequest request = new gcdav::ImportEntitiesRequest
{
ProjectId = "",
Labels = { { "", "" }, },
InputUrl = "",
EntityFilter = new gcdav::EntityFilter(),
};
// Make the request
Operation<Empty, gcdav::ImportEntitiesMetadata> response = await datastoreAdminClient.ImportEntitiesAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
projectId |
string Required. Project ID against which to make the request. |
labels |
IDictionarystringstring Client-assigned labels. |
inputUrl |
string 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:
For more information, see [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. |
entityFilter |
EntityFilter 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. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationEmptyImportEntitiesMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
string inputUrl = "";
gcdav::EntityFilter entityFilter = new gcdav::EntityFilter();
// Make the request
Operation<Empty, gcdav::ImportEntitiesMetadata> response = await datastoreAdminClient.ImportEntitiesAsync(projectId, labels, inputUrl, entityFilter);
// Poll until the returned long-running operation is complete
Operation<Empty, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
projectId |
string Required. Project ID against which to make the request. |
labels |
IDictionarystringstring Client-assigned labels. |
inputUrl |
string 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:
For more information, see [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. |
entityFilter |
EntityFilter 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. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationEmptyImportEntitiesMetadata |
A Task containing the RPC response. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
IDictionary<string, string> labels = new Dictionary<string, string> { { "", "" }, };
string inputUrl = "";
gcdav::EntityFilter entityFilter = new gcdav::EntityFilter();
// Make the request
Operation<Empty, gcdav::ImportEntitiesMetadata> response = await datastoreAdminClient.ImportEntitiesAsync(projectId, labels, inputUrl, entityFilter);
// Poll until the returned long-running operation is complete
Operation<Empty, gcdav::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, gcdav::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 | |
---|---|
Name | Description |
request |
ListIndexesRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListIndexesResponseIndex |
A pageable sequence of Index resources. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = gcdav::DatastoreAdminClient.Create();
// Initialize request argument(s)
gcdav::ListIndexesRequest request = new gcdav::ListIndexesRequest
{
ProjectId = "",
Filter = "",
};
// Make the request
PagedEnumerable<gcdav::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 (gcdav::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 | |
---|---|
Name | Description |
request |
ListIndexesRequest The request object containing all of the parameters for the API call. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListIndexesResponseIndex |
A pageable asynchronous sequence of Index resources. |
// Create client
gcdav::DatastoreAdminClient datastoreAdminClient = await gcdav::DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
gcdav::ListIndexesRequest request = new gcdav::ListIndexesRequest
{
ProjectId = "",
Filter = "",
};
// Make the request
PagedAsyncEnumerable<gcdav::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((gcdav::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 | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationIndexIndexOperationMetadata |
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 | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationIndexIndexOperationMetadata |
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 | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationIndexIndexOperationMetadata |
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 | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationIndexIndexOperationMetadata |
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 | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationExportEntitiesResponseExportEntitiesMetadata |
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 | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationExportEntitiesResponseExportEntitiesMetadata |
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 | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationEmptyImportEntitiesMetadata |
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 | |
---|---|
Name | Description |
operationName |
string The name of a previously invoked operation. Must not be |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationEmptyImportEntitiesMetadata |
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 | |
---|---|
Type | Description |
Task |
A task representing the asynchronous shutdown operation. |
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.