Skip to content

Latest commit

 

History

History
 
 

client-datazone

@aws-sdk/client-datazone

Description

AWS SDK for JavaScript DataZone Client for Node.js, Browser and React Native.

Amazon DataZone is a data management service that enables you to catalog, discover, govern, share, and analyze your data. With Amazon DataZone, you can share and access your data across accounts and supported regions. Amazon DataZone simplifies your experience across Amazon Web Services services, including, but not limited to, Amazon Redshift, Amazon Athena, Amazon Web Services Glue, and Amazon Web Services Lake Formation.

Installing

To install the this package, simply type add or install @aws-sdk/client-datazone using your favorite package manager:

  • npm install @aws-sdk/client-datazone
  • yarn add @aws-sdk/client-datazone
  • pnpm add @aws-sdk/client-datazone

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the DataZoneClient and the commands you need, for example ListDomainsCommand:

// ES5 example
const { DataZoneClient, ListDomainsCommand } = require("@aws-sdk/client-datazone");
// ES6+ example
import { DataZoneClient, ListDomainsCommand } from "@aws-sdk/client-datazone";

Usage

To send a request, you:

  • Initiate client with configuration (e.g. credentials, region).
  • Initiate command with input parameters.
  • Call send operation on client with command object as input.
  • If you are using a custom http handler, you may call destroy() to close open connections.
// a client can be shared by different commands.
const client = new DataZoneClient({ region: "REGION" });

const params = {
  /** input parameters */
};
const command = new ListDomainsCommand(params);

Async/await

We recommend using await operator to wait for the promise returned by send operation as follows:

// async/await.
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}

Async-await is clean, concise, intuitive, easy to debug and has better error handling as compared to using Promise chains or callbacks.

Promises

You can also use Promise chaining to execute send operation.

client.send(command).then(
  (data) => {
    // process data.
  },
  (error) => {
    // error handling.
  }
);

Promises can also be called using .catch() and .finally() as follows:

client
  .send(command)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  })
  .finally(() => {
    // finally.
  });

Callbacks

We do not recommend using callbacks because of callback hell, but they are supported by the send operation.

// callbacks.
client.send(command, (err, data) => {
  // process err and data.
});

v2 compatible style

The client can also send requests using v2 compatible style. However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post on modular packages in AWS SDK for JavaScript

import * as AWS from "@aws-sdk/client-datazone";
const client = new AWS.DataZone({ region: "REGION" });

// async/await.
try {
  const data = await client.listDomains(params);
  // process data.
} catch (error) {
  // error handling.
}

// Promises.
client
  .listDomains(params)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  });

