Skip to content

Commit f5abdf8

Browse files
author
awstools
committed
feat(client-amp): Add Resource-based Policy APIs for Amazon Prometheus
1 parent bbe9734 commit f5abdf8

File tree

10 files changed

+1009
-1
lines changed

10 files changed

+1009
-1
lines changed

clients/client-amp/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,14 @@ DeleteQueryLoggingConfiguration
274274

275275
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/DeleteQueryLoggingConfigurationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DeleteQueryLoggingConfigurationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DeleteQueryLoggingConfigurationCommandOutput/)
276276

277+
</details>
278+
<details>
279+
<summary>
280+
DeleteResourcePolicy
281+
</summary>
282+
283+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/DeleteResourcePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DeleteResourcePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DeleteResourcePolicyCommandOutput/)
284+
277285
</details>
278286
<details>
279287
<summary>
@@ -322,6 +330,14 @@ DescribeQueryLoggingConfiguration
322330

323331
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/DescribeQueryLoggingConfigurationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DescribeQueryLoggingConfigurationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DescribeQueryLoggingConfigurationCommandOutput/)
324332

333+
</details>
334+
<details>
335+
<summary>
336+
DescribeResourcePolicy
337+
</summary>
338+
339+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/DescribeResourcePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DescribeResourcePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DescribeResourcePolicyCommandOutput/)
340+
325341
</details>
326342
<details>
327343
<summary>
@@ -402,6 +418,14 @@ PutAlertManagerDefinition
402418

403419
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/PutAlertManagerDefinitionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/PutAlertManagerDefinitionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/PutAlertManagerDefinitionCommandOutput/)
404420

421+
</details>
422+
<details>
423+
<summary>
424+
PutResourcePolicy
425+
</summary>
426+
427+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/PutResourcePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/PutResourcePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/PutResourcePolicyCommandOutput/)
428+
405429
</details>
406430
<details>
407431
<summary>

