Search in sources :

Example 1 with DescribeParametersRequest

use of software.amazon.awssdk.services.ssm.model.DescribeParametersRequest 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

DescribeParametersRequest (software.amazon.awssdk.services.ssm.model.DescribeParametersRequest)1 DescribeParametersResponse (software.amazon.awssdk.services.ssm.model.DescribeParametersResponse)1 ParameterMetadata (software.amazon.awssdk.services.ssm.model.ParameterMetadata)1 SsmException (software.amazon.awssdk.services.ssm.model.SsmException)1