SDK for SAP ABAP를 사용한 ACM 예제 - AWS SDK 코드 예제

Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. AWS

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

SDK for SAP ABAP를 사용한 ACM 예제

다음 코드 예제에서는 ACM과 함께 AWS SDK for SAP ABAP를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.

작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 개별 서비스 함수를 직접적으로 호출하는 방법을 보여주며 관련 시나리오의 컨텍스트에 맞는 작업을 볼 수 있습니다.

각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.

주제

작업

다음 코드 예시는 AddTagsToCertificate의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. 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.

다음 코드 예시는 DeleteCertificate의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. 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.
  • API 세부 정보는 SDK for SAP ABAP API 참조의 DeleteCertificate를 참조하세요. AWS

다음 코드 예시는 DescribeCertificate의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. 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.
  • API 세부 정보는 SDK for SAP ABAP API 참조의 DescribeCertificate를 참조하세요. AWS

다음 코드 예시는 GetCertificate의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. 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.
  • API 세부 정보는 SDK for SAP ABAP API 참조의 GetCertificate를 참조하세요. AWS

다음 코드 예시는 ImportCertificate의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. 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.
  • API 세부 정보는 SDK for SAP ABAP API 참조의 ImportCertificate를 참조하세요. AWS

다음 코드 예시는 ListCertificates의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. 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.
  • API 세부 정보는 AWS SDK for SAP ABAP API 참조ListCertificates를 참조하세요.

다음 코드 예시는 ListTagsForCertificate의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. 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.

다음 코드 예시는 RemoveTagsFromCertificate의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. 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.

다음 코드 예시는 RequestCertificate의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. 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.
  • API 세부 정보는 SDK for SAP ABAP API 참조의 RequestCertificate를 참조하세요. AWS

다음 코드 예시는 ResendValidationEmail의 사용 방법을 보여 줍니다.

SDK for SAP ABAP API
참고

GitHub에 더 많은 내용이 있습니다. 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.