Skip to content

Commit

Permalink
feat(client-detective): Added the ability to get data source package …
Browse files Browse the repository at this point in the history
…information for the behavior graph. Graph administrators can now start (or stop) optional datasources on the behavior graph.
  • Loading branch information
awstools committed Jul 26, 2022
1 parent f85fa66 commit 6b3a1ff
Show file tree
Hide file tree
Showing 15 changed files with 2,196 additions and 48 deletions.
10 changes: 6 additions & 4 deletions clients/client-detective/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ account in the behavior graph.</p>
<p>Detective is also integrated with Organizations. The organization
management account designates the Detective administrator account for the
organization. That account becomes the administrator account for the organization behavior
graph. The Detective administrator account can enable any organization account as
a member account in the organization behavior graph. The organization accounts do not
receive invitations. The Detective administrator account can also invite other
accounts to the organization behavior graph.</p>
graph. The Detective administrator account is also the delegated administrator
account for Detective in Organizations.</p>
<p>The Detective administrator account can enable any organization account as a
member account in the organization behavior graph. The organization accounts do not receive
invitations. The Detective administrator account can also invite other accounts to
the organization behavior graph.</p>
<p>Every behavior graph is specific to a Region. You can only use the API to manage
behavior graphs that belong to the Region that is associated with the currently selected
endpoint.</p>
Expand Down
179 changes: 167 additions & 12 deletions clients/client-detective/src/Detective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ import {
AcceptInvitationCommandInput,
AcceptInvitationCommandOutput,
} from "./commands/AcceptInvitationCommand";
import {
BatchGetGraphMemberDatasourcesCommand,
BatchGetGraphMemberDatasourcesCommandInput,
BatchGetGraphMemberDatasourcesCommandOutput,
} from "./commands/BatchGetGraphMemberDatasourcesCommand";
import {
BatchGetMembershipDatasourcesCommand,
BatchGetMembershipDatasourcesCommandInput,
BatchGetMembershipDatasourcesCommandOutput,
} from "./commands/BatchGetMembershipDatasourcesCommand";
import { CreateGraphCommand, CreateGraphCommandInput, CreateGraphCommandOutput } from "./commands/CreateGraphCommand";
import {
CreateMembersCommand,
Expand Down Expand Up @@ -39,6 +49,11 @@ import {
EnableOrganizationAdminAccountCommandOutput,
} from "./commands/EnableOrganizationAdminAccountCommand";
import { GetMembersCommand, GetMembersCommandInput, GetMembersCommandOutput } from "./commands/GetMembersCommand";
import {
ListDatasourcePackagesCommand,
ListDatasourcePackagesCommandInput,
ListDatasourcePackagesCommandOutput,
} from "./commands/ListDatasourcePackagesCommand";
import { ListGraphsCommand, ListGraphsCommandInput, ListGraphsCommandOutput } from "./commands/ListGraphsCommand";
import {
ListInvitationsCommand,
Expand Down Expand Up @@ -72,6 +87,11 @@ import {
UntagResourceCommandInput,
UntagResourceCommandOutput,
} from "./commands/UntagResourceCommand";
import {
UpdateDatasourcePackagesCommand,
UpdateDatasourcePackagesCommandInput,
UpdateDatasourcePackagesCommandOutput,
} from "./commands/UpdateDatasourcePackagesCommand";
import {
UpdateOrganizationConfigurationCommand,
UpdateOrganizationConfigurationCommandInput,
Expand All @@ -93,10 +113,12 @@ import { DetectiveClient } from "./DetectiveClient";
* <p>Detective is also integrated with Organizations. The organization
* management account designates the Detective administrator account for the
* organization. That account becomes the administrator account for the organization behavior
* graph. The Detective administrator account can enable any organization account as
* a member account in the organization behavior graph. The organization accounts do not
* receive invitations. The Detective administrator account can also invite other
* accounts to the organization behavior graph.</p>
* graph. The Detective administrator account is also the delegated administrator
* account for Detective in Organizations.</p>
* <p>The Detective administrator account can enable any organization account as a
* member account in the organization behavior graph. The organization accounts do not receive
* invitations. The Detective administrator account can also invite other accounts to
* the organization behavior graph.</p>
* <p>Every behavior graph is specific to a Region. You can only use the API to manage
* behavior graphs that belong to the Region that is associated with the currently selected
* endpoint.</p>
Expand Down Expand Up @@ -191,6 +213,70 @@ export class Detective extends DetectiveClient {
}
}

/**
* <p>Gets data source package information for the behavior graph.</p>
*/
public batchGetGraphMemberDatasources(
args: BatchGetGraphMemberDatasourcesCommandInput,
options?: __HttpHandlerOptions
): Promise<BatchGetGraphMemberDatasourcesCommandOutput>;
public batchGetGraphMemberDatasources(
args: BatchGetGraphMemberDatasourcesCommandInput,
cb: (err: any, data?: BatchGetGraphMemberDatasourcesCommandOutput) => void
): void;
public batchGetGraphMemberDatasources(
args: BatchGetGraphMemberDatasourcesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchGetGraphMemberDatasourcesCommandOutput) => void
): void;
public batchGetGraphMemberDatasources(
args: BatchGetGraphMemberDatasourcesCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: BatchGetGraphMemberDatasourcesCommandOutput) => void),
cb?: (err: any, data?: BatchGetGraphMemberDatasourcesCommandOutput) => void
): Promise<BatchGetGraphMemberDatasourcesCommandOutput> | void {
const command = new BatchGetGraphMemberDatasourcesCommand(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>Gets information on the data source package history for an account.</p>
*/
public batchGetMembershipDatasources(
args: BatchGetMembershipDatasourcesCommandInput,
options?: __HttpHandlerOptions
): Promise<BatchGetMembershipDatasourcesCommandOutput>;
public batchGetMembershipDatasources(
args: BatchGetMembershipDatasourcesCommandInput,
cb: (err: any, data?: BatchGetMembershipDatasourcesCommandOutput) => void
): void;
public batchGetMembershipDatasources(
args: BatchGetMembershipDatasourcesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchGetMembershipDatasourcesCommandOutput) => void
): void;
public batchGetMembershipDatasources(
args: BatchGetMembershipDatasourcesCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: BatchGetMembershipDatasourcesCommandOutput) => void),
cb?: (err: any, data?: BatchGetMembershipDatasourcesCommandOutput) => void
): Promise<BatchGetMembershipDatasourcesCommandOutput> | void {
const command = new BatchGetMembershipDatasourcesCommand(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>Creates a new behavior graph for the calling account, and sets that account as the
* administrator account. This operation is called by the account that is enabling Detective.</p>
Expand Down Expand Up @@ -405,11 +491,12 @@ export class Detective extends DetectiveClient {
}

/**
* <p>Removes the Detective administrator account for the organization in the current
* Region. Deletes the behavior graph for that account.</p>
* <p>Can only be called by the organization management account. Before you can select a
* different Detective administrator account, you must remove the Detective
* administrator account in all Regions.</p>
* <p>Removes the Detective administrator account in the current Region. Deletes the
* organization behavior graph.</p>
* <p>Can only be called by the organization management account.</p>
* <p>Removing the Detective administrator account does not affect the delegated
* administrator account for Detective in Organizations.</p>
* <p>To remove the delegated administrator account in Organizations, use the Organizations API. Removing the delegated administrator account also removes the Detective administrator account in all Regions, except for Regions where the Detective administrator account is the organization management account.</p>
*/
public disableOrganizationAdminAccount(
args: DisableOrganizationAdminAccountCommandInput,
Expand Down Expand Up @@ -484,9 +571,13 @@ export class Detective extends DetectiveClient {
* <p>If the account does not have Detective enabled, then enables Detective
* for that account and creates a new behavior graph.</p>
* <p>Can only be called by the organization management account.</p>
* <p>The Detective administrator account for an organization must be the same in all
* Regions. If you already designated a Detective administrator account in another
* Region, then you must designate the same account.</p>
* <p>If the organization has a delegated administrator account in Organizations, then the
* Detective administrator account must be either the delegated administrator
* account or the organization management account.</p>
* <p>If the organization does not have a delegated administrator account in Organizations, then you can choose any account in the organization. If you choose an account other
* than the organization management account, Detective calls Organizations to
* make that account the delegated administrator account for Detective. The
* organization management account cannot be the delegated administrator account.</p>
*/
public enableOrganizationAdminAccount(
args: EnableOrganizationAdminAccountCommandInput,
Expand Down Expand Up @@ -544,6 +635,38 @@ export class Detective extends DetectiveClient {
}
}

/**
* <p>Lists data source packages in the behavior graph.</p>
*/
public listDatasourcePackages(
args: ListDatasourcePackagesCommandInput,
options?: __HttpHandlerOptions
): Promise<ListDatasourcePackagesCommandOutput>;
public listDatasourcePackages(
args: ListDatasourcePackagesCommandInput,
cb: (err: any, data?: ListDatasourcePackagesCommandOutput) => void
): void;
public listDatasourcePackages(
args: ListDatasourcePackagesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListDatasourcePackagesCommandOutput) => void
): void;
public listDatasourcePackages(
args: ListDatasourcePackagesCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListDatasourcePackagesCommandOutput) => void),
cb?: (err: any, data?: ListDatasourcePackagesCommandOutput) => void
): Promise<ListDatasourcePackagesCommandOutput> | void {
const command = new ListDatasourcePackagesCommand(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>Returns the list of behavior graphs that the calling account is an administrator account
* of. This operation can only be called by an administrator account.</p>
Expand Down Expand Up @@ -846,6 +969,38 @@ export class Detective extends DetectiveClient {
}
}

/**
* <p>Starts a data source packages for the behavior graph.</p>
*/
public updateDatasourcePackages(
args: UpdateDatasourcePackagesCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateDatasourcePackagesCommandOutput>;
public updateDatasourcePackages(
args: UpdateDatasourcePackagesCommandInput,
cb: (err: any, data?: UpdateDatasourcePackagesCommandOutput) => void
): void;
public updateDatasourcePackages(
args: UpdateDatasourcePackagesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateDatasourcePackagesCommandOutput) => void
): void;
public updateDatasourcePackages(
args: UpdateDatasourcePackagesCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateDatasourcePackagesCommandOutput) => void),
cb?: (err: any, data?: UpdateDatasourcePackagesCommandOutput) => void
): Promise<UpdateDatasourcePackagesCommandOutput> | void {
const command = new UpdateDatasourcePackagesCommand(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>Updates the configuration for the Organizations integration in the current Region.
* Can only be called by the Detective administrator account for the
Expand Down
34 changes: 30 additions & 4 deletions clients/client-detective/src/DetectiveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ import {
} from "@aws-sdk/types";

import { AcceptInvitationCommandInput, AcceptInvitationCommandOutput } from "./commands/AcceptInvitationCommand";
import {
BatchGetGraphMemberDatasourcesCommandInput,
BatchGetGraphMemberDatasourcesCommandOutput,
} from "./commands/BatchGetGraphMemberDatasourcesCommand";
import {
BatchGetMembershipDatasourcesCommandInput,
BatchGetMembershipDatasourcesCommandOutput,
} from "./commands/BatchGetMembershipDatasourcesCommand";
import { CreateGraphCommandInput, CreateGraphCommandOutput } from "./commands/CreateGraphCommand";
import { CreateMembersCommandInput, CreateMembersCommandOutput } from "./commands/CreateMembersCommand";
import { DeleteGraphCommandInput, DeleteGraphCommandOutput } from "./commands/DeleteGraphCommand";
Expand All @@ -75,6 +83,10 @@ import {
EnableOrganizationAdminAccountCommandOutput,
} from "./commands/EnableOrganizationAdminAccountCommand";
import { GetMembersCommandInput, GetMembersCommandOutput } from "./commands/GetMembersCommand";
import {
ListDatasourcePackagesCommandInput,
ListDatasourcePackagesCommandOutput,
} from "./commands/ListDatasourcePackagesCommand";
import { ListGraphsCommandInput, ListGraphsCommandOutput } from "./commands/ListGraphsCommand";
import { ListInvitationsCommandInput, ListInvitationsCommandOutput } from "./commands/ListInvitationsCommand";
import { ListMembersCommandInput, ListMembersCommandOutput } from "./commands/ListMembersCommand";
Expand All @@ -93,6 +105,10 @@ import {
} from "./commands/StartMonitoringMemberCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
import {
UpdateDatasourcePackagesCommandInput,
UpdateDatasourcePackagesCommandOutput,
} from "./commands/UpdateDatasourcePackagesCommand";
import {
UpdateOrganizationConfigurationCommandInput,
UpdateOrganizationConfigurationCommandOutput,
Expand All @@ -101,6 +117,8 @@ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";

export type ServiceInputTypes =
| AcceptInvitationCommandInput
| BatchGetGraphMemberDatasourcesCommandInput
| BatchGetMembershipDatasourcesCommandInput
| CreateGraphCommandInput
| CreateMembersCommandInput
| DeleteGraphCommandInput
Expand All @@ -110,6 +128,7 @@ export type ServiceInputTypes =
| DisassociateMembershipCommandInput
| EnableOrganizationAdminAccountCommandInput
| GetMembersCommandInput
| ListDatasourcePackagesCommandInput
| ListGraphsCommandInput
| ListInvitationsCommandInput
| ListMembersCommandInput
Expand All @@ -119,10 +138,13 @@ export type ServiceInputTypes =
| StartMonitoringMemberCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
| UpdateDatasourcePackagesCommandInput
| UpdateOrganizationConfigurationCommandInput;

export type ServiceOutputTypes =
| AcceptInvitationCommandOutput
| BatchGetGraphMemberDatasourcesCommandOutput
| BatchGetMembershipDatasourcesCommandOutput
| CreateGraphCommandOutput
| CreateMembersCommandOutput
| DeleteGraphCommandOutput
Expand All @@ -132,6 +154,7 @@ export type ServiceOutputTypes =
| DisassociateMembershipCommandOutput
| EnableOrganizationAdminAccountCommandOutput
| GetMembersCommandOutput
| ListDatasourcePackagesCommandOutput
| ListGraphsCommandOutput
| ListInvitationsCommandOutput
| ListMembersCommandOutput
Expand All @@ -141,6 +164,7 @@ export type ServiceOutputTypes =
| StartMonitoringMemberCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
| UpdateDatasourcePackagesCommandOutput
| UpdateOrganizationConfigurationCommandOutput;

export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
Expand Down Expand Up @@ -310,10 +334,12 @@ export interface DetectiveClientResolvedConfig extends DetectiveClientResolvedCo
* <p>Detective is also integrated with Organizations. The organization
* management account designates the Detective administrator account for the
* organization. That account becomes the administrator account for the organization behavior
* graph. The Detective administrator account can enable any organization account as
* a member account in the organization behavior graph. The organization accounts do not
* receive invitations. The Detective administrator account can also invite other
* accounts to the organization behavior graph.</p>
* graph. The Detective administrator account is also the delegated administrator
* account for Detective in Organizations.</p>
* <p>The Detective administrator account can enable any organization account as a
* member account in the organization behavior graph. The organization accounts do not receive
* invitations. The Detective administrator account can also invite other accounts to
* the organization behavior graph.</p>
* <p>Every behavior graph is specific to a Region. You can only use the API to manage
* behavior graphs that belong to the Region that is associated with the currently selected
* endpoint.</p>
Expand Down
Loading

0 comments on commit 6b3a1ff

Please sign in to comment.