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
InitializationTask
The task that is executed when the resource provider is initialized.
Task InitializationTask { get; }
  Property Value
Remarks
This task enables the consumers of the resource provider to wait for the initialization to be completed.
IsInitialized
Indicates whether the resource provider is initialized or not.
bool IsInitialized { get; }
  Property Value
Name
The name of the resource provider.
string Name { get; }
  Property Value
StorageAccountName
The name of the storage account used by the resource provider.
string StorageAccountName { get; }
  Property Value
StorageContainerName
The name of the storage account container used by the resource provider.
string StorageContainerName { get; }
  Property Value
StorageRootPath
Gets the optional storage root path used by the resource provider.
string? StorageRootPath { get; }
  Property Value
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
instanceIdstringThe FoundationaLLM instance identifier.
resourceNamestringThe name of the resource being logically deleted.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity providing information about the calling user identity.
Returns
Type Parameters
TThe type of the resource.
ExecuteResourceActionAsync<T, TAction, TResult>(string, string, string, TAction, UnifiedUserIdentity, ResourceBase?)
Executes an action on a resource.
Task<TResult> ExecuteResourceActionAsync<T, TAction, TResult>(string instanceId, string resourceName, string actionName, TAction actionPayload, UnifiedUserIdentity userIdentity, ResourceBase? parentResourceInstance = null) where T : ResourceBase where TAction : class? where TResult : ResourceProviderActionResult
  Parameters
instanceIdstringThe FoundationaLLM instance identifier.
resourceNamestringThe name of the resource on which the action is executed.
actionNamestringThe name of the action being executed.
actionPayloadTActionThe payload of the action providing details about it.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
parentResourceInstanceResourceBaseThe optional parent resource of the resource identified by
instanceIdandresourceName.
Returns
- Task<TResult>
 
Type Parameters
TThe type of the resource.
TActionThe type of the action payload providing details about the action to be executed.
TResultThe type of the result returned.
Remarks
When the parent resource instance is provided, and it specifies inheritable authorizable actions, the parent resource instance is used to authorize the request for any of those actions.
ExecuteResourceActionAsync<TMain, TSubordinate, TAction, TResult>(string, string, string, string, TAction, UnifiedUserIdentity, ResourceBase?)
Executes an action on a main resource and it subordinate resource.
Task<TResult> ExecuteResourceActionAsync<TMain, TSubordinate, TAction, TResult>(string instanceId, string mainResourceName, string resourceName, string actionName, TAction actionPayload, UnifiedUserIdentity userIdentity, ResourceBase? parentResourceInstance = null) where TMain : ResourceBase where TSubordinate : ResourceBase where TAction : class? where TResult : ResourceProviderActionResult
  Parameters
instanceIdstringThe FoundationaLLM instance identifier.
mainResourceNamestringThe name of the main resource on which the action is executed.
resourceNamestringThe name of the subordinate resource on which the action is executed.
actionNamestringThe name of the action being executed.
actionPayloadTActionThe payload of the action providing details about it.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
parentResourceInstanceResourceBaseThe optional parent resource of the resource identified by
instanceIdandresourceName.
Returns
- Task<TResult>
 
Type Parameters
TMainThe type of the main resource.
TSubordinateThe type of the subordinate resource.
TActionThe type of the action payload providing details about the action to be executed.
TResultThe type of the result returned.
Remarks
When the parent resource instance is provided, and it specifies inheritable authorizable actions, the parent resource instance is used to authorize the request for any of those actions.
GetResourceAsync<T>(string, UnifiedUserIdentity, ResourceProviderGetOptions?, ResourceBase?)
Gets a resource based on its logical path.
Task<T> GetResourceAsync<T>(string resourcePath, UnifiedUserIdentity userIdentity, ResourceProviderGetOptions? options = null, ResourceBase? parentResourceInstance = null) where T : ResourceBase
  Parameters
resourcePathstringThe logical path of the resource.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
optionsResourceProviderGetOptionsThe ResourceProviderGetOptions which provides operation parameters.
parentResourceInstanceResourceBaseThe optional parent resource of the resource identified by
resourcePath.
Returns
- Task<T>
 The instance of the resource corresponding to the specified logical path.
Type Parameters
TThe type of the resource.
Remarks
When the parent resource instance is provided, and it specifies inheritable authorizable actions, the parent resource instance is used to authorize the request for any of those actions.
GetResourceAsync<T>(string, string, UnifiedUserIdentity, ResourceProviderGetOptions?, ResourceBase?)
Gets a resource based on its name.
Task<T> GetResourceAsync<T>(string instanceId, string resourceName, UnifiedUserIdentity userIdentity, ResourceProviderGetOptions? options = null, ResourceBase? parentResourceInstance = null) where T : ResourceBase
  Parameters
instanceIdstringThe FoundationaLLM instance identifier.
resourceNamestringThe logical path of the resource.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
optionsResourceProviderGetOptionsThe ResourceProviderGetOptions which provides operation parameters.
parentResourceInstanceResourceBaseThe optional parent resource of the resource identified by
instanceIdandresourceName.
Returns
- Task<T>
 The instance of the resource corresponding to the specified logical path.
Type Parameters
TThe type of the resource.
Remarks
When the parent resource instance is provided, and it specifies inheritable authorizable actions, the parent resource instance is used to authorize the request for any of those actions.
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
instanceIdstringThe FoundationaLLM instance identifier.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
optionsResourceProviderGetOptionsThe ResourceProviderGetOptions which provides operation parameters.
Returns
- Task<List<ResourceProviderGetResult<T>>>
 A list of ResourceProviderGetResult<T> containing the loaded resources.
Type Parameters
TThe type of resource to return.
Initialize()
Initializes the resource provider.
Task Initialize()
  Returns
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
instanceIdstringThe FoundationaLLM instance identifier.
resourceNamestringThe resource name being checked.
userIdentityUnifiedUserIdentityThe 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
TThe 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
instanceIdstringThe FoundationaLLM instance identifier.
resourceNamestringThe name of the resource being updated.
propertyValuesDictionary<string, object>The dictionary with propery names and values to update.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
Returns
- Task<TResult>
 
Type Parameters
TThe type of the resource.
TResultThe 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
instanceIdstringThe FoundationaLLM instance identifier.
resourceTThe instance of the resource being created or updated.
userIdentityUnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
optionsResourceProviderUpsertOptionsThe ResourceProviderUpsertOptions which provides operation parameters.
Returns
- Task<TResult>
 The object id of the resource.
Type Parameters
TThe type of the resource.
TResultThe type of the result returned
WaitForInitialization()
Waits for the resource provider service to be initialized.
Task WaitForInitialization()