// callbacks.
client.listDomains(params, (err, data) => {
  // process err and data.
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  const { requestId, cfId, extendedRequestId } = error.$$metadata;
  console.log({ requestId, cfId, extendedRequestId });
  /**
   * The keys within exceptions are also parsed.
   * You can access them by specifying exception names:
   * if (error.name === 'SomeServiceException') {
   *     const value = error.specialKeyInException;
   * }
   */
}

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-datazone package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

AcceptPredictions

Command API Reference / Input / Output

AcceptSubscriptionRequest

Command API Reference / Input / Output

CancelSubscription

Command API Reference / Input / Output

CreateAsset

Command API Reference / Input / Output

CreateAssetRevision

Command API Reference / Input / Output

CreateAssetType

Command API Reference / Input / Output

CreateDataSource

Command API Reference / Input / Output

CreateDomain

Command API Reference / Input / Output

CreateEnvironment

Command API Reference / Input / Output

CreateEnvironmentProfile

Command API Reference / Input / Output

CreateFormType

Command API Reference / Input / Output

CreateGlossary

Command API Reference / Input / Output

CreateGlossaryTerm

Command API Reference / Input / Output

CreateGroupProfile

Command API Reference / Input / Output

CreateListingChangeSet

Command API Reference / Input / Output

CreateProject

Command API Reference / Input / Output

CreateProjectMembership

Command API Reference / Input / Output

CreateSubscriptionGrant

Command API Reference / Input / Output

CreateSubscriptionRequest

Command API Reference / Input / Output

CreateSubscriptionTarget

Command API Reference / Input / Output

CreateUserProfile

Command API Reference / Input / Output

DeleteAsset

Command API Reference / Input / Output

DeleteAssetType

Command API Reference / Input / Output

DeleteDataSource

Command API Reference / Input / Output

DeleteDomain

Command API Reference / Input / Output

DeleteEnvironment

Command API Reference / Input / Output

DeleteEnvironmentBlueprintConfiguration

Command API Reference / Input / Output

DeleteEnvironmentProfile

Command API Reference / Input / Output

DeleteFormType

Command API Reference / Input / Output

DeleteGlossary

Command API Reference / Input / Output

DeleteGlossaryTerm

Command API Reference / Input / Output

DeleteListing

Command API Reference / Input / Output

DeleteProject

Command API Reference / Input / Output

DeleteProjectMembership

Command API Reference / Input / Output

DeleteSubscriptionGrant

Command API Reference / Input / Output

DeleteSubscriptionRequest

Command API Reference / Input / Output

DeleteSubscriptionTarget

Command API Reference / Input / Output

GetAsset

Command API Reference / Input / Output

GetAssetType

Command API Reference / Input / Output

GetDataSource

Command API Reference / Input / Output

GetDataSourceRun

Command API Reference / Input / Output

GetDomain

Command API Reference / Input / Output

GetEnvironment

Command API Reference / Input / Output

GetEnvironmentBlueprint

Command API Reference / Input / Output

GetEnvironmentBlueprintConfiguration

Command API Reference / Input / Output

GetEnvironmentProfile

Command API Reference / Input / Output

GetFormType

Command API Reference / Input / Output

GetGlossary

Command API Reference / Input / Output

GetGlossaryTerm

Command API Reference / Input / Output

GetGroupProfile

Command API Reference / Input / Output

GetIamPortalLoginUrl

Command API Reference / Input / Output

GetListing

Command API Reference / Input / Output

GetProject

Command API Reference / Input / Output

GetSubscription

Command API Reference / Input / Output

GetSubscriptionGrant

Command API Reference / Input / Output

GetSubscriptionRequestDetails

Command API Reference / Input / Output

GetSubscriptionTarget

Command API Reference / Input / Output

GetUserProfile

Command API Reference / Input / Output

ListAssetRevisions

Command API Reference / Input / Output

ListDataSourceRunActivities

Command API Reference / Input / Output

ListDataSourceRuns

Command API Reference / Input / Output

ListDataSources

Command API Reference / Input / Output

ListDomains

Command API Reference / Input / Output

ListEnvironmentBlueprintConfigurations

Command API Reference / Input / Output

ListEnvironmentBlueprints

Command API Reference / Input / Output

ListEnvironmentProfiles

Command API Reference / Input / Output

ListEnvironments

Command API Reference / Input / Output

ListNotifications

Command API Reference / Input / Output

ListProjectMemberships

Command API Reference / Input / Output

ListProjects

Command API Reference / Input / Output

ListSubscriptionGrants

Command API Reference / Input / Output

ListSubscriptionRequests

Command API Reference / Input / Output

ListSubscriptions

Command API Reference / Input / Output

ListSubscriptionTargets

Command API Reference / Input / Output

ListTagsForResource

Command API Reference / Input / Output

PutEnvironmentBlueprintConfiguration

Command API Reference / Input / Output

RejectPredictions

Command API Reference / Input / Output

RejectSubscriptionRequest

Command API Reference / Input / Output

RevokeSubscription

Command API Reference / Input / Output

Search

Command API Reference / Input / Output

SearchGroupProfiles

Command API Reference / Input / Output

SearchListings

Command API Reference / Input / Output

SearchTypes

Command API Reference / Input / Output

SearchUserProfiles

Command API Reference / Input / Output

StartDataSourceRun

Command API Reference / Input / Output

TagResource

Command API Reference / Input / Output

UntagResource

Command API Reference / Input / Output

UpdateDataSource

Command API Reference / Input / Output

UpdateDomain

Command API Reference / Input / Output

UpdateEnvironment

Command API Reference / Input / Output

UpdateEnvironmentProfile

Command API Reference / Input / Output

UpdateGlossary

Command API Reference / Input / Output

UpdateGlossaryTerm

Command API Reference / Input / Output

UpdateGroupProfile

Command API Reference / Input / Output

UpdateProject

Command API Reference / Input / Output

UpdateSubscriptionGrantStatus

Command API Reference / Input / Output

UpdateSubscriptionRequest

Command API Reference / Input / Output

UpdateSubscriptionTarget

Command API Reference / Input / Output

UpdateUserProfile

Command API Reference / Input / Output