Skip to content

Commit 6b3a1ff

Browse files
author
awstools
committed
feat(client-detective): Added the ability to get data source package information for the behavior graph. Graph administrators can now start (or stop) optional datasources on the behavior graph.
1 parent f85fa66 commit 6b3a1ff

15 files changed

+2196
-48
lines changed

clients/client-detective/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ account in the behavior graph.</p>
2222
<p>Detective is also integrated with Organizations. The organization
2323
management account designates the Detective administrator account for the
2424
organization. That account becomes the administrator account for the organization behavior
25-
graph. The Detective administrator account can enable any organization account as
26-
a member account in the organization behavior graph. The organization accounts do not
27-
receive invitations. The Detective administrator account can also invite other
28-
accounts to the organization behavior graph.</p>
25+
graph. The Detective administrator account is also the delegated administrator
26+
account for Detective in Organizations.</p>
27+
<p>The Detective administrator account can enable any organization account as a
28+
member account in the organization behavior graph. The organization accounts do not receive
29+
invitations. The Detective administrator account can also invite other accounts to
30+
the organization behavior graph.</p>
2931
<p>Every behavior graph is specific to a Region. You can only use the API to manage
3032
behavior graphs that belong to the Region that is associated with the currently selected
3133
endpoint.</p>

clients/client-detective/src/Detective.ts

