66from datapilot .clients .altimate .utils import check_token_and_instance
77from datapilot .clients .altimate .utils import get_all_dbt_configs
88from datapilot .clients .altimate .utils import onboard_file
9+ from datapilot .clients .altimate .utils import resolve_integration_name_to_id
910from datapilot .clients .altimate .utils import start_dbt_ingestion
1011from datapilot .clients .altimate .utils import validate_credentials
1112from datapilot .clients .altimate .utils import validate_permissions
@@ -136,9 +137,14 @@ def project_health(
136137 "--dbt_core_integration_id" ,
137138 "--dbt_integration_id" ,
138139 "dbt_integration_id" , # This is the parameter name that will be passed to the function
139- prompt = "DBT Integration ID" ,
140140 help = "DBT Core Integration ID or DBT Integration ID" ,
141141)
142+ @click .option (
143+ "--dbt_core_integration_name" ,
144+ "--dbt_integration_name" ,
145+ "dbt_integration_name" , # This is the parameter name that will be passed to the function
146+ help = "DBT Core Integration Name or DBT Integration Name (alternative to ID)" ,
147+ )
142148@click .option (
143149 "--dbt_core_integration_environment" ,
144150 "--dbt_integration_environment" ,
@@ -154,11 +160,12 @@ def onboard(
154160 instance_name ,
155161 backend_url ,
156162 dbt_integration_id ,
163+ dbt_integration_name ,
157164 dbt_integration_environment ,
158165 manifest_path ,
159166 catalog_path ,
160167):
161- """Onboard a manifest file to DBT."""
168+ """Onboard a manifest file to DBT. You can specify either --dbt_integration_id or --dbt_integration_name. """
162169
163170 # For onboard command, token and instance_name are required
164171 if not token :
@@ -176,6 +183,21 @@ def onboard(
176183 click .echo ("Error: You don't have permission to perform this action." )
177184 return
178185
186+ # Resolve integration name to ID if name is provided instead of ID
187+ if not dbt_integration_id and not dbt_integration_name :
188+ dbt_integration_id = click .prompt ("DBT Integration ID" )
189+ elif dbt_integration_name and not dbt_integration_id :
190+ click .echo (f"Resolving integration name '{ dbt_integration_name } ' to ID..." )
191+ resolved_id = resolve_integration_name_to_id (dbt_integration_name , token , instance_name , backend_url )
192+ if resolved_id :
193+ dbt_integration_id = resolved_id
194+ click .echo (f"Found integration ID: { dbt_integration_id } " )
195+ else :
196+ click .echo (f"Error: Integration with name '{ dbt_integration_name } ' not found." )
197+ return
198+ elif dbt_integration_name and dbt_integration_id :
199+ click .echo ("Warning: Both integration ID and name provided. Using ID and ignoring name." )
200+
179201 try :
180202 load_manifest (manifest_path )
181203 except Exception as e :
0 commit comments