- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateFilterCommand
Creates a recommendation filter. For more information, see Filtering recommendations and user segments .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { PersonalizeClient, CreateFilterCommand } from "@aws-sdk/client-personalize"; // ES Modules import
// const { PersonalizeClient, CreateFilterCommand } = require("@aws-sdk/client-personalize"); // CommonJS import
const client = new PersonalizeClient(config);
const input = { // CreateFilterRequest
name: "STRING_VALUE", // required
datasetGroupArn: "STRING_VALUE", // required
filterExpression: "STRING_VALUE", // required
tags: [ // Tags
{ // Tag
tagKey: "STRING_VALUE", // required
tagValue: "STRING_VALUE", // required
},
],
};
const command = new CreateFilterCommand(input);
const response = await client.send(command);
// { // CreateFilterResponse
// filterArn: "STRING_VALUE",
// };
CreateFilterCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
datasetGroupArn Required | string | undefined | The ARN of the dataset group that the filter will belong to. |
filterExpression Required | string | undefined | The filter expression defines which items are included or excluded from recommendations. Filter expression must follow specific format rules. For information about filter expression structure and syntax, see Filter expressions . |
name Required | string | undefined | The name of the filter to create. |
tags | Tag[] | undefined | A list of tags to apply to the filter. |
CreateFilterCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
filterArn | string | undefined | The ARN of the new filter. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidInputException | client | Provide a valid value for the field or parameter. |
LimitExceededException | client | The limit on the number of requests per second has been exceeded. |
ResourceAlreadyExistsException | client | The specified resource already exists. |
ResourceNotFoundException | client | Could not find the specified resource. |
TooManyTagsException | client | You have exceeded the maximum number of tags you can apply to this resource. |
PersonalizeServiceException | Base exception class for all service exceptions from Personalize service. |