GetRuleCommand

Gets the details of a rule in Amazon DataZone. A rule is a formal agreement that enforces specific requirements across user workflows (e.g., publishing assets to the catalog, requesting subscriptions, creating projects) within the Amazon DataZone data portal. These rules help maintain consistency, ensure compliance, and uphold governance standards in data management processes. For instance, a metadata enforcement rule can specify the required information for creating a subscription request or publishing a data asset to the catalog, ensuring alignment with organizational standards.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { DataZoneClient, GetRuleCommand } from "@aws-sdk/client-datazone"; // ES Modules import
// const { DataZoneClient, GetRuleCommand } = require("@aws-sdk/client-datazone"); // CommonJS import
const client = new DataZoneClient(config);
const input = { // GetRuleInput
  domainIdentifier: "STRING_VALUE", // required
  identifier: "STRING_VALUE", // required
  revision: "STRING_VALUE",
};
const command = new GetRuleCommand(input);
const response = await client.send(command);
// { // GetRuleOutput
//   identifier: "STRING_VALUE", // required
//   revision: "STRING_VALUE", // required
//   name: "STRING_VALUE", // required
//   ruleType: "METADATA_FORM_ENFORCEMENT", // required
//   target: { // RuleTarget Union: only one key present
//     domainUnitTarget: { // DomainUnitTarget
//       domainUnitId: "STRING_VALUE", // required
//       includeChildDomainUnits: true || false,
//     },
//   },
//   action: "CREATE_LISTING_CHANGE_SET" || "CREATE_SUBSCRIPTION_REQUEST", // required
//   scope: { // RuleScope
//     assetType: { // AssetTypesForRule
//       selectionMode: "ALL" || "SPECIFIC", // required
//       specificAssetTypes: [ // RuleAssetTypeList
//         "STRING_VALUE",
//       ],
//     },
//     dataProduct: true || false,
//     project: { // ProjectsForRule
//       selectionMode: "ALL" || "SPECIFIC", // required
//       specificProjects: [ // RuleProjectIdentifierList
//         "STRING_VALUE",
//       ],
//     },
//   },
//   detail: { // RuleDetail Union: only one key present
//     metadataFormEnforcementDetail: { // MetadataFormEnforcementDetail
//       requiredMetadataForms: [ // RequiredMetadataFormList
//         { // MetadataFormReference
//           typeIdentifier: "STRING_VALUE", // required
//           typeRevision: "STRING_VALUE", // required
//         },
//       ],
//     },
//   },
//   targetType: "DOMAIN_UNIT",
//   description: "STRING_VALUE",
//   createdAt: new Date("TIMESTAMP"), // required
//   updatedAt: new Date("TIMESTAMP"), // required
//   createdBy: "STRING_VALUE", // required
//   lastUpdatedBy: "STRING_VALUE", // required
// };

GetRuleCommand Input

See GetRuleCommandInput for more details

Parameter
Type
Description
domainIdentifier
Required
string | undefined

The ID of the domain where the GetRule action is to be invoked.

identifier
Required
string | undefined

The ID of the rule.

revision
string | undefined

The revision of the rule.

GetRuleCommand Output

See GetRuleCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
action
Required
RuleAction | undefined

The action of the rule.

createdAt
Required
Date | undefined

The timestamp at which the rule was created.

createdBy
Required
string | undefined

The user who created the rule.

detail
Required
RuleDetail | undefined

The detail of the rule.

identifier
Required
string | undefined

The ID of the rule.

lastUpdatedBy
Required
string | undefined

The timestamp at which the rule was last updated.

name
Required
string | undefined

The name of the rule.

revision
Required
string | undefined

The revision of the rule.

ruleType
Required
RuleType | undefined

The type of the rule.

scope
Required
RuleScope | undefined

The scope of the rule.

target
Required
RuleTarget | undefined

The target of the rule.

updatedAt
Required
Date | undefined

The timestamp at which the rule was last updated.

description
string | undefined

The description of the rule.

targetType
RuleTargetType | undefined

The target type of the rule.

Throws

Name
Fault
Details
AccessDeniedException
client

You do not have sufficient access to perform this action.

InternalServerException
server

The request has failed because of an unknown error, exception or failure.

ResourceNotFoundException
client

The specified resource cannot be found.

ThrottlingException
client

The request was denied due to request throttling.

ValidationException
client

The input fails to satisfy the constraints specified by the Amazon Web Services service.

UnauthorizedException
client

You do not have permission to perform this action.

DataZoneServiceException
Base exception class for all service exceptions from DataZone service.