Skip to content

Commit

Permalink
feat(client-glue): This release enables the new ListCrawls API for vi…
Browse files Browse the repository at this point in the history
…ewing the AWS Glue Crawler run history.
  • Loading branch information
awstools committed Jun 24, 2022
1 parent 647d02e commit 95c192f
Show file tree
Hide file tree
Showing 12 changed files with 1,008 additions and 219 deletions.
43 changes: 43 additions & 0 deletions clients/client-glue/src/Glue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ import {
ListCrawlersCommandInput,
ListCrawlersCommandOutput,
} from "./commands/ListCrawlersCommand";
import { ListCrawlsCommand, ListCrawlsCommandInput, ListCrawlsCommandOutput } from "./commands/ListCrawlsCommand";
import {
ListCustomEntityTypesCommand,
ListCustomEntityTypesCommandInput,
Expand Down Expand Up @@ -4781,6 +4782,48 @@ export class Glue extends GlueClient {
}
}

/**
* <p>Returns all the crawls of a specified crawler. Returns only the crawls that have occurred since the launch date of the crawler history feature, and only retains up to 12 months of crawls. Older crawls will not be returned.</p>
*
* <p>You may use this API to:</p>
* <ul>
* <li>
* <p>Retrive all the crawls of a specified crawler.</p>
* </li>
* <li>
* <p>Retrieve all the crawls of a specified crawler within a limited count.</p>
* </li>
* <li>
* <p>Retrieve all the crawls of a specified crawler in a specific time range.</p>
* </li>
* <li>
* <p>Retrieve all the crawls of a specified crawler with a particular state, crawl ID, or DPU hour value.</p>
* </li>
* </ul>
*/
public listCrawls(args: ListCrawlsCommandInput, options?: __HttpHandlerOptions): Promise<ListCrawlsCommandOutput>;
public listCrawls(args: ListCrawlsCommandInput, cb: (err: any, data?: ListCrawlsCommandOutput) => void): void;
public listCrawls(
args: ListCrawlsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListCrawlsCommandOutput) => void
): void;
public listCrawls(
args: ListCrawlsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListCrawlsCommandOutput) => void),
cb?: (err: any, data?: ListCrawlsCommandOutput) => void
): Promise<ListCrawlsCommandOutput> | void {
const command = new ListCrawlsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Lists all the custom patterns that have been created.</p>
*/
Expand Down
3 changes: 3 additions & 0 deletions clients/client-glue/src/GlueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ import {
} from "./commands/ImportCatalogToGlueCommand";
import { ListBlueprintsCommandInput, ListBlueprintsCommandOutput } from "./commands/ListBlueprintsCommand";
import { ListCrawlersCommandInput, ListCrawlersCommandOutput } from "./commands/ListCrawlersCommand";
import { ListCrawlsCommandInput, ListCrawlsCommandOutput } from "./commands/ListCrawlsCommand";
import {
ListCustomEntityTypesCommandInput,
ListCustomEntityTypesCommandOutput,
Expand Down Expand Up @@ -530,6 +531,7 @@ export type ServiceInputTypes =
| ImportCatalogToGlueCommandInput
| ListBlueprintsCommandInput
| ListCrawlersCommandInput
| ListCrawlsCommandInput
| ListCustomEntityTypesCommandInput
| ListDevEndpointsCommandInput
| ListJobsCommandInput
Expand Down Expand Up @@ -715,6 +717,7 @@ export type ServiceOutputTypes =
| ImportCatalogToGlueCommandOutput
| ListBlueprintsCommandOutput
| ListCrawlersCommandOutput
| ListCrawlsCommandOutput
| ListCustomEntityTypesCommandOutput
| ListDevEndpointsCommandOutput
| ListJobsCommandOutput
Expand Down
112 changes: 112 additions & 0 deletions clients/client-glue/src/commands/ListCrawlsCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
// smithy-typescript generated code
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { GlueClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlueClient";
import { ListCrawlsRequest, ListCrawlsResponse } from "../models/models_1";
import {
deserializeAws_json1_1ListCrawlsCommand,
serializeAws_json1_1ListCrawlsCommand,
} from "../protocols/Aws_json1_1";

export interface ListCrawlsCommandInput extends ListCrawlsRequest {}
export interface ListCrawlsCommandOutput extends ListCrawlsResponse, __MetadataBearer {}

/**
* <p>Returns all the crawls of a specified crawler. Returns only the crawls that have occurred since the launch date of the crawler history feature, and only retains up to 12 months of crawls. Older crawls will not be returned.</p>
*
* <p>You may use this API to:</p>
* <ul>
* <li>
* <p>Retrive all the crawls of a specified crawler.</p>
* </li>
* <li>
* <p>Retrieve all the crawls of a specified crawler within a limited count.</p>
* </li>
* <li>
* <p>Retrieve all the crawls of a specified crawler in a specific time range.</p>
* </li>
* <li>
* <p>Retrieve all the crawls of a specified crawler with a particular state, crawl ID, or DPU hour value.</p>
* </li>
* </ul>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { GlueClient, ListCrawlsCommand } from "@aws-sdk/client-glue"; // ES Modules import
* // const { GlueClient, ListCrawlsCommand } = require("@aws-sdk/client-glue"); // CommonJS import
* const client = new GlueClient(config);
* const command = new ListCrawlsCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListCrawlsCommandInput} for command's `input` shape.
* @see {@link ListCrawlsCommandOutput} for command's `response` shape.
* @see {@link GlueClientResolvedConfig | config} for GlueClient's `config` shape.
*
*/
export class ListCrawlsCommand extends $Command<
ListCrawlsCommandInput,
ListCrawlsCommandOutput,
GlueClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: ListCrawlsCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: GlueClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListCrawlsCommandInput, ListCrawlsCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "GlueClient";
const commandName = "ListCrawlsCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: ListCrawlsRequest.filterSensitiveLog,
outputFilterSensitiveLog: ListCrawlsResponse.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: ListCrawlsCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_json1_1ListCrawlsCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListCrawlsCommandOutput> {
return deserializeAws_json1_1ListCrawlsCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "@aws-sdk/types";

import { GlueClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlueClient";
import { RegisterSchemaVersionInput, RegisterSchemaVersionResponse } from "../models/models_1";
import { RegisterSchemaVersionInput, RegisterSchemaVersionResponse } from "../models/models_2";
import {
deserializeAws_json1_1RegisterSchemaVersionCommand,
serializeAws_json1_1RegisterSchemaVersionCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "@aws-sdk/types";

import { GlueClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlueClient";
import { RemoveSchemaVersionMetadataInput, RemoveSchemaVersionMetadataResponse } from "../models/models_1";
import { RemoveSchemaVersionMetadataInput, RemoveSchemaVersionMetadataResponse } from "../models/models_2";
import {
deserializeAws_json1_1RemoveSchemaVersionMetadataCommand,
serializeAws_json1_1RemoveSchemaVersionMetadataCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "@aws-sdk/types";

import { GlueClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlueClient";
import { ResetJobBookmarkRequest, ResetJobBookmarkResponse } from "../models/models_1";
import { ResetJobBookmarkRequest, ResetJobBookmarkResponse } from "../models/models_2";
import {
deserializeAws_json1_1ResetJobBookmarkCommand,
serializeAws_json1_1ResetJobBookmarkCommand,
Expand Down
1 change: 1 addition & 0 deletions clients/client-glue/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export * from "./GetWorkflowRunsCommand";
export * from "./ImportCatalogToGlueCommand";
export * from "./ListBlueprintsCommand";
export * from "./ListCrawlersCommand";
export * from "./ListCrawlsCommand";
export * from "./ListCustomEntityTypesCommand";
export * from "./ListDevEndpointsCommand";
export * from "./ListJobsCommand";
Expand Down
8 changes: 4 additions & 4 deletions clients/client-glue/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1356,11 +1356,11 @@ export namespace BatchGetCrawlersRequest {
}

/**
* <p>Specifies AWS Lake Formation configuration settings for the crawler.</p>
* <p>Specifies Lake Formation configuration settings for the crawler.</p>
*/
export interface LakeFormationConfiguration {
/**
* <p>Specifies whether to use AWS Lake Formation credentials for the crawler instead of the IAM role credentials.</p>
* <p>Specifies whether to use Lake Formation credentials for the crawler instead of the IAM role credentials.</p>
*/
UseLakeFormationCredentials?: boolean;

Expand Down Expand Up @@ -1916,7 +1916,7 @@ export interface Crawler {
CrawlerSecurityConfiguration?: string;

/**
* <p>Specifies whether the crawler should use AWS Lake Formation credentials for the crawler instead of the IAM role credentials.</p>
* <p>Specifies whether the crawler should use Lake Formation credentials for the crawler instead of the IAM role credentials.</p>
*/
LakeFormationConfiguration?: LakeFormationConfiguration;
}
Expand Down Expand Up @@ -6933,7 +6933,7 @@ export interface CreateCrawlerRequest {
LineageConfiguration?: LineageConfiguration;

/**
* <p>Specifies AWS Lake Formation configuration settings for the crawler.</p>
* <p>Specifies Lake Formation configuration settings for the crawler.</p>
*/
LakeFormationConfiguration?: LakeFormationConfiguration;

Expand Down
Loading

0 comments on commit 95c192f

Please sign in to comment.