Table of Contents

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 IConfiguration

Configuration.

httpClientFactory IHttpClientFactory

The http client factory.

httpContextAccessor IHttpContextAccessor

Provides access to the current HttpContext.

applicationContext IApplicationContext

The 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 HttpMethod

The http method of service.

clusterName string

The cluster name to invoke the method on.

path string

The path of the service.

keyValues object

The 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 object

The data that will be JSON serialized and provided as the request body.

cancellationToken CancellationToken

A CancellationToken that can be used to cancel the operation.

Returns

Task<string>

A Task that will return when the operation has completed with raw json.

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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

httpMethod HttpMethod

The http method of service.

path string

The path of the service.

parameters IDictionary<string, object>

A collection of parameters key-value pairs that will be provided to the request.

cancellationToken CancellationToken

A 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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

httpMethod HttpMethod

The http method of service.

path string

The path of the service.

data TRequest

The 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 CancellationToken

A 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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

entityViewName string

The name of the entity view to invoke.

keyValues object

The 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 CancellationToken

A 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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

entityViewName string

The 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 string

The filter used in OData syntax to limit the results that are returned by the request.

orderBy string

The 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 CancellationToken

A 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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

entityViewName string

The name of the entity view to invoke.

keyValues object

The 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 CancellationToken

A 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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

methodName string

The 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 CancellationToken

A 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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

methodName string

The 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 CancellationToken

A CancellationToken that can be used to cancel the operation.

Returns

Task

A Task that will return when the operation has completed.

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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

methodName string

The 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 CancellationToken

A 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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

cancellationToken CancellationToken?

A CancellationToken that can be used to cancel the operation.

Returns

Task<string>

A Task that will return when the operation has completed with the json content.

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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

entityViewName string

The name of the entity view to invoke.

data TRequest

The 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 CancellationToken

A 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 string

The cluster name to invoke the method on.

apiVersion string

The version of the REST API to invoke.

entityViewName string

The name of the entity view to invoke.

keyValues object

The key values of the entity view to get.

data TRequest

The 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 CancellationToken

A 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 string

The cluster name to invoke the method on.

path string

The path of the service.

apiVersion string

The version of the REST API to invoke (defaults to "v1").

httpMethod HttpMethod

The 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 CancellationToken

A CancellationToken that can be used to cancel the operation.

Returns

Task<byte[]>

A Task that will return when the operation has completed with a binary image file content.