Skip to content

Commit fa9cc65

Browse files
committed
Adding AWS Support MVP
1 parent 33b34b8 commit fa9cc65

13 files changed

+1407
-0
lines changed

Diff for: .doc_gen/metadata/services.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,14 @@ sts:
489489
product_categories: {'Security, Identity, & Compliance'}
490490
version: sts-2011-06-15
491491
api_ref: STS/latest/APIReference/welcome.html
492+
support:
493+
long: '&SUPPORTlong;'
494+
short: '&SUPPORT;'
495+
sort: Support
496+
tags:
497+
product_categories: {'Customer Enablement Services'}
498+
version: support-2013-04-15
499+
api_ref: support/latest/APIReference/welcome.html
492500
textract:
493501
long: '&TEXTRACTlong;'
494502
short: '&TEXTRACT;'

Diff for: .doc_gen/metadata/support_metadata.yaml

+200
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
# zexi 0.4.0
2+
support_Hello:
3+
title: Hello &SUPPORT;
4+
title_abbrev: Hello &SUPPORT;
5+
synopsis: get started using &SUPPORTlong; (&SUPPORT;).
6+
category: Hello
7+
languages:
8+
.NET:
9+
versions:
10+
- sdk_version: 3
11+
github: dotnetv3/Support
12+
sdkguide:
13+
excerpts:
14+
- description:
15+
snippet_tags:
16+
- Support.dotnetv3.HelloSupport
17+
services:
18+
support: {ListServices}
19+
support_AddAttachment:
20+
title: Add an &SUPPORT; attachment to a set using an &AWS; SDK
21+
title_abbrev: Add an attachment to a set
22+
synopsis: add an &SUPPORT; attachment to an attachment set to use in a support case.
23+
category:
24+
languages:
25+
.NET:
26+
versions:
27+
- sdk_version: 3
28+
github: dotnetv3/Support
29+
sdkguide:
30+
excerpts:
31+
- description:
32+
snippet_tags:
33+
- Support.dotnetv3.AddAttachmentToSet
34+
services:
35+
support: {AddAttachmentsToSet}
36+
support_addCommunication:
37+
title: Add an &SUPPORT; communication to a support case using an &AWS; SDK
38+
title_abbrev: Add a communication to a case
39+
synopsis: add an &SUPPORT; communication with an attachment to a support case.
40+
category:
41+
languages:
42+
.NET:
43+
versions:
44+
- sdk_version: 3
45+
github: dotnetv3/Support
46+
sdkguide:
47+
excerpts:
48+
- description:
49+
snippet_tags:
50+
- Support.dotnetv3.AddCommunicationToCase
51+
services:
52+
support: {AddCommunicationToCase}
53+
support_createCase:
54+
title: Create an &SUPPORT; case using an &AWS; SDK
55+
title_abbrev: Create a case
56+
synopsis: create a new &SUPPORT; case.
57+
category:
58+
languages:
59+
.NET:
60+
versions:
61+
- sdk_version: 3
62+
github: dotnetv3/Support
63+
sdkguide:
64+
excerpts:
65+
- description:
66+
snippet_tags:
67+
- Support.dotnetv3.CreateCase
68+
services:
69+
support: {CreateCase}
70+
support_describeAttachment:
71+
title: Describe an &SUPPORT; attachment for a case using an &AWS; SDK
72+
title_abbrev: Describe an attachment
73+
synopsis: Describe an &SUPPORT; attachment for a case.
74+
category:
75+
languages:
76+
.NET:
77+
versions:
78+
- sdk_version: 3
79+
github: dotnetv3/Support
80+
sdkguide:
81+
excerpts:
82+
- description:
83+
snippet_tags:
84+
- Support.dotnetv3.DescribeAttachment
85+
services:
86+
support: {DescribeAttachment}
87+
support_describeCases:
88+
title: Describe &SUPPORT; cases using an &AWS; SDK
89+
title_abbrev: Describe cases
90+
synopsis: Describe &SUPPORT; cases.
91+
category:
92+
languages:
93+
.NET:
94+
versions:
95+
- sdk_version: 3
96+
github: dotnetv3/Support
97+
sdkguide:
98+
excerpts:
99+
- description:
100+
snippet_tags:
101+
- Support.dotnetv3.DescribeCases
102+
services:
103+
support: {DescribeCases}
104+
support_describeCommunications:
105+
title: Describe &SUPPORT; communications for a case using an &AWS; SDK
106+
title_abbrev: Describe communications
107+
synopsis: Describe &SUPPORT; communications for a case.
108+
category:
109+
languages:
110+
.NET:
111+
versions:
112+
- sdk_version: 3
113+
github: dotnetv3/Support
114+
sdkguide:
115+
excerpts:
116+
- description:
117+
snippet_tags:
118+
- Support.dotnetv3.DescribeCommunications
119+
services:
120+
support: {DescribeCommunications}
121+
support_describeServices:
122+
title: Describe &SUPPORT; services using an &AWS; SDK
123+
title_abbrev: Describe services
124+
synopsis: Describe &SUPPORT; services.
125+
category:
126+
languages:
127+
.NET:
128+
versions:
129+
- sdk_version: 3
130+
github: dotnetv3/Support
131+
sdkguide:
132+
excerpts:
133+
- description:
134+
snippet_tags:
135+
- Support.dotnetv3.DescribeServices
136+
services:
137+
support: {DescribeServices}
138+
support_describeSeverityLevels:
139+
title: Describe &SUPPORT; severity levels using an &AWS; SDK
140+
title_abbrev: Describe severity levels
141+
synopsis: Describe &SUPPORT; severity levels.
142+
category:
143+
languages:
144+
.NET:
145+
versions:
146+
- sdk_version: 3
147+
github: dotnetv3/Support
148+
sdkguide:
149+
excerpts:
150+
- description:
151+
snippet_tags:
152+
- Support.dotnetv3.DescribeSeverityLevels
153+
services:
154+
support: {DescribeSeverityLevels}
155+
support_resolveCase:
156+
title: Resolve an &SUPPORT; case using an &AWS; SDK
157+
title_abbrev: Resolve case
158+
synopsis: Resolve an &SUPPORT; case.
159+
category:
160+
languages:
161+
.NET:
162+
versions:
163+
- sdk_version: 3
164+
github: dotnetv3/Support
165+
sdkguide:
166+
excerpts:
167+
- description:
168+
snippet_tags:
169+
- Support.dotnetv3.ResolveCase
170+
services:
171+
support: {ResolveCase}
172+
support_Scenario_GetStartedSupportCases:
173+
title: Get started with &SUPPORT; cases using an &AWS; SDK
174+
title_abbrev: Get started with &SUPPORT; cases
175+
synopsis_list:
176+
- Get and display available services and severity levels for cases.
177+
- Create a support case using a selected service, category, and severity level.
178+
- Get and display a list of open cases for the current day.
179+
- Add an attachment set and a communication to the new case.
180+
- Describe the new attachment and communication for the case.
181+
- Resolve the case.
182+
- Get and display a list of resolved cases for the current day.
183+
category: Scenarios
184+
languages:
185+
.NET:
186+
versions:
187+
- sdk_version: 3
188+
github: dotnetv3/Support
189+
sdkguide:
190+
excerpts:
191+
- description: Run an interactive scenario at a command prompt.
192+
snippet_tags:
193+
- Support.dotnetv3.SupportBasics
194+
- description: Wrapper methods used by the scenario for &SUPPORT actions.
195+
snippet_tags:
196+
- Support.dotnetv3.SupportWrapper
197+
services:
198+
support: {AddAttachmentsToSet, AddCommunicationToCase, CreateCase, DescribeAttachment,
199+
DescribeCases, DescribeCommunications, DescribeServices, DescribeSeverityLevels,
200+
ResolveCase}

Diff for: dotnetv3/Support/Actions/HelloSupport.cs

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
using Amazon.AWSSupport;
5+
using Amazon.Extensions.NETCore.Setup;
6+
using Microsoft.Extensions.DependencyInjection;
7+
using Microsoft.Extensions.Hosting;
8+
using Microsoft.Extensions.Logging;
9+
using Microsoft.Extensions.Logging.Console;
10+
using Microsoft.Extensions.Logging.Debug;
11+
12+
namespace SupportActions;
13+
14+
// snippet-start:[Support.dotnetv3.HelloSupport]
15+
16+
/// <summary>
17+
/// Hello AWS Support example.
18+
/// </summary>
19+
public static class HelloSupport
20+
{
21+
static async Task Main(string[] args)
22+
{
23+
// Set up dependency injection for the AWS Support service.
24+
// Use your AWS profile name, or leave blank to use the default profile.
25+
using var host = Host.CreateDefaultBuilder(args)
26+
.ConfigureLogging(logging =>
27+
logging.AddFilter("System", LogLevel.Debug)
28+
.AddFilter<DebugLoggerProvider>("Microsoft", LogLevel.Information)
29+
.AddFilter<ConsoleLoggerProvider>("Microsoft", LogLevel.Trace))
30+
.ConfigureServices((_, services) =>
31+
services.AddAWSService<IAmazonAWSSupport>(new AWSOptions(){Profile = "dotnettesting"})
32+
.AddTransient<SupportWrapper>()
33+
)
34+
.Build();
35+
36+
var logger = LoggerFactory.Create(builder =>
37+
{
38+
builder.AddConsole();
39+
}).CreateLogger(typeof(HelloSupport));
40+
41+
var supportWrapper = host.Services.GetRequiredService<SupportWrapper>();
42+
43+
Console.WriteLine(new string('-', 80));
44+
Console.WriteLine("Welcome to the AWS Support Hello Support example.");
45+
Console.WriteLine(new string('-', 80));
46+
47+
try
48+
{
49+
var apiSupported = await supportWrapper.VerifySubscription();
50+
if (!apiSupported)
51+
{
52+
logger.LogError("You must have a Business, Enterprise On-Ramp, or Enterprise Support " +
53+
"plan to use the AWS Support API. \n\tPlease upgrade your subscription to run these examples.");
54+
return;
55+
}
56+
57+
var services = await supportWrapper.DescribeServices();
58+
Console.WriteLine($"AWS Support client returned {services.Count} services.");
59+
60+
Console.WriteLine(new string('-', 80));
61+
Console.WriteLine("Hello Support example is complete.");
62+
Console.WriteLine(new string('-', 80));
63+
}
64+
catch (Exception ex)
65+
{
66+
logger.LogError(ex, "There was a problem executing the scenario.");
67+
}
68+
}
69+
}
70+
// snippet-end:[Support.dotnetv3.HelloSupport]

Diff for: dotnetv3/Support/Actions/SupportActions.csproj

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="AWSSDK.AWSSupport" Version="3.7.0.217" />
12+
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.2" />
13+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
14+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
15+
</ItemGroup>
16+
17+
</Project>

0 commit comments

Comments
 (0)