clients/client-amp/src/Amp.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ import {
4848
DeleteQueryLoggingConfigurationCommandInput,
4949
DeleteQueryLoggingConfigurationCommandOutput,
5050
} from "./commands/DeleteQueryLoggingConfigurationCommand";
51+
import {
52+
DeleteResourcePolicyCommand,
53+
DeleteResourcePolicyCommandInput,
54+
DeleteResourcePolicyCommandOutput,
55+
} from "./commands/DeleteResourcePolicyCommand";
5156
import {
5257
DeleteRuleGroupsNamespaceCommand,
5358
DeleteRuleGroupsNamespaceCommandInput,
@@ -78,6 +83,11 @@ import {
7883
DescribeQueryLoggingConfigurationCommandInput,
7984
DescribeQueryLoggingConfigurationCommandOutput,
8085
} from "./commands/DescribeQueryLoggingConfigurationCommand";
86+
import {
87+
DescribeResourcePolicyCommand,
88+
DescribeResourcePolicyCommandInput,
89+
DescribeResourcePolicyCommandOutput,
90+
} from "./commands/DescribeResourcePolicyCommand";
8191
import {
8292
DescribeRuleGroupsNamespaceCommand,
8393
DescribeRuleGroupsNamespaceCommandInput,
@@ -128,6 +138,11 @@ import {
128138
PutAlertManagerDefinitionCommandInput,
129139
PutAlertManagerDefinitionCommandOutput,
130140
} from "./commands/PutAlertManagerDefinitionCommand";
141+
import {
142+
PutResourcePolicyCommand,
143+
PutResourcePolicyCommandInput,
144+
PutResourcePolicyCommandOutput,
145+
} from "./commands/PutResourcePolicyCommand";
131146
import {
132147
PutRuleGroupsNamespaceCommand,
133148
PutRuleGroupsNamespaceCommandInput,
@@ -175,12 +190,14 @@ const commands = {
175190
DeleteAlertManagerDefinitionCommand,
176191
DeleteLoggingConfigurationCommand,
177192
DeleteQueryLoggingConfigurationCommand,
193+
DeleteResourcePolicyCommand,
178194
DeleteRuleGroupsNamespaceCommand,
179195
DeleteScraperCommand,
180196
DeleteWorkspaceCommand,
181197
DescribeAlertManagerDefinitionCommand,
182198
DescribeLoggingConfigurationCommand,
183199
DescribeQueryLoggingConfigurationCommand,
200+
DescribeResourcePolicyCommand,
184201
DescribeRuleGroupsNamespaceCommand,
185202
DescribeScraperCommand,
186203
DescribeWorkspaceCommand,
@@ -191,6 +208,7 @@ const commands = {
191208
ListTagsForResourceCommand,
192209
ListWorkspacesCommand,
193210
PutAlertManagerDefinitionCommand,
211+
PutResourcePolicyCommand,
194212
PutRuleGroupsNamespaceCommand,
195213
TagResourceCommand,
196214
UntagResourceCommand,
@@ -347,6 +365,23 @@ export interface Amp {
347365
cb: (err: any, data?: DeleteQueryLoggingConfigurationCommandOutput) => void
348366
): void;
349367

368+
/**
369+
* @see {@link DeleteResourcePolicyCommand}
370+
*/
371+
deleteResourcePolicy(
372+
args: DeleteResourcePolicyCommandInput,
373+
options?: __HttpHandlerOptions
374+
): Promise<DeleteResourcePolicyCommandOutput>;
375+
deleteResourcePolicy(
376+
args: DeleteResourcePolicyCommandInput,
377+
cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
378+
): void;
379+
deleteResourcePolicy(
380+
args: DeleteResourcePolicyCommandInput,
381+
options: __HttpHandlerOptions,
382+
cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
383+
): void;
384+
350385
/**
351386
* @see {@link DeleteRuleGroupsNamespaceCommand}
352387
*/
@@ -440,6 +475,23 @@ export interface Amp {
440475
cb: (err: any, data?: DescribeQueryLoggingConfigurationCommandOutput) => void
441476
): void;
442477

478+
/**
479+
* @see {@link DescribeResourcePolicyCommand}
480+
*/
481+
describeResourcePolicy(
482+
args: DescribeResourcePolicyCommandInput,
483+
options?: __HttpHandlerOptions
484+
): Promise<DescribeResourcePolicyCommandOutput>;
485+
describeResourcePolicy(
486+
args: DescribeResourcePolicyCommandInput,
487+
cb: (err: any, data?: DescribeResourcePolicyCommandOutput) => void
488+
): void;
489+
describeResourcePolicy(
490+
args: DescribeResourcePolicyCommandInput,
491+
options: __HttpHandlerOptions,
492+
cb: (err: any, data?: DescribeResourcePolicyCommandOutput) => void
493+
): void;
494+
443495
/**
444496
* @see {@link DescribeRuleGroupsNamespaceCommand}
445497
*/
@@ -601,6 +653,23 @@ export interface Amp {
601653
cb: (err: any, data?: PutAlertManagerDefinitionCommandOutput) => void
602654
): void;
603655

656+
/**
657+
* @see {@link PutResourcePolicyCommand}
658+
*/
659+
putResourcePolicy(
660+
args: PutResourcePolicyCommandInput,
661+
options?: __HttpHandlerOptions
662+
): Promise<PutResourcePolicyCommandOutput>;
663+
putResourcePolicy(
664+
args: PutResourcePolicyCommandInput,
665+
cb: (err: any, data?: PutResourcePolicyCommandOutput) => void
666+
): void;
667+
putResourcePolicy(
668+
args: PutResourcePolicyCommandInput,
669+
options: __HttpHandlerOptions,
670+
cb: (err: any, data?: PutResourcePolicyCommandOutput) => void
671+
): void;
672+
604673
/**
605674
* @see {@link PutRuleGroupsNamespaceCommand}
606675
*/

clients/client-amp/src/AmpClient.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ import {
8383
DeleteQueryLoggingConfigurationCommandInput,
8484
DeleteQueryLoggingConfigurationCommandOutput,
8585
} from "./commands/DeleteQueryLoggingConfigurationCommand";
86+
import {
87+
DeleteResourcePolicyCommandInput,
88+
DeleteResourcePolicyCommandOutput,
89+
} from "./commands/DeleteResourcePolicyCommand";
8690
import {
8791
DeleteRuleGroupsNamespaceCommandInput,
8892
DeleteRuleGroupsNamespaceCommandOutput,
@@ -101,6 +105,10 @@ import {
101105
DescribeQueryLoggingConfigurationCommandInput,
102106
DescribeQueryLoggingConfigurationCommandOutput,
103107
} from "./commands/DescribeQueryLoggingConfigurationCommand";
108+
import {
109+
DescribeResourcePolicyCommandInput,
110+
DescribeResourcePolicyCommandOutput,
111+
} from "./commands/DescribeResourcePolicyCommand";
104112
import {
105113
DescribeRuleGroupsNamespaceCommandInput,
106114
DescribeRuleGroupsNamespaceCommandOutput,
@@ -129,6 +137,7 @@ import {
129137
PutAlertManagerDefinitionCommandInput,
130138
PutAlertManagerDefinitionCommandOutput,
131139
} from "./commands/PutAlertManagerDefinitionCommand";
140+
import { PutResourcePolicyCommandInput, PutResourcePolicyCommandOutput } from "./commands/PutResourcePolicyCommand";
132141
import {
133142
PutRuleGroupsNamespaceCommandInput,
134143
PutRuleGroupsNamespaceCommandOutput,
@@ -176,12 +185,14 @@ export type ServiceInputTypes =
176185
| DeleteAlertManagerDefinitionCommandInput
177186
| DeleteLoggingConfigurationCommandInput
178187
| DeleteQueryLoggingConfigurationCommandInput
188+
| DeleteResourcePolicyCommandInput
179189
| DeleteRuleGroupsNamespaceCommandInput
180190
| DeleteScraperCommandInput
181191
| DeleteWorkspaceCommandInput
182192
| DescribeAlertManagerDefinitionCommandInput
183193
| DescribeLoggingConfigurationCommandInput
184194
| DescribeQueryLoggingConfigurationCommandInput
195+
| DescribeResourcePolicyCommandInput
185196
| DescribeRuleGroupsNamespaceCommandInput
186197
| DescribeScraperCommandInput
187198
| DescribeWorkspaceCommandInput
@@ -192,6 +203,7 @@ export type ServiceInputTypes =
192203
| ListTagsForResourceCommandInput
193204
| ListWorkspacesCommandInput
194205
| PutAlertManagerDefinitionCommandInput
206+
| PutResourcePolicyCommandInput
195207
| PutRuleGroupsNamespaceCommandInput
196208
| TagResourceCommandInput
197209
| UntagResourceCommandInput
@@ -214,12 +226,14 @@ export type ServiceOutputTypes =
214226
| DeleteAlertManagerDefinitionCommandOutput
215227
| DeleteLoggingConfigurationCommandOutput
216228
| DeleteQueryLoggingConfigurationCommandOutput
229+
| DeleteResourcePolicyCommandOutput
217230
| DeleteRuleGroupsNamespaceCommandOutput
218231
| DeleteScraperCommandOutput
219232
| DeleteWorkspaceCommandOutput
220233
| DescribeAlertManagerDefinitionCommandOutput
221234
| DescribeLoggingConfigurationCommandOutput
222235
| DescribeQueryLoggingConfigurationCommandOutput
236+
| DescribeResourcePolicyCommandOutput
223237
| DescribeRuleGroupsNamespaceCommandOutput
224238
| DescribeScraperCommandOutput
225239
| DescribeWorkspaceCommandOutput
@@ -230,6 +244,7 @@ export type ServiceOutputTypes =
230244
| ListTagsForResourceCommandOutput
231245
| ListWorkspacesCommandOutput
232246
| PutAlertManagerDefinitionCommandOutput
247+
| PutResourcePolicyCommandOutput
233248
| PutRuleGroupsNamespaceCommandOutput
234249
| TagResourceCommandOutput
235250
| UntagResourceCommandOutput
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { AmpClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AmpClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { DeleteResourcePolicyRequest } from "../models/models_0";
10+
import { de_DeleteResourcePolicyCommand, se_DeleteResourcePolicyCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link DeleteResourcePolicyCommand}.
21+
*/
22+
export interface DeleteResourcePolicyCommandInput extends DeleteResourcePolicyRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link DeleteResourcePolicyCommand}.
27+
*/
28+
export interface DeleteResourcePolicyCommandOutput extends __MetadataBearer {}
29+
30+
/**
31+
* <p>Deletes the resource-based policy attached to an Amazon Managed Service for Prometheus workspace.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { AmpClient, DeleteResourcePolicyCommand } from "@aws-sdk/client-amp"; // ES Modules import
36+
* // const { AmpClient, DeleteResourcePolicyCommand } = require("@aws-sdk/client-amp"); // CommonJS import
37+
* const client = new AmpClient(config);
38+
* const input = { // DeleteResourcePolicyRequest
39+
* workspaceId: "STRING_VALUE", // required
40+
* clientToken: "STRING_VALUE",
41+
* revisionId: "STRING_VALUE",
42+
* };
43+
* const command = new DeleteResourcePolicyCommand(input);
44+
* const response = await client.send(command);
45+
* // {};
46+
*
47+
* ```
48+
*
49+
* @param DeleteResourcePolicyCommandInput - {@link DeleteResourcePolicyCommandInput}
50+
* @returns {@link DeleteResourcePolicyCommandOutput}
51+
* @see {@link DeleteResourcePolicyCommandInput} for command's `input` shape.
52+
* @see {@link DeleteResourcePolicyCommandOutput} for command's `response` shape.
53+
* @see {@link AmpClientResolvedConfig | config} for AmpClient's `config` shape.
54+
*
55+
* @throws {@link AccessDeniedException} (client fault)
56+
* <p>You do not have sufficient access to perform this action.</p>
57+
*
58+
* @throws {@link ConflictException} (client fault)
59+
* <p>The request would cause an inconsistent state.</p>
60+
*
61+
* @throws {@link InternalServerException} (server fault)
62+
* <p>An unexpected error occurred during the processing of the request.</p>
63+
*
64+
* @throws {@link ResourceNotFoundException} (client fault)
65+
* <p>The request references a resources that doesn't exist.</p>
66+
*
67+
* @throws {@link ThrottlingException} (client fault)
68+
* <p>The request was denied due to request throttling.</p>
69+
*
70+
* @throws {@link ValidationException} (client fault)
71+
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
72+
*
73+
* @throws {@link AmpServiceException}
74+
* <p>Base exception class for all service exceptions from Amp service.</p>
75+
*
76+
*
77+
* @public
78+
*/
79+
export class DeleteResourcePolicyCommand extends $Command
80+
.classBuilder<
81+
DeleteResourcePolicyCommandInput,
82+
DeleteResourcePolicyCommandOutput,
83+
AmpClientResolvedConfig,
84+
ServiceInputTypes,
85+
ServiceOutputTypes
86+
>()
87+
.ep(commonParams)
88+
.m(function (this: any, Command: any, cs: any, config: AmpClientResolvedConfig, o: any) {
89+
return [
90+
getSerdePlugin(config, this.serialize, this.deserialize),
91+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
92+
];
93+
})
94+
.s("AmazonPrometheusService", "DeleteResourcePolicy", {})
95+
.n("AmpClient", "DeleteResourcePolicyCommand")
96+
.f(void 0, void 0)
97+
.ser(se_DeleteResourcePolicyCommand)
98+
.de(de_DeleteResourcePolicyCommand)
99+
.build() {
100+
/** @internal type navigation helper, not in runtime. */
101+
protected declare static __types: {
102+
api: {
103+
input: DeleteResourcePolicyRequest;
104+
output: {};
105+
};
106+
sdk: {
107+
input: DeleteResourcePolicyCommandInput;
108+
output: DeleteResourcePolicyCommandOutput;
109+
};
110+
};
111+
}

0 commit comments

Comments
 (0)