public abstract class ServiceControllerClient
ServiceController client wrapper, for convenient use.
Inheritance
System.Object > ServiceControllerClientNamespace
Google.Cloud.ServiceControl.V1Assembly
Google.Cloud.ServiceControl.V1.dll
Remarks
Lets clients check and report operations against a managed service.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the ServiceController service, which is a host of "servicecontrol.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
System.String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default ServiceController scopes.
Property Value | |
---|---|
Type | Description |
System.Collections.Generic.IReadOnlyList<System.String> |
The default ServiceController scopes are:
GrpcClient
public virtual ServiceController.ServiceControllerClient GrpcClient { get; }
The underlying gRPC ServiceController client
Property Value | |
---|---|
Type | Description |
ServiceController.ServiceControllerClient |
Methods
Check(CheckRequest, CallSettings)
public virtual CheckResponse Check(CheckRequest request, CallSettings callSettings = null)
Checks whether an operation on a service should be allowed to proceed based on the configuration of the service and related policies. It must be called before the operation is executed.
If feasible, the client should cache the check results and reuse them for
60 seconds. In case of any server errors, the client should rely on the
cached results for much longer time to avoid outage.
WARNING: There is general 60s delay for the configuration and policy
propagation, therefore callers MUST NOT depend on the Check
method having
the latest policy information.
NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has the size limit of 64KB.
This method requires the servicemanagement.services.check
permission
on the specified service. For more information, see
Cloud IAM.
Parameters | |
---|---|
Name | Description |
request | CheckRequest The request object containing all of the parameters for the API call. |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
CheckResponse | The RPC response. |
CheckAsync(CheckRequest, CallSettings)
public virtual Task<CheckResponse> CheckAsync(CheckRequest request, CallSettings callSettings = null)
Checks whether an operation on a service should be allowed to proceed based on the configuration of the service and related policies. It must be called before the operation is executed.
If feasible, the client should cache the check results and reuse them for
60 seconds. In case of any server errors, the client should rely on the
cached results for much longer time to avoid outage.
WARNING: There is general 60s delay for the configuration and policy
propagation, therefore callers MUST NOT depend on the Check
method having
the latest policy information.
NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has the size limit of 64KB.
This method requires the servicemanagement.services.check
permission
on the specified service. For more information, see
Cloud IAM.
Parameters | |
---|---|
Name | Description |
request | CheckRequest The request object containing all of the parameters for the API call. |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<CheckResponse> | A Task containing the RPC response. |
CheckAsync(CheckRequest, CancellationToken)
public virtual Task<CheckResponse> CheckAsync(CheckRequest request, CancellationToken cancellationToken)
Checks whether an operation on a service should be allowed to proceed based on the configuration of the service and related policies. It must be called before the operation is executed.
If feasible, the client should cache the check results and reuse them for
60 seconds. In case of any server errors, the client should rely on the
cached results for much longer time to avoid outage.
WARNING: There is general 60s delay for the configuration and policy
propagation, therefore callers MUST NOT depend on the Check
method having
the latest policy information.
NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has the size limit of 64KB.
This method requires the servicemanagement.services.check
permission
on the specified service. For more information, see
Cloud IAM.
Parameters | |
---|---|
Name | Description |
request | CheckRequest The request object containing all of the parameters for the API call. |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<CheckResponse> | A Task containing the RPC response. |
Create()
public static ServiceControllerClient Create()
Synchronously creates a ServiceControllerClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ServiceControllerClientBuilder.
Returns | |
---|---|
Type | Description |
ServiceControllerClient | The created ServiceControllerClient. |
CreateAsync(CancellationToken)
public static Task<ServiceControllerClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a ServiceControllerClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ServiceControllerClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | System.Threading.CancellationToken The System.Threading.CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<ServiceControllerClient> | The task representing the created ServiceControllerClient. |
Report(ReportRequest, CallSettings)
public virtual ReportResponse Report(ReportRequest request, CallSettings callSettings = null)
Reports operation results to Google Service Control, such as logs and metrics. It should be called after an operation is completed.
If feasible, the client should aggregate reporting data for up to 5 seconds to reduce API traffic. Limiting aggregation to 5 seconds is to reduce data loss during client crashes. Clients should carefully choose the aggregation time window to avoid data loss risk more than 0.01% for business and compliance reasons.
NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has the size limit (wire-format byte size) of 1MB.
This method requires the servicemanagement.services.report
permission
on the specified service. For more information, see
Google Cloud IAM.
Parameters | |
---|---|
Name | Description |
request | ReportRequest The request object containing all of the parameters for the API call. |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ReportResponse | The RPC response. |
ReportAsync(ReportRequest, CallSettings)
public virtual Task<ReportResponse> ReportAsync(ReportRequest request, CallSettings callSettings = null)
Reports operation results to Google Service Control, such as logs and metrics. It should be called after an operation is completed.
If feasible, the client should aggregate reporting data for up to 5 seconds to reduce API traffic. Limiting aggregation to 5 seconds is to reduce data loss during client crashes. Clients should carefully choose the aggregation time window to avoid data loss risk more than 0.01% for business and compliance reasons.
NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has the size limit (wire-format byte size) of 1MB.
This method requires the servicemanagement.services.report
permission
on the specified service. For more information, see
Google Cloud IAM.
Parameters | |
---|---|
Name | Description |
request | ReportRequest The request object containing all of the parameters for the API call. |
callSettings | Google.Api.Gax.Grpc.CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<ReportResponse> | A Task containing the RPC response. |
ReportAsync(ReportRequest, CancellationToken)
public virtual Task<ReportResponse> ReportAsync(ReportRequest request, CancellationToken cancellationToken)
Reports operation results to Google Service Control, such as logs and metrics. It should be called after an operation is completed.
If feasible, the client should aggregate reporting data for up to 5 seconds to reduce API traffic. Limiting aggregation to 5 seconds is to reduce data loss during client crashes. Clients should carefully choose the aggregation time window to avoid data loss risk more than 0.01% for business and compliance reasons.
NOTE: the [ReportRequest][google.api.servicecontrol.v1.ReportRequest] has the size limit (wire-format byte size) of 1MB.
This method requires the servicemanagement.services.report
permission
on the specified service. For more information, see
Google Cloud IAM.
Parameters | |
---|---|
Name | Description |
request | ReportRequest The request object containing all of the parameters for the API call. |
cancellationToken | System.Threading.CancellationToken A System.Threading.CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
System.Threading.Tasks.Task<ReportResponse> | A Task containing the RPC response. |
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 |
System.Threading.Tasks.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.