Describe Amazon Web Services Support severity levels using an Amazon SDK - Amazon Web Services Support
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Describe Amazon Web Services Support severity levels using an Amazon SDK

The following code examples show how to describe Amazon Web Services Support severity levels.

.NET
Amazon SDK for .NET
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

/// <summary> /// Get the descriptions of support severity levels. /// </summary> /// <param name="name">Optional language for severity levels. /// Currently "en" (English) and "ja" (Japanese) are supported.</param> /// <returns>The list of support severity levels.</returns> public async Task<List<SeverityLevel>> DescribeSeverityLevels(string language = "en") { var response = await _amazonSupport.DescribeSeverityLevelsAsync( new DescribeSeverityLevelsRequest() { Language = language }); return response.SeverityLevels; }
Java
SDK for Java 2.x
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

public static String displaySevLevels(SupportClient supportClient) { try { DescribeSeverityLevelsRequest severityLevelsRequest = DescribeSeverityLevelsRequest.builder() .language("en") .build(); DescribeSeverityLevelsResponse response = supportClient.describeSeverityLevels(severityLevelsRequest); List<SeverityLevel> severityLevels = response.severityLevels(); String levelName = null; for (SeverityLevel sevLevel: severityLevels) { System.out.println("The severity level name is: "+ sevLevel.name()); if (sevLevel.name().compareTo("High")==0) levelName = sevLevel.name(); } return levelName; } catch (SupportException e) { System.out.println(e.getLocalizedMessage()); System.exit(1); } return ""; }
JavaScript
SDK for JavaScript V3
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

import { DescribeSeverityLevelsCommand } from "@aws-sdk/client-support"; import { client } from "../libs/client.js"; export const main = async () => { try { // Get the list of severity levels. // The available values depend on the support plan for the account. const response = await client.send(new DescribeSeverityLevelsCommand({})); console.log(response.severityLevels) return response; } catch (err) { console.error(err); } };
Kotlin
SDK for Kotlin
Note

This is prerelease documentation for a feature in preview release. It is subject to change.

Note

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

suspend fun displaySevLevels(): String { var levelName = "" val severityLevelsRequest = DescribeSeverityLevelsRequest { language = "en" } SupportClient { region = "us-west-2" }.use { supportClient -> val response = supportClient.describeSeverityLevels(severityLevelsRequest) response.severityLevels?.forEach { sevLevel -> println("The severity level name is: ${sevLevel.name}") if (sevLevel.name == "High") { levelName = sevLevel.name!! } } return levelName } }

For a complete list of Amazon SDK developer guides and code examples, see Using Amazon Web Services Support with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.