Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh SDK AWS Doc
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Contoh Organizations menggunakan SDK untuk SAP ABAP
Contoh kode berikut menunjukkan cara melakukan tindakan dan mengimplementasikan skenario umum dengan menggunakan AWS SDK untuk SAP ABAP with Organizations.
Tindakan merupakan kutipan kode dari program yang lebih besar dan harus dijalankan dalam konteks. Sementara tindakan menunjukkan cara memanggil fungsi layanan individual, Anda dapat melihat tindakan dalam konteks dalam skenario terkait.
Setiap contoh menyertakan tautan ke kode sumber lengkap, di mana Anda dapat menemukan instruksi tentang cara mengatur dan menjalankan kode dalam konteks.
Topik
Tindakan
Contoh kode berikut menunjukkan cara menggunakanAttachPolicy.
- SDK for SAP ABAP
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di Repositori Contoh Kode AWS
. TRY. lo_org->attachpolicy( iv_policyid = iv_policy_id iv_targetid = iv_target_id ). MESSAGE 'Policy attached to target.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to attach the policy.' TYPE 'E'. CATCH /aws1/cx_orgpolicynotfoundex. MESSAGE 'The specified policy does not exist.' TYPE 'E'. CATCH /aws1/cx_orgtargetnotfoundex. MESSAGE 'The specified target does not exist.' TYPE 'E'. CATCH /aws1/cx_orgduplicateplyatta00. MESSAGE 'The policy is already attached to the target.' TYPE 'E'. ENDTRY.-
Untuk detail API, lihat AttachPolicydi AWS SDK untuk referensi SAP ABAP API.
-
Contoh kode berikut menunjukkan cara menggunakanCreatePolicy.
- SDK for SAP ABAP
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di Repositori Contoh Kode AWS
. TRY. oo_result = lo_org->createpolicy( " oo_result is returned for testing purposes. " iv_name = iv_policy_name iv_description = iv_policy_description iv_content = iv_policy_content iv_type = iv_policy_type ). MESSAGE 'Policy created.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to create a policy.' TYPE 'E'. CATCH /aws1/cx_orgduplicatepolicyex. MESSAGE 'A policy with this name already exists.' TYPE 'E'. CATCH /aws1/cx_orgmalformedplydocex. MESSAGE 'The policy content is malformed.' TYPE 'E'. ENDTRY.-
Untuk detail API, lihat CreatePolicydi AWS SDK untuk referensi SAP ABAP API.
-
Contoh kode berikut menunjukkan cara menggunakanDeletePolicy.
- SDK for SAP ABAP
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di Repositori Contoh Kode AWS
. TRY. lo_org->deletepolicy( iv_policyid = iv_policy_id ). MESSAGE 'Policy deleted.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to delete the policy.' TYPE 'E'. CATCH /aws1/cx_orgpolicynotfoundex. MESSAGE 'The specified policy does not exist.' TYPE 'E'. CATCH /aws1/cx_orgpolicyinuseex. MESSAGE 'The policy is still attached to one or more targets.' TYPE 'E'. ENDTRY.-
Untuk detail API, lihat DeletePolicydi AWS SDK untuk referensi SAP ABAP API.
-
Contoh kode berikut menunjukkan cara menggunakanDescribePolicy.
- SDK for SAP ABAP
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di Repositori Contoh Kode AWS
. TRY. oo_result = lo_org->describepolicy( " oo_result is returned for testing purposes. " iv_policyid = iv_policy_id ). DATA(lo_policy) = oo_result->get_policy( ). MESSAGE 'Retrieved policy details.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to describe the policy.' TYPE 'E'. CATCH /aws1/cx_orgpolicynotfoundex. MESSAGE 'The specified policy does not exist.' TYPE 'E'. ENDTRY.-
Untuk detail API, lihat DescribePolicydi AWS SDK untuk referensi SAP ABAP API.
-
Contoh kode berikut menunjukkan cara menggunakanDetachPolicy.
- SDK for SAP ABAP
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di Repositori Contoh Kode AWS
. TRY. lo_org->detachpolicy( iv_policyid = iv_policy_id iv_targetid = iv_target_id ). MESSAGE 'Policy detached from target.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to detach the policy.' TYPE 'E'. CATCH /aws1/cx_orgpolicynotfoundex. MESSAGE 'The specified policy does not exist.' TYPE 'E'. CATCH /aws1/cx_orgtargetnotfoundex. MESSAGE 'The specified target does not exist.' TYPE 'E'. CATCH /aws1/cx_orgpolicynotattex. MESSAGE 'The policy is not attached to the target.' TYPE 'E'. ENDTRY.-
Untuk detail API, lihat DetachPolicydi AWS SDK untuk referensi SAP ABAP API.
-
Contoh kode berikut menunjukkan cara menggunakanListPolicies.
- SDK for SAP ABAP
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankannya di Repositori Contoh Kode AWS
. TRY. oo_result = lo_org->listpolicies( " oo_result is returned for testing purposes. " iv_filter = iv_filter ). DATA(lt_policies) = oo_result->get_policies( ). MESSAGE 'Retrieved list of policies.' TYPE 'I'. CATCH /aws1/cx_orgaccessdeniedex. MESSAGE 'You do not have permission to list policies.' TYPE 'E'. CATCH /aws1/cx_orgawsorgsnotinuseex. MESSAGE 'Your account is not a member of an organization.' TYPE 'E'. ENDTRY.-
Untuk detail API, lihat ListPoliciesdi AWS SDK untuk referensi SAP ABAP API.
-