apiVersion: v1
kind: ConfigMap
metadata:
  name: datafabric-configmap
  labels:
    app: datafabric
data:
  credit_risk_training_light.csv: "CheckingStatus,LoanDuration,CreditHistory,LoanPurpose,LoanAmount,ExistingSavings,EmploymentDuration,InstallmentPercent,Sex,OthersOnLoan,CurrentResidenceDuration,OwnsProperty,Age,InstallmentPlans,Housing,ExistingCreditsCount,Job,Dependents,Telephone,ForeignWorker,Risk\r\n0_to_200,31,credits_paid_to_date,other,1889,100_to_500,less_1,3,female,none,3,savings_insurance,32,none,own,1,skilled,1,none,yes,No Risk\r\nless_0,18,credits_paid_to_date,car_new,462,less_100,1_to_4,2,female,none,2,savings_insurance,37,stores,own,2,skilled,1,none,yes,No Risk\r\nless_0,15,prior_payments_delayed,furniture,250,less_100,1_to_4,2,male,none,3,real_estate,28,none,own,2,skilled,1,yes,no,No Risk\r\n0_to_200,28,credits_paid_to_date,retraining,3693,less_100,greater_7,3,male,none,2,savings_insurance,32,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,28,prior_payments_delayed,education,6235,500_to_1000,greater_7,3,male,none,3,unknown,57,none,own,2,skilled,1,none,yes,Risk\r\nno_checking,32,outstanding_credit,vacation,9604,500_to_1000,greater_7,6,male,co-applicant,5,unknown,57,none,free,2,skilled,2,yes,yes,Risk\r\nno_checking,9,prior_payments_delayed,car_new,1032,100_to_500,4_to_7,3,male,none,4,savings_insurance,41,none,own,1,management_self-employed,1,none,yes,No Risk\r\nless_0,16,credits_paid_to_date,vacation,3109,less_100,4_to_7,3,female,none,1,car_other,36,none,own,2,skilled,1,none,yes,No Risk\r\n0_to_200,11,credits_paid_to_date,car_new,4553,less_100,less_1,3,female,none,3,savings_insurance,22,none,own,1,management_self-employed,1,none,yes,No Risk\r\nno_checking,35,outstanding_credit,appliances,7138,500_to_1000,greater_7,5,male,co-applicant,4,unknown,49,none,free,2,skilled,2,yes,yes,Risk\r\nless_0,5,all_credits_paid_back,car_new,1523,less_100,unemployed,2,female,none,2,real_estate,19,none,rent,1,management_self-employed,1,none,yes,No Risk\r\nless_0,9,all_credits_paid_back,car_used,4302,less_100,1_to_4,3,male,none,1,car_other,34,none,free,1,skilled,1,none,yes,No Risk\r\nno_checking,27,outstanding_credit,furniture,3310,500_to_1000,greater_7,5,male,none,3,car_other,40,none,free,1,skilled,1,yes,yes,No Risk\r\n0_to_200,29,credits_paid_to_date,furniture,3705,less_100,less_1,3,female,co-applicant,3,car_other,44,none,own,1,skilled,1,none,yes,No Risk\r\ngreater_200,4,all_credits_paid_back,car_new,2407,less_100,1_to_4,3,female,none,2,car_other,52,none,own,1,skilled,2,yes,yes,No Risk\r\nno_checking,33,all_credits_paid_back,furniture,3810,100_to_500,less_1,2,female,co-applicant,4,savings_insurance,35,none,own,1,skilled,1,none,yes,Risk\r\n0_to_200,4,all_credits_paid_back,car_new,250,less_100,1_to_4,2,female,none,1,real_estate,26,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,39,prior_payments_delayed,repairs,7150,500_to_1000,4_to_7,3,male,co-applicant,4,unknown,52,none,own,2,skilled,1,yes,yes,Risk\r\n0_to_200,4,all_credits_paid_back,car_new,250,less_100,1_to_4,2,female,none,2,real_estate,28,none,own,1,skilled,1,none,yes,No Risk\r\nless_0,13,all_credits_paid_back,vacation,2317,less_100,less_1,2,female,none,2,savings_insurance,27,stores,own,2,skilled,1,none,yes,No Risk\r\n0_to_200,15,prior_payments_delayed,furniture,250,500_to_1000,4_to_7,3,male,none,2,savings_insurance,24,none,own,2,skilled,2,yes,yes,No Risk\r\n0_to_200,16,prior_payments_delayed,car_new,5551,100_to_500,1_to_4,3,male,none,3,car_other,34,none,rent,2,management_self-employed,1,none,yes,No Risk\r\nno_checking,34,prior_payments_delayed,furniture,6063,unknown,1_to_4,4,male,none,5,car_other,40,none,own,2,skilled,1,none,yes,No Risk\r\nless_0,13,all_credits_paid_back,radio_tv,1045,100_to_500,less_1,2,female,none,1,real_estate,24,none,rent,1,skilled,1,none,yes,No Risk\r\nless_0,15,credits_paid_to_date,vacation,250,less_100,4_to_7,2,female,none,2,real_estate,19,stores,rent,1,skilled,1,none,yes,No Risk\r\n0_to_200,33,credits_paid_to_date,repairs,3946,less_100,4_to_7,2,female,none,2,car_other,33,stores,own,1,unskilled,1,none,yes,No Risk\r\nless_0,23,prior_payments_delayed,car_used,250,greater_1000,1_to_4,2,male,none,3,real_estate,19,stores,rent,1,skilled,1,none,yes,No Risk\r\nless_0,9,prior_payments_delayed,furniture,292,less_100,less_1,2,female,none,3,car_other,51,none,rent,1,skilled,1,none,yes,No Risk\r\nno_checking,10,prior_payments_delayed,radio_tv,4312,100_to_500,less_1,3,female,none,3,car_other,38,none,own,1,skilled,2,yes,yes,No Risk\r\nno_checking,25,outstanding_credit,radio_tv,6945,500_to_1000,1_to_4,4,male,none,4,unknown,46,none,own,1,management_self-employed,1,yes,yes,Risk\r\nno_checking,20,prior_payments_delayed,appliances,2827,unknown,4_to_7,3,male,co-applicant,3,savings_insurance,31,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,26,prior_payments_delayed,appliances,4391,500_to_1000,greater_7,4,male,none,3,car_other,39,stores,own,2,unskilled,2,yes,yes,Risk\r\nless_0,21,prior_payments_delayed,car_used,319,100_to_500,greater_7,3,male,none,3,savings_insurance,32,none,rent,1,skilled,1,none,yes,Risk\r\n0_to_200,28,credits_paid_to_date,furniture,3519,less_100,4_to_7,4,male,none,2,savings_insurance,39,none,own,1,skilled,1,yes,yes,No Risk\r\n0_to_200,7,credits_paid_to_date,car_new,250,less_100,less_1,1,female,none,2,real_estate,31,none,own,1,skilled,1,none,yes,No Risk\r\nless_0,15,prior_payments_delayed,car_used,1420,100_to_500,4_to_7,2,male,none,3,car_other,35,stores,rent,1,skilled,1,none,yes,No Risk\r\ngreater_200,14,prior_payments_delayed,car_new,1683,100_to_500,1_to_4,3,male,co-applicant,4,savings_insurance,35,none,own,1,skilled,1,yes,yes,No Risk\r\nno_checking,28,outstanding_credit,car_used,4904,500_to_1000,1_to_4,2,male,none,3,car_other,40,none,own,1,skilled,2,yes,yes,Risk\r\nno_checking,28,prior_payments_delayed,repairs,3789,100_to_500,4_to_7,4,male,none,4,car_other,29,none,own,2,skilled,1,none,yes,Risk\r\nno_checking,64,outstanding_credit,retraining,9918,unknown,4_to_7,6,male,co-applicant,5,unknown,49,none,free,2,skilled,2,yes,yes,Risk\r\n0_to_200,6,all_credits_paid_back,car_used,3115,less_100,1_to_4,2,female,co-applicant,2,real_estate,27,none,own,1,skilled,1,none,yes,Risk\r\nless_0,10,all_credits_paid_back,car_new,1400,less_100,less_1,1,female,none,1,car_other,28,stores,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,7,all_credits_paid_back,car_new,250,less_100,less_1,2,male,none,1,real_estate,22,none,rent,1,skilled,1,none,yes,No Risk\r\nno_checking,31,prior_payments_delayed,furniture,7685,100_to_500,4_to_7,4,male,none,4,unknown,51,none,free,2,skilled,1,yes,yes,Risk\r\nless_0,4,credits_paid_to_date,car_new,250,less_100,1_to_4,2,female,none,1,real_estate,19,stores,own,1,skilled,1,none,yes,No Risk\r\nno_checking,25,credits_paid_to_date,radio_tv,3818,greater_1000,1_to_4,2,male,none,4,savings_insurance,36,none,rent,2,skilled,1,none,yes,Risk\r\n0_to_200,19,credits_paid_to_date,car_used,1897,100_to_500,unemployed,1,male,none,3,savings_insurance,19,none,rent,1,skilled,1,none,yes,No Risk\r\nless_0,39,outstanding_credit,appliances,4131,100_to_500,1_to_4,4,male,none,4,unknown,29,bank,own,1,unskilled,1,yes,yes,No Risk\r\nno_checking,35,outstanding_credit,repairs,3541,greater_1000,greater_7,5,male,none,4,car_other,45,none,own,1,skilled,1,yes,yes,Risk\r\nless_0,17,credits_paid_to_date,repairs,3861,less_100,1_to_4,3,male,none,3,real_estate,25,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,38,outstanding_credit,other,6086,unknown,greater_7,4,female,co-applicant,5,unknown,44,stores,rent,2,unskilled,2,yes,yes,Risk\r\nno_checking,26,prior_payments_delayed,radio_tv,6402,100_to_500,4_to_7,4,female,none,4,unknown,52,none,free,2,skilled,1,yes,yes,No Risk\r\nno_checking,8,no_credits,car_new,250,less_100,1_to_4,3,female,none,3,real_estate,46,none,own,2,management_self-employed,2,none,yes,No Risk\r\nno_checking,30,outstanding_credit,appliances,7650,500_to_1000,1_to_4,4,male,none,4,unknown,59,none,free,2,management_self-employed,2,yes,yes,Risk\r\nno_checking,28,outstanding_credit,appliances,5990,500_to_1000,greater_7,5,male,co-applicant,3,car_other,55,none,free,2,skilled,2,yes,yes,Risk\r\ngreater_200,22,all_credits_paid_back,car_used,3376,less_100,less_1,3,female,none,2,car_other,32,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,39,credits_paid_to_date,vacation,6434,unknown,greater_7,5,male,none,4,car_other,39,none,own,2,skilled,2,yes,yes,Risk\r\n0_to_200,20,credits_paid_to_date,furniture,2442,less_100,unemployed,3,female,none,1,real_estate,42,none,own,1,skilled,1,none,yes,No Risk\r\ngreater_200,4,all_credits_paid_back,education,4206,less_100,unemployed,1,female,none,3,savings_insurance,27,none,own,1,management_self-employed,1,none,yes,No Risk\r\ngreater_200,23,credits_paid_to_date,car_used,2963,greater_1000,greater_7,4,male,none,4,car_other,46,none,own,2,skilled,1,none,yes,Risk\r\nno_checking,31,prior_payments_delayed,vacation,2673,500_to_1000,1_to_4,3,male,none,2,real_estate,35,stores,rent,1,skilled,2,none,yes,Risk\r\nno_checking,37,prior_payments_delayed,other,6971,500_to_1000,1_to_4,3,male,none,3,savings_insurance,54,none,own,2,skilled,1,yes,yes,Risk\r\nno_checking,14,all_credits_paid_back,car_new,1525,500_to_1000,4_to_7,3,male,none,4,real_estate,33,none,own,1,skilled,1,none,yes,No Risk\r\nless_0,10,prior_payments_delayed,furniture,4037,less_100,4_to_7,3,male,none,3,savings_insurance,31,none,rent,1,skilled,1,none,yes,Risk\r\n0_to_200,28,credits_paid_to_date,retraining,1152,less_100,less_1,2,female,none,2,savings_insurance,20,stores,own,1,skilled,1,none,yes,No Risk\r\nless_0,17,credits_paid_to_date,car_new,1880,less_100,less_1,3,female,co-applicant,2,savings_insurance,41,none,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,39,prior_payments_delayed,appliances,5685,100_to_500,1_to_4,4,female,none,2,unknown,37,none,own,2,skilled,1,yes,yes,Risk\r\nno_checking,32,prior_payments_delayed,radio_tv,5105,500_to_1000,1_to_4,4,male,none,5,savings_insurance,44,none,own,2,management_self-employed,1,none,yes,Risk\r\nno_checking,38,prior_payments_delayed,appliances,4990,500_to_1000,greater_7,4,male,none,4,car_other,50,bank,own,2,unemployed,2,yes,yes,Risk\r\nless_0,17,credits_paid_to_date,furniture,1017,less_100,less_1,2,female,none,1,car_other,30,none,own,1,skilled,1,none,yes,No Risk\r\nless_0,33,all_credits_paid_back,car_new,3618,500_to_1000,4_to_7,2,male,none,3,unknown,31,stores,own,2,unskilled,1,none,yes,No Risk\r\nless_0,12,no_credits,car_new,3037,less_100,less_1,1,female,none,2,car_other,31,stores,own,1,skilled,1,none,yes,No Risk\r\nno_checking,23,prior_payments_delayed,furniture,1440,100_to_500,1_to_4,3,female,none,3,real_estate,39,stores,own,1,unskilled,1,yes,yes,No Risk\r\nless_0,18,prior_payments_delayed,retraining,4032,less_100,1_to_4,2,female,none,2,car_other,36,none,rent,1,skilled,1,none,yes,No Risk\r\nno_checking,11,prior_payments_delayed,car_used,944,greater_1000,1_to_4,3,male,none,4,real_estate,35,none,own,1,management_self-employed,1,yes,yes,No Risk\r\nno_checking,36,prior_payments_delayed,appliances,5927,unknown,greater_7,4,male,co-applicant,3,savings_insurance,47,none,own,2,skilled,1,none,yes,Risk\r\nno_checking,50,outstanding_credit,other,4694,unknown,greater_7,4,male,none,4,unknown,37,none,own,1,skilled,2,yes,yes,Risk\r\nno_checking,32,prior_payments_delayed,radio_tv,10584,100_to_500,1_to_4,3,male,co-applicant,3,unknown,46,stores,own,2,unskilled,2,yes,yes,No Risk\r\nno_checking,41,prior_payments_delayed,furniture,8900,500_to_1000,4_to_7,4,male,co-applicant,3,car_other,26,none,free,2,skilled,1,yes,yes,Risk\r\n0_to_200,14,credits_paid_to_date,car_used,1144,100_to_500,less_1,2,female,none,2,real_estate,33,none,rent,1,skilled,1,none,yes,No Risk\r\nno_checking,14,outstanding_credit,appliances,1680,100_to_500,greater_7,4,male,none,3,car_other,47,none,own,1,management_self-employed,1,none,yes,No Risk\r\n0_to_200,23,credits_paid_to_date,retraining,3387,less_100,less_1,3,female,none,3,savings_insurance,28,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,14,credits_paid_to_date,furniture,1269,500_to_1000,greater_7,2,male,none,2,savings_insurance,39,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,36,prior_payments_delayed,appliances,9570,100_to_500,4_to_7,4,male,co-applicant,3,car_other,53,none,free,2,skilled,1,yes,yes,No Risk\r\nless_0,16,credits_paid_to_date,car_new,1428,less_100,4_to_7,1,male,none,1,car_other,20,bank,rent,1,unemployed,1,yes,yes,No Risk\r\nno_checking,24,outstanding_credit,car_used,4620,greater_1000,1_to_4,3,male,none,4,savings_insurance,40,none,own,2,skilled,1,yes,yes,No Risk\r\nno_checking,34,prior_payments_delayed,furniture,2196,500_to_1000,greater_7,3,male,none,4,savings_insurance,27,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,25,prior_payments_delayed,car_used,8708,100_to_500,1_to_4,4,male,none,5,car_other,43,none,free,2,management_self-employed,1,none,yes,No Risk\r\nno_checking,37,outstanding_credit,radio_tv,10550,unknown,greater_7,5,male,co-applicant,4,unknown,48,stores,own,2,unemployed,2,yes,yes,Risk\r\nno_checking,27,prior_payments_delayed,radio_tv,4981,500_to_1000,4_to_7,4,male,none,4,savings_insurance,47,none,own,2,management_self-employed,2,yes,yes,No Risk\r\nless_0,13,all_credits_paid_back,car_new,2436,less_100,less_1,2,female,none,1,savings_insurance,19,stores,own,1,skilled,1,none,yes,No Risk\r\ngreater_200,25,outstanding_credit,appliances,4136,100_to_500,4_to_7,3,male,none,2,car_other,46,bank,own,1,unemployed,1,yes,yes,No Risk\r\nno_checking,15,credits_paid_to_date,retraining,4014,less_100,1_to_4,4,male,co-applicant,4,savings_insurance,33,none,own,1,skilled,1,yes,yes,Risk\r\nno_checking,28,prior_payments_delayed,appliances,5440,100_to_500,4_to_7,3,male,none,2,unknown,40,none,own,2,skilled,1,yes,yes,Risk\r\nless_0,13,prior_payments_delayed,appliances,250,500_to_1000,4_to_7,2,male,none,3,car_other,28,stores,own,1,skilled,1,none,yes,No Risk\r\nless_0,19,credits_paid_to_date,furniture,2111,less_100,4_to_7,3,male,none,2,savings_insurance,34,bank,own,1,unemployed,2,none,yes,No Risk\r\nno_checking,27,prior_payments_delayed,appliances,6455,100_to_500,4_to_7,3,male,none,4,car_other,43,none,own,1,skilled,1,none,yes,Risk\r\nless_0,17,credits_paid_to_date,car_used,250,less_100,4_to_7,3,female,none,2,real_estate,40,none,free,2,skilled,1,none,yes,No Risk\r\nno_checking,27,prior_payments_delayed,radio_tv,4521,100_to_500,less_1,4,male,none,4,savings_insurance,28,none,own,1,management_self-employed,2,yes,yes,No Risk\r\nno_checking,37,prior_payments_delayed,other,7945,500_to_1000,1_to_4,4,male,none,4,savings_insurance,39,none,own,2,management_self-employed,1,none,yes,No Risk\r\nless_0,6,all_credits_paid_back,car_used,250,less_100,1_to_4,2,male,none,2,savings_insurance,28,stores,rent,1,skilled,1,none,yes,Risk\r\nless_0,14,all_credits_paid_back,appliances,1431,less_100,unemployed,1,female,none,1,car_other,25,stores,own,1,skilled,1,none,yes,Risk\r\ngreater_200,5,credits_paid_to_date,car_used,250,less_100,4_to_7,3,male,none,2,savings_insurance,42,none,rent,1,skilled,1,none,yes,No Risk\r\nless_0,11,all_credits_paid_back,furniture,2016,less_100,less_1,1,female,none,1,car_other,34,bank,own,1,unemployed,1,none,yes,No Risk\r\nless_0,4,credits_paid_to_date,car_new,250,less_100,unemployed,1,female,none,1,real_estate,29,none,rent,1,skilled,1,none,yes,No Risk\r\n0_to_200,16,prior_payments_delayed,radio_tv,1923,100_to_500,less_1,3,female,none,2,car_other,46,none,rent,1,skilled,2,none,yes,Risk\r\nless_0,5,prior_payments_delayed,car_used,2528,less_100,1_to_4,2,male,none,2,real_estate,23,none,rent,1,skilled,1,none,yes,No Risk\r\ngreater_200,29,prior_payments_delayed,vacation,7083,500_to_1000,4_to_7,4,male,none,4,unknown,49,none,own,2,skilled,2,yes,yes,Risk\r\nno_checking,43,prior_payments_delayed,repairs,8886,greater_1000,greater_7,5,male,co-applicant,4,car_other,35,none,free,2,skilled,1,yes,yes,No Risk\r\nno_checking,24,prior_payments_delayed,radio_tv,4393,100_to_500,less_1,3,female,none,3,real_estate,41,none,own,1,management_self-employed,1,none,yes,No Risk\r\nno_checking,32,outstanding_credit,appliances,8032,500_to_1000,1_to_4,3,male,none,3,unknown,41,none,own,1,skilled,1,none,yes,No Risk\r\nless_0,20,credits_paid_to_date,car_used,6201,500_to_1000,4_to_7,4,male,guarantor,4,unknown,40,stores,own,2,unskilled,1,yes,yes,No Risk\r\n0_to_200,28,prior_payments_delayed,car_used,3952,greater_1000,greater_7,4,male,none,4,savings_insurance,36,none,own,2,skilled,1,none,yes,No Risk\r\nless_0,16,prior_payments_delayed,car_used,2122,less_100,1_to_4,2,male,none,3,car_other,32,none,own,2,skilled,1,none,yes,No Risk\r\nless_0,4,all_credits_paid_back,car_new,250,less_100,unemployed,1,male,none,1,real_estate,19,none,rent,1,skilled,1,none,yes,No Risk\r\nno_checking,29,outstanding_credit,appliances,5220,500_to_1000,greater_7,4,male,co-applicant,3,car_other,52,none,free,2,skilled,1,yes,yes,Risk\r\nless_0,13,credits_paid_to_date,furniture,1276,500_to_1000,1_to_4,3,male,none,1,real_estate,23,none,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,14,credits_paid_to_date,furniture,1074,less_100,4_to_7,3,male,none,2,savings_insurance,35,none,rent,1,skilled,1,none,yes,No Risk\r\nless_0,4,all_credits_paid_back,radio_tv,250,less_100,unemployed,2,male,none,1,real_estate,19,none,rent,1,skilled,1,none,yes,No Risk\r\n0_to_200,16,credits_paid_to_date,vacation,2691,less_100,1_to_4,3,female,none,2,car_other,36,none,free,1,skilled,1,none,yes,No Risk\r\ngreater_200,10,credits_paid_to_date,furniture,1668,less_100,less_1,2,female,none,2,real_estate,20,none,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,29,credits_paid_to_date,radio_tv,5536,less_100,4_to_7,3,female,none,3,unknown,52,stores,own,2,skilled,1,yes,yes,No Risk\r\n0_to_200,20,credits_paid_to_date,car_used,3713,less_100,less_1,3,male,none,2,real_estate,29,none,rent,1,skilled,1,none,yes,No Risk\r\nno_checking,32,outstanding_credit,repairs,6331,unknown,greater_7,5,male,co-applicant,4,car_other,48,none,free,2,management_self-employed,2,yes,yes,Risk\r\nless_0,7,credits_paid_to_date,vacation,250,less_100,4_to_7,3,female,none,3,real_estate,19,none,own,1,skilled,1,none,yes,No Risk\r\nless_0,33,credits_paid_to_date,business,2398,less_100,less_1,3,male,none,3,savings_insurance,22,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,37,prior_payments_delayed,other,5843,unknown,greater_7,5,male,none,3,savings_insurance,49,none,own,3,skilled,2,yes,yes,Risk\r\nless_0,14,all_credits_paid_back,furniture,250,less_100,less_1,2,male,none,1,real_estate,30,none,own,2,skilled,1,none,yes,No Risk\r\nno_checking,25,prior_payments_delayed,radio_tv,7587,500_to_1000,1_to_4,4,male,none,4,car_other,38,none,own,2,management_self-employed,1,none,yes,No Risk\r\n0_to_200,13,prior_payments_delayed,radio_tv,2453,less_100,4_to_7,3,male,none,2,car_other,39,none,own,2,skilled,1,none,yes,No Risk\r\n0_to_200,4,prior_payments_delayed,car_used,357,less_100,less_1,2,female,none,2,savings_insurance,34,bank,rent,1,unskilled,1,none,yes,No Risk\r\n0_to_200,18,prior_payments_delayed,retraining,7506,500_to_1000,1_to_4,3,male,none,3,unknown,46,none,free,3,skilled,1,yes,yes,Risk\r\nless_0,14,prior_payments_delayed,furniture,1697,less_100,1_to_4,3,female,none,3,car_other,19,none,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,14,credits_paid_to_date,car_new,1939,500_to_1000,1_to_4,2,male,co-applicant,4,car_other,36,none,free,1,skilled,1,yes,yes,Risk\r\nless_0,4,all_credits_paid_back,car_new,2783,less_100,less_1,2,female,none,1,savings_insurance,31,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,35,outstanding_credit,appliances,6996,unknown,greater_7,5,male,co-applicant,4,unknown,52,stores,own,2,unskilled,2,yes,yes,Risk\r\nno_checking,23,prior_payments_delayed,furniture,3786,greater_1000,4_to_7,4,male,guarantor,5,car_other,38,none,own,1,skilled,1,yes,yes,No Risk\r\n0_to_200,23,prior_payments_delayed,retraining,2964,less_100,less_1,2,male,none,3,real_estate,32,none,own,1,skilled,1,yes,yes,No Risk\r\nless_0,12,all_credits_paid_back,furniture,250,less_100,unemployed,2,female,none,2,savings_insurance,27,bank,rent,1,unemployed,2,yes,yes,No Risk\r\nno_checking,25,outstanding_credit,education,5614,500_to_1000,1_to_4,4,male,none,3,car_other,45,none,own,1,management_self-employed,1,none,yes,No Risk\r\nless_0,4,all_credits_paid_back,vacation,2064,less_100,1_to_4,2,female,none,1,savings_insurance,19,bank,rent,1,unskilled,1,none,yes,No Risk\r\nno_checking,35,prior_payments_delayed,furniture,5222,unknown,greater_7,4,male,guarantor,3,savings_insurance,53,none,free,2,skilled,2,yes,yes,No Risk\r\nno_checking,25,credits_paid_to_date,car_used,2056,500_to_1000,4_to_7,3,male,none,4,real_estate,30,stores,own,2,skilled,1,none,yes,No Risk\r\nless_0,14,all_credits_paid_back,car_used,250,less_100,1_to_4,1,female,none,2,car_other,33,stores,rent,1,unskilled,1,none,yes,No Risk\r\nno_checking,8,credits_paid_to_date,vacation,4448,less_100,4_to_7,2,male,none,3,car_other,40,none,own,1,management_self-employed,1,yes,yes,Risk\r\n0_to_200,24,outstanding_credit,radio_tv,3091,500_to_1000,less_1,2,male,none,3,savings_insurance,37,bank,rent,2,unskilled,2,yes,yes,No Risk\r\n0_to_200,11,credits_paid_to_date,vacation,3605,less_100,1_to_4,3,female,none,2,savings_insurance,19,none,rent,1,skilled,1,none,yes,No Risk\r\n0_to_200,14,prior_payments_delayed,car_new,2609,less_100,4_to_7,4,male,none,2,savings_insurance,33,bank,rent,1,unskilled,1,yes,yes,No Risk\r\nno_checking,8,credits_paid_to_date,furniture,463,greater_1000,4_to_7,3,male,none,4,savings_insurance,42,none,own,2,skilled,1,yes,yes,No Risk\r\ngreater_200,35,all_credits_paid_back,car_used,5208,less_100,4_to_7,3,male,none,2,savings_insurance,31,none,own,2,skilled,1,yes,yes,No Risk\r\n0_to_200,16,credits_paid_to_date,furniture,1524,less_100,less_1,1,female,none,1,savings_insurance,36,stores,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,22,credits_paid_to_date,radio_tv,2783,less_100,less_1,3,male,none,2,savings_insurance,28,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,16,credits_paid_to_date,repairs,6907,less_100,less_1,4,female,none,3,car_other,34,none,own,1,management_self-employed,1,yes,yes,No Risk\r\nless_0,16,all_credits_paid_back,car_new,250,100_to_500,less_1,1,male,none,1,savings_insurance,20,none,rent,1,skilled,1,none,yes,No Risk\r\nless_0,15,credits_paid_to_date,furniture,250,less_100,4_to_7,2,male,none,1,savings_insurance,27,stores,own,1,skilled,1,none,yes,No Risk\r\nno_checking,41,outstanding_credit,retraining,6674,500_to_1000,4_to_7,5,male,none,5,savings_insurance,44,stores,free,2,unskilled,1,yes,yes,Risk\r\n0_to_200,26,credits_paid_to_date,radio_tv,250,less_100,4_to_7,2,male,none,2,real_estate,22,stores,own,1,skilled,1,none,yes,No Risk\r\nless_0,16,prior_payments_delayed,car_new,1149,less_100,1_to_4,3,male,none,2,savings_insurance,45,none,own,2,skilled,1,yes,yes,Risk\r\nno_checking,25,prior_payments_delayed,repairs,4183,100_to_500,1_to_4,4,female,none,2,car_other,24,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,40,outstanding_credit,retraining,7846,greater_1000,greater_7,4,male,guarantor,4,unknown,56,none,free,2,skilled,1,yes,yes,Risk\r\nno_checking,13,all_credits_paid_back,furniture,778,less_100,4_to_7,2,male,none,2,savings_insurance,22,none,rent,1,skilled,1,none,yes,No Risk\r\nno_checking,50,outstanding_credit,appliances,7443,unknown,greater_7,4,male,co-applicant,4,unknown,56,bank,own,3,unemployed,2,yes,yes,Risk\r\n0_to_200,25,outstanding_credit,furniture,1244,100_to_500,1_to_4,2,female,none,3,savings_insurance,40,stores,free,2,skilled,1,yes,yes,No Risk\r\n0_to_200,25,all_credits_paid_back,radio_tv,2429,500_to_1000,1_to_4,3,male,none,3,savings_insurance,29,none,own,1,skilled,1,none,yes,No Risk\r\nless_0,4,all_credits_paid_back,car_new,250,less_100,unemployed,1,female,none,2,real_estate,19,none,rent,1,skilled,1,none,yes,No Risk\r\nno_checking,25,outstanding_credit,furniture,5371,500_to_1000,greater_7,4,male,none,4,unknown,45,none,free,2,skilled,2,yes,yes,Risk\r\nno_checking,31,prior_payments_delayed,appliances,3453,500_to_1000,less_1,3,female,co-applicant,3,savings_insurance,27,none,own,1,skilled,1,yes,yes,Risk\r\nno_checking,35,prior_payments_delayed,repairs,5601,unknown,4_to_7,4,male,none,5,car_other,42,none,rent,2,skilled,1,yes,yes,No Risk\r\n0_to_200,4,prior_payments_delayed,car_new,250,less_100,1_to_4,2,male,none,2,real_estate,29,none,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,19,credits_paid_to_date,retraining,5368,less_100,4_to_7,3,female,none,1,unknown,42,none,own,1,skilled,2,none,yes,No Risk\r\nless_0,4,no_credits,car_new,250,less_100,unemployed,1,male,none,2,real_estate,19,none,rent,1,skilled,1,none,yes,No Risk\r\nno_checking,48,outstanding_credit,other,7083,500_to_1000,greater_7,5,male,co-applicant,4,unknown,53,none,free,2,skilled,2,yes,yes,Risk\r\n0_to_200,18,credits_paid_to_date,car_new,250,less_100,unemployed,2,female,none,2,real_estate,24,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,25,outstanding_credit,furniture,6221,unknown,4_to_7,4,male,co-applicant,5,car_other,54,none,free,3,management_self-employed,2,yes,yes,Risk\r\n0_to_200,13,credits_paid_to_date,car_new,2719,500_to_1000,1_to_4,3,male,none,2,savings_insurance,38,none,own,2,skilled,1,none,yes,No Risk\r\n0_to_200,17,prior_payments_delayed,car_new,4188,greater_1000,greater_7,4,male,none,3,unknown,43,none,own,2,skilled,1,none,yes,No Risk\r\n0_to_200,5,no_credits,car_new,4855,less_100,unemployed,1,female,none,3,car_other,25,none,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,21,prior_payments_delayed,retraining,5308,greater_1000,greater_7,3,male,none,3,unknown,40,none,own,2,skilled,1,none,yes,No Risk\r\n0_to_200,6,prior_payments_delayed,car_new,3452,less_100,4_to_7,3,male,co-applicant,4,car_other,48,none,own,1,skilled,1,none,yes,Risk\r\nno_checking,29,prior_payments_delayed,radio_tv,10213,500_to_1000,less_1,3,male,none,4,car_other,38,none,own,2,management_self-employed,1,none,yes,No Risk\r\n0_to_200,26,all_credits_paid_back,furniture,3416,less_100,1_to_4,3,male,none,1,savings_insurance,19,stores,own,1,unskilled,1,none,yes,No Risk\r\n0_to_200,13,prior_payments_delayed,radio_tv,3910,less_100,less_1,3,male,none,3,car_other,36,stores,own,2,unskilled,1,none,yes,No Risk\r\nless_0,4,credits_paid_to_date,car_new,250,less_100,1_to_4,2,female,none,2,real_estate,22,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,46,outstanding_credit,other,8464,500_to_1000,4_to_7,5,male,none,4,car_other,47,none,free,2,management_self-employed,1,none,yes,Risk\r\ngreater_200,8,credits_paid_to_date,vacation,2674,less_100,less_1,3,female,none,2,savings_insurance,21,none,own,2,management_self-employed,1,none,yes,No Risk\r\nno_checking,27,prior_payments_delayed,appliances,5893,100_to_500,greater_7,5,female,none,4,car_other,46,none,free,2,skilled,1,none,yes,No Risk\r\ngreater_200,24,credits_paid_to_date,radio_tv,5600,less_100,less_1,4,male,none,3,car_other,38,stores,own,2,unskilled,1,none,yes,No Risk\r\n0_to_200,21,credits_paid_to_date,car_new,2442,less_100,4_to_7,3,male,none,4,real_estate,47,none,own,1,management_self-employed,1,none,yes,No Risk\r\nno_checking,11,credits_paid_to_date,furniture,2187,less_100,1_to_4,3,female,none,2,real_estate,33,none,own,1,skilled,1,yes,yes,No Risk\r\n0_to_200,36,outstanding_credit,appliances,5495,unknown,greater_7,5,male,none,3,unknown,49,none,own,2,skilled,2,yes,yes,Risk\r\nno_checking,8,prior_payments_delayed,radio_tv,2254,100_to_500,greater_7,4,male,none,4,savings_insurance,43,none,own,1,management_self-employed,1,none,yes,Risk\r\nless_0,8,prior_payments_delayed,furniture,1832,less_100,4_to_7,3,male,none,3,real_estate,31,none,rent,1,skilled,1,none,yes,No Risk\r\nno_checking,27,outstanding_credit,radio_tv,2996,unknown,4_to_7,4,male,none,3,savings_insurance,36,none,own,2,skilled,1,yes,yes,No Risk\r\n0_to_200,15,credits_paid_to_date,furniture,3322,100_to_500,4_to_7,3,female,none,2,car_other,34,none,own,2,skilled,1,yes,yes,No Risk\r\nno_checking,9,credits_paid_to_date,car_new,1884,less_100,less_1,2,female,none,3,savings_insurance,27,stores,own,1,unskilled,1,yes,yes,No Risk\r\nless_0,10,all_credits_paid_back,car_new,250,less_100,less_1,1,female,none,2,real_estate,19,none,rent,1,skilled,1,none,yes,No Risk\r\ngreater_200,33,prior_payments_delayed,furniture,1231,100_to_500,1_to_4,3,male,none,2,savings_insurance,41,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,25,prior_payments_delayed,business,6453,greater_1000,greater_7,4,male,none,3,car_other,48,none,own,2,skilled,1,none,yes,Risk\r\nno_checking,27,prior_payments_delayed,furniture,7158,100_to_500,greater_7,5,male,none,3,car_other,37,stores,own,2,unskilled,1,none,yes,No Risk\r\n0_to_200,31,outstanding_credit,furniture,5702,100_to_500,greater_7,3,male,none,4,unknown,47,none,own,2,skilled,1,yes,yes,Risk\r\n0_to_200,14,credits_paid_to_date,car_new,2886,100_to_500,unemployed,1,male,none,1,savings_insurance,29,stores,own,1,skilled,1,none,yes,No Risk\r\nless_0,15,prior_payments_delayed,furniture,2746,500_to_1000,greater_7,3,male,none,1,car_other,41,stores,own,2,skilled,1,none,yes,No Risk\r\nno_checking,9,prior_payments_delayed,radio_tv,3533,greater_1000,greater_7,3,male,none,4,car_other,38,none,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,17,prior_payments_delayed,furniture,2292,100_to_500,1_to_4,3,male,none,3,car_other,36,none,own,2,management_self-employed,1,none,yes,Risk\r\n0_to_200,4,all_credits_paid_back,car_new,250,100_to_500,less_1,2,female,none,3,real_estate,26,bank,rent,1,unskilled,1,none,yes,No Risk\r\n0_to_200,16,prior_payments_delayed,radio_tv,2208,less_100,greater_7,4,female,none,3,car_other,43,none,free,2,skilled,1,yes,yes,No Risk\r\nless_0,4,credits_paid_to_date,car_new,250,100_to_500,less_1,1,female,none,2,savings_insurance,21,none,rent,1,skilled,1,none,yes,No Risk\r\nless_0,15,credits_paid_to_date,car_new,3012,less_100,1_to_4,2,male,none,1,real_estate,27,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,8,prior_payments_delayed,furniture,1073,unknown,4_to_7,3,male,none,3,car_other,46,none,own,1,skilled,1,yes,yes,No Risk\r\nno_checking,27,prior_payments_delayed,appliances,4164,100_to_500,4_to_7,3,female,none,4,savings_insurance,54,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,29,outstanding_credit,repairs,4794,500_to_1000,4_to_7,4,male,none,3,unknown,30,none,own,1,skilled,1,yes,yes,No Risk\r\n0_to_200,14,credits_paid_to_date,vacation,2511,100_to_500,1_to_4,2,female,none,1,real_estate,29,none,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,20,prior_payments_delayed,radio_tv,3424,greater_1000,1_to_4,2,male,none,3,unknown,27,none,own,1,skilled,1,yes,yes,No Risk\r\nno_checking,44,outstanding_credit,appliances,7532,greater_1000,greater_7,4,male,co-applicant,3,unknown,47,none,own,2,skilled,1,none,yes,Risk\r\nno_checking,41,credits_paid_to_date,appliances,2901,100_to_500,4_to_7,4,female,none,3,savings_insurance,36,none,own,1,skilled,1,none,yes,No Risk\r\nno_checking,36,outstanding_credit,repairs,5673,unknown,greater_7,5,male,none,4,unknown,48,none,own,2,skilled,1,none,yes,Risk\r\ngreater_200,17,credits_paid_to_date,car_new,250,greater_1000,less_1,1,male,co-applicant,2,real_estate,40,none,own,1,skilled,1,yes,yes,No Risk\r\nless_0,14,all_credits_paid_back,car_used,1543,less_100,less_1,2,female,none,2,real_estate,21,none,rent,1,skilled,1,none,yes,No Risk\r\n0_to_200,4,all_credits_paid_back,car_used,1008,less_100,unemployed,2,female,none,3,real_estate,19,none,rent,1,management_self-employed,1,none,yes,No Risk\r\nless_0,11,prior_payments_delayed,furniture,1546,500_to_1000,4_to_7,3,male,none,3,savings_insurance,28,none,own,2,skilled,1,yes,yes,Risk\r\nno_checking,10,credits_paid_to_date,car_used,5056,less_100,4_to_7,3,male,none,3,savings_insurance,47,none,own,3,skilled,1,yes,yes,Risk\r\nno_checking,28,outstanding_credit,car_used,4926,500_to_1000,1_to_4,3,male,none,3,savings_insurance,38,none,own,2,skilled,2,yes,no,Risk\r\n0_to_200,44,prior_payments_delayed,appliances,5045,unknown,greater_7,4,male,guarantor,4,unknown,36,stores,free,2,unskilled,1,yes,yes,No Risk\r\nno_checking,26,prior_payments_delayed,education,5740,100_to_500,4_to_7,4,male,none,4,car_other,43,none,own,2,management_self-employed,1,yes,yes,Risk\r\nno_checking,36,prior_payments_delayed,other,3114,unknown,4_to_7,3,male,none,4,savings_insurance,27,bank,own,1,unemployed,1,none,yes,No Risk\r\nless_0,26,credits_paid_to_date,car_used,3243,less_100,1_to_4,3,male,none,3,car_other,36,none,own,1,skilled,1,none,yes,Risk\r\nless_0,8,all_credits_paid_back,car_used,250,100_to_500,unemployed,1,female,none,2,real_estate,20,bank,rent,1,unemployed,1,none,yes,No Risk\r\n0_to_200,15,prior_payments_delayed,vacation,5913,less_100,1_to_4,4,male,none,2,unknown,40,none,own,2,management_self-employed,1,none,yes,Risk\r\nno_checking,29,outstanding_credit,appliances,6238,500_to_1000,4_to_7,3,male,none,3,car_other,41,none,own,1,skilled,1,none,yes,Risk\r\nless_0,11,all_credits_paid_back,car_new,250,less_100,unemployed,1,male,none,1,real_estate,26,bank,rent,1,unskilled,1,none,yes,No Risk\r\nless_0,16,prior_payments_delayed,appliances,250,less_100,4_to_7,1,male,none,2,savings_insurance,22,stores,own,1,unskilled,1,none,yes,Risk\r\nless_0,13,all_credits_paid_back,car_new,393,less_100,4_to_7,3,male,none,2,real_estate,28,none,own,1,skilled,1,none,yes,No Risk\r\nless_0,7,all_credits_paid_back,car_used,250,less_100,less_1,2,female,none,1,real_estate,19,stores,own,1,skilled,1,none,yes,No Risk\r\nno_checking,29,prior_payments_delayed,car_used,8862,unknown,greater_7,5,male,co-applicant,5,unknown,53,none,free,3,skilled,2,yes,yes,Risk\r\nless_0,12,all_credits_paid_back,furniture,250,less_100,1_to_4,1,female,none,1,real_estate,25,stores,rent,1,skilled,1,none,yes,No Risk\r\n0_to_200,16,credits_paid_to_date,furniture,3881,less_100,less_1,2,female,co-applicant,3,savings_insurance,43,none,own,1,skilled,1,yes,yes,Risk\r\n0_to_200,4,all_credits_paid_back,car_used,250,less_100,1_to_4,2,female,none,1,savings_insurance,22,none,rent,1,skilled,1,none,yes,No Risk\r\nless_0,10,credits_paid_to_date,car_used,652,less_100,4_to_7,2,male,none,1,savings_insurance,33,stores,own,1,skilled,1,none,yes,No Risk\r\n0_to_200,32,credits_paid_to_date,car_used,2703,100_to_500,4_to_7,4,male,none,4,car_other,31,bank,own,1,unemployed,1,yes,yes,No Risk\r\nless_0,13,all_credits_paid_back,car_used,1820,100_to_500,unemployed,2,female,none,3,car_other,28,none,rent,2,skilled,2,none,yes,No Risk\r\nno_checking,25,prior_payments_delayed,radio_tv,1668,100_to_500,4_to_7,3,female,none,4,savings_insurance,49,none,free,1,skilled,1,yes,yes,Risk\r\nno_checking,40,prior_payments_delayed,appliances,7301,greater_1000,greater_7,5,male,co-applicant,4,savings_insurance,48,none,free,3,skilled,2,yes,yes,Risk\r\nno_checking,41,outstanding_credit,repairs,3423,unknown,greater_7,5,male,none,5,savings_insurance,56,none,free,2,skilled,1,yes,yes,Risk\r\nno_checking,30,prior_payments_delayed,appliances,6703,unknown,greater_7,4,male,none,3,car_other,54,none,own,2,skilled,1,yes,yes,No Risk\r\n0_to_200,22,credits_paid_to_date,repairs,812,less_100,4_to_7,3,male,none,2,savings_insurance,19,bank,rent,1,unemployed,1,none,yes,No Risk\r\n0_to_200,13,prior_payments_delayed,furniture,2735,500_to_1000,4_to_7,2,female,none,3,savings_insurance,45,stores,rent,2,skilled,1,none,yes,Risk\r\nless_0,28,credits_paid_to_date,radio_tv,530,less_100,1_to_4,2,male,none,2,real_estate,32,stores,own,1,skilled,1,none,yes,No Risk\r\nless_0,17,credits_paid_to_date,retraining,2119,less_100,1_to_4,3,female,none,2,savings_insurance,23,bank,rent,1,unskilled,1,none,yes,No Risk\r\nno_checking,26,outstanding_credit,furniture,3573,greater_1000,greater_7,5,male,none,5,car_other,39,none,own,2,skilled,1,none,yes,Risk"
  datafabric_setup.sh: |
    #!/bin/sh

    ############################################################
    # Login to Cloud pak for Data and get the token
    ############################################################
    CPD_CLUSTER_HOST="https://ibm-nginx-svc"
    USERNAME="${ENV_USERNAME}"
    PASSWORD="${ENV_PASSWORD}"

    if [ "${CPD_CLUSTER_HOST}" != "" ] && [ "${USERNAME}" != "" ] && [ "${PASSWORD}" != "" ]; then
      if ! CPD_TOKEN=$(
        curl -k -X POST \
          "${CPD_CLUSTER_HOST}"/icp4d-api/v1/authorize \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"username": "'"${USERNAME}"'","password":"'"${PASSWORD}"'"}' | jq -r '.token'
      ); then
        exit 1
      fi
    fi

    ############################################################
    #  Create Users in Cloud pak for Data
    ############################################################
    CPD_USER1="dfengineer"
    CPD_USER2="dfsteward"
    CPD_USER3="dfscientist"

    if [ "$CPD_CLUSTER_HOST" != "" ] && [ "$CPD_TOKEN" != "" ]; then
      EMAIL="${CPD_USER1}@in.ibm.com"
      if ! DFUSER1_RESPONSE=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/icp4d-api/v1/users \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"user_name":"'"$CPD_USER1"'","displayName":"'"$CPD_USER1"'","email":"'"${EMAIL}"'","password":"'"$CPD_USER1"'" , "user_roles": ["zen_data_engineer_role", "zen_developer_role", "zen_user_role"]}'
      ); then
        echo "Failed to Create dfuser1"
        exit 1
      fi
      echo "dfuser1 created"
      EMAIL="${CPD_USER2}@in.ibm.com"
      if ! DFUSER2_RESPONSE=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/icp4d-api/v1/users \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"user_name":"'"$CPD_USER2"'","displayName":"'"$CPD_USER2"'","email":"'"${EMAIL}"'","password":"'"$CPD_USER2"'" , "user_roles": ["wkc_data_quality_analyst_role", "wkc_data_steward_role", "zen_developer_role", "zen_user_role"]}'
      ); then
        echo "Failed to Create dfuser2"
        exit 1
      fi
      echo "dfuser2 created"
      EMAIL="${CPD_USER3}@in.ibm.com"
      if ! DFUSER3_RESPONSE=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/icp4d-api/v1/users \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"user_name":"'"$CPD_USER3"'","displayName":"'"$CPD_USER3"'","email":"'"${EMAIL}"'","password":"'"$CPD_USER3"'" , "user_roles": ["wkc_data_scientist_role", "zen_developer_role", "zen_user_role"]}'
      ); then
        echo "Failed to Create dfuser3"
        exit 1
      fi
      echo "dfuser3 created"
    else
      echo "Please provide CPD_CLUSTER_HOST & CPD_TOKEN "
    fi

    ############################################################
    # Create Amazon S3 Platform connection in Cloud pak for Data
    ############################################################
    BUCKET=${ENV_S3_BUCKET_ID//$'\n'/}
    REGION=${ENV_S3_BUCKET_REGION//$'\n'/}
    URL=${ENV_S3_BUCKET_URL//$'\n'/}
    ACCESS_KEY=${ENV_AWS_ACCESS_KEY//$'\n'/}
    SECRET_KEY=${ENV_AWS_SECRET_KEY//$'\n'/}

    if [ "$CPD_CLUSTER_HOST" != "" ] && [ "$CPD_TOKEN" != "" ]; then
      if ! DS_RESPONSE=$(
        curl -k -X GET \
          "$CPD_CLUSTER_HOST"/v2/datasource_types \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json'
      ); then
        echo "Failed to get CPD datasource types"
        exit 1
      fi
      DATASOURCE_TYPE=$(echo "$DS_RESPONSE" | jq -r '.resources[] | select(.entity.name=="amazons3") | .metadata.asset_id')
      echo "ASSET_ID ---- $DATASOURCE_TYPE "

      if ! CAT_RESPONSE=$(
        curl -k -X GET \
          "$CPD_CLUSTER_HOST"/v2/catalogs \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json'
      ); then
        echo "Failed to get CPD Catalogs"
        exit 1
      fi
      CATALOG_ID=$(echo "$CAT_RESPONSE" | jq -r '.catalogs[] | select(.entity.name=="Platform assets catalog") | .metadata.guid')
      echo "GUID ---- $CATALOG_ID "
      CREATE_CONN_URL="$CPD_CLUSTER_HOST/v2/connections?test=true&catalog_id=$CATALOG_ID"
      echo "CREATE_CONN_URL --- $CREATE_CONN_URL"

      if ! AWS_CONNECTION=$(
        curl -k -X POST \
          "$CREATE_CONN_URL" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"datasource_type":"'"$DATASOURCE_TYPE"'","flags":[],"name":"aws-s3-conn","origin_country":"us","properties":{"bucket":"'"$BUCKET"'","region":"'"$REGION"'","url":"'"$URL"'","access_key":"'"$ACCESS_KEY"'","secret_key":"'"$SECRET_KEY"'"}}'
      ); then
        echo "Failed to create AWS connection"
        exit 1
      fi
      AWS_CONN_NAME=$(echo "$AWS_CONNECTION" | jq -r '. | select(.entity.name=="aws-s3-conn") | .entity.name')
      echo "AWS Connection with name ""$AWS_CONN_NAME "" created"
      CONNECTION_ID=$(echo "$AWS_CONNECTION" | jq -r '. | select(.metadata.asset_id=="aws-s3-conn") | .metadata.asset_id')

      if ! ADD_DS_DV=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/icp4data-databases/dv/zen/dvapiserver/v1/datasource_connection_v2 \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"catalog_id":"'"$CATALOG_ID"'","connection_id":"'"$CONNECTION_ID"'"}'
      ); then
        echo "Failed to Add Data Source to DV"
        exit 1
      fi
      echo "Data Source to DV Added"

    else
      echo "Please provide CPD_CLUSTER_HOST & CPD_TOKEN "
    fi

    ############################################################
    # Create Analytics Project in Cloud pak for Data
    ############################################################
    ANALYTICS_PROJECT_NAME="datafab-autoai-project"

    if [ "$CPD_CLUSTER_HOST" != "" ] && [ "$CPD_TOKEN" != "" ]; then
      UNIQUE_ID=$(openssl rand -hex 2)
      NAME="$ANALYTICS_PROJECT_NAME$UNIQUE_ID"
      if ! PROJECT_LOCATION=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/transactional/v2/projects \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"name":"'"$NAME"'","description":"This is a project for AutoAI for Data Fabric","public":false,"storage":{"type":"assetfiles","guid":"d0e410a0-b358-42fc-b402-dba83316413a"}}' | jq -r '.location'
      ); then
        echo "Failed to Create Analytics Project"
        exit 1
      fi
      echo "Analytics Project created"
      if ! DFUSER1_ID=$(
        curl -k -X GET \
          "$CPD_CLUSTER_HOST/icp4d-api/v1/users/$CPD_USER1" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' | jq -r '.UserInfo.uid'
      ); then
        echo "Failed to get dfuser1 details"
        exit 1
      fi
      echo "DFUSER1_ID $DFUSER1_ID"
      if ! DFUSER2_ID=$(
        curl -k -X GET \
          "$CPD_CLUSTER_HOST/icp4d-api/v1/users/$CPD_USER2" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' | jq -r '.UserInfo.uid'
      ); then
        echo "Failed to get dfuser2 details"
        exit 1
      fi
      echo "DFUSER2_ID $DFUSER2_ID"
      if ! DFUSER3_ID=$(
        curl -k -X GET \
          "$CPD_CLUSTER_HOST/icp4d-api/v1/users/$CPD_USER3" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' | jq -r '.UserInfo.uid'
      ); then
        echo "Failed to get dfuser3 details"
        exit 1
      fi
      echo "DFUSER3_ID $DFUSER3_ID"

      PROJECT_URL="$CPD_CLUSTER_HOST$PROJECT_LOCATION/members"
      echo "PROJECT_URL $PROJECT_URL"
      if ! ADD_COLLABRATORS=$(
        curl -k -X POST \
          "$PROJECT_URL" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"members":[{"id":"'"$DFUSER1_ID"'","state":"ACTIVE","type":"user","user_name":"'"$CPD_USER1"'","role":"editor"},{"id":"'"$DFUSER2_ID"'","state":"ACTIVE","type":"user","user_name":"'"$CPD_USER2"'","role":"editor"},{"id":"'"$DFUSER3_ID"'","state":"ACTIVE","type":"user","user_name":"'"$CPD_USER3"'","role":"editor"}]}'
      ); then
        echo "Failed to ADD COLLABRATORS"
        exit 1
      fi
      echo "COLLABRATORS Added to the Project"
      #Get DV instance ID
      if ! SVC_INSTANCE_LIST=$(
        curl -k -X GET \
          "$CPD_CLUSTER_HOST"/zen-data/v3/service_instances \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json'
      ); then
        echo "Failed to Get DV instance ID"
        exit 1
      fi
      DV_INST_ID=$(echo "$SVC_INSTANCE_LIST" | jq -r '.service_instances[] | select(.addon_type=="dv") | .id')
      echo "DV instance ID- $DV_INST_ID"
      #Assign dv view to above created analytics project
      PROJECT_ID=${PROJECT_LOCATION##*/}
      DV_INST_STR="dv-$DV_INST_ID"
      if ! ASSIGN_VIRTUALISED_OBJ=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/icp4data-databases/dv/zen/dvapiserver/v1/integration/cp4d/project/assign \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -H 'X-DB-Profile: '"$DV_INST_STR"'' \
          -d '{"project_id":"'"$PROJECT_ID"'","vts":["ADMIN.CUSTOMER360"]}'
      ); then
        echo "Failed to Assign virtualised obj"
        exit 1
      fi
      echo "Assign virtualised obj initiated"
    else
      echo "Please provide CPD_CLUSTER_HOST & CPD_TOKEN "
    fi

    ############################################################
    # Virtualize files from DV
    ############################################################
    if [ "$CPD_CLUSTER_HOST" != "" ] && [ "$CPD_TOKEN" != "" ]; then
      #Virtualize file from s3
      if ! VIRTUALIZE_FILE_S3=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/icp4data-databases/dv/zen/dvapiserver/v1/virtualize/cloud_object_storages \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"url":"s3a://"'"$BUCKET_NAME"'"/dvcustomer","virtual_schema":"ADMIN","virtual_name":"dvcustomer","virtual_table_def":[{"column_name":"Customer_ID","column_type":"VARCHAR(3)"},{"column_name":"Name","column_type":"VARCHAR(19)"},{"column_name":"Address","column_type":"VARCHAR(24)"},{"column_name":"City","column_type":"VARCHAR(11)"},{"column_name":"State","column_type":"VARCHAR(16)"},{"column_name":"County","column_type":"VARCHAR(5)"},{"column_name":"Age","column_type":"INT"},{"column_name":"Birthdate","column_type":"VARCHAR(8)"},{"column_name":"Employer","column_type":"VARCHAR(21)"},{"column_name":"annual_income","column_type":"VARCHAR(8)"},{"column_name":"Gender","column_type":"VARCHAR(6)"},{"column_name":"email","column_type":"VARCHAR(34)"},{"column_name":"mobile","column_type":"BIGINT"},{"column_name":"pancard","column_type":"VARCHAR(10)"},{"column_name":"aadhaar_card","column_type":"VARCHAR(11)"},{"column_name":"Profession","column_type":"VARCHAR(24)"},{"column_name":"marital_status","column_type":"BOOLEAN"},{"column_name":"Children","column_type":"VARCHAR(1)"},{"column_name":"employed_yrs_x000D","column_type":"VARCHAR(102)"}],"is_replace":false,"options":"COLNAMES=true"}'
      ); then
        echo "Failed to Virtualize file from s3"
        exit 1
      fi
      echo "Virtualize file from s3 initiated"
      #Virtualize cibil_score table
      if ! VIRTUALIZE_CIBIL=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/icp4data-databases/dv/zen/dvapiserver/v1/virtualize/cloud_object_storages \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"url":"s3a://"'"$BUCKET_NAME"'"/dvcibil","virtual_schema":"ADMIN","virtual_name":"dvcibil","virtual_table_def":[{"column_name":"Customer_ID","column_type":"VARCHAR(3)"},{"column_name":"cibil_score","column_type":"VARCHAR(4)"}],"is_replace":false,"options":"COLNAMES=true"}'
      ); then
        echo "Failed to Virtualize cibil_score table"
        exit 1
      fi
      echo "Virtualize cibil_score table initiated"
    else
      echo "Please provide CPD_CLUSTER_HOST & CPD_TOKEN "
    fi

    ############################################################
    # Create Join
    ############################################################
    if [ "$CPD_CLUSTER_HOST" != "" ] && [ "$CPD_TOKEN" != "" ]; then
      #Get DV instance ID
      if ! SVC_INSTANCE_LIST=$(
        curl -k -X GET \
          "$CPD_CLUSTER_HOST"/zen-data/v3/service_instances \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json'
      ); then
        echo "Failed to Get DV instance ID"
        exit 1
      fi
      DV_INST_ID=$(echo "$SVC_INSTANCE_LIST" | jq -r '.service_instances[] | select(.addon_type=="dv") | .id')
      echo "DV instance ID- $DV_INST_ID"
      #Create Join
      if ! CREATE_JOIN=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/icp4data-databases/dv/zen/dvapiserver/v1/views/CUSTOMER360 \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"schemaName":"ADMIN","tables":[{"name":"dvcibil","schemaName":"ADMIN","selectedColumns":[{"oldName":"cibil_score","newName":"cibil_score"}]},{"name":"dvcustomer","schemaName":"ADMIN","selectedColumns":[{"oldName":"Customer_ID","newName":"Customer_ID"},{"oldName":"Name","newName":"Name"},{"oldName":"Address","newName":"Address"},{"oldName":"City","newName":"City"},{"oldName":"State","newName":"State"},{"oldName":"County","newName":"County"},{"oldName":"Age","newName":"Age"},{"oldName":"Birthdate","newName":"Birthdate"},{"oldName":"Employer","newName":"Employer"},{"oldName":"annual_income","newName":"annual_income"},{"oldName":"Gender","newName":"Gender"},{"oldName":"email","newName":"email"},{"oldName":"mobile","newName":"mobile"},{"oldName":"Profession","newName":"Profession"},{"oldName":"marital_status","newName":"marital_status"},{"oldName":"Children","newName":"Children"},{"oldName":"employed_yrs_x000D","newName":"employed_yrs_x000D"}]}],"serviceInstanceId":"'"$DV_INST_ID"'","joinKeys":[{"name":"Customer_ID_Customer_ID","sourceTable":{"tableName":"dvcibil","schemaName":"ADMIN","key":"Customer_ID"},"targetTable":{"tableName":"dvcustomer","schemaName":"ADMIN","key":"Customer_ID"}}]}'
      ); then
        echo "Failed to Create Join"
        exit 1
      fi
      echo "Create Join initiated"
    else
      echo "Please provide CPD_CLUSTER_HOST & CPD_TOKEN "
    fi

    ############################################################
    # Create Category, Classification, Business Term,
    # Reference Data, Data Class, Data Protection Rule
    ############################################################
    if [ "$CPD_CLUSTER_HOST" != "" ] && [ "$CPD_TOKEN" != "" ]; then
      UNIQUE_ID=$(openssl rand -hex 2)
      NAME="Data Fabric Category$UNIQUE_ID"
      #Create Category
      if ! CREATE_CATEGORY=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/v3/categories \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"name":"'"$NAME"'","short_description":"","long_description":"This is for Data Fabric"}'
      ); then
        echo "Failed to Create Category "
        exit 1
      fi
      echo "Create Category  Completed"
      CATEGORY_ID=$(echo "$CREATE_CATEGORY" | jq -r '.resources[] | select(.entity_type=="category") | .artifact_id')
      #Create Classification
      NAME="Data Fabric Classification$UNIQUE_ID"
      if ! CREATE_CLASSIFICATION=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/v3/classifications?skip_workflow_if_possible=true \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"name":"'"$NAME"'","long_description":"This is a Data Fabric classification","parent_category":{"id":"'"$CATEGORY_ID"'","name":"Data Fabric Category","context":[]}}'
      ); then
        echo "Failed to Create Classification"
        exit 1
      fi
      echo "Create Classification Completed"
      CLASSIFICATION_ID=$(echo "$CREATE_CLASSIFICATION" | jq -r '.resources[] | select(.entity_type=="classification") | .artifact_id')
      #Create Business Term
      NAME="Data Fabric Business Term$UNIQUE_ID"
      if ! CREATE_BUSINESS_TERM=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/v3/glossary_terms?skip_workflow_if_possible=true \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '[{"name":"'"$NAME"'","long_description":"This is a Data Fabric Business Term","parent_category":{"id":"'"$CATEGORY_ID"'","name":"Data Fabric Category","context":[]}}]'
      ); then
        echo "Failed to Create Business Term"
        exit 1
      fi
      echo "Create Business Term Completed"
      BUSINESS_TERM_ID=$(echo "$CREATE_BUSINESS_TERM" | jq -r '.resources[] | select(.entity_type=="glossary_term") | .artifact_id')
      #Create Reference Data Set
      NAME="Data Fabric data$UNIQUE_ID"
      if ! CREATE_REF_DATASET=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/v3/reference_data?skip_workflow_if_possible=true \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"name":"'"$NAME"'","type":"Text","parent_category":{"id":"'"$CATEGORY_ID"'","name":"Data Fabric Category","context":[]},"rds_values":[{"code":"SWZ","value":"Eswatini","parent":null,"description":"The Kingdom of Eswatini"}],"terms":[{"id":"'"$BUSINESS_TERM_ID"'"}]}'
      ); then
        echo "Failed to Create Reference Data Set"
        exit 1
      fi
      echo "Create Reference Data Set Completed"
      REF_FILE_ID=$(echo "$CREATE_REF_DATASET" | jq -r '.resources[] | select(.entity_type=="reference_data") | .artifact_id')
      #Create Data Class
      NAME="Data Fabric data$UNIQUE_ID"
      if ! CREATE_DATA_CLASS=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/v3/data_classes?skip_workflow_if_possible=true \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"name":"'"$NAME"'","long_description":"This is a Data Fabric data class","data_class_type":"ReferenceDataSet","case_sensitive":false,"allow_substring_match":false,"valid_value_reference_file":"'"$REF_FILE_ID"'","squeeze_consecutive_white_spaces":false,"enabled":true,"applicable_for":"structured_data_only","parent_category":{"id":"'"$CATEGORY_ID"'","name":"Data Fabric Category","context":[]},"terms":[{"id":"'"$BUSINESS_TERM_ID"'"}]}'
      ); then
        echo "Failed to Create Data Class"
        exit 1
      fi
      echo "Create Data Class Completed"
      DATA_CLASS_ID=$(echo "$CREATE_DATA_CLASS" | jq -r '.resources[] | select(.entity_type=="data_class") | .global_id')
      DSYMBOL="$"
      VALUE="${DSYMBOL}$DATA_CLASS_ID"
      #Create Data Protection Rule
      NAME="Data Fabric rule$UNIQUE_ID"
      if ! CREATE_CLASSIFICATION=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/v3/enforcement/rules \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"description":"this is a Data Fabric rule","name":"'"$NAME"'","governance_type_id":"Access","trigger":["$Asset.InferredClassification","CONTAINS",["'"${VALUE}"'"]],"action":{"name":"Transform","subaction":{"name":"redactDataClasses","parameters":[{"name":"dataclass_ids","value":["'"$DATA_CLASS_ID"'"]}]}},"state":"active"}'
      ); then
        echo "Failed to Create Data Protection Rule"
        exit 1
      fi
      echo "Create Data Protection Rule Completed"
    else
      echo "Please provide CPD_CLUSTER_HOST & CPD_TOKEN "
    fi

    ############################################################
    # Add Connection to Catalog, Add Connected asset to Catalog,
    # Add users to Catalog
    ############################################################
    if [ "$CPD_CLUSTER_HOST" != "" ] && [ "$CPD_TOKEN" != "" ]; then
      UNIQUE_ID=$(openssl rand -hex 2)
      NAME="DataFabricCatalog$UNIQUE_ID"
      #Create Catalog
      if ! CATALOG_ID=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/v2/catalogs \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"name":"'"$NAME"'","description":"This Catalog of for Data Fabric","generator":"admin@ibm.com","is_governed":true}' | jq -r '.metadata.guid'
      ); then
        echo "Failed to Create Catalog  "
        exit 1
      fi
      echo "Create Catalog   Completed"
      if ! DFUSER1_ID=$(
        curl -k -X GET \
          "$CPD_CLUSTER_HOST/icp4d-api/v1/users/$CPD_USER1" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' | jq -r '.UserInfo.uid'
      ); then
        echo "Failed to get dfuser1 details"
        exit 1
      fi
      echo "DFUSER1_ID $DFUSER1_ID"
      if ! DFUSER2_ID=$(
        curl -k -X GET \
          "$CPD_CLUSTER_HOST/icp4d-api/v1/users/$CPD_USER2" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' | jq -r '.UserInfo.uid'
      ); then
        echo "Failed to get dfuser2 details"
        exit 1
      fi
      echo "DFUSER2_ID $DFUSER2_ID"
      #Add Users to Catalog
      if ! ADD_USERS=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST/v2/catalogs/$CATALOG_ID/members" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"members":[{"user_id":"'"$CPD_USER1"'","user_iam_id":"'"$DFUSER1_ID"'","access_group_id":null,"role":"editor","href":"string","create_time":"string"},{"user_id":"'"$CPD_USER1"'","user_iam_id":"'"$DFUSER1_ID"'","access_group_id":null,"role":"editor","href":"string","create_time":"string"}]}'
      ); then
        echo "Failed to Add Users to Catalog"
        exit 1
      fi
      echo "Add Users to Catalog Completed"
      # #Add Connection to Catalog
      # CREATE_CONN_URL="$CPD_CLUSTER_HOST/projects/api/connections-v2?test=true&catalog_id=b6079fda-25ab-4b2b-bebc-02a6135c5e71"
      # if ! ADD_CONN_CAT=$(curl -k -X POST  \
      #         "$CREATE_CONN_URL" \
      #         -H 'Authorization: Bearer '"$CPD_TOKEN"''\
      #         -H 'cache-control: no-cache' \
      #         -H 'content-type: application/json' \
      #         -d '{"ref_catalog_id":"c3fe634e-2680-4223-912c-7864a6303fac","ref_asset_id":"26192d4e-d7ca-469b-b31d-cb5accd9cf41"}'
      # );then
      #   echo "Failed to Add Connection to Catalog "
      #   exit 1
      # fi
      # echo "Add Connection to Catalog Completed"
      # #Add Connected Data Asset to Catalog
      #  if ! CREATE_REF_DATASET=$(curl -k -X POST  \
      #         "$CPD_CLUSTER_HOST"/data/catalogs/api/b6079fda-25ab-4b2b-bebc-02a6135c5e71/connection-asset \
      #         -H 'Authorization: Bearer '"$CPD_TOKEN"''\
      #         -H 'cache-control: no-cache' \
      #         -H 'content-type: application/json' \
      #         -d '{"metadata":{"name":"Customer.csv","description":"","tags":[],"assetType":"data_asset","originCountry":"none","dataFormat":"application/octet-stream","members":[],"privacy":0,"classification":""},"entity":{"data_asset":{"dataset":true,"mime_type":"text/csv","properties":[{"name":"bucket","value":"datafabric-v2"},{"name":"file_name","value":"dvcustomer/Customer.csv"},{"name":"first_line_header","value":"true"},{"name":"encoding","value":"UTF-8"},{"name":"invalid_data_handling","value":"fail"},{"name":"file_format","value":"csv"}],"columns":[{"name":"Customer_ID","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"Name","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"Address","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"City","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"State","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"County","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"Age","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"Birthdate","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"Employer","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"annual_income","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"Gender","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"email","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"mobile","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"pancard","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"aadhaar_card","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"Profession","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"marital_status","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"Children","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}},{"name":"employed_yrs","type":{"type":"varchar","length":1024,"scale":0,"nullable":true}}]}},"assetType":"data_asset","connection_id":"a0a08af4-91c9-4b5f-a9b4-93bd85b814ed","connection_path":"/datafabric-v2/dvcustomer/Customer.csv","is_partitioned":false,"assetTerms":{"name":"asset_terms","entity":{"list":[]}}}'
      # );then
      #   echo "Failed to Add Connected Data Asset to Catalog"
      #   exit 1
      # fi
      # echo "Add Connected Data Asset to Catalog Completed"

    else
      echo "Please provide CPD_CLUSTER_HOST & CPD_TOKEN "
    fi

    ############################################################
    # Create Auto AI Experiment
    # (Create Space, Create Pipeline, Create Data Asset,
    # Create & Upload Attachment, Create Training and Deploy Model)
    ############################################################
    if [ "$CPD_CLUSTER_HOST" != "" ] && [ "$CPD_TOKEN" != "" ]; then
      UNIQUE_ID=$(openssl rand -hex 1)
      NAME="Data Fabric$UNIQUE_ID"
      #Create Space
      if ! CREATE_SPACE=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST"/v2/spaces \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"name":"'"$NAME"'","description":"Data Fabric Auto AI Experiment"}'
      ); then
        echo "Failed to Create Space "
        exit 1
      fi
      sleep 5
      echo "Create Space  Completed $CREATE_SPACE"
      SPACE_ID=$(echo "$CREATE_SPACE" | jq -r '.metadata.id')
      echo "SPACE_ID*************$SPACE_ID"
      #Create Pipeline
      NAME="Data Fabric Credit Risk Prediction - AutoAI$UNIQUE_ID"
      if ! CREATE_PIPELINE=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST/ml/v4/pipelines?version=2020-08-01" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"space_id":"'"$SPACE_ID"'","name":"'"$NAME"'","description":"","document":{"doc_type":"pipeline","version":"2.0","pipelines":[{"id":"autoai","runtime_ref":"hybrid","nodes":[{"id":"automl","type":"execution_node","parameters":{"stage_flag":true,"output_logs":true,"input_file_separator":",","optimization":{"learning_type":"binary","label":"Risk","max_num_daub_ensembles":1,"daub_include_only_estimators":["ExtraTreesClassifierEstimator","GradientBoostingClassifierEstimator","LGBMClassifierEstimator","LogisticRegressionEstimator","RandomForestClassifierEstimator","XGBClassifierEstimator","DecisionTreeClassifierEstimator"],"scorer_for_ranking":"roc_auc","compute_pipeline_notebooks_flag":true,"run_cognito_flag":true,"holdout_param":0.1}},"runtime_ref":"autoai","op":"kube"}]}],"runtimes":[{"id":"autoai","name":"auto_ai.kb","app_data":{"wml_data":{"hardware_spec":{"name":"L"}}},"version":"3.0.2"}],"primary_pipeline":"autoai"}}'
      ); then
        echo "Failed to Create Pipeline"
        exit 1
      fi
      sleep 5
      echo "Create Pipeline Completed"
      PIPELINE_ID=$(echo "$CREATE_PIPELINE" | jq -r '.metadata.id')
      echo "PIPELINE_ID*************$PIPELINE_ID"
      #Create Data Asset
      NAME="df_autoai_training_data$UNIQUE_ID"
      if ! CREATE_DATA_ASSET=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST/v2/assets?space_id=$SPACE_ID&version=2020-08-01" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"metadata":{"name":"'"$NAME"'","description":"desc","asset_type":"data_asset","origin_country":"us","asset_category":"USER"},"entity":{"data_asset":{"mime_type":"text/csv"}}}'
      ); then
        echo "Failed to Create Data Asset"
        exit 1
      fi
      echo "Create Data Asset Completed"
      HREF=$(echo "$CREATE_DATA_ASSET" | jq -r '.href')
      ASSET_ID=$(echo "$CREATE_DATA_ASSET" | jq -r '.metadata.asset_id')
      ASSET_TYPE=$(echo "$CREATE_DATA_ASSET" | jq -r '.metadata.asset_type')

      echo "HREF ******************$HREF"
      echo "ASSET_ID***************$ASSET_ID"
      echo "ASSET_TYPE*************$ASSET_TYPE"

      #Create Attachment
      NAME="df_"$UNIQUE_ID"_credit_risk_training_light.csv"
      if ! CREATE_ATTACHMENT=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST/v2/assets/$ASSET_ID/attachments?space_id=$SPACE_ID&version=2020-08-01" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"asset_type":"'"$ASSET_TYPE"'","name":"'"$NAME"'","mime":"text/csv"}'
      ); then
        echo "Failed to Create Attachment"
        exit 1
      fi
      sleep 2
      echo "Create Attachment Completed ***** $CREATE_ATTACHMENT"
      URL1_PATH=$(echo "$CREATE_ATTACHMENT" | jq -r '.url1')
      ATTACHMENT_ID=$(echo "$CREATE_ATTACHMENT" | jq -r '.attachment_id')
      echo "URL1_PATH --- $URL1_PATH"
      echo "ATTACHMENT_ID --- $ATTACHMENT_ID"
      #Upload CSV file
      if ! UPLOAD_CSV=$(
        curl -sk -X PUT \
          "$CPD_CLUSTER_HOST$URL1_PATH" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'content-type: multipart/form-data' \
          -F 'file=@/df-scripts/credit_risk_training_light.csv'
      ); then
        echo "Failed to Upload CSV file ** $UPLOAD_CSV"
        exit 1
      fi
      echo "Upload CSV file Completed"

      #Check Status
      if ! CHECK_STATUS=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST/v2/assets/$ASSET_ID/attachments/$ATTACHMENT_ID/complete?space_id=$SPACE_ID&version=2020-08-01" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json'
      ); then
        echo "Failed to Check Status"
        exit 1
      fi
      echo "Check Status Completed"

      #Create Training
      RANDOM_ID=$(openssl rand -hex 20)
      LOC_PATH="/spaces/"$SPACE_ID"/assets/auto_ml/auto_ml_curl."$RANDOM_ID"/wml_data"
      if ! CREATE_TRAINING=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST/ml/v4/trainings?version=2020-08-01" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"space_id":"'"$SPACE_ID"'","training_data_references":[{"type":"'"$ASSET_TYPE"'","id":"credit_risk_training_light.csv","connection":{},"location":{"href":"'"$HREF"'"}}],"results_reference":{"type":"fs","id":"autoai_results","connection":{},"location":{"path":"'"$LOC_PATH"'"}},"tags":[{"value":"autoai"}],"pipeline":{"id":"'"$PIPELINE_ID"'"}}'

      ); then
        echo "Failed to Create Training -- $CREATE_TRAINING"
        exit 1
      fi
      echo "Create Training Completed - $CREATE_TRAINING"
      TRAINING_ID=$(echo "$CREATE_TRAINING" | jq -r '.metadata.id')
      echo "TRAINING_ID**********$TRAINING_ID"

      CHECK_TRAINING_STATUS="pending"

      while [ "$CHECK_TRAINING_STATUS" != "completed" ]; do
        #Check Training Status
        TRAINING_STATUS_API="$CPD_CLUSTER_HOST/ml/v4/trainings/$TRAINING_ID?space_id=$SPACE_ID&version=2020-08-01"
        echo "TRAINING_STATUS_API*****$TRAINING_STATUS_API"
        sleep 30
        if ! CHECK_TRAINING_STATUS=$(
          curl -sk -X GET \
            "$TRAINING_STATUS_API" \
            -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
            -H 'content-type: application/json' | jq -r '.entity.status.state'
        ); then
          echo "Failed to Check Training Status"
          exit 1
        fi
        echo "Check Training Status **** $CHECK_TRAINING_STATUS *******"
      done
      #Get Model Payload
      MODEL_PAYLOAD_API="$CPD_CLUSTER_HOST/v2/asset_files/auto_ml/auto_ml_curl.$RANDOM_ID/wml_data/$TRAINING_ID/assets/"$TRAINING_ID"_P1_global_output/resources/wml_model/request.json?space_id=$SPACE_ID"
      if ! MODEL_PAYLOAD=$(
        curl -sk -X GET \
          "$MODEL_PAYLOAD_API" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'content-type: application/json'
      ); then
        echo "Failed to Get Model Payload --- $MODEL_PAYLOAD"
        exit 1
      fi
      echo "Get Model Payload Completed ----- $MODEL_PAYLOAD"

      #Create Model
      if ! CREATE_MODEL=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST/ml/v4/models?version=2020-08-01&space_id=$SPACE_ID" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d ''"$MODEL_PAYLOAD"''

      ); then
        echo "Failed to Create Model"
        exit 1
      fi
      sleep 5
      echo "Create Model Completed"
      MODEL_ID=$(echo "$CREATE_MODEL" | jq -r '.metadata.id')
      echo "MODEL_ID*******************$MODEL_ID"
      #Create Deployment
      NAME="Data Fabric AutoAI deployment$UNIQUE_ID"
      if ! CREATE_DEPLOYMENT=$(
        curl -k -X POST \
          "$CPD_CLUSTER_HOST/ml/v4/deployments?version=2020-08-01" \
          -H 'Authorization: Bearer '"$CPD_TOKEN"'' \
          -H 'cache-control: no-cache' \
          -H 'content-type: application/json' \
          -d '{"space_id": "'"$SPACE_ID"'","name": "'"$NAME"'","description": "Data Fabric AutoAI deployment","batch": {}, "hybrid_pipeline_hardware_specs": [{"node_runtime_id": "auto_ai.kb", "hardware_spec": {"name": "M"}}],"asset": {"id": "'"$MODEL_ID"'"}}'

      ); then
        echo "Failed to Create Deployment"
        exit 1
      fi
      sleep 5
      echo "Create Deployment Completed *** $CREATE_DEPLOYMENT"

    else
      echo "Please provide CPD_CLUSTER_HOST & CPD_TOKEN "
    fi
    exit 0
