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
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
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
stringThe FoundationaLLM instance identifier.
resourceName
stringThe name of the resource being logically deleted.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity providing information about the calling user identity.
Returns
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
stringThe FoundationaLLM instance identifier.
resourceName
stringThe name of the resource on which the action is executed.
actionName
stringThe name of the action being executed.
actionPayload
TActionThe payload of the action providing details about it.
userIdentity
UnifiedUserIdentityThe 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
stringThe logical path of the resource.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
options
ResourceProviderGetOptionsThe 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
stringThe FoundationaLLM instance identifier.
resourceName
stringThe logical path of the resource.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
options
ResourceProviderGetOptionsThe 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
stringThe FoundationaLLM instance identifier.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
options
ResourceProviderGetOptionsThe 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
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
stringThe FoundationaLLM instance identifier.
resourceName
stringThe resource name being checked.
userIdentity
UnifiedUserIdentityThe 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
stringThe FoundationaLLM instance identifier.
resourceName
stringThe name of the resource being updated.
propertyValues
Dictionary<string, object>The dictionary with propery names and values to update.
userIdentity
UnifiedUserIdentityThe 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
stringThe FoundationaLLM instance identifier.
resource
TThe instance of the resource being created or updated.
userIdentity
UnifiedUserIdentityThe UnifiedUserIdentity with details about the identity of the user.
options
ResourceProviderUpsertOptionsThe 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()