Amazon AWS SDK Guide de l'utilisateur Page 94 : Resource APIs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
Resource APIs
The SDK for .NET provides the AWS Resource APIs for .NET for programming with Amazon Glacier.
These resource APIs provide a resource-level programming model that enables you to write code to work
more directly with Amazon Glacier resources as compared to their low-level and high-level API counterparts.
(For more information about the AWS Resource APIs for .NET, including how to download and reference
these resource APIs, see
AWS Resource APIs for .NET (p. 41)
.)
The following example shows how to use the AWS Resource APIs for .NET to list accessible vaults in
Amazon Glacier:
// using Amazon.Glacier.Resources;
// using Amazon.Runtime.Resources;
var g = new Glacier();
foreach (var vault in g.GetVaults())
{
Console.WriteLine("Vault: {0}", vault.Name);
Console.WriteLine("
Creation date: {0}", vault.CreationDate);
Console.WriteLine("
Size in bytes: {0}", vault.SizeInBytes);
Console.WriteLine("
Number of archives: {0}", vault.NumberOfArchives);
try
{
var n = vault.GetNotification();
Console.WriteLine("
Notifications:");
Console.WriteLine("
Topic: {0}", n.SNSTopic);
var events = n.Events;
if (events.Any())
{
Console.WriteLine("
Events:");
foreach (var e in events)
{
Console.WriteLine("{0}", e);
}
}
else
{
Console.WriteLine("
No events set.");
}
}
catch (ResourceLoadException)
{
Console.WriteLine("
No notifications set.");
}
var jobs = vault.GetJobs();
if (jobs.Any())
{
Console.WriteLine("
Jobs:");
Version v2.0.0
90
AWS SDK for .NET Developer Guide
Programming Models
Fichier PDF · ·
Questions sur Amazon AWS SDK
Pas encore de questions sur ce manuel. Posez la première.
Produits connexes et manuels pour Logiciel Amazon AWS SDK
- Logiciel Amazon Redshift Manuel d'utilisateur
(24 pages) - Logiciel Amazon Redshift Manuel d'utilisateur
(11 pages) - Logiciel Amazon AWS SDK Guide de l'utilisateur
(73 pages)