Lines changed: 167 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ import {
66
AcceptInvitationCommandInput,
77
AcceptInvitationCommandOutput,
88
} from "./commands/AcceptInvitationCommand";
9+
import {
10+
BatchGetGraphMemberDatasourcesCommand,
11+
BatchGetGraphMemberDatasourcesCommandInput,
12+
BatchGetGraphMemberDatasourcesCommandOutput,
13+
} from "./commands/BatchGetGraphMemberDatasourcesCommand";
14+
import {
15+
BatchGetMembershipDatasourcesCommand,
16+
BatchGetMembershipDatasourcesCommandInput,
17+
BatchGetMembershipDatasourcesCommandOutput,
18+
} from "./commands/BatchGetMembershipDatasourcesCommand";
919
import { CreateGraphCommand, CreateGraphCommandInput, CreateGraphCommandOutput } from "./commands/CreateGraphCommand";
1020
import {
1121
CreateMembersCommand,
@@ -39,6 +49,11 @@ import {
3949
EnableOrganizationAdminAccountCommandOutput,
4050
} from "./commands/EnableOrganizationAdminAccountCommand";
4151
import { GetMembersCommand, GetMembersCommandInput, GetMembersCommandOutput } from "./commands/GetMembersCommand";
52+
import {
53+
ListDatasourcePackagesCommand,
54+
ListDatasourcePackagesCommandInput,
55+
ListDatasourcePackagesCommandOutput,
56+
} from "./commands/ListDatasourcePackagesCommand";
4257
import { ListGraphsCommand, ListGraphsCommandInput, ListGraphsCommandOutput } from "./commands/ListGraphsCommand";
4358
import {
4459
ListInvitationsCommand,
@@ -72,6 +87,11 @@ import {
7287
UntagResourceCommandInput,
7388
UntagResourceCommandOutput,
7489
} from "./commands/UntagResourceCommand";
90+
import {
91+
UpdateDatasourcePackagesCommand,
92+
UpdateDatasourcePackagesCommandInput,
93+
UpdateDatasourcePackagesCommandOutput,
94+
} from "./commands/UpdateDatasourcePackagesCommand";
7595
import {
7696
UpdateOrganizationConfigurationCommand,
7797
UpdateOrganizationConfigurationCommandInput,
@@ -93,10 +113,12 @@ import { DetectiveClient } from "./DetectiveClient";
93113
* <p>Detective is also integrated with Organizations. The organization
94114
* management account designates the Detective administrator account for the
95115
* organization. That account becomes the administrator account for the organization behavior
96-
* graph. The Detective administrator account can enable any organization account as
97-
* a member account in the organization behavior graph. The organization accounts do not
98-
* receive invitations. The Detective administrator account can also invite other
99-
* accounts to the organization behavior graph.</p>
116+
* graph. The Detective administrator account is also the delegated administrator
117+
* account for Detective in Organizations.</p>
118+
* <p>The Detective administrator account can enable any organization account as a
119+
* member account in the organization behavior graph. The organization accounts do not receive
120+
* invitations. The Detective administrator account can also invite other accounts to
121+
* the organization behavior graph.</p>
100122
* <p>Every behavior graph is specific to a Region. You can only use the API to manage
101123
* behavior graphs that belong to the Region that is associated with the currently selected
102124
* endpoint.</p>
@@ -191,6 +213,70 @@ export class Detective extends DetectiveClient {
191213
}
192214
}
193215

216+
/**
217+
* <p>Gets data source package information for the behavior graph.</p>
218+
*/
219+
public batchGetGraphMemberDatasources(
220+
args: BatchGetGraphMemberDatasourcesCommandInput,
221+
options?: __HttpHandlerOptions
222+
): Promise<BatchGetGraphMemberDatasourcesCommandOutput>;
223+
public batchGetGraphMemberDatasources(
224+
args: BatchGetGraphMemberDatasourcesCommandInput,
225+
cb: (err: any, data?: BatchGetGraphMemberDatasourcesCommandOutput) => void
226+
): void;
227+
public batchGetGraphMemberDatasources(
228+
args: BatchGetGraphMemberDatasourcesCommandInput,
229+
options: __HttpHandlerOptions,
230+
cb: (err: any, data?: BatchGetGraphMemberDatasourcesCommandOutput) => void
231+
): void;
232+
public batchGetGraphMemberDatasources(
233+
args: BatchGetGraphMemberDatasourcesCommandInput,
234+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: BatchGetGraphMemberDatasourcesCommandOutput) => void),
235+
cb?: (err: any, data?: BatchGetGraphMemberDatasourcesCommandOutput) => void
236+
): Promise<BatchGetGraphMemberDatasourcesCommandOutput> | void {
237+
const command = new BatchGetGraphMemberDatasourcesCommand(args);
238+
if (typeof optionsOrCb === "function") {
239+
this.send(command, optionsOrCb);
240+
} else if (typeof cb === "function") {
241+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
242+
this.send(command, optionsOrCb || {}, cb);
243+
} else {
244+
return this.send(command, optionsOrCb);
245+
}
246+
}
247+
248+
/**
249+
* <p>Gets information on the data source package history for an account.</p>
250+
*/
251+
public batchGetMembershipDatasources(
252+
args: BatchGetMembershipDatasourcesCommandInput,
253+
options?: __HttpHandlerOptions
254+
): Promise<BatchGetMembershipDatasourcesCommandOutput>;
255+
public batchGetMembershipDatasources(
256+
args: BatchGetMembershipDatasourcesCommandInput,
257+
cb: (err: any, data?: BatchGetMembershipDatasourcesCommandOutput) => void
258+
): void;
259+
public batchGetMembershipDatasources(
260+
args: BatchGetMembershipDatasourcesCommandInput,
261+
options: __HttpHandlerOptions,
262+
cb: (err: any, data?: BatchGetMembershipDatasourcesCommandOutput) => void
263+
): void;
264+
public batchGetMembershipDatasources(
265+
args: BatchGetMembershipDatasourcesCommandInput,
266+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: BatchGetMembershipDatasourcesCommandOutput) => void),
267+
cb?: (err: any, data?: BatchGetMembershipDatasourcesCommandOutput) => void
268+
): Promise<BatchGetMembershipDatasourcesCommandOutput> | void {
269+
const command = new BatchGetMembershipDatasourcesCommand(args);
270+
if (typeof optionsOrCb === "function") {
271+
this.send(command, optionsOrCb);
272+
} else if (typeof cb === "function") {
273+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
274+
this.send(command, optionsOrCb || {}, cb);
275+
} else {
276+
return this.send(command, optionsOrCb);
277+
}
278+
}
279+
194280
/**
195281
* <p>Creates a new behavior graph for the calling account, and sets that account as the
196282
* administrator account. This operation is called by the account that is enabling Detective.</p>
@@ -405,11 +491,12 @@ export class Detective extends DetectiveClient {
405491
}
406492

407493
/**
408-
* <p>Removes the Detective administrator account for the organization in the current
409-
* Region. Deletes the behavior graph for that account.</p>
410-
* <p>Can only be called by the organization management account. Before you can select a
411-
* different Detective administrator account, you must remove the Detective
412-
* administrator account in all Regions.</p>
494+
* <p>Removes the Detective administrator account in the current Region. Deletes the
495+
* organization behavior graph.</p>
496+
* <p>Can only be called by the organization management account.</p>
497+
* <p>Removing the Detective administrator account does not affect the delegated
498+
* administrator account for Detective in Organizations.</p>
499+
* <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>
413500
*/
414501
public disableOrganizationAdminAccount(
415502
args: DisableOrganizationAdminAccountCommandInput,
@@ -484,9 +571,13 @@ export class Detective extends DetectiveClient {
484571
* <p>If the account does not have Detective enabled, then enables Detective
485572
* for that account and creates a new behavior graph.</p>
486573
* <p>Can only be called by the organization management account.</p>
487-
* <p>The Detective administrator account for an organization must be the same in all
488-
* Regions. If you already designated a Detective administrator account in another
489-
* Region, then you must designate the same account.</p>
574+
* <p>If the organization has a delegated administrator account in Organizations, then the
575+
* Detective administrator account must be either the delegated administrator
576+
* account or the organization management account.</p>
577+
* <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
578+
* than the organization management account, Detective calls Organizations to
579+
* make that account the delegated administrator account for Detective. The
580+
* organization management account cannot be the delegated administrator account.</p>
490581
*/
491582
public enableOrganizationAdminAccount(
492583
args: EnableOrganizationAdminAccountCommandInput,
@@ -544,6 +635,38 @@ export class Detective extends DetectiveClient {
544635
}
545636
}
546637

638+
/**
639+
* <p>Lists data source packages in the behavior graph.</p>
640+
*/
641+
public listDatasourcePackages(
642+
args: ListDatasourcePackagesCommandInput,
643+
options?: __HttpHandlerOptions
644+
): Promise<ListDatasourcePackagesCommandOutput>;
645+
public listDatasourcePackages(
646+
args: ListDatasourcePackagesCommandInput,
647+
cb: (err: any, data?: ListDatasourcePackagesCommandOutput) => void
648+
): void;
649+
public listDatasourcePackages(
650+
args: ListDatasourcePackagesCommandInput,
651+
options: __HttpHandlerOptions,
652+
cb: (err: any, data?: ListDatasourcePackagesCommandOutput) => void
653+
): void;
654+
public listDatasourcePackages(
655+
args: ListDatasourcePackagesCommandInput,
656+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListDatasourcePackagesCommandOutput) => void),
657+
cb?: (err: any, data?: ListDatasourcePackagesCommandOutput) => void
658+
): Promise<ListDatasourcePackagesCommandOutput> | void {
659+
const command = new ListDatasourcePackagesCommand(args);
660+
if (typeof optionsOrCb === "function") {
661+
this.send(command, optionsOrCb);
662+
} else if (typeof cb === "function") {
663+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
664+
this.send(command, optionsOrCb || {}, cb);
665+
} else {
666+
return this.send(command, optionsOrCb);
667+
}
668+
}
669+
547670
/**
548671
* <p>Returns the list of behavior graphs that the calling account is an administrator account
549672
* of. This operation can only be called by an administrator account.</p>
@@ -846,6 +969,38 @@ export class Detective extends DetectiveClient {
846969
}
847970
}
848971

972+
/**
973+
* <p>Starts a data source packages for the behavior graph.</p>
974+
*/
975+
public updateDatasourcePackages(
976+
args: UpdateDatasourcePackagesCommandInput,
977+
options?: __HttpHandlerOptions
978+
): Promise<UpdateDatasourcePackagesCommandOutput>;
979+
public updateDatasourcePackages(
980+
args: UpdateDatasourcePackagesCommandInput,
981+
cb: (err: any, data?: UpdateDatasourcePackagesCommandOutput) => void
982+
): void;
983+
public updateDatasourcePackages(
984+
args: UpdateDatasourcePackagesCommandInput,
985+
options: __HttpHandlerOptions,
986+
cb: (err: any, data?: UpdateDatasourcePackagesCommandOutput) => void
987+
): void;
988+
public updateDatasourcePackages(
989+
args: UpdateDatasourcePackagesCommandInput,
990+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateDatasourcePackagesCommandOutput) => void),
991+
cb?: (err: any, data?: UpdateDatasourcePackagesCommandOutput) => void
992+
): Promise<UpdateDatasourcePackagesCommandOutput> | void {
993+
const command = new UpdateDatasourcePackagesCommand(args);
994+
if (typeof optionsOrCb === "function") {
995+
this.send(command, optionsOrCb);
996+
} else if (typeof cb === "function") {
997+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
998+
this.send(command, optionsOrCb || {}, cb);
999+
} else {
1000+
return this.send(command, optionsOrCb);
1001+
}
1002+
}
1003+
8491004
/**
8501005
* <p>Updates the configuration for the Organizations integration in the current Region.
8511006
* Can only be called by the Detective administrator account for the

clients/client-detective/src/DetectiveClient.ts

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ import {
5454
} from "@aws-sdk/types";
5555

5656
import { AcceptInvitationCommandInput, AcceptInvitationCommandOutput } from "./commands/AcceptInvitationCommand";
57+
import {
58+
BatchGetGraphMemberDatasourcesCommandInput,
59+
BatchGetGraphMemberDatasourcesCommandOutput,
60+
} from "./commands/BatchGetGraphMemberDatasourcesCommand";
61+
import {
62+
BatchGetMembershipDatasourcesCommandInput,
63+
BatchGetMembershipDatasourcesCommandOutput,
64+
} from "./commands/BatchGetMembershipDatasourcesCommand";
5765
import { CreateGraphCommandInput, CreateGraphCommandOutput } from "./commands/CreateGraphCommand";
5866
import { CreateMembersCommandInput, CreateMembersCommandOutput } from "./commands/CreateMembersCommand";
5967
import { DeleteGraphCommandInput, DeleteGraphCommandOutput } from "./commands/DeleteGraphCommand";
@@ -75,6 +83,10 @@ import {
7583
EnableOrganizationAdminAccountCommandOutput,
7684
} from "./commands/EnableOrganizationAdminAccountCommand";
7785
import { GetMembersCommandInput, GetMembersCommandOutput } from "./commands/GetMembersCommand";
86+
import {
87+
ListDatasourcePackagesCommandInput,
88+
ListDatasourcePackagesCommandOutput,
89+
} from "./commands/ListDatasourcePackagesCommand";
7890
import { ListGraphsCommandInput, ListGraphsCommandOutput } from "./commands/ListGraphsCommand";
7991
import { ListInvitationsCommandInput, ListInvitationsCommandOutput } from "./commands/ListInvitationsCommand";
8092
import { ListMembersCommandInput, ListMembersCommandOutput } from "./commands/ListMembersCommand";
@@ -93,6 +105,10 @@ import {
93105
} from "./commands/StartMonitoringMemberCommand";
94106
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
95107
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
108+
import {
109+
UpdateDatasourcePackagesCommandInput,
110+
UpdateDatasourcePackagesCommandOutput,
111+
} from "./commands/UpdateDatasourcePackagesCommand";
96112
import {
97113
UpdateOrganizationConfigurationCommandInput,
98114
UpdateOrganizationConfigurationCommandOutput,
@@ -101,6 +117,8 @@ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
101117

102118
export type ServiceInputTypes =
103119
| AcceptInvitationCommandInput
120+
| BatchGetGraphMemberDatasourcesCommandInput
121+
| BatchGetMembershipDatasourcesCommandInput
104122
| CreateGraphCommandInput
105123
| CreateMembersCommandInput
106124
| DeleteGraphCommandInput
@@ -110,6 +128,7 @@ export type ServiceInputTypes =
110128
| DisassociateMembershipCommandInput
111129
| EnableOrganizationAdminAccountCommandInput
112130
| GetMembersCommandInput
131+
| ListDatasourcePackagesCommandInput
113132
| ListGraphsCommandInput
114133
| ListInvitationsCommandInput
115134
| ListMembersCommandInput
@@ -119,10 +138,13 @@ export type ServiceInputTypes =
119138
| StartMonitoringMemberCommandInput
120139
| TagResourceCommandInput
121140
| UntagResourceCommandInput
141+
| UpdateDatasourcePackagesCommandInput
122142
| UpdateOrganizationConfigurationCommandInput;
123143

124144
export type ServiceOutputTypes =
125145
| AcceptInvitationCommandOutput
146+
| BatchGetGraphMemberDatasourcesCommandOutput
147+
| BatchGetMembershipDatasourcesCommandOutput
126148
| CreateGraphCommandOutput
127149
| CreateMembersCommandOutput
128150
| DeleteGraphCommandOutput
@@ -132,6 +154,7 @@ export type ServiceOutputTypes =
132154
| DisassociateMembershipCommandOutput
133155
| EnableOrganizationAdminAccountCommandOutput
134156
| GetMembersCommandOutput
157+
| ListDatasourcePackagesCommandOutput
135158
| ListGraphsCommandOutput
136159
| ListInvitationsCommandOutput
137160
| ListMembersCommandOutput
@@ -141,6 +164,7 @@ export type ServiceOutputTypes =
141164
| StartMonitoringMemberCommandOutput
142165
| TagResourceCommandOutput
143166
| UntagResourceCommandOutput
167+
| UpdateDatasourcePackagesCommandOutput
144168
| UpdateOrganizationConfigurationCommandOutput;
145169

146170
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
@@ -310,10 +334,12 @@ export interface DetectiveClientResolvedConfig extends DetectiveClientResolvedCo
310334
* <p>Detective is also integrated with Organizations. The organization
311335
* management account designates the Detective administrator account for the
312336
* organization. That account becomes the administrator account for the organization behavior
313-
* graph. The Detective administrator account can enable any organization account as
314-
* a member account in the organization behavior graph. The organization accounts do not
315-
* receive invitations. The Detective administrator account can also invite other
316-
* accounts to the organization behavior graph.</p>
337+
* graph. The Detective administrator account is also the delegated administrator
338+
* account for Detective in Organizations.</p>
339+
* <p>The Detective administrator account can enable any organization account as a
340+
* member account in the organization behavior graph. The organization accounts do not receive
341+
* invitations. The Detective administrator account can also invite other accounts to
342+
* the organization behavior graph.</p>
317343
* <p>Every behavior graph is specific to a Region. You can only use the API to manage
318344
* behavior graphs that belong to the Region that is associated with the currently selected
319345
* endpoint.</p>

0 commit comments

Comments
 (0)