public abstract class InstanceServiceClient
Reference documentation and code samples for the Chronicle v1 API class InstanceServiceClient.
InstanceService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Chronicle.V1Assembly
Google.Cloud.Chronicle.V1.dll
Remarks
InstanceService provides the entry interface for the Chronicle API.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the InstanceService service, which is a host of "chronicle.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default InstanceService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default InstanceService scopes are:
GrpcClient
public virtual InstanceService.InstanceServiceClient GrpcClient { get; }
The underlying gRPC InstanceService client
Property Value | |
---|---|
Type | Description |
InstanceServiceInstanceServiceClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
Methods
Create()
public static InstanceServiceClient Create()
Synchronously creates a InstanceServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use InstanceServiceClientBuilder.
Returns | |
---|---|
Type | Description |
InstanceServiceClient |
The created InstanceServiceClient. |
CreateAsync(CancellationToken)
public static Task<InstanceServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a InstanceServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use InstanceServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken |
CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskInstanceServiceClient |
The task representing the created InstanceServiceClient. |
GetInstance(GetInstanceRequest, CallSettings)
public virtual Instance GetInstance(GetInstanceRequest request, CallSettings callSettings = null)
Gets a Instance.
Parameters | |
---|---|
Name | Description |
request |
GetInstanceRequest 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 |
Instance |
The RPC response. |
// Create client
InstanceServiceClient instanceServiceClient = InstanceServiceClient.Create();
// Initialize request argument(s)
GetInstanceRequest request = new GetInstanceRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
};
// Make the request
Instance response = instanceServiceClient.GetInstance(request);
GetInstance(InstanceName, CallSettings)
public virtual Instance GetInstance(InstanceName name, CallSettings callSettings = null)
Gets a Instance.
Parameters | |
---|---|
Name | Description |
name |
InstanceName Required. The name of the instance to retrieve.
Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Instance |
The RPC response. |
// Create client
InstanceServiceClient instanceServiceClient = InstanceServiceClient.Create();
// Initialize request argument(s)
InstanceName name = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Instance response = instanceServiceClient.GetInstance(name);
GetInstance(string, CallSettings)
public virtual Instance GetInstance(string name, CallSettings callSettings = null)
Gets a Instance.
Parameters | |
---|---|
Name | Description |
name |
string Required. The name of the instance to retrieve.
Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Instance |
The RPC response. |
// Create client
InstanceServiceClient instanceServiceClient = InstanceServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Instance response = instanceServiceClient.GetInstance(name);
GetInstanceAsync(GetInstanceRequest, CallSettings)
public virtual Task<Instance> GetInstanceAsync(GetInstanceRequest request, CallSettings callSettings = null)
Gets a Instance.
Parameters | |
---|---|
Name | Description |
request |
GetInstanceRequest 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 |
TaskInstance |
A Task containing the RPC response. |
// Create client
InstanceServiceClient instanceServiceClient = await InstanceServiceClient.CreateAsync();
// Initialize request argument(s)
GetInstanceRequest request = new GetInstanceRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
};
// Make the request
Instance response = await instanceServiceClient.GetInstanceAsync(request);
GetInstanceAsync(GetInstanceRequest, CancellationToken)
public virtual Task<Instance> GetInstanceAsync(GetInstanceRequest request, CancellationToken cancellationToken)
Gets a Instance.
Parameters | |
---|---|
Name | Description |
request |
GetInstanceRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
InstanceServiceClient instanceServiceClient = await InstanceServiceClient.CreateAsync();
// Initialize request argument(s)
GetInstanceRequest request = new GetInstanceRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
};
// Make the request
Instance response = await instanceServiceClient.GetInstanceAsync(request);
GetInstanceAsync(InstanceName, CallSettings)
public virtual Task<Instance> GetInstanceAsync(InstanceName name, CallSettings callSettings = null)
Gets a Instance.
Parameters | |
---|---|
Name | Description |
name |
InstanceName Required. The name of the instance to retrieve.
Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
InstanceServiceClient instanceServiceClient = await InstanceServiceClient.CreateAsync();
// Initialize request argument(s)
InstanceName name = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Instance response = await instanceServiceClient.GetInstanceAsync(name);
GetInstanceAsync(InstanceName, CancellationToken)
public virtual Task<Instance> GetInstanceAsync(InstanceName name, CancellationToken cancellationToken)
Gets a Instance.
Parameters | |
---|---|
Name | Description |
name |
InstanceName Required. The name of the instance to retrieve.
Format:
|
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
InstanceServiceClient instanceServiceClient = await InstanceServiceClient.CreateAsync();
// Initialize request argument(s)
InstanceName name = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]");
// Make the request
Instance response = await instanceServiceClient.GetInstanceAsync(name);
GetInstanceAsync(string, CallSettings)
public virtual Task<Instance> GetInstanceAsync(string name, CallSettings callSettings = null)
Gets a Instance.
Parameters | |
---|---|
Name | Description |
name |
string Required. The name of the instance to retrieve.
Format:
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
InstanceServiceClient instanceServiceClient = await InstanceServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Instance response = await instanceServiceClient.GetInstanceAsync(name);
GetInstanceAsync(string, CancellationToken)
public virtual Task<Instance> GetInstanceAsync(string name, CancellationToken cancellationToken)
Gets a Instance.
Parameters | |
---|---|
Name | Description |
name |
string Required. The name of the instance to retrieve.
Format:
|
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskInstance |
A Task containing the RPC response. |
// Create client
InstanceServiceClient instanceServiceClient = await InstanceServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/instances/[INSTANCE]";
// Make the request
Instance response = await instanceServiceClient.GetInstanceAsync(name);
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.