Search in sources :

Example 1 with OpsItem

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

the class GetOpsItem method getOpsItem.

// snippet-start:[ssm.Java2.get_ops.main]
public static void getOpsItem(SsmClient ssmClient, String opsID) {
    try {
        GetOpsItemRequest opsRequest = GetOpsItemRequest.builder().opsItemId(opsID).build();
        // Get SSM Parameters (you can define them in the AWS Management Console)
        GetOpsItemResponse opsItem = ssmClient.getOpsItem(opsRequest);
        OpsItem item = opsItem.opsItem();
        System.out.println(item.title());
        System.out.println(item.description());
        System.out.println(item.source());
    } catch (SsmException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : GetOpsItemResponse(software.amazon.awssdk.services.ssm.model.GetOpsItemResponse) OpsItem(software.amazon.awssdk.services.ssm.model.OpsItem) GetOpsItemRequest(software.amazon.awssdk.services.ssm.model.GetOpsItemRequest) SsmException(software.amazon.awssdk.services.ssm.model.SsmException)

Aggregations

GetOpsItemRequest (software.amazon.awssdk.services.ssm.model.GetOpsItemRequest)1 GetOpsItemResponse (software.amazon.awssdk.services.ssm.model.GetOpsItemResponse)1 OpsItem (software.amazon.awssdk.services.ssm.model.OpsItem)1 SsmException (software.amazon.awssdk.services.ssm.model.SsmException)1