Exemples d'ACM utilisant le SDK pour SAP ABAP - AWS SDK pour SAP ABAP

Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.

Exemples d'ACM utilisant le SDK pour SAP ABAP

Les exemples de code suivants vous montrent comment effectuer des actions et implémenter des scénarios courants à l'aide du AWS SDK pour SAP ABAP avec ACM.

Les actions sont des extraits de code de programmes plus larges et doivent être exécutées dans leur contexte. Alors que les actions vous indiquent comment appeler des fonctions de service individuelles, vous pouvez les voir en contexte dans leurs scénarios associés.

Chaque exemple inclut un lien vers le code source complet, où vous trouverez des instructions sur la configuration et l’exécution du code en contexte.

Rubriques

Actions

L'exemple de code suivant montre comment utiliserAddTagsToCertificate.

Kit SDK pour SAP ABAP
Note

Il y en a plus à ce sujet GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS.

TRY. " iv_certificate_arn = 'arn:aws:acm:region:123456789012:certificate/certificate-id' lo_acm->addtagstocertificate( iv_certificatearn = iv_certificate_arn it_tags = it_tags ). MESSAGE 'Tags added to certificate successfully.' TYPE 'I'. CATCH /aws1/cx_acminvalidarnex. MESSAGE 'The certificate ARN is not valid.' TYPE 'I'. CATCH /aws1/cx_acmresourcenotfoundex. MESSAGE 'Certificate not found.' TYPE 'I'. CATCH /aws1/cx_acminvalidtagex. MESSAGE 'Invalid tag provided.' TYPE 'I'. CATCH /aws1/cx_acmtoomanytagsex. MESSAGE 'Too many tags for certificate.' TYPE 'I'. ENDTRY.
  • Pour plus de détails sur l'API, reportez-vous AddTagsToCertificateà la section de référence du AWS SDK pour l'API SAP ABAP.

L'exemple de code suivant montre comment utiliserDeleteCertificate.

Kit SDK pour SAP ABAP
Note

Il y en a plus à ce sujet GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS.

TRY. " iv_certificate_arn = 'arn:aws:acm:region:123456789012:certificate/certificate-id' lo_acm->deletecertificate( iv_certificatearn = iv_certificate_arn ). MESSAGE 'Certificate deleted successfully.' TYPE 'I'. CATCH /aws1/cx_acminvalidarnex. MESSAGE 'The certificate ARN is not valid.' TYPE 'I'. CATCH /aws1/cx_acmresourcenotfoundex. MESSAGE 'Certificate not found.' TYPE 'I'. CATCH /aws1/cx_acmresourceinuseex. MESSAGE 'Certificate is in use and cannot be deleted.' TYPE 'I'. ENDTRY.
  • Pour plus de détails sur l'API, reportez-vous DeleteCertificateà la section de référence du AWS SDK pour l'API SAP ABAP.

L'exemple de code suivant montre comment utiliserDescribeCertificate.

Kit SDK pour SAP ABAP
Note

Il y en a plus à ce sujet GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS.

TRY. " iv_certificate_arn = 'arn:aws:acm:region:123456789012:certificate/certificate-id' oo_result = lo_acm->describecertificate( iv_certificatearn = iv_certificate_arn ). MESSAGE 'Certificate details retrieved.' TYPE 'I'. CATCH /aws1/cx_acminvalidarnex. MESSAGE 'The certificate ARN is not valid.' TYPE 'I'. CATCH /aws1/cx_acmresourcenotfoundex. MESSAGE 'Certificate not found.' TYPE 'I'. ENDTRY.
  • Pour plus de détails sur l'API, reportez-vous DescribeCertificateà la section de référence du AWS SDK pour l'API SAP ABAP.

L'exemple de code suivant montre comment utiliserGetCertificate.

Kit SDK pour SAP ABAP
Note

Il y en a plus à ce sujet GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS.

TRY. " iv_certificate_arn = 'arn:aws:acm:region:123456789012:certificate/certificate-id' oo_result = lo_acm->getcertificate( iv_certificatearn = iv_certificate_arn ). MESSAGE 'Certificate body and chain retrieved.' TYPE 'I'. CATCH /aws1/cx_acminvalidarnex. MESSAGE 'The certificate ARN is not valid.' TYPE 'I'. CATCH /aws1/cx_acmresourcenotfoundex. MESSAGE 'Certificate not found.' TYPE 'I'. CATCH /aws1/cx_acmrequestinprgssex. MESSAGE 'Certificate request is in progress.' TYPE 'I'. ENDTRY.
  • Pour plus de détails sur l'API, reportez-vous GetCertificateà la section de référence du AWS SDK pour l'API SAP ABAP.

L'exemple de code suivant montre comment utiliserImportCertificate.

Kit SDK pour SAP ABAP
Note

Il y en a plus à ce sujet GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS.

TRY. " Only pass certificate chain if it's provided (it's optional) IF iv_certificate_chain IS NOT INITIAL. DATA(lo_result) = lo_acm->importcertificate( iv_certificate = iv_certificate iv_privatekey = iv_private_key iv_certificatechain = iv_certificate_chain ). ELSE. lo_result = lo_acm->importcertificate( iv_certificate = iv_certificate iv_privatekey = iv_private_key ). ENDIF. ov_certificate_arn = lo_result->get_certificatearn( ). MESSAGE 'Certificate imported successfully.' TYPE 'I'. CATCH /aws1/cx_acminvalidparameterex. MESSAGE 'Invalid parameter provided.' TYPE 'I'. CATCH /aws1/cx_acmlimitexceededex. MESSAGE 'Certificate limit exceeded.' TYPE 'I'. ENDTRY.
  • Pour plus de détails sur l'API, reportez-vous ImportCertificateà la section de référence du AWS SDK pour l'API SAP ABAP.

L'exemple de code suivant montre comment utiliserListCertificates.

Kit SDK pour SAP ABAP
Note

Il y en a plus à ce sujet GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS.

TRY. oo_result = lo_acm->listcertificates( iv_maxitems = iv_max_items it_certificatestatuses = it_statuses io_includes = io_includes ). MESSAGE 'Certificates listed successfully.' TYPE 'I'. CATCH /aws1/cx_acminvalidargsex. MESSAGE 'Invalid arguments provided.' TYPE 'I'. CATCH /aws1/cx_acmvalidationex. MESSAGE 'Validation error occurred.' TYPE 'I'. ENDTRY.
  • Pour plus de détails sur l'API, reportez-vous ListCertificatesà la section de référence du AWS SDK pour l'API SAP ABAP.

L'exemple de code suivant montre comment utiliserListTagsForCertificate.

Kit SDK pour SAP ABAP
Note

Il y en a plus à ce sujet GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS.

TRY. " iv_certificate_arn = 'arn:aws:acm:region:123456789012:certificate/certificate-id' DATA(lo_result) = lo_acm->listtagsforcertificate( iv_certificatearn = iv_certificate_arn ). ot_tags = lo_result->get_tags( ). MESSAGE 'Certificate tags retrieved successfully.' TYPE 'I'. CATCH /aws1/cx_acminvalidarnex. MESSAGE 'The certificate ARN is not valid.' TYPE 'I'. CATCH /aws1/cx_acmresourcenotfoundex. MESSAGE 'Certificate not found.' TYPE 'I'. ENDTRY.
  • Pour plus de détails sur l'API, reportez-vous ListTagsForCertificateà la section de référence du AWS SDK pour l'API SAP ABAP.

L'exemple de code suivant montre comment utiliserRemoveTagsFromCertificate.

Kit SDK pour SAP ABAP
Note

Il y en a plus à ce sujet GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS.

TRY. " iv_certificate_arn = 'arn:aws:acm:region:123456789012:certificate/certificate-id' lo_acm->removetagsfromcertificate( iv_certificatearn = iv_certificate_arn it_tags = it_tags ). MESSAGE 'Tags removed from certificate successfully.' TYPE 'I'. CATCH /aws1/cx_acminvalidarnex. MESSAGE 'The certificate ARN is not valid.' TYPE 'I'. CATCH /aws1/cx_acmresourcenotfoundex. MESSAGE 'Certificate not found.' TYPE 'I'. CATCH /aws1/cx_acminvalidtagex. MESSAGE 'Invalid tag provided.' TYPE 'I'. ENDTRY.
  • Pour plus de détails sur l'API, reportez-vous RemoveTagsFromCertificateà la section de référence du AWS SDK pour l'API SAP ABAP.

L'exemple de code suivant montre comment utiliserRequestCertificate.

Kit SDK pour SAP ABAP
Note

Il y en a plus à ce sujet GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS.

TRY. " iv_domain_name = 'example.com' " iv_validation_method = 'DNS' or 'EMAIL' DATA(lo_result) = lo_acm->requestcertificate( iv_domainname = iv_domain_name it_subjectalternativenames = COND #( WHEN it_alternate_domains IS NOT INITIAL THEN it_alternate_domains ) iv_validationmethod = iv_validation_method ). ov_certificate_arn = lo_result->get_certificatearn( ). MESSAGE 'Certificate requested successfully.' TYPE 'I'. CATCH /aws1/cx_acminvalidparameterex. MESSAGE 'Invalid parameter provided.' TYPE 'I'. CATCH /aws1/cx_acmlimitexceededex. MESSAGE 'Certificate limit exceeded.' TYPE 'I'. CATCH /aws1/cx_acminvdomvationoptsex. MESSAGE 'Invalid domain validation options.' TYPE 'I'. ENDTRY.
  • Pour plus de détails sur l'API, reportez-vous RequestCertificateà la section de référence du AWS SDK pour l'API SAP ABAP.

L'exemple de code suivant montre comment utiliserResendValidationEmail.

Kit SDK pour SAP ABAP
Note

Il y en a plus à ce sujet GitHub. Trouvez l’exemple complet et découvrez comment le configurer et l’exécuter dans le référentiel d’exemples de code AWS.

TRY. " iv_certificate_arn = 'arn:aws:acm:region:123456789012:certificate/certificate-id' " iv_domain = 'example.com' " iv_validation_domain = 'example.com' lo_acm->resendvalidationemail( iv_certificatearn = iv_certificate_arn iv_domain = iv_domain iv_validationdomain = iv_validation_domain ). MESSAGE 'Validation email resent successfully.' TYPE 'I'. CATCH /aws1/cx_acminvalidarnex. MESSAGE 'The certificate ARN is not valid.' TYPE 'I'. CATCH /aws1/cx_acmresourcenotfoundex. MESSAGE 'Certificate not found.' TYPE 'I'. CATCH /aws1/cx_acminvalidstateex. MESSAGE 'Certificate is not in a valid state.' TYPE 'I'. CATCH /aws1/cx_acminvdomvationoptsex. MESSAGE 'Invalid domain validation options.' TYPE 'I'. ENDTRY.
  • Pour plus de détails sur l'API, reportez-vous ResendValidationEmailà la section de référence du AWS SDK pour l'API SAP ABAP.