-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-grafana): This release adds tagging support to the Manage…
…d Grafana service. New APIs: TagResource, UntagResource and ListTagsForResource. Updates: add optional field tags to support tagging while calling CreateWorkspace.
- Loading branch information
awstools
committed
Mar 31, 2022
1 parent
ac15087
commit 38838fa
Showing
9 changed files
with
3,396 additions
and
2,314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
clients/client-grafana/src/commands/ListTagsForResourceCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
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 { GrafanaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GrafanaClient"; | ||
import { ListTagsForResourceRequest, ListTagsForResourceResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1ListTagsForResourceCommand, | ||
serializeAws_restJson1ListTagsForResourceCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface ListTagsForResourceCommandInput extends ListTagsForResourceRequest {} | ||
export interface ListTagsForResourceCommandOutput extends ListTagsForResourceResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>The <code>ListTagsForResource</code> operation returns the tags that | ||
* are associated with the Amazon Managed Service for Grafana resource specified by the <code>resourceArn</code>. | ||
* Currently, the only resource that can be tagged is a workspace. </p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { GrafanaClient, ListTagsForResourceCommand } from "@aws-sdk/client-grafana"; // ES Modules import | ||
* // const { GrafanaClient, ListTagsForResourceCommand } = require("@aws-sdk/client-grafana"); // CommonJS import | ||
* const client = new GrafanaClient(config); | ||
* const command = new ListTagsForResourceCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link ListTagsForResourceCommandInput} for command's `input` shape. | ||
* @see {@link ListTagsForResourceCommandOutput} for command's `response` shape. | ||
* @see {@link GrafanaClientResolvedConfig | config} for GrafanaClient's `config` shape. | ||
* | ||
*/ | ||
export class ListTagsForResourceCommand extends $Command< | ||
ListTagsForResourceCommandInput, | ||
ListTagsForResourceCommandOutput, | ||
GrafanaClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: ListTagsForResourceCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: GrafanaClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "GrafanaClient"; | ||
const commandName = "ListTagsForResourceCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: ListTagsForResourceRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: ListTagsForResourceResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: ListTagsForResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1ListTagsForResourceCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListTagsForResourceCommandOutput> { | ||
return deserializeAws_restJson1ListTagsForResourceCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
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 { GrafanaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GrafanaClient"; | ||
import { TagResourceRequest, TagResourceResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1TagResourceCommand, | ||
serializeAws_restJson1TagResourceCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface TagResourceCommandInput extends TagResourceRequest {} | ||
export interface TagResourceCommandOutput extends TagResourceResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>The <code>TagResource</code> operation associates tags with an Amazon Managed Grafana resource. | ||
* Currently, the only resource that can be tagged is workspaces. </p> | ||
* <p>If you specify a new tag key for the resource, this tag is appended to the list of tags associated | ||
* with the resource. If you specify a tag key that is already associated with the resource, the new tag | ||
* value that you specify replaces the previous value for that tag.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { GrafanaClient, TagResourceCommand } from "@aws-sdk/client-grafana"; // ES Modules import | ||
* // const { GrafanaClient, TagResourceCommand } = require("@aws-sdk/client-grafana"); // CommonJS import | ||
* const client = new GrafanaClient(config); | ||
* const command = new TagResourceCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link TagResourceCommandInput} for command's `input` shape. | ||
* @see {@link TagResourceCommandOutput} for command's `response` shape. | ||
* @see {@link GrafanaClientResolvedConfig | config} for GrafanaClient's `config` shape. | ||
* | ||
*/ | ||
export class TagResourceCommand extends $Command< | ||
TagResourceCommandInput, | ||
TagResourceCommandOutput, | ||
GrafanaClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: TagResourceCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: GrafanaClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<TagResourceCommandInput, TagResourceCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "GrafanaClient"; | ||
const commandName = "TagResourceCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: TagResourceRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: TagResourceResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: TagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1TagResourceCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<TagResourceCommandOutput> { | ||
return deserializeAws_restJson1TagResourceCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
Oops, something went wrong.