Skip to content

get_parameters_by_path async

get_parameters_by_path(
    path: PSParameterName,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    recursive: Optional[Boolean] = None,
    parameter_filters: Optional[ParameterStringFilterList] = None,
    with_decryption: Optional[Boolean] = None,
    max_results: Optional[GetParametersByPathMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> GetParametersByPathResult

Retrieve information about one or more parameters under a specified level in a hierarchy.

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.

Parameter names can't contain spaces. The service removes any spaces specified for the beginning or end of a parameter name. If the specified name for a parameter contains spaces between characters, the request fails with a ValidationException error.

Parameters:

  • path (PSParameterName) –

    The hierarchy for the parameter. Hierarchies start with a forward slash (/). The hierarchy is the parameter name except the last part of the parameter. For the API call to succeed, the last part of the parameter name can't be in the path. A parameter name hierarchy can have a maximum of 15 levels. Here is an example of a hierarchy: /Finance/Prod/IAD/WinServ2016/license33

  • recursive (Optional[Boolean], default: None ) –

    Retrieve all parameters within a hierarchy.

    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/b, they can still call the GetParametersByPath API operation recursively for /a and view /a/b.

  • parameter_filters (Optional[ParameterStringFilterList], default: None ) –

    Filters to limit the request results.

    The following Key values are supported for GetParametersByPath: Type, KeyId, and Label.

    The following Key values aren't supported for GetParametersByPath: tag, DataType, Name, Path, and Tier.

  • with_decryption (Optional[Boolean], default: None ) –

    Retrieve all parameters in a hierarchy with their value decrypted.

  • max_results (Optional[GetParametersByPathMaxResults], default: None ) –

    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.

  • next_token (Optional[NextToken], default: None ) –

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

Raises:

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def get_parameters_by_path(
    self,
    path: "capo_ssm.types.ps_parameter_name.PSParameterName",
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    recursive: Optional["capo_ssm.types.boolean.Boolean"] = None,
    parameter_filters: Optional[
        "capo_ssm.types.parameter_string_filter_list.ParameterStringFilterList"
    ] = None,
    with_decryption: Optional["capo_ssm.types.boolean.Boolean"] = None,
    max_results: Optional[
        "capo_ssm.types.get_parameters_by_path_max_results.GetParametersByPathMaxResults"
    ] = None,
    next_token: Optional["capo_ssm.types.next_token.NextToken"] = None,
) -> "capo_ssm.types.get_parameters_by_path_result.GetParametersByPathResult":
    """<p>Retrieve information about one or more parameters under a specified level in a hierarchy. </p> <p>Request results are returned on a best-effort basis. If you specify <code>MaxResults</code> 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 <code>MaxResults</code>. 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 <code>NextToken</code>. You can specify the <code>NextToken</code> in a subsequent call to get the next set of results.</p> <p>Parameter names can't contain spaces. The service removes any spaces specified for the beginning or end of a parameter name. If the specified name for a parameter contains spaces between characters, the request fails with a <code>ValidationException</code> error.</p>

    Args:
        path: <p>The hierarchy for the parameter. Hierarchies start with a forward slash (/). The hierarchy is the parameter name except the last part of the parameter. For the API call to succeed, the last part of the parameter name can't be in the path. A parameter name hierarchy can have a maximum of 15 levels. Here is an example of a hierarchy: <code>/Finance/Prod/IAD/WinServ2016/license33 </code> </p>
        recursive: <p>Retrieve all parameters within a hierarchy.</p> <important> <p>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 <code>/a</code>, then the user can also access <code>/a/b</code>. Even if a user has explicitly been denied access in IAM for parameter <code>/a/b</code>, they can still call the GetParametersByPath API operation recursively for <code>/a</code> and view <code>/a/b</code>.</p> </important>
        parameter_filters: <p>Filters to limit the request results.</p> <note> <p>The following <code>Key</code> values are supported for <code>GetParametersByPath</code>: <code>Type</code>, <code>KeyId</code>, and <code>Label</code>.</p> <p>The following <code>Key</code> values aren't supported for <code>GetParametersByPath</code>: <code>tag</code>, <code>DataType</code>, <code>Name</code>, <code>Path</code>, and <code>Tier</code>.</p> </note>
        with_decryption: <p>Retrieve all parameters in a hierarchy with their value decrypted.</p>
        max_results: <p>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.</p>
        next_token: <p>A token to start the list. Use this token to get the next set of results. </p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.invalid_filter_key.InvalidFilterKey: <p>The specified key isn't valid.</p>
        capo_ssm.errors.invalid_filter_option.InvalidFilterOption: <p>The specified filter option isn't valid. Valid options are Equals and BeginsWith. For Path filter, valid options are Recursive and OneLevel.</p>
        capo_ssm.errors.invalid_filter_value.InvalidFilterValue: <p>The filter value isn't valid. Verify the value and try again.</p>
        capo_ssm.errors.invalid_key_id.InvalidKeyId: <p>The query key ID isn't valid.</p>
        capo_ssm.errors.invalid_next_token.InvalidNextToken: <p>The specified token isn't valid.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.get_parameters_by_path_request.GetParametersByPathRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.get_parameters_by_path_result.GetParametersByPathResult"
    ]:
        import capo_ssm._operations.amazon_ssm.get_parameters_by_path

        (
            output,
            http_response,
        ) = await capo_ssm._operations.amazon_ssm.get_parameters_by_path.async_get_parameters_by_path(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ssm.types.get_parameters_by_path_result.GetParametersByPathResult",
    ) -> dict[str, Any]:
        import capo_ssm.types.get_parameters_by_path_result

        return capo_ssm.types.get_parameters_by_path_result.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetParametersByPath", redact_output=_redact_output),
    )
    input_: capo_ssm.types.get_parameters_by_path_request.GetParametersByPathRequest = {
        "path": path
    }
    if recursive is not None:
        input_["recursive"] = recursive
    if parameter_filters is not None:
        input_["parameter_filters"] = parameter_filters
    if with_decryption is not None:
        input_["with_decryption"] = with_decryption
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output