- 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.
CreateSubscriptionGrantCommand
Creates a subsscription grant in Amazon DataZone.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DataZoneClient, CreateSubscriptionGrantCommand } from "@aws-sdk/client-datazone"; // ES Modules import
// const { DataZoneClient, CreateSubscriptionGrantCommand } = require("@aws-sdk/client-datazone"); // CommonJS import
const client = new DataZoneClient(config);
const input = { // CreateSubscriptionGrantInput
domainIdentifier: "STRING_VALUE", // required
environmentIdentifier: "STRING_VALUE", // required
subscriptionTargetIdentifier: "STRING_VALUE",
grantedEntity: { // GrantedEntityInput Union: only one key present
listing: { // ListingRevisionInput
identifier: "STRING_VALUE", // required
revision: "STRING_VALUE", // required
},
},
assetTargetNames: [ // AssetTargetNames
{ // AssetTargetNameMap
assetId: "STRING_VALUE", // required
targetName: "STRING_VALUE", // required
},
],
clientToken: "STRING_VALUE",
};
const command = new CreateSubscriptionGrantCommand(input);
const response = await client.send(command);
// { // CreateSubscriptionGrantOutput
// id: "STRING_VALUE", // required
// createdBy: "STRING_VALUE", // required
// updatedBy: "STRING_VALUE",
// domainId: "STRING_VALUE", // required
// createdAt: new Date("TIMESTAMP"), // required
// updatedAt: new Date("TIMESTAMP"), // required
// subscriptionTargetId: "STRING_VALUE", // required
// grantedEntity: { // GrantedEntity Union: only one key present
// listing: { // ListingRevision
// id: "STRING_VALUE", // required
// revision: "STRING_VALUE", // required
// },
// },
// status: "PENDING" || "IN_PROGRESS" || "GRANT_FAILED" || "REVOKE_FAILED" || "GRANT_AND_REVOKE_FAILED" || "COMPLETED" || "INACCESSIBLE", // required
// assets: [ // SubscribedAssets
// { // SubscribedAsset
// assetId: "STRING_VALUE", // required
// assetRevision: "STRING_VALUE", // required
// status: "GRANT_PENDING" || "REVOKE_PENDING" || "GRANT_IN_PROGRESS" || "REVOKE_IN_PROGRESS" || "GRANTED" || "REVOKED" || "GRANT_FAILED" || "REVOKE_FAILED", // required
// targetName: "STRING_VALUE",
// failureCause: { // FailureCause
// message: "STRING_VALUE",
// },
// grantedTimestamp: new Date("TIMESTAMP"),
// failureTimestamp: new Date("TIMESTAMP"),
// assetScope: { // AssetScope
// assetId: "STRING_VALUE", // required
// filterIds: [ // FilterIds // required
// "STRING_VALUE",
// ],
// status: "STRING_VALUE", // required
// errorMessage: "STRING_VALUE",
// },
// },
// ],
// subscriptionId: "STRING_VALUE",
// };
CreateSubscriptionGrantCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
domainIdentifier Required | string | undefined | The ID of the Amazon DataZone domain in which the subscription grant is created. |
environmentIdentifier Required | string | undefined | The ID of the environment in which the subscription grant is created. |
grantedEntity Required | GrantedEntityInput | undefined | The entity to which the subscription is to be granted. |
assetTargetNames | AssetTargetNameMap[] | undefined | The names of the assets for which the subscription grant is created. |
clientToken | string | undefined | A unique, case-sensitive identifier that is provided to ensure the idempotency of the request. |
subscriptionTargetIdentifier | string | undefined | The ID of the subscription target for which the subscription grant is created. |
CreateSubscriptionGrantCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
createdAt Required | Date | undefined | A timestamp of when the subscription grant is created. |
createdBy Required | string | undefined | The Amazon DataZone user who created the subscription grant. |
domainId Required | string | undefined | The ID of the Amazon DataZone domain in which the subscription grant is created. |
grantedEntity Required | GrantedEntity | undefined | The entity to which the subscription is granted. |
id Required | string | undefined | The ID of the subscription grant. |
status Required | SubscriptionGrantOverallStatus | undefined | The status of the subscription grant. |
subscriptionTargetId Required | string | undefined | The ID of the subscription target for which the subscription grant is created. |
updatedAt Required | Date | undefined | A timestamp of when the subscription grant was updated. |
assets | SubscribedAsset[] | undefined | The assets for which the subscription grant is created. |
subscriptionId | string | undefined | The identifier of the subscription grant. |
updatedBy | string | undefined | The Amazon DataZone user who updated the subscription grant. |
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. |
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. |