From 7013be5dee06ad9461b4c682cb963bdc2fdbf97f Mon Sep 17 00:00:00 2001 From: itsnotaboutthecell Date: Sat, 7 Mar 2026 15:00:33 -0600 Subject: [PATCH] feat: promote VariableLibrary from portal-only to full API support Variable Libraries now have a complete suite of REST APIs (Create, Delete, Get, List, Update, Get/Update Definition). This change reclassifies VariableLibrary from portal-only to API-supported by: - Moving VARIABLE_LIBRARY to the API section in ItemType enum - Moving format_mapping and uri_mapping entries to API sections - Adding definition_format_mapping entry for export/import support All existing commands (mv, cp, export, import, set) continue to work. Generic handlers for mkdir, rm, get, and set now also apply correctly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .changes/unreleased/added-20260307-205227.yaml | 6 ++++++ src/fabric_cli/core/fab_types.py | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changes/unreleased/added-20260307-205227.yaml diff --git a/.changes/unreleased/added-20260307-205227.yaml b/.changes/unreleased/added-20260307-205227.yaml new file mode 100644 index 00000000..3dacac3b --- /dev/null +++ b/.changes/unreleased/added-20260307-205227.yaml @@ -0,0 +1,6 @@ +kind: added +body: Promote VariableLibrary from portal-only to full API support, enabling create, get, set, rm, ls, export, import, cp, and mv commands via the Variable Library REST APIs +time: 2026-03-07T20:52:27.0056271Z +custom: + Author: v-alexmoraru + AuthorLink: https://github.com/v-alexmoraru diff --git a/src/fabric_cli/core/fab_types.py b/src/fabric_cli/core/fab_types.py index ef29554e..1e80cf09 100644 --- a/src/fabric_cli/core/fab_types.py +++ b/src/fabric_cli/core/fab_types.py @@ -253,7 +253,6 @@ class ItemType(_BaseItemType): METRIC_SET = "MetricSet" ORG_APP = "OrgApp" SUSTAINABILITY_DATA_SOLUTION = "SustainabilityDataSolution" - VARIABLE_LIBRARY = "VariableLibrary" # API COSMOS_DB_DATABASE = "CosmosDBDatabase" @@ -287,6 +286,7 @@ class ItemType(_BaseItemType): MOUNTED_DATA_FACTORY = "MountedDataFactory" SQL_DATABASE = "SQLDatabase" DATAFLOW = "Dataflow" + VARIABLE_LIBRARY = "VariableLibrary" def __str__(self): return self.value @@ -493,7 +493,6 @@ class MirroredDatabaseFolders(Enum): ItemType.SUSTAINABILITY_DATA_SOLUTION: "sustainabilitydatasolutions", ItemType.METRIC_SET: "metricsets", ItemType.ORG_APP: "orgapps", - ItemType.VARIABLE_LIBRARY: "variablelibraries", # API ItemType.COSMOS_DB_DATABASE: "cosmosDbDatabases", ItemType.DASHBOARD: "dashboards", @@ -526,6 +525,7 @@ class MirroredDatabaseFolders(Enum): ItemType.USER_DATA_FUNCTION: "userdatafunctions", ItemType.MOUNTED_DATA_FACTORY: "mounteddatafactories", ItemType.DATAFLOW: "dataflows", + ItemType.VARIABLE_LIBRARY: "variablelibraries", } # Item URI in the Fabric Portal @@ -540,7 +540,6 @@ class MirroredDatabaseFolders(Enum): ItemType.SUSTAINABILITY_DATA_SOLUTION: "sustainability-data-manager", ItemType.METRIC_SET: "metricsets", ItemType.ORG_APP: "orgapps", - ItemType.VARIABLE_LIBRARY: "variable-libraries", # API ItemType.COSMOS_DB_DATABASE: "cosmosdbdatabases", ItemType.DASHBOARD: "dashboards", @@ -572,6 +571,7 @@ class MirroredDatabaseFolders(Enum): ItemType.GRAPHQLAPI: "graphql", ItemType.MOUNTED_DATA_FACTORY: "mounteddatafactories", ItemType.DATAFLOW: "dataflows-gen2", + ItemType.VARIABLE_LIBRARY: "variable-libraries", } # Item Payload definition @@ -595,4 +595,5 @@ class MirroredDatabaseFolders(Enum): ItemType.COSMOS_DB_DATABASE: {"default": ""}, ItemType.USER_DATA_FUNCTION: {"default": ""}, ItemType.GRAPH_QUERY_SET: {"default": ""}, + ItemType.VARIABLE_LIBRARY: {"default": ""}, }