Search in sources :

Example 1 with CreateOpsItemResponse

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

the class CreateOpsItem method createNewOpsItem.

// snippet-start:[ssm.java2.create_ops.main]
public static String createNewOpsItem(SsmClient ssmClient, String title, String source, String category, String severity) {
    try {
        CreateOpsItemRequest opsItemRequest = CreateOpsItemRequest.builder().description("Created by the SSM Java API").title(title).source(source).category(category).severity(severity).build();
        CreateOpsItemResponse itemResponse = ssmClient.createOpsItem(opsItemRequest);
        return itemResponse.opsItemId();
    } catch (SsmException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
    return "";
}
Also used : CreateOpsItemRequest(software.amazon.awssdk.services.ssm.model.CreateOpsItemRequest) CreateOpsItemResponse(software.amazon.awssdk.services.ssm.model.CreateOpsItemResponse) SsmException(software.amazon.awssdk.services.ssm.model.SsmException)

Aggregations

CreateOpsItemRequest (software.amazon.awssdk.services.ssm.model.CreateOpsItemRequest)1 CreateOpsItemResponse (software.amazon.awssdk.services.ssm.model.CreateOpsItemResponse)1 SsmException (software.amazon.awssdk.services.ssm.model.SsmException)1