Table of Contents

Interface IResourceProviderService

Namespace
FoundationaLLM.Common.Interfaces
Assembly
FoundationaLLM.Common.dll

Provides the core services implemented by all resource providers.

public interface IResourceProviderService : IManagementProviderService
Inherited Members
Extension Methods

Properties

AllowedResourceTypes

The metadata describing the resource types allowed by the resource provider.

Dictionary<string, ResourceTypeDescriptor> AllowedResourceTypes { get; }

Property Value

Dictionary<string, ResourceTypeDescriptor>

IsInitialized

Indicates whether the resource provider is initialized or not.

bool IsInitialized { get; }

Property Value

bool

Name

The name of the resource provider.

string Name { get; }

Property Value

string

StorageAccountName

The name of the storage account used by the resource provider.

string StorageAccountName { get; }

Property Value

string

StorageContainerName

The name of the storage account container used by the resource provider.

string StorageContainerName { get; }

Property Value

string

Methods

DeleteResourceAsync<T>(string, string, UnifiedUserIdentity)

Deletes logically a resource based on its logical path.

Task DeleteResourceAsync<T>(string instanceId, string resourceName, UnifiedUserIdentity userIdentity) where T : ResourceBase

Parameters

instanceId string

The FoundationaLLM instance identifier.

resourceName string

The name of the resource being logically deleted.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity providing information about the calling user identity.

Returns

Task

Type Parameters

T

The type of the resource.

ExecuteResourceActionAsync<T, TAction, TResult>(string, string, string, TAction, UnifiedUserIdentity)

Executes an action on a resource.

Task<TResult> ExecuteResourceActionAsync<T, TAction, TResult>(string instanceId, string resourceName, string actionName, TAction actionPayload, UnifiedUserIdentity userIdentity) where T : ResourceBase where TAction : class? where TResult : ResourceProviderActionResult

Parameters

instanceId string

The FoundationaLLM instance identifier.

resourceName string

The name of the resource on which the action is executed.

actionName string

The name of the action being executed.

actionPayload TAction

The payload of the action providing details about it.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity with details about the identity of the user.

Returns

Task<TResult>

Type Parameters

T

The type of the resource.

TAction

The type of the action payload providing details about the action to be executed.

TResult

The type of the result returned.

GetResourceAsync<T>(string, UnifiedUserIdentity, ResourceProviderGetOptions?)

Gets a resource based on its logical path.

Task<T> GetResourceAsync<T>(string resourcePath, UnifiedUserIdentity userIdentity, ResourceProviderGetOptions? options = null) where T : ResourceBase

Parameters

resourcePath string

The logical path of the resource.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity with details about the identity of the user.

options ResourceProviderGetOptions

The ResourceProviderGetOptions which provides operation parameters.

Returns

Task<T>

The instance of the resource corresponding to the specified logical path.

Type Parameters

T

The type of the resource.

GetResourceAsync<T>(string, string, UnifiedUserIdentity, ResourceProviderGetOptions?)

Gets a resource based on its name.

Task<T> GetResourceAsync<T>(string instanceId, string resourceName, UnifiedUserIdentity userIdentity, ResourceProviderGetOptions? options = null) where T : ResourceBase

Parameters

instanceId string

The FoundationaLLM instance identifier.

resourceName string

The logical path of the resource.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity with details about the identity of the user.

options ResourceProviderGetOptions

The ResourceProviderGetOptions which provides operation parameters.

Returns

Task<T>

The instance of the resource corresponding to the specified logical path.

Type Parameters

T

The type of the resource.

GetResourcesAsync<T>(string, UnifiedUserIdentity, ResourceProviderGetOptions?)

Gets resources of a specific type.

Task<List<ResourceProviderGetResult<T>>> GetResourcesAsync<T>(string instanceId, UnifiedUserIdentity userIdentity, ResourceProviderGetOptions? options = null) where T : ResourceBase

Parameters

instanceId string

The FoundationaLLM instance identifier.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity with details about the identity of the user.

options ResourceProviderGetOptions

The ResourceProviderGetOptions which provides operation parameters.

Returns

Task<List<ResourceProviderGetResult<T>>>

A list of ResourceProviderGetResult<T> containing the loaded resources.

Type Parameters

T

The type of resource to return.

Initialize()

Initializes the resource provider.

Task Initialize()

Returns

Task

ResourceExistsAsync<T>(string, string, UnifiedUserIdentity)

Checks if a resource exists.

Task<(bool Exists, bool Deleted)> ResourceExistsAsync<T>(string instanceId, string resourceName, UnifiedUserIdentity userIdentity) where T : ResourceBase

Parameters

instanceId string

The FoundationaLLM instance identifier.

resourceName string

The resource name being checked.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity providing information about the calling user identity.

Returns

Task<(bool Exists, bool Deleted)>

A tuple indicating whether the resource exists or not and whether it is logically deleted or not.

Type Parameters

T

The type of the resource.

Remarks

If a resource was logically deleted but not purged, this method will return True, indicating the existence of the resource.

UpdateResourcePropertiesAsync<T, TResult>(string, string, Dictionary<string, object?>, UnifiedUserIdentity)

Updates a subset of the properties of a resource.

Task<TResult> UpdateResourcePropertiesAsync<T, TResult>(string instanceId, string resourceName, Dictionary<string, object?> propertyValues, UnifiedUserIdentity userIdentity) where T : ResourceBase where TResult : ResourceProviderUpsertResult<T>

Parameters

instanceId string

The FoundationaLLM instance identifier.

resourceName string

The name of the resource being updated.

propertyValues Dictionary<string, object>

The dictionary with propery names and values to update.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity with details about the identity of the user.

Returns

Task<TResult>

Type Parameters

T

The type of the resource.

TResult

The type of the result returned.

UpsertResourceAsync<T, TResult>(string, T, UnifiedUserIdentity, ResourceProviderUpsertOptions?)

Creates or updates a resource based on its logical path.

Task<TResult> UpsertResourceAsync<T, TResult>(string instanceId, T resource, UnifiedUserIdentity userIdentity, ResourceProviderUpsertOptions? options = null) where T : ResourceBase where TResult : ResourceProviderUpsertResult<T>

Parameters

instanceId string

The FoundationaLLM instance identifier.

resource T

The instance of the resource being created or updated.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity with details about the identity of the user.

options ResourceProviderUpsertOptions

The ResourceProviderUpsertOptions which provides operation parameters.

Returns

Task<TResult>

The object id of the resource.

Type Parameters

T

The type of the resource.

TResult

The type of the result returned

WaitForInitialization()

Waits for the resource provider service to be initialized.

Task WaitForInitialization()

Returns

Task