Table of Contents

Class OpenBiApiClientConnectionTemplateExtensions

Namespace
BiExcellence.OpenBi.Api.ConnectionTemplates
Assembly
BiExcellence.OpenBi.Api.Client.dll

Extension methods for the /connectiontemplates and /dataprovidertypes REST APIs.

public static class OpenBiApiClientConnectionTemplateExtensions
Inheritance
object
OpenBiApiClientConnectionTemplateExtensions

Methods

CreateConnectionTemplateAsync(IOpenBiApiClient, CreateConnectionTemplateRequest, CancellationToken)

Creates a connection template (POST connectiontemplates) and returns it as stored, including a server-generated id. UpdateConnectionTemplateAsync(IOpenBiApiClient, string, CreateConnectionTemplateRequest, CancellationToken) creates as well as updates, so a caller that picks its own id can use that instead. Which parameters are required depends on the type - GetDataproviderTypesAsync(IOpenBiApiClient, CancellationToken) lists them. Nothing is contacted here; use ValidateConnectionTemplateAsync(IOpenBiApiClient, string, ValidateConnectionTemplateRequest?, CancellationToken) to find out whether the credentials work. A built-in template's id is refused with a 400.

public static Task<ConnectionTemplate?> CreateConnectionTemplateAsync(this IOpenBiApiClient client, CreateConnectionTemplateRequest connectionTemplate, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
connectionTemplate CreateConnectionTemplateRequest
cancellationToken CancellationToken

Returns

Task<ConnectionTemplate>

DeleteConnectionTemplateAsync(IOpenBiApiClient, string, CancellationToken)

Deletes a connection template and its parameters (DELETE connectiontemplates/{id}). Stored views and dashboards opened through it keep their reference, so they stop resolving. An id that does not exist succeeds as well. Built-in templates cannot be deleted (400).

public static Task DeleteConnectionTemplateAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task

GetConnectionTemplateAsync(IOpenBiApiClient, string, CancellationToken)

Gets one connection template by id (GET connectiontemplates/{id}) - a stored one, a built-in one or a SAP_BW_DB twin, in the same shape GetConnectionTemplatesAsync(IOpenBiApiClient, string?, OpenBiListRequest?, CancellationToken) returns. Throws OpenBiApiException (404) when there is no connection template with this id.

public static Task<ConnectionTemplate> GetConnectionTemplateAsync(this IOpenBiApiClient client, string id, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
cancellationToken CancellationToken

Returns

Task<ConnectionTemplate>

GetConnectionTemplatesAsync(IOpenBiApiClient, string?, OpenBiListRequest?, CancellationToken)

Lists connection templates, optionally restricted to a single data provider type. The result always includes the built-in templates (OPENBI, MASTER, ENTITY, CORE) and, for every stored SAP_BW template, its synthesized SAP_BW_DB twin. A caller without openbi.connectiontemplate.write does not see parameters flagged as supplied.

public static Task<OpenBiListResult<ConnectionTemplate>> GetConnectionTemplatesAsync(this IOpenBiApiClient client, string? type = null, OpenBiListRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
type string
request OpenBiListRequest
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<ConnectionTemplate>>

GetDataproviderTypesAsync(IOpenBiApiClient, CancellationToken)

Lists the data provider types the server understands, with the parameters each one expects.

public static Task<OpenBiListResult<DataproviderTypeDto>> GetDataproviderTypesAsync(this IOpenBiApiClient client, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
cancellationToken CancellationToken

Returns

Task<OpenBiListResult<DataproviderTypeDto>>

UpdateConnectionTemplateAsync(IOpenBiApiClient, string, CreateConnectionTemplateRequest, CancellationToken)

Creates or updates the connection template with this id (POST connectiontemplates/{id}): an id that does not exist yet is inserted rather than answered with a 404. The parameters are replaced wholesale. Built-in templates cannot be modified (400).

public static Task<ConnectionTemplate?> UpdateConnectionTemplateAsync(this IOpenBiApiClient client, string id, CreateConnectionTemplateRequest connectionTemplate, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient
id string
connectionTemplate CreateConnectionTemplateRequest
cancellationToken CancellationToken

Returns

Task<ConnectionTemplate>

ValidateConnectionTemplateAsync(IOpenBiApiClient, string, ValidateConnectionTemplateRequest?, CancellationToken)

Opens the connection this template describes and puts a dataprovider into the caller's session - both the credential check and the way a dataproviders/{id} id comes into existence (POST connectiontemplates/{id}/validate). Continue with OpenDataProviderAsync. A template needing an interactive OAuth consent answers with OAuthUrl instead; call this again once the user is back. Throws OpenBiApiException (404) when there is no connection template with this id or no dataprovider of the requested type, and (400) when the source system refuses the credentials.

public static Task<ValidateConnectionTemplateResult> ValidateConnectionTemplateAsync(this IOpenBiApiClient client, string id, ValidateConnectionTemplateRequest? request = null, CancellationToken cancellationToken = default)

Parameters

client IOpenBiApiClient

The client.

id string

The connection template, stored or built-in.

request ValidateConnectionTemplateRequest

The source type, the name to open under and the connection parameters.

cancellationToken CancellationToken

A cancellation token.

Returns

Task<ValidateConnectionTemplateResult>