- 3.10.0 (latest)
- 3.9.0
- 3.8.0
- 3.7.0
- 3.6.0
- 3.5.0
- 3.4.0
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.0
- 2.28.0
- 2.27.0
- 2.26.0
- 2.25.0
- 2.24.0
- 2.23.0
- 2.22.0
- 2.21.0
- 2.20.0
- 2.19.0
- 2.18.0
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.0
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
public abstract class IndexServiceClient
IndexService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.AIPlatform.V1Assembly
Google.Cloud.AIPlatform.V1.dll
Remarks
A service for creating and managing Vertex AI's Index resources.
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 IndexService service, which is a host of "aiplatform.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default IndexService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default IndexService scopes are:
DeleteIndexOperationsClient
public virtual OperationsClient DeleteIndexOperationsClient { get; }
The long-running operations client for DeleteIndex
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
GrpcClient
public virtual IndexService.IndexServiceClient GrpcClient { get; }
The underlying gRPC IndexService client
Property Value | |
---|---|
Type | Description |
IndexService.IndexServiceClient |
UpdateIndexOperationsClient
public virtual OperationsClient UpdateIndexOperationsClient { get; }
The long-running operations client for UpdateIndex
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
Methods
Create()
public static IndexServiceClient Create()
Synchronously creates a IndexServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use IndexServiceClientBuilder.
Returns | |
---|---|
Type | Description |
IndexServiceClient | The created IndexServiceClient. |
CreateAsync(CancellationToken)
public static Task<IndexServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a IndexServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use IndexServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<IndexServiceClient> | The task representing the created IndexServiceClient. |
CreateIndex(LocationName, Index, CallSettings)
public virtual Operation<Index, CreateIndexOperationMetadata> CreateIndex(LocationName parent, Index index, CallSettings callSettings = null)
Creates an Index.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the Location to create the Index in.
Format: |
index | Index Required. The Index to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Index, CreateIndexOperationMetadata> | The RPC response. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcav::Index index = new gcav::Index();
// Make the request
Operation<gcav::Index, CreateIndexOperationMetadata> response = indexServiceClient.CreateIndex(parent, index);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, CreateIndexOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcav::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<gcav::Index, CreateIndexOperationMetadata> retrievedResponse = indexServiceClient.PollOnceCreateIndex(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
CreateIndex(CreateIndexRequest, CallSettings)
public virtual Operation<Index, CreateIndexOperationMetadata> CreateIndex(CreateIndexRequest request, CallSettings callSettings = null)
Creates an Index.
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 |
Operation<Index, CreateIndexOperationMetadata> | The RPC response. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
CreateIndexRequest request = new CreateIndexRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Index = new gcav::Index(),
};
// Make the request
Operation<gcav::Index, CreateIndexOperationMetadata> response = indexServiceClient.CreateIndex(request);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, CreateIndexOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcav::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<gcav::Index, CreateIndexOperationMetadata> retrievedResponse = indexServiceClient.PollOnceCreateIndex(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
CreateIndex(String, Index, CallSettings)
public virtual Operation<Index, CreateIndexOperationMetadata> CreateIndex(string parent, Index index, CallSettings callSettings = null)
Creates an Index.
Parameters | |
---|---|
Name | Description |
parent | String Required. The resource name of the Location to create the Index in.
Format: |
index | Index Required. The Index to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Index, CreateIndexOperationMetadata> | The RPC response. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcav::Index index = new gcav::Index();
// Make the request
Operation<gcav::Index, CreateIndexOperationMetadata> response = indexServiceClient.CreateIndex(parent, index);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, CreateIndexOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcav::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<gcav::Index, CreateIndexOperationMetadata> retrievedResponse = indexServiceClient.PollOnceCreateIndex(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
CreateIndexAsync(LocationName, Index, CallSettings)
public virtual Task<Operation<Index, CreateIndexOperationMetadata>> CreateIndexAsync(LocationName parent, Index index, CallSettings callSettings = null)
Creates an Index.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the Location to create the Index in.
Format: |
index | Index Required. The Index to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Index, CreateIndexOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcav::Index index = new gcav::Index();
// Make the request
Operation<gcav::Index, CreateIndexOperationMetadata> response = await indexServiceClient.CreateIndexAsync(parent, index);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, CreateIndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcav::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<gcav::Index, CreateIndexOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceCreateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
CreateIndexAsync(LocationName, Index, CancellationToken)
public virtual Task<Operation<Index, CreateIndexOperationMetadata>> CreateIndexAsync(LocationName parent, Index index, CancellationToken cancellationToken)
Creates an Index.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the Location to create the Index in.
Format: |
index | Index Required. The Index to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Index, CreateIndexOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
gcav::Index index = new gcav::Index();
// Make the request
Operation<gcav::Index, CreateIndexOperationMetadata> response = await indexServiceClient.CreateIndexAsync(parent, index);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, CreateIndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcav::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<gcav::Index, CreateIndexOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceCreateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
CreateIndexAsync(CreateIndexRequest, CallSettings)
public virtual Task<Operation<Index, CreateIndexOperationMetadata>> CreateIndexAsync(CreateIndexRequest request, CallSettings callSettings = null)
Creates an Index.
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 |
Task<Operation<Index, CreateIndexOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
CreateIndexRequest request = new CreateIndexRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Index = new gcav::Index(),
};
// Make the request
Operation<gcav::Index, CreateIndexOperationMetadata> response = await indexServiceClient.CreateIndexAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, CreateIndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcav::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<gcav::Index, CreateIndexOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceCreateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
CreateIndexAsync(CreateIndexRequest, CancellationToken)
public virtual Task<Operation<Index, CreateIndexOperationMetadata>> CreateIndexAsync(CreateIndexRequest request, CancellationToken cancellationToken)
Creates an Index.
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 |
Task<Operation<Index, CreateIndexOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
CreateIndexRequest request = new CreateIndexRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Index = new gcav::Index(),
};
// Make the request
Operation<gcav::Index, CreateIndexOperationMetadata> response = await indexServiceClient.CreateIndexAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, CreateIndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcav::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<gcav::Index, CreateIndexOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceCreateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
CreateIndexAsync(String, Index, CallSettings)
public virtual Task<Operation<Index, CreateIndexOperationMetadata>> CreateIndexAsync(string parent, Index index, CallSettings callSettings = null)
Creates an Index.
Parameters | |
---|---|
Name | Description |
parent | String Required. The resource name of the Location to create the Index in.
Format: |
index | Index Required. The Index to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Index, CreateIndexOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcav::Index index = new gcav::Index();
// Make the request
Operation<gcav::Index, CreateIndexOperationMetadata> response = await indexServiceClient.CreateIndexAsync(parent, index);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, CreateIndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcav::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<gcav::Index, CreateIndexOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceCreateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
CreateIndexAsync(String, Index, CancellationToken)
public virtual Task<Operation<Index, CreateIndexOperationMetadata>> CreateIndexAsync(string parent, Index index, CancellationToken cancellationToken)
Creates an Index.
Parameters | |
---|---|
Name | Description |
parent | String Required. The resource name of the Location to create the Index in.
Format: |
index | Index Required. The Index to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Index, CreateIndexOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
gcav::Index index = new gcav::Index();
// Make the request
Operation<gcav::Index, CreateIndexOperationMetadata> response = await indexServiceClient.CreateIndexAsync(parent, index);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, CreateIndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcav::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<gcav::Index, CreateIndexOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceCreateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
DeleteIndex(DeleteIndexRequest, CallSettings)
public virtual Operation<Empty, DeleteOperationMetadata> DeleteIndex(DeleteIndexRequest request, CallSettings callSettings = null)
Deletes an Index. An Index can only be deleted when all its [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed.
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 |
Operation<Empty, DeleteOperationMetadata> | The RPC response. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
DeleteIndexRequest request = new DeleteIndexRequest
{
IndexName = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]"),
};
// Make the request
Operation<Empty, DeleteOperationMetadata> response = indexServiceClient.DeleteIndex(request);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> 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, DeleteOperationMetadata> retrievedResponse = indexServiceClient.PollOnceDeleteIndex(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;
}
DeleteIndex(IndexName, CallSettings)
public virtual Operation<Empty, DeleteOperationMetadata> DeleteIndex(IndexName name, CallSettings callSettings = null)
Deletes an Index. An Index can only be deleted when all its [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed.
Parameters | |
---|---|
Name | Description |
name | IndexName Required. The name of the Index resource to be deleted.
Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Empty, DeleteOperationMetadata> | The RPC response. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
IndexName name = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]");
// Make the request
Operation<Empty, DeleteOperationMetadata> response = indexServiceClient.DeleteIndex(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> 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, DeleteOperationMetadata> retrievedResponse = indexServiceClient.PollOnceDeleteIndex(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;
}
DeleteIndex(String, CallSettings)
public virtual Operation<Empty, DeleteOperationMetadata> DeleteIndex(string name, CallSettings callSettings = null)
Deletes an Index. An Index can only be deleted when all its [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the Index resource to be deleted.
Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Empty, DeleteOperationMetadata> | The RPC response. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/indexes/[INDEX]";
// Make the request
Operation<Empty, DeleteOperationMetadata> response = indexServiceClient.DeleteIndex(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> 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, DeleteOperationMetadata> retrievedResponse = indexServiceClient.PollOnceDeleteIndex(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;
}
DeleteIndexAsync(DeleteIndexRequest, CallSettings)
public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteIndexAsync(DeleteIndexRequest request, CallSettings callSettings = null)
Deletes an Index. An Index can only be deleted when all its [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed.
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 |
Task<Operation<Empty, DeleteOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteIndexRequest request = new DeleteIndexRequest
{
IndexName = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]"),
};
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await indexServiceClient.DeleteIndexAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> 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, DeleteOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceDeleteIndexAsync(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;
}
DeleteIndexAsync(DeleteIndexRequest, CancellationToken)
public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteIndexAsync(DeleteIndexRequest request, CancellationToken cancellationToken)
Deletes an Index. An Index can only be deleted when all its [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed.
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 |
Task<Operation<Empty, DeleteOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteIndexRequest request = new DeleteIndexRequest
{
IndexName = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]"),
};
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await indexServiceClient.DeleteIndexAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> 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, DeleteOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceDeleteIndexAsync(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;
}
DeleteIndexAsync(IndexName, CallSettings)
public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteIndexAsync(IndexName name, CallSettings callSettings = null)
Deletes an Index. An Index can only be deleted when all its [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed.
Parameters | |
---|---|
Name | Description |
name | IndexName Required. The name of the Index resource to be deleted.
Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, DeleteOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
IndexName name = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]");
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await indexServiceClient.DeleteIndexAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> 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, DeleteOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceDeleteIndexAsync(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;
}
DeleteIndexAsync(IndexName, CancellationToken)
public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteIndexAsync(IndexName name, CancellationToken cancellationToken)
Deletes an Index. An Index can only be deleted when all its [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed.
Parameters | |
---|---|
Name | Description |
name | IndexName Required. The name of the Index resource to be deleted.
Format:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, DeleteOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
IndexName name = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]");
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await indexServiceClient.DeleteIndexAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> 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, DeleteOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceDeleteIndexAsync(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;
}
DeleteIndexAsync(String, CallSettings)
public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteIndexAsync(string name, CallSettings callSettings = null)
Deletes an Index. An Index can only be deleted when all its [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the Index resource to be deleted.
Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, DeleteOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/indexes/[INDEX]";
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await indexServiceClient.DeleteIndexAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> 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, DeleteOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceDeleteIndexAsync(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;
}
DeleteIndexAsync(String, CancellationToken)
public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteIndexAsync(string name, CancellationToken cancellationToken)
Deletes an Index. An Index can only be deleted when all its [DeployedIndexes][google.cloud.aiplatform.v1.Index.deployed_indexes] had been undeployed.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the Index resource to be deleted.
Format:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, DeleteOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/indexes/[INDEX]";
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await indexServiceClient.DeleteIndexAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> 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, DeleteOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceDeleteIndexAsync(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;
}
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
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
GetIndexRequest request = new GetIndexRequest
{
IndexName = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]"),
};
// Make the request
gcav::Index response = indexServiceClient.GetIndex(request);
GetIndex(IndexName, CallSettings)
public virtual Index GetIndex(IndexName name, CallSettings callSettings = null)
Gets an Index.
Parameters | |
---|---|
Name | Description |
name | IndexName Required. The name of the Index resource.
Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Index | The RPC response. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
IndexName name = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]");
// Make the request
gcav::Index response = indexServiceClient.GetIndex(name);
GetIndex(String, CallSettings)
public virtual Index GetIndex(string name, CallSettings callSettings = null)
Gets an Index.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the Index resource.
Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Index | The RPC response. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/indexes/[INDEX]";
// Make the request
gcav::Index response = indexServiceClient.GetIndex(name);
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 |
Task<Index> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
GetIndexRequest request = new GetIndexRequest
{
IndexName = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]"),
};
// Make the request
gcav::Index response = await indexServiceClient.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 |
Task<Index> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
GetIndexRequest request = new GetIndexRequest
{
IndexName = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]"),
};
// Make the request
gcav::Index response = await indexServiceClient.GetIndexAsync(request);
GetIndexAsync(IndexName, CallSettings)
public virtual Task<Index> GetIndexAsync(IndexName name, CallSettings callSettings = null)
Gets an Index.
Parameters | |
---|---|
Name | Description |
name | IndexName Required. The name of the Index resource.
Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Index> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
IndexName name = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]");
// Make the request
gcav::Index response = await indexServiceClient.GetIndexAsync(name);
GetIndexAsync(IndexName, CancellationToken)
public virtual Task<Index> GetIndexAsync(IndexName name, CancellationToken cancellationToken)
Gets an Index.
Parameters | |
---|---|
Name | Description |
name | IndexName Required. The name of the Index resource.
Format:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Index> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
IndexName name = IndexName.FromProjectLocationIndex("[PROJECT]", "[LOCATION]", "[INDEX]");
// Make the request
gcav::Index response = await indexServiceClient.GetIndexAsync(name);
GetIndexAsync(String, CallSettings)
public virtual Task<Index> GetIndexAsync(string name, CallSettings callSettings = null)
Gets an Index.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the Index resource.
Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Index> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/indexes/[INDEX]";
// Make the request
gcav::Index response = await indexServiceClient.GetIndexAsync(name);
GetIndexAsync(String, CancellationToken)
public virtual Task<Index> GetIndexAsync(string name, CancellationToken cancellationToken)
Gets an Index.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the Index resource.
Format:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Index> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/indexes/[INDEX]";
// Make the request
gcav::Index response = await indexServiceClient.GetIndexAsync(name);
ListIndexes(LocationName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListIndexesResponse, Index> ListIndexes(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists Indexes in a Location.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the Location from which to list the Indexes.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListIndexesResponse, Index> | A pageable sequence of Index resources. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListIndexesResponse, gcav::Index> response = indexServiceClient.ListIndexes(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (gcav::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 (gcav::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<gcav::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 (gcav::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;
ListIndexes(ListIndexesRequest, CallSettings)
public virtual PagedEnumerable<ListIndexesResponse, Index> ListIndexes(ListIndexesRequest request, CallSettings callSettings = null)
Lists Indexes in a Location.
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 |
PagedEnumerable<ListIndexesResponse, Index> | A pageable sequence of Index resources. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
ListIndexesRequest request = new ListIndexesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
ReadMask = new FieldMask(),
};
// Make the request
PagedEnumerable<ListIndexesResponse, gcav::Index> response = indexServiceClient.ListIndexes(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (gcav::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 (gcav::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<gcav::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 (gcav::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;
ListIndexes(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListIndexesResponse, Index> ListIndexes(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists Indexes in a Location.
Parameters | |
---|---|
Name | Description |
parent | String Required. The resource name of the Location from which to list the Indexes.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListIndexesResponse, Index> | A pageable sequence of Index resources. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListIndexesResponse, gcav::Index> response = indexServiceClient.ListIndexes(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (gcav::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 (gcav::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<gcav::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 (gcav::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(LocationName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListIndexesResponse, Index> ListIndexesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists Indexes in a Location.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the Location from which to list the Indexes.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListIndexesResponse, Index> | A pageable asynchronous sequence of Index resources. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListIndexesResponse, gcav::Index> response = indexServiceClient.ListIndexesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gcav::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 (gcav::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<gcav::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 (gcav::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 Indexes in a Location.
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 |
PagedAsyncEnumerable<ListIndexesResponse, Index> | A pageable asynchronous sequence of Index resources. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
ListIndexesRequest request = new ListIndexesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
ReadMask = new FieldMask(),
};
// Make the request
PagedAsyncEnumerable<ListIndexesResponse, gcav::Index> response = indexServiceClient.ListIndexesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gcav::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 (gcav::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<gcav::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 (gcav::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(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListIndexesResponse, Index> ListIndexesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists Indexes in a Location.
Parameters | |
---|---|
Name | Description |
parent | String Required. The resource name of the Location from which to list the Indexes.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListIndexesResponse, Index> | A pageable asynchronous sequence of Index resources. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListIndexesResponse, gcav::Index> response = indexServiceClient.ListIndexesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gcav::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 (gcav::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<gcav::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 (gcav::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, CreateIndexOperationMetadata> 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 |
Operation<Index, CreateIndexOperationMetadata> | The result of polling the operation. |
PollOnceCreateIndexAsync(String, CallSettings)
public virtual Task<Operation<Index, CreateIndexOperationMetadata>> 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 |
Task<Operation<Index, CreateIndexOperationMetadata>> | A task representing the result of polling the operation. |
PollOnceDeleteIndex(String, CallSettings)
public virtual Operation<Empty, DeleteOperationMetadata> 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 |
Operation<Empty, DeleteOperationMetadata> | The result of polling the operation. |
PollOnceDeleteIndexAsync(String, CallSettings)
public virtual Task<Operation<Empty, DeleteOperationMetadata>> 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 |
Task<Operation<Empty, DeleteOperationMetadata>> | A task representing the result of polling the operation. |
PollOnceUpdateIndex(String, CallSettings)
public virtual Operation<Index, UpdateIndexOperationMetadata> PollOnceUpdateIndex(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of UpdateIndex
.
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 |
Operation<Index, UpdateIndexOperationMetadata> | The result of polling the operation. |
PollOnceUpdateIndexAsync(String, CallSettings)
public virtual Task<Operation<Index, UpdateIndexOperationMetadata>> PollOnceUpdateIndexAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
UpdateIndex
.
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 |
Task<Operation<Index, UpdateIndexOperationMetadata>> | 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.
UpdateIndex(Index, FieldMask, CallSettings)
public virtual Operation<Index, UpdateIndexOperationMetadata> UpdateIndex(Index index, FieldMask updateMask, CallSettings callSettings = null)
Updates an Index.
Parameters | |
---|---|
Name | Description |
index | Index Required. The Index which updates the resource on the server. |
updateMask | FieldMask The update mask applies to the resource.
For the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Index, UpdateIndexOperationMetadata> | The RPC response. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
gcav::Index index = new gcav::Index();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<gcav::Index, UpdateIndexOperationMetadata> response = indexServiceClient.UpdateIndex(index, updateMask);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, UpdateIndexOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcav::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<gcav::Index, UpdateIndexOperationMetadata> retrievedResponse = indexServiceClient.PollOnceUpdateIndex(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
UpdateIndex(UpdateIndexRequest, CallSettings)
public virtual Operation<Index, UpdateIndexOperationMetadata> UpdateIndex(UpdateIndexRequest request, CallSettings callSettings = null)
Updates an Index.
Parameters | |
---|---|
Name | Description |
request | UpdateIndexRequest 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 |
Operation<Index, UpdateIndexOperationMetadata> | The RPC response. |
// Create client
IndexServiceClient indexServiceClient = IndexServiceClient.Create();
// Initialize request argument(s)
UpdateIndexRequest request = new UpdateIndexRequest
{
Index = new gcav::Index(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<gcav::Index, UpdateIndexOperationMetadata> response = indexServiceClient.UpdateIndex(request);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, UpdateIndexOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcav::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<gcav::Index, UpdateIndexOperationMetadata> retrievedResponse = indexServiceClient.PollOnceUpdateIndex(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
UpdateIndexAsync(Index, FieldMask, CallSettings)
public virtual Task<Operation<Index, UpdateIndexOperationMetadata>> UpdateIndexAsync(Index index, FieldMask updateMask, CallSettings callSettings = null)
Updates an Index.
Parameters | |
---|---|
Name | Description |
index | Index Required. The Index which updates the resource on the server. |
updateMask | FieldMask The update mask applies to the resource.
For the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Index, UpdateIndexOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
gcav::Index index = new gcav::Index();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<gcav::Index, UpdateIndexOperationMetadata> response = await indexServiceClient.UpdateIndexAsync(index, updateMask);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, UpdateIndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcav::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<gcav::Index, UpdateIndexOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceUpdateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
UpdateIndexAsync(Index, FieldMask, CancellationToken)
public virtual Task<Operation<Index, UpdateIndexOperationMetadata>> UpdateIndexAsync(Index index, FieldMask updateMask, CancellationToken cancellationToken)
Updates an Index.
Parameters | |
---|---|
Name | Description |
index | Index Required. The Index which updates the resource on the server. |
updateMask | FieldMask The update mask applies to the resource.
For the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Index, UpdateIndexOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
gcav::Index index = new gcav::Index();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<gcav::Index, UpdateIndexOperationMetadata> response = await indexServiceClient.UpdateIndexAsync(index, updateMask);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, UpdateIndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcav::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<gcav::Index, UpdateIndexOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceUpdateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
UpdateIndexAsync(UpdateIndexRequest, CallSettings)
public virtual Task<Operation<Index, UpdateIndexOperationMetadata>> UpdateIndexAsync(UpdateIndexRequest request, CallSettings callSettings = null)
Updates an Index.
Parameters | |
---|---|
Name | Description |
request | UpdateIndexRequest 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 |
Task<Operation<Index, UpdateIndexOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateIndexRequest request = new UpdateIndexRequest
{
Index = new gcav::Index(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<gcav::Index, UpdateIndexOperationMetadata> response = await indexServiceClient.UpdateIndexAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, UpdateIndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcav::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<gcav::Index, UpdateIndexOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceUpdateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}
UpdateIndexAsync(UpdateIndexRequest, CancellationToken)
public virtual Task<Operation<Index, UpdateIndexOperationMetadata>> UpdateIndexAsync(UpdateIndexRequest request, CancellationToken cancellationToken)
Updates an Index.
Parameters | |
---|---|
Name | Description |
request | UpdateIndexRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Index, UpdateIndexOperationMetadata>> | A Task containing the RPC response. |
// Create client
IndexServiceClient indexServiceClient = await IndexServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateIndexRequest request = new UpdateIndexRequest
{
Index = new gcav::Index(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<gcav::Index, UpdateIndexOperationMetadata> response = await indexServiceClient.UpdateIndexAsync(request);
// Poll until the returned long-running operation is complete
Operation<gcav::Index, UpdateIndexOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcav::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<gcav::Index, UpdateIndexOperationMetadata> retrievedResponse = await indexServiceClient.PollOnceUpdateIndexAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcav::Index retrievedResult = retrievedResponse.Result;
}