Search in sources :

Example 6 with SsmException

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

the class DescribeParameters method describeParams.

// snippet-start:[ssm.Java2.get_params.main]
public static void describeParams(SsmClient ssmClient) {
    try {
        // Create a DescribeParametersRequest object
        DescribeParametersRequest desRequest = DescribeParametersRequest.builder().maxResults(10).build();
        // Get SSM Parameters (you can define them in the AWS Console)
        DescribeParametersResponse desResponse = ssmClient.describeParameters(desRequest);
        List<ParameterMetadata> params = desResponse.parameters();
        // Iterate through the list
        Iterator<ParameterMetadata> paramIterator = params.iterator();
        while (paramIterator.hasNext()) {
            ParameterMetadata paraMeta = paramIterator.next();
            System.out.println(paraMeta.name());
            System.out.println(paraMeta.description());
        }
    } catch (SsmException e) {
        e.getStackTrace();
    }
}
Also used : DescribeParametersRequest(software.amazon.awssdk.services.ssm.model.DescribeParametersRequest) ParameterMetadata(software.amazon.awssdk.services.ssm.model.ParameterMetadata) SsmException(software.amazon.awssdk.services.ssm.model.SsmException) DescribeParametersResponse(software.amazon.awssdk.services.ssm.model.DescribeParametersResponse)

Aggregations

SsmException (software.amazon.awssdk.services.ssm.model.SsmException)6 CreateOpsItemRequest (software.amazon.awssdk.services.ssm.model.CreateOpsItemRequest)1 CreateOpsItemResponse (software.amazon.awssdk.services.ssm.model.CreateOpsItemResponse)1 DescribeOpsItemsRequest (software.amazon.awssdk.services.ssm.model.DescribeOpsItemsRequest)1 DescribeOpsItemsResponse (software.amazon.awssdk.services.ssm.model.DescribeOpsItemsResponse)1 DescribeParametersRequest (software.amazon.awssdk.services.ssm.model.DescribeParametersRequest)1 DescribeParametersResponse (software.amazon.awssdk.services.ssm.model.DescribeParametersResponse)1 GetOpsItemRequest (software.amazon.awssdk.services.ssm.model.GetOpsItemRequest)1 GetOpsItemResponse (software.amazon.awssdk.services.ssm.model.GetOpsItemResponse)1 GetParameterRequest (software.amazon.awssdk.services.ssm.model.GetParameterRequest)1 GetParameterResponse (software.amazon.awssdk.services.ssm.model.GetParameterResponse)1 OpsItem (software.amazon.awssdk.services.ssm.model.OpsItem)1 OpsItemSummary (software.amazon.awssdk.services.ssm.model.OpsItemSummary)1 ParameterMetadata (software.amazon.awssdk.services.ssm.model.ParameterMetadata)1 UpdateOpsItemRequest (software.amazon.awssdk.services.ssm.model.UpdateOpsItemRequest)1