Diese Seite ist nur für Bestandskunden des Amazon Glacier-Service bestimmt, die Vaults und die ursprüngliche REST-API von 2012 verwenden.
Wenn Sie nach Archivspeicherlösungen suchen, empfehlen wir die Verwendung der Amazon Glacier-Speicherklassen in Amazon S3, S3 Glacier Instant Retrieval, S3 Glacier Flexible Retrieval und S3 Glacier Deep Archive. Weitere Informationen zu diesen Speicheroptionen finden Sie unter Amazon Glacier-Speicherklassen
Amazon Glacier (ursprünglicher eigenständiger, vault-basierter Service) akzeptiert ab dem 15. Dezember 2025 keine Neukunden mehr, ohne dass dies Auswirkungen auf Bestandskunden hat. Amazon Glacier ist ein eigenständiger Service APIs , der Daten in Tresoren speichert und sich von den Speicherklassen Amazon S3 und Amazon S3 Glacier unterscheidet. Ihre vorhandenen Daten bleiben in Amazon Glacier auf unbestimmte Zeit sicher und zugänglich. Es ist keine Migration erforderlich. Für kostengünstige, langfristige Archivierungsspeicherung AWS empfiehlt sich die Amazon S3 Glacier-Speicherklasse
Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.
Konfiguration von Tresor-Benachrichtigungen in Amazon Glacier mithilfe der AWS SDK für Java
Nachfolgend werden die Schritte zum Konfigurieren von Benachrichtigungen auf einem Tresor mithilfe der Low-Level-API für das AWS SDK für Java beschrieben.
-
Erstellen einer Instance der
AmazonGlacierClient-Klasse (Client).Sie müssen eine AWS Region angeben, in der sich der Tresor befindet. Alle Operationen, die Sie mit diesem Client ausführen, gelten für diese AWS Region.
-
Stellen Sie Informationen zur Benachrichtigungskonfiguration bereit, indem Sie eine Instance der
SetVaultNotificationsRequest-Klasse erstellen.Sie müssen den Tresornamen, Informationen zur Benachrichtigungskonfiguration und die Konto-ID bereitstellen. Wenn Sie eine Benachrichtigungskonfiguration angeben, stellen Sie den Amazon-Ressourcennamen (ARN) eines Amazon-SNS-Themas und eines oder mehrere Ereignisse bereit, bei denen Sie benachrichtigt werden möchten. Eine Liste der unterstützten Ereignisse finden Sie unter Set Vault Notification Configuration (PUT notification-configuration).
-
Führen Sie die
setVaultNotifications-Methode aus, indem das Anforderungsobjekt als Parameter festgelegt wird.
Der folgende Java-Codeausschnitt veranschaulicht die vorherigen Schritte. Der Ausschnitt richtet eine Benachrichtigungskonfiguration auf einem Tresor ein. Die Konfiguration fordert Amazon Glacier (Amazon Glacier) auf, eine Benachrichtigung an das angegebene Amazon SNS SNS-Thema zu senden, wenn entweder das ArchiveRetrievalCompleted Ereignis oder das InventoryRetrievalCompleted Ereignis eintritt.
SetVaultNotificationsRequest request = new SetVaultNotificationsRequest() .withAccountId("-") .withVaultName("*** provide vault name ***") .withVaultNotificationConfig( new VaultNotificationConfig() .withSNSTopic("*** provide SNS topic ARN ***") .withEvents("ArchiveRetrievalCompleted", "InventoryRetrievalCompleted") ); client.setVaultNotifications(request);
Anmerkung
Weitere Informationen zur zugrunde liegenden REST-API finden Sie unter Tresor-Operationen.
Beispiel: Einstellung der Benachrichtigungskonfiguration in einem Tresor mithilfe von AWS SDK für Java
Das folgende Java-Codebeispiel richtet Benachrichtigungskonfiguration für einen Tresor ein, löscht die Konfiguration und stellt die Konfiguration wieder her. step-by-stepAnweisungen zur Ausführung des folgenden Beispiels finden Sie unterVerwenden von AWS SDK für Java mit Amazon Glacier.
import java.io.IOException; import com.amazonaws.auth.profile.ProfileCredentialsProvider; import com.amazonaws.services.glacier.AmazonGlacierClient; import com.amazonaws.services.glacier.model.DeleteVaultNotificationsRequest; import com.amazonaws.services.glacier.model.GetVaultNotificationsRequest; import com.amazonaws.services.glacier.model.GetVaultNotificationsResult; import com.amazonaws.services.glacier.model.SetVaultNotificationsRequest; import com.amazonaws.services.glacier.model.VaultNotificationConfig; public class AmazonGlacierVaultNotifications { public static AmazonGlacierClient client; public static String vaultName = "*** provide vault name ****"; public static String snsTopicARN = "*** provide sns topic ARN ***"; public static void main(String[] args) throws IOException { ProfileCredentialsProvider credentials = new ProfileCredentialsProvider(); client = new AmazonGlacierClient(credentials); client.setEndpoint("https://glacier.us-east-1.amazonaws.com/"); try { System.out.println("Adding notification configuration to the vault."); setVaultNotifications(); getVaultNotifications(); deleteVaultNotifications(); } catch (Exception e) { System.err.println("Vault operations failed." + e.getMessage()); } } private static void setVaultNotifications() { VaultNotificationConfig config = new VaultNotificationConfig() .withSNSTopic(snsTopicARN) .withEvents("ArchiveRetrievalCompleted", "InventoryRetrievalCompleted"); SetVaultNotificationsRequest request = new SetVaultNotificationsRequest() .withVaultName(vaultName) .withVaultNotificationConfig(config); client.setVaultNotifications(request); System.out.println("Notification configured for vault: " + vaultName); } private static void getVaultNotifications() { VaultNotificationConfig notificationConfig = null; GetVaultNotificationsRequest request = new GetVaultNotificationsRequest() .withVaultName(vaultName); GetVaultNotificationsResult result = client.getVaultNotifications(request); notificationConfig = result.getVaultNotificationConfig(); System.out.println("Notifications configuration for vault: " + vaultName); System.out.println("Topic: " + notificationConfig.getSNSTopic()); System.out.println("Events: " + notificationConfig.getEvents()); } private static void deleteVaultNotifications() { DeleteVaultNotificationsRequest request = new DeleteVaultNotificationsRequest() .withVaultName(vaultName); client.deleteVaultNotifications(request); System.out.println("Notifications configuration deleted for vault: " + vaultName); } }