Menu
AWS Systems Manager
API Reference (API Version 2014-11-06)

GetParametersByPath

Retrieve parameters in a specific hierarchy. For more information, see Working with Systems Manager Parameters in the AWS Systems Manager User Guide.

Request results are returned on a best-effort basis. If you specify MaxResults in the request, the response includes information up to the limit specified. The number of items returned, however, can be between zero and the value of MaxResults. If the service reaches an internal limit while processing the results, it stops the operation and returns the matching values up to that point and a NextToken. You can specify the NextToken in a subsequent call to get the next set of results.

Note

This API action doesn't support filtering by tags.

Request Syntax

{ "MaxResults": number, "NextToken": "string", "ParameterFilters": [ { "Key": "string", "Option": "string", "Values": [ "string" ] } ], "Path": "string", "Recursive": boolean, "WithDecryption": boolean }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 10.

Required: No

NextToken

A token to start the list. Use this token to get the next set of results.

Type: String

Required: No

ParameterFilters

Filters to limit the request results.

Note

You can't filter using the parameter name.

Type: Array of ParameterStringFilter objects

Required: No

Path

The hierarchy for the parameter. Hierarchies start with a forward slash (/) and end with the parameter name. A hierarchy can have a maximum of 15 levels. Here is an example of a hierarchy: /Finance/Prod/IAD/WinServ2016/license33

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Required: Yes

Recursive

Retrieve all parameters within a hierarchy.

Important

If a user has access to a path, then the user can access all levels of that path. For example, if a user has permission to access path /a, then the user can also access /a/b. Even if a user has explicitly been denied access in IAM for parameter /a, they can still call the GetParametersByPath API action recursively and view /a/b.

Type: Boolean

Required: No

WithDecryption

Retrieve all parameters in a hierarchy with their value decrypted.

Type: Boolean

Required: No

Response Syntax

{ "NextToken": "string", "Parameters": [ { "Name": "string", "Type": "string", "Value": "string", "Version": number } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NextToken

The token for the next set of items to return. Use this token to get the next set of results.

Type: String

Parameters

A list of parameters found in the specified hierarchy.

Type: Array of Parameter objects

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerError

An error occurred on the server side.

HTTP Status Code: 400

InvalidFilterKey

The specified key is not valid.

HTTP Status Code: 400

InvalidFilterOption

The specified filter option is not valid. Valid options are Equals and BeginsWith. For Path filter, valid options are Recursive and OneLevel.

HTTP Status Code: 400

InvalidFilterValue

The filter value is not valid. Verify the value and try again.

HTTP Status Code: 400

InvalidKeyId

The query key ID is not valid.

HTTP Status Code: 400

InvalidNextToken

The specified token is not valid.

HTTP Status Code: 400

Example

Sample Request

POST / HTTP/1.1 Host: ssm.us-east-2.amazonaws.com Accept-Encoding: identity Content-Length: 46 X-Amz-Target: AmazonSSM.GetParametersByPath X-Amz-Date: 20180316T004724Z User-Agent: aws-cli/1.11.180 Python/2.7.9 Windows/8 botocore/1.7.38 Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20180316/us-east-2/ssm/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=39c3b3042cd2aEXAMPLE { "Path": "/Branch312/Dev/", "Recursive": true }

Sample Response

{ "Parameters": [ { "Name": "/Branch312/Dev/Engineer1", "Type": "String", "Value": "Saanvi Sarkar", "Version": 1 }, { "Name": "/Branch312/Dev/Engineer2", "Type": "String", "Value": "Zhang Wei", "Version": 1 }, { "Name": "/Branch312/Dev/Engineer3", "Type": "String", "Value": "Alejandro Rosalez", "Version": 1 }, { "Name": "/Branch312/Dev/Engineer4", "Type": "String", "Value": "Maria Garcia", "Version": 2 }, { "Name": "/Branch312/Dev/Engineer5", "Type": "String", "Value": "Paulo Santos", "Version": 1 }, { "Name": "/Branch312/Dev/Engineer6", "Type": "String", "Value": "Mary Major", "Version": 1 }, { "Name": "/Branch312/Dev/Intern", "Type": "String", "Value": "Nikhil Jayashankar", "Version": 1 }, { "Name": "/Branch312/Dev/TeamLead", "Type": "String", "Value": "Jane Roe", "Version": 1 } ] }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: