Search in sources :

Example 1 with GetOpsItemResult

use of com.amazonaws.services.simplesystemsmanagement.model.GetOpsItemResult in project aws-doc-sdk-examples by awsdocs.

the class GetSimpleSystemsManagementOps method main.

public static void main(String[] args) {
    if (args.length < 1) {
        System.out.println("Please specify a SSM OpsItem ID value. You can obtain this value using the AWS Console.");
        System.exit(1);
    }
    // snippet-start:[ssm.Java1.get_ops.main]
    // Get the OpsItem ID value
    String opsID = args[0];
    // Create the AWSSimpleSystemsManagement client object
    AWSSimpleSystemsManagement ssm = AWSSimpleSystemsManagementClientBuilder.standard().withRegion(Regions.DEFAULT_REGION).build();
    try {
        GetOpsItemRequest opsRequest = new GetOpsItemRequest();
        opsRequest.setOpsItemId(opsID);
        GetOpsItemResult opsResults = ssm.getOpsItem(opsRequest);
        OpsItem item = opsResults.getOpsItem();
        System.out.println(item.getTitle());
        System.out.println(item.getDescription());
        System.out.println(item.getSource());
    } catch (AmazonServiceException e) {
        e.getStackTrace();
    }
// snippet-end:[ssm.Java1.get_ops.main]
}
Also used : GetOpsItemResult(com.amazonaws.services.simplesystemsmanagement.model.GetOpsItemResult) OpsItem(com.amazonaws.services.simplesystemsmanagement.model.OpsItem) AmazonServiceException(com.amazonaws.AmazonServiceException) AWSSimpleSystemsManagement(com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement) GetOpsItemRequest(com.amazonaws.services.simplesystemsmanagement.model.GetOpsItemRequest)

Aggregations

AmazonServiceException (com.amazonaws.AmazonServiceException)1 AWSSimpleSystemsManagement (com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement)1 GetOpsItemRequest (com.amazonaws.services.simplesystemsmanagement.model.GetOpsItemRequest)1 GetOpsItemResult (com.amazonaws.services.simplesystemsmanagement.model.GetOpsItemResult)1 OpsItem (com.amazonaws.services.simplesystemsmanagement.model.OpsItem)1