in csharp/Microsoft.Azure.Databricks.Client.Sample/SampleProgram.Library.cs [13:54]
private static async Task TestLibrariesApi(DatabricksClient client)
{
Console.WriteLine("All cluster statuses");
var libraries = await client.Libraries.AllClusterStatuses();
foreach (var (clusterId, libraryStatuses) in libraries)
{
Console.WriteLine("Cluster: {0}", clusterId);
foreach (var status in libraryStatuses)
{
Console.WriteLine("\t{0}\t{1}", status.Status, status.Library);
}
}
const string testClusterId = "0530-210517-viced348";
Console.WriteLine("Getting cluster statuses for {0}", testClusterId);
var statuses = await client.Libraries.ClusterStatus(testClusterId);
foreach (var status in statuses)
{
Console.WriteLine("\t{0}\t{1}", status.Status, status.Library);
}
var mvnlibraryToInstall = new MavenLibrary
{
MavenLibrarySpec = new MavenLibrarySpec
{
Coordinates = "org.jsoup:jsoup:1.7.2",
Exclusions = new[] { "slf4j:slf4j" }
}
};
await TestInstallUninstallLibrary(client, mvnlibraryToInstall, testClusterId);
var whlLibraryToInstall = new WheelLibrary
{
Wheel = "dbfs:/mnt/dbfsmount1/temp/docutils-0.14-py3-none-any.whl"
};
await TestInstallUninstallLibrary(client, whlLibraryToInstall, testClusterId);
}