Ada lebih banyak AWS SDK contoh yang tersedia di GitHub repo SDKContoh AWS Dokumen
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Gunakan DescribePortal
dengan AWS SDK atau CLI
Contoh kode berikut menunjukkan cara menggunakanDescribePortal
.
- CLI
-
- AWS CLI
-
Untuk menggambarkan portal
describe-portal
Contoh berikut menjelaskan portal web untuk perusahaan peternakan angin.aws iotsitewise describe-portal \ --portal-id
a1b2c3d4-5678-90ab-cdef-aaaaaEXAMPLE
Output:
{ "portalId": "a1b2c3d4-5678-90ab-cdef-aaaaaEXAMPLE", "portalArn": "arn:aws:iotsitewise:us-west-2:123456789012:portal/a1b2c3d4-5678-90ab-cdef-aaaaaEXAMPLE", "portalName": "WindFarmPortal", "portalDescription": "A portal that contains wind farm projects for Example Corp.", "portalClientId": "E-a1b2c3d4e5f6_a1b2c3d4e5f6EXAMPLE", "portalStartUrl": "https://a1b2c3d4-5678-90ab-cdef-aaaaaEXAMPLE.app.iotsitewise.aws", "portalContactEmail": "support@example.com", "portalStatus": { "state": "ACTIVE" }, "portalCreationDate": "2020-02-04T23:01:52.90248068Z", "portalLastUpdateDate": "2020-02-04T23:01:52.90248078Z", "roleArn": "arn:aws:iam::123456789012:role/MySiteWiseMonitorServiceRole" }
Untuk informasi selengkapnya, lihat Mengelola portal Anda di Panduan Pengguna AWS SiteWise IoT.
-
Untuk API detailnya, lihat DescribePortal
di Referensi AWS CLI Perintah.
-
- Java
-
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara pengaturan dan menjalankannya di Repositori Contoh Kode AWS
. /** * Retrieves a portal's description. * * @param portalId the ID of the portal to describe. * @return a {@link CompletableFuture} that represents a {@link String} result of the portal's start URL * (see: {@link DescribePortalResponse#portalStartUrl()}). The calling code can attach callbacks, then handle the * result or exception by calling {@link CompletableFuture#join()} or {@link CompletableFuture#get()}. * <p> * If any completion stage in this method throws an exception, the method logs the exception cause and keeps * it available to the calling code as a {@link CompletionException}. By calling * {@link CompletionException#getCause()}, the calling code can access the original exception. */ public CompletableFuture<String> describePortalAsync(String portalId) { DescribePortalRequest request = DescribePortalRequest.builder() .portalId(portalId) .build(); return getAsyncClient().describePortal(request) .handle((response, exception) -> { if (exception != null) { logger.error("An exception occurred retrieving the portal description: {}", exception.getCause().getMessage()); throw (CompletionException) exception; } return response.portalStartUrl(); }); }
-
Untuk API detailnya, lihat DescribePortaldi AWS SDK for Java 2.x APIReferensi.
-