@@ -0,0 +1,2852 @@
+/**%0A * Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A *%0A * This file is licensed under the Apache License, Version 2.0 (the %22License%22).%0A * You may not use this file except in compliance with the License. A copy of%0A * the License is located at%0A *%0A * http://aws.amazon.com/apache2.0/%0A *%0A * This file is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES OR%0A * CONDITIONS OF ANY KIND, either express or implied. See the License for the%0A * specific language governing permissions and limitations under the License.%0A *%0A */%0A%0A// snippet-comment:%5BThese are tags for the AWS doc team's sample catalog. Do not remove.%5D%0A// snippet-sourcedescription:%5BGetSimpleSystemsManagementOps.java demonstrates how to get information about an OpsItem by using the ID value%5D%0A// snippet-service:%5Bssm%5D%0A// snippet-keyword:%5BJava%5D%0A// snippet-keyword:%5BAmazon Simple Systems Management%5D%0A// snippet-keyword:%5BCode Sample%5D%0A// snippet-sourcetype:%5Bfull-example%5D%0A// snippet-sourcedate:%5B2020-01-24%5D%0A// snippet-sourceauthor:%5BAWS - scmacdon%5D%0A%0A// snippet-start:%5Bssm.Java2.get_ops.complete%5D%0A%0Apackage com.example.ssm;%0A%0A// snippet-start:%5Bssm.Java2.get_ops.import%5D%0Aimport software.amazon.awssdk.regions.Region;%0Aimport software.amazon.awssdk.services.ssm.SsmClient;%0Aimport software.amazon.awssdk.services.ssm.model.GetOpsItemResponse;%0Aimport software.amazon.awssdk.services.ssm.model.GetOpsItemRequest;%0Aimport software.amazon.awssdk.services.ssm.model.OpsItem;%0Aimport software.amazon.awssdk.services.ssm.model.SsmException;%0A// snippet-end:%5Bssm.Java2.get_ops.import%5D%0A%0A%0Apublic class GetSimpleSystemsManagementOps %7B%0A    public static void main(String%5B%5D args) %7B%0A%0A        if (args.length %3C 1) %7B%0A            System.out.println(%22Please specify a SSM OpsItem ID value. You can obtain this value using the AWS Console.%22);%0A            System.exit(1);%0A        %7D%0A%0A        // snippet-start:%5Bssm.Java2.get_ops.main%5D%0A        // Get the OpsItem ID value%0A        String opsID = args%5B0%5D;%0A%0A        SsmClient ssmClient;%0A        GetOpsItemRequest opsRequest;%0A%0A        try %7B%0A%0A            Region region = Region.US_WEST_2;%0A            ssmClient = SsmClient.builder().region(region).build();%0A%0A            // Create a DescribeParametersRequest object%0A            opsRequest = GetOpsItemRequest.builder()%0A                    .opsItemId(opsID)%0A                    .build();%0A%0A            // Get SSM Parameters (you can define them in the AWS Console)%0A            GetOpsItemResponse opsItem = ssmClient.getOpsItem(opsRequest);%0A            OpsItem item = opsItem.opsItem();%0A%0A            System.out.println(item.title());%0A            System.out.println(item.description());%0A            System.out.println(item.source());%0A%0A        %7D catch (SsmException e) %7B%0A            e.getStackTrace();%0A        %7D%0A        // snippet-end:%5Bssm.Java2.get_ops.main%5D%0A    %7D%0A%7D%0A// snippet-end:%5Bssm.Java2.get_ops.complete%5D%0A

Create GetSimpleSystemsManagementOps.java