Skip to main content

A Sceptre resolver to make requests from REST API endpoints

Project description

sceptre-request-resolver

A Sceptre resolver to make requests from REST API endpoints.

Motivation

There are some pretty useful REST API endpoints on the internet. The endpoints can return lots of different types of data, typically in JSON format. This simple resolver can retrieve that data and pass it to Sceptre parameters or scepter_user_data parameters.

Installation

To install directly from PyPI

pip install sceptre-request-resolver

To install from this git repo

pip install git+https://github.com/Sceptre/sceptre-request-resolver.git

Usage/Examples

parameters|sceptre_user_data:
  <name>: !request <API ENDPOINT>
parameters|sceptre_user_data:
  <name>: !request
    url: <API ENDPOINT>
    auth: <authentication type>
    user: <auth user name>
    password: <auth password>

Note:

  • This resolver always returns a string.
  • Supported authentication types: basic

Example

Simple request:

parameters:
  wisdom: !request 'https://ron-swanson-quotes.herokuapp.com/v2/quotes'

Request with basic authentication:

parameters:
  wisdom: !request
    url: https://private.endpoint.com/
    auth: basic
    user: MyUsername
    password: MyUserPwd

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sceptre_request_resolver-0.4.0.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

sceptre_request_resolver-0.4.0-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page