- 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.
CreateDomainUnitCommand
Creates a domain unit in Amazon DataZone.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DataZoneClient, CreateDomainUnitCommand } from "@aws-sdk/client-datazone"; // ES Modules import
// const { DataZoneClient, CreateDomainUnitCommand } = require("@aws-sdk/client-datazone"); // CommonJS import
const client = new DataZoneClient(config);
const input = { // CreateDomainUnitInput
domainIdentifier: "STRING_VALUE", // required
name: "STRING_VALUE", // required
parentDomainUnitIdentifier: "STRING_VALUE", // required
description: "STRING_VALUE",
clientToken: "STRING_VALUE",
};
const command = new CreateDomainUnitCommand(input);
const response = await client.send(command);
// { // CreateDomainUnitOutput
// id: "STRING_VALUE", // required
// domainId: "STRING_VALUE", // required
// name: "STRING_VALUE", // required
// parentDomainUnitId: "STRING_VALUE",
// description: "STRING_VALUE",
// owners: [ // DomainUnitOwners // required
// { // DomainUnitOwnerProperties Union: only one key present
// user: { // DomainUnitUserProperties
// userId: "STRING_VALUE",
// },
// group: { // DomainUnitGroupProperties
// groupId: "STRING_VALUE",
// },
// },
// ],
// ancestorDomainUnitIds: [ // DomainUnitIds // required
// "STRING_VALUE",
// ],
// createdAt: new Date("TIMESTAMP"),
// createdBy: "STRING_VALUE",
// };
CreateDomainUnitCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
domainIdentifier Required | string | undefined | The ID of the domain where you want to crate a domain unit. |
name Required | string | undefined | The name of the domain unit. |
parentDomainUnitIdentifier Required | string | undefined | The ID of the parent domain unit. |
clientToken | string | undefined | A unique, case-sensitive identifier that is provided to ensure the idempotency of the request. |
description | string | undefined | The description of the domain unit. |
CreateDomainUnitCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ancestorDomainUnitIds Required | string[] | undefined | The IDs of the ancestor domain units. |
domainId Required | string | undefined | The ID of the domain where the domain unit was created. |
id Required | string | undefined | The ID of the domain unit. |
name Required | string | undefined | The name of the domain unit. |
owners Required | DomainUnitOwnerProperties[] | undefined | The owners of the domain unit. |
createdAt | Date | undefined | The timestamp at which the domain unit was created. |
createdBy | string | undefined | The user who created the domain unit. |
description | string | undefined | The description of the domain unit. |
parentDomainUnitId | string | undefined | The ID of the parent domain unit. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient access to perform this action. |
ConflictException | client | There is a conflict while performing this action. |
InternalServerException | server | The request has failed because of an unknown error, exception or failure. |
ServiceQuotaExceededException | client | The request has exceeded the specified service quota. |
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. |