///<summary>/// Get information about an AWS Glue crawler.///</summary>///<param name="crawlerName">The name of the crawler.</param>///<returns>A Crawler object describing the crawler.</returns>publicasync Task<Crawler?> GetCrawlerAsync(string crawlerName)
{var crawlerRequest = new GetCrawlerRequest
{
Name = crawlerName,
};
var response = await _amazonGlue.GetCrawlerAsync(crawlerRequest);
if (response.HttpStatusCode == System.Net.HttpStatusCode.OK)
{var databaseName = response.Crawler.DatabaseName;
Console.WriteLine($"{crawlerName} has the database {databaseName}");
return response.Crawler;
}
Console.WriteLine($"No information regarding {crawlerName} could be found.");
returnnull;
}
API の詳細については、「AWS SDK for .NET API リファレンス」の「GetCrawler」を参照してください。
/**
* Retrieves a specific crawler from the AWS Glue service and waits for it to be in the "READY" state.
*
* @param glueClient the AWS Glue client used to interact with the Glue service
* @param crawlerName the name of the crawler to be retrieved
*/publicstaticvoidgetSpecificCrawler(GlueClient glueClient, String crawlerName)throws InterruptedException {try{
GetCrawlerRequest crawlerRequest = GetCrawlerRequest.builder()
.name(crawlerName)
.build();
boolean ready = false;
while (!ready) {
GetCrawlerResponse response = glueClient.getCrawler(crawlerRequest);
String status = response.crawler().stateAsString();
if (status.compareTo("READY") == 0) {
ready = true;
}
Thread.sleep(3000);
}
System.out.println("The crawler is now ready");
} catch (GlueException | InterruptedException e) {throw e;
}
}
API の詳細については、「AWS SDK for Java 2.x API リファレンス」の「GetCrawler」を参照してください。
suspendfungetSpecificCrawler(crawlerName: String?){val request =
GetCrawlerRequest {
name = crawlerName
}
GlueClient { region = "us-east-1" }.use { glueClient ->
val response = glueClient.getCrawler(request)
val role = response.crawler?.role
println("The role associated with this crawler is $role")
}
}
API の詳細については、「AWS SDK for Kotlin API リファレンス」の「GetCrawler」を参照してください。
# The `GlueWrapper` class serves as a wrapper around the AWS Glue API, providing a simplified interface for common operations.# It encapsulates the functionality of the AWS SDK for Glue and provides methods for interacting with Glue crawlers, databases, tables, jobs, and S3 resources.# The class initializes with a Glue client and a logger, allowing it to make API calls and log any errors or informational messages.classGlueWrapperdefinitialize(glue_client, logger)@glue_client = glue_client
@logger = logger
end# Retrieves information about a specific crawler.## @param name [String] The name of the crawler to retrieve information about.# @return [Aws::Glue::Types::Crawler, nil] The crawler object if found, or nil if not found.defget_crawler(name)@glue_client.get_crawler(name: name)
rescue Aws::Glue::Errors::EntityNotFoundException
@logger.info("Crawler #{name} doesn't exist.")
falserescue Aws::Glue::Errors::GlueException => e
@logger.error("Glue could not get crawler #{name}: \n#{e.message}")
raise
end
API の詳細については、「AWS SDK for Ruby API リファレンス」の「GetCrawler」を参照してください。
///<summary>/// Get information about an AWS Glue crawler.///</summary>///<param name="crawlerName">The name of the crawler.</param>///<returns>A Crawler object describing the crawler.</returns>publicasync Task<Crawler?> GetCrawlerAsync(string crawlerName)
{var crawlerRequest = new GetCrawlerRequest
{
Name = crawlerName,
};
var response = await _amazonGlue.GetCrawlerAsync(crawlerRequest);
if (response.HttpStatusCode == System.Net.HttpStatusCode.OK)
{var databaseName = response.Crawler.DatabaseName;
Console.WriteLine($"{crawlerName} has the database {databaseName}");
return response.Crawler;
}
Console.WriteLine($"No information regarding {crawlerName} could be found.");
returnnull;
}
API の詳細については、「AWS SDK for .NET API リファレンス」の「GetCrawler」を参照してください。