Class RemoteClusterServiceInvoker
- Namespace
- GroupeIsa.Neos.ClusterCommunication
- Assembly
- GroupeIsa.Neos.ClusterCommunication.dll
A client for interacting with the Dapr endpoints over HTTP protocol.
[Obsolete("Use the RemoteServiceInvoker class instead.", UrlFormat = "https://documentation.neos.groupeisagri.com/articles/communication/service-invocation.html")]
public class RemoteClusterServiceInvoker : IRemoteClusterServiceInvoker
- Inheritance
-
RemoteClusterServiceInvoker
- Implements
- Inherited Members
Constructors
RemoteClusterServiceInvoker(IConfiguration, IHttpClientFactory, IHttpContextAccessor, IApplicationContext, INeosLogger<RemoteClusterServiceInvoker>)
Initializes a new instance of the RemoteClusterServiceInvoker class.
public RemoteClusterServiceInvoker(IConfiguration configuration, IHttpClientFactory httpClientFactory, IHttpContextAccessor httpContextAccessor, IApplicationContext applicationContext, INeosLogger<RemoteClusterServiceInvoker> logger)
Parameters
configuration
IConfigurationConfiguration.
httpClientFactory
IHttpClientFactoryThe http client factory.
httpContextAccessor
IHttpContextAccessorProvides access to the current HttpContext.
applicationContext
IApplicationContextThe application context.
logger
INeosLogger<RemoteClusterServiceInvoker>Logger.
Methods
InvokeAsync(HttpMethod, string, string, object?, IDictionary<string, object?>?, object?, CancellationToken)
Performs service invocation for the cluster identified by clusterName
and the specified path.
public Task<string> InvokeAsync(HttpMethod httpMethod, string clusterName, string path, object? keyValues = null, IDictionary<string, object?>? parameters = null, object? data = null, CancellationToken cancellationToken = default)
Parameters
httpMethod
HttpMethodThe http method of service.
clusterName
stringThe cluster name to invoke the method on.
path
stringThe path of the service.
keyValues
objectThe key values of the entity view to get.
parameters
IDictionary<string, object>A collection of parameters key-value pairs that will be provided to the request.
data
objectThe data that will be JSON serialized and provided as the request body.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
InvokeAsync<TResponse>(string, string, HttpMethod, string, IDictionary<string, object?>?, CancellationToken)
Performs service invocation for the cluster identified by clusterName
and the specified path.
public Task<TResponse?> InvokeAsync<TResponse>(string clusterName, string apiVersion, HttpMethod httpMethod, string path, IDictionary<string, object?>? parameters = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.httpMethod
HttpMethodThe http method of service.
path
stringThe path of the service.
parameters
IDictionary<string, object>A collection of parameters key-value pairs that will be provided to the request.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TResponse>
A Task<TResult> that will return when the operation has completed.
Type Parameters
TResponse
The type of the data that will be JSON deserialized from the response body.
InvokeAsync<TRequest, TResponse>(string, string, HttpMethod, string, TRequest, IDictionary<string, object?>?, CancellationToken)
Performs service invocation for the cluster identified by clusterName
and the specified path.
public Task<TResponse?> InvokeAsync<TRequest, TResponse>(string clusterName, string apiVersion, HttpMethod httpMethod, string path, TRequest data, IDictionary<string, object?>? parameters = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.httpMethod
HttpMethodThe http method of service.
path
stringThe path of the service.
data
TRequestThe data that will be JSON serialized and provided as the request body.
parameters
IDictionary<string, object>A collection of parameters key-value pairs that will be provided to the request.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TResponse>
A Task<TResult> that will return when the operation has completed.
Type Parameters
TRequest
The type of the data that will be JSON serialized and provided as the request body.
TResponse
The type of the data that will be JSON deserialized from the response body.
InvokeDeleteAsync(string, string, string, object, IDictionary<string, object?>?, CancellationToken)
Performs service invocation for the cluster identified by clusterName
and invokes the resource
specified by entityViewName
with the DELETE
HTTP method and an empty request body.
public Task InvokeDeleteAsync(string clusterName, string apiVersion, string entityViewName, object keyValues, IDictionary<string, object?>? parameters = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.entityViewName
stringThe name of the entity view to invoke.
keyValues
objectThe key values of the entity view to get.
parameters
IDictionary<string, object>A collection of parameters key-value pairs that will be provided to the request.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task
A Task<TResult> that will return when the operation has completed.
InvokeGetAllAsync<TResponse>(string, string, string, int?, int?, string?, string?, IDictionary<string, object?>?, CancellationToken)
Performs service invocation for the cluster identified by clusterName
and invokes the resource
specified by entityViewName
with the GET
HTTP method and an empty request body.
public Task<TResponse?> InvokeGetAllAsync<TResponse>(string clusterName, string apiVersion, string entityViewName, int? skip = null, int? top = null, string? filter = null, string? orderBy = null, IDictionary<string, object?>? parameters = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.entityViewName
stringThe name of the entity view to invoke.
skip
int?The number of elements to skip before returning the remaining elements.
top
int?The number of elements to return from the start of a sequence.
filter
stringThe filter used in OData syntax to limit the results that are returned by the request.
orderBy
stringThe list of fields used in OData syntax to sort the elements based on in ascending or decending order.
parameters
IDictionary<string, object>A collection of parameters key-value pairs that will be provided to the request.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TResponse>
A Task<TResult> that will return when the operation has completed.
Type Parameters
TResponse
The type of the data that will be JSON deserialized from the response body.
InvokeGetAsync<TResponse>(string, string, string, object, IDictionary<string, object?>?, CancellationToken)
Performs service invocation for the cluster identified by clusterName
and invokes the resource
specified by entityViewName
with the GET
HTTP method and an empty request body.
public Task<TResponse?> InvokeGetAsync<TResponse>(string clusterName, string apiVersion, string entityViewName, object keyValues, IDictionary<string, object?>? parameters = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.entityViewName
stringThe name of the entity view to invoke.
keyValues
objectThe key values of the entity view to get.
parameters
IDictionary<string, object>A collection of parameters key-value pairs that will be provided to the request.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TResponse>
A Task<TResult> that will return when the operation has completed.
Type Parameters
TResponse
The type of the data that will be JSON deserialized from the response body.
InvokeMethodGetAsync<TResponse>(string, string, string, IDictionary<string, object?>?, CancellationToken)
Performs service invocation for the cluster identified by clusterName
and invokes the server
method specified by methodName
with the GET
HTTP method and an empty request body.
public Task<TResponse?> InvokeMethodGetAsync<TResponse>(string clusterName, string apiVersion, string methodName, IDictionary<string, object?>? arguments = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.methodName
stringThe name of the server method to invoke.
arguments
IDictionary<string, object>A collection of arguments key-value pairs that will be provided to the server method.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TResponse>
A Task<TResult> that will return when the operation has completed.
Type Parameters
TResponse
The type of the data that will be JSON deserialized from the response body.
InvokeMethodPostAsync(string, string, string, Dictionary<string, object?>?, CancellationToken)
Performs service invocation for the cluster idenfied by clusterName
and invokes the server
method specified by methodName
with the POST
HTTP method and an empty request body.
public Task InvokeMethodPostAsync(string clusterName, string apiVersion, string methodName, Dictionary<string, object?>? arguments = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.methodName
stringThe name of the server method to invoke.
arguments
Dictionary<string, object>A collection of arguments key-value pairs that will be provided to the server method.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
InvokeMethodPostAsync<TResponse>(string, string, string, Dictionary<string, object?>?, CancellationToken)
Perform service invocation for the cluster identified by clusterName
and invokes the server
method specified by methodName
with the POST
HTTP method and an empty request body.
public Task<TResponse?> InvokeMethodPostAsync<TResponse>(string clusterName, string apiVersion, string methodName, Dictionary<string, object?>? arguments = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.methodName
stringThe name of the server method to invoke.
arguments
Dictionary<string, object>A collection of arguments key-value pairs that will be provided to the server method.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TResponse>
A Task<TResult> that will return when the operation has completed.
Type Parameters
TResponse
The type of the data that will be JSON deserialized from the response body.
InvokeOpenApiAsync(string, string, CancellationToken?)
Performs service invocation for the cluster identified by clusterName
and invoke swagger json.
public Task<string> InvokeOpenApiAsync(string clusterName, string apiVersion, CancellationToken? cancellationToken = null)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.cancellationToken
CancellationToken?A CancellationToken that can be used to cancel the operation.
Returns
InvokePostAsync<TRequest, TResponse>(string, string, string, TRequest, IDictionary<string, object?>?, CancellationToken)
Performs service invocation for the cluster idenfied by clusterName
and invokes the resource
specified by entityViewName
with the POST
HTTP method and a JSON serialized request body
specified by data
.
public Task<TResponse?> InvokePostAsync<TRequest, TResponse>(string clusterName, string apiVersion, string entityViewName, TRequest data, IDictionary<string, object?>? parameters = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.entityViewName
stringThe name of the entity view to invoke.
data
TRequestThe data that will be JSON serialized and provided as the request body.
parameters
IDictionary<string, object>A collection of parameters key-value pairs that will be provided to the request.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TResponse>
A Task<TResult> that will return when the operation has completed.
Type Parameters
TRequest
The type of the data that will be JSON serialized and provided as the request body.
TResponse
The type of the data that will be JSON deserialized from the response body.
InvokePutAsync<TRequest, TResponse>(string, string, string, object, TRequest, IDictionary<string, object?>?, CancellationToken)
Performs service invocation for the cluster identified by clusterName
and invokes the resource
specified by entityViewName
with the PUT
HTTP method and a JSON serialized request body
specified by data
.
public Task<TResponse?> InvokePutAsync<TRequest, TResponse>(string clusterName, string apiVersion, string entityViewName, object keyValues, TRequest data, IDictionary<string, object?>? parameters = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
apiVersion
stringThe version of the
REST API
to invoke.entityViewName
stringThe name of the entity view to invoke.
keyValues
objectThe key values of the entity view to get.
data
TRequestThe data that will be JSON serialized and provided as the request body.
parameters
IDictionary<string, object>A collection of parameters key-value pairs that will be provided to the request.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
- Task<TResponse>
A Task<TResult> that will return when the operation has completed.
Type Parameters
TRequest
The type of the data that will be JSON serialized and provided as the request body.
TResponse
The type of the data that will be JSON deserialized from the response body.
RetrieveBinaryImageAsync(string, string, string?, HttpMethod?, IDictionary<string, object?>?, CancellationToken)
Performs service invocation for the cluster identified by clusterName
and the specified path.
public Task<byte[]?> RetrieveBinaryImageAsync(string clusterName, string path, string? apiVersion = null, HttpMethod? httpMethod = null, IDictionary<string, object?>? parameters = null, CancellationToken cancellationToken = default)
Parameters
clusterName
stringThe cluster name to invoke the method on.
path
stringThe path of the service.
apiVersion
stringThe version of the
REST API
to invoke (defaults to "v1").httpMethod
HttpMethodThe http method of service (defaults to
System.Net.Http.HttpMethod.Get
).parameters
IDictionary<string, object>A collection of parameters key-value pairs that will be provided to the request.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.