This package has been deprecated

Author message:

The package @aws-sdk/client-support-node has been renamed to @aws-sdk/client-support. Please install the renamed package.

@aws-sdk/client-support-node
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-preview.2 • Public • Published

@aws-sdk/client-support-node

NPM version NPM downloads

Description

AWS Support

The AWS Support API reference is intended for programmers who need detailed information about the AWS Support operations and data types. This service enables you to manage your AWS Support cases programmatically. It uses HTTP methods that return results in JSON format.

The AWS Support service also exposes a set of Trusted Advisor features. You can retrieve a list of checks and their descriptions, get check results, specify checks to refresh, and get the refresh status of checks.

The following list describes the AWS Support case management operations:

  • Service names, issue categories, and available severity levels. The DescribeServices and DescribeSeverityLevels operations return AWS service names, service codes, service categories, and problem severity levels. You use these values when you call the CreateCase operation.

  • Case creation, case details, and case resolution. The CreateCase, DescribeCases, DescribeAttachment, and ResolveCase operations create AWS Support cases, retrieve information about cases, and resolve cases.

  • Case communication. The DescribeCommunications, AddCommunicationToCase, and AddAttachmentsToSet operations retrieve and add communications and attachments to AWS Support cases.

The following list describes the operations available from the AWS Support service for Trusted Advisor:

  • DescribeTrustedAdvisorChecks returns the list of checks that run against your AWS resources.

  • Using the checkId for a specific check returned by DescribeTrustedAdvisorChecks, you can call DescribeTrustedAdvisorCheckResult to obtain the results for the check you specified.

  • DescribeTrustedAdvisorCheckSummaries returns summarized results for one or more Trusted Advisor checks.

  • RefreshTrustedAdvisorCheck requests that Trusted Advisor rerun a specified check.

  • DescribeTrustedAdvisorCheckRefreshStatuses reports the refresh status of one or more checks.

For authentication of requests, AWS Support uses Signature Version 4 Signing Process.

See About the AWS Support API in the AWS Support User Guide for information about how to use this service to create and manage your support cases, and how to call Trusted Advisor for results of checks on your resources.

Installing

To install the this package using NPM, simply type the following into a terminal window:

npm install @aws-sdk/client-support-node

Getting Started

Import

The AWS SDK is modulized by clients and commands in CommonJS modules. To send a request, you only need to import the client(SupportClient) and the commands you need, for example AddAttachmentsToSetCommand:

//JavaScript
const { SupportClient } = require("@aws-sdk/client-support-node/SupportClient");
const {
  AddAttachmentsToSetCommand
} = require("@aws-sdk/client-support-node/commands/AddAttachmentsToSetCommand");
//TypeScript
import { SupportClient } from "@aws-sdk/client-support-node/SupportClient";
import { AddAttachmentsToSetCommand } from "@aws-sdk/client-support-node/commands/AddAttachmentsToSetCommand";

Usage

To send a request, you:

  • Initiate client with configuration (e.g. credentials, region). For more information you can refer to the API reference.
  • 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.
const support = new SupportClient({ region: "region" });
//clients can be shared by different commands
const params = {
  attachments: [
    /**a list of structure*/
  ]
};
const addAttachmentsToSetCommand = new AddAttachmentsToSetCommand(params);
support
  .send(addAttachmentsToSetCommand)
  .then(data => {
    // do something
  })
  .catch(error => {
    // error handling
  });

In addition to using promises, there are 2 other ways to send a request:

// async/await
try {
  const data = await support.send(addAttachmentsToSetCommand);
  // do something
} catch (error) {
  // error handling
}
// callback
support.send(addAttachmentsToSetCommand, (err, data) => {
  //do something
});

The SDK can also send requests using the simplified callback style from version 2 of the SDK.

import * as AWS from "@aws-sdk/@aws-sdk/client-support-node/Support";
const support = new AWS.Support({ region: "region" });
support.addAttachmentsToSet(params, (err, data) => {
  //do something
});

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 support.send(addAttachmentsToSetCommand);
  // do something
} catch (error) {
  const metadata = error.$metadata;
  console.log(
    `requestId: ${metadata.requestId}
cfId: ${metadata.cfId}
extendedRequestId: ${metadata.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 and have limited bandwidth to address them.

  • Ask a question on StackOverflow and tag it with aws-sdk-js
  • Come join the AWS JavaScript community on gitter
  • If it turns out that you may have found a bug, please open an issue

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/@aws-sdk/client-support-node' package is updated. To contribute to SDK you can checkout our code generator package.

License

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

Readme

Keywords

none

Package Sidebar

Install

npm i @aws-sdk/client-support-node

Weekly Downloads

1

Version

0.1.0-preview.2

License

Apache-2.0

Unpacked Size

299 kB

Total Files

515

Last publish

Collaborators

  • amzn-oss
  • aws-sdk-bot