Search in sources :

Example 1 with DescribeOpsItemsRequest

use of software.amazon.awssdk.services.ssm.model.DescribeOpsItemsRequest in project aws-doc-sdk-examples by awsdocs.

the class DescribeOpsItems method describeItems.

// snippet-start:[ssm.java2.describe_ops.main]
public static void describeItems(SsmClient ssmClient) {
    try {
        DescribeOpsItemsRequest itemsRequest = DescribeOpsItemsRequest.builder().maxResults(10).build();
        DescribeOpsItemsResponse itemsResponse = ssmClient.describeOpsItems(itemsRequest);
        List<OpsItemSummary> items = itemsResponse.opsItemSummaries();
        for (OpsItemSummary item : items) {
            System.out.println("The item title is " + item.title());
        }
    } catch (SsmException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : DescribeOpsItemsRequest(software.amazon.awssdk.services.ssm.model.DescribeOpsItemsRequest) DescribeOpsItemsResponse(software.amazon.awssdk.services.ssm.model.DescribeOpsItemsResponse) SsmException(software.amazon.awssdk.services.ssm.model.SsmException) OpsItemSummary(software.amazon.awssdk.services.ssm.model.OpsItemSummary)

Aggregations

DescribeOpsItemsRequest (software.amazon.awssdk.services.ssm.model.DescribeOpsItemsRequest)1 DescribeOpsItemsResponse (software.amazon.awssdk.services.ssm.model.DescribeOpsItemsResponse)1 OpsItemSummary (software.amazon.awssdk.services.ssm.model.OpsItemSummary)1 SsmException (software.amazon.awssdk.services.ssm.model.SsmException)1