Skip to main content

REST API defined as YAML and invoked with lastapi.

Project description


The Omni REST API Client

This is still WIP, but I've got prototype working which is for the update DNS function using CloudFlare API.

The project is written in Python 3. You can install dependencies with

pip3 install --user -r requirements.txt


REST API schema

The schema is defined in schemas/cloudflare.yaml

Name: cloudflare
  Protocol: https
  X-Auth-Key: ${auth_key}
  X-Auth-Email: ${auth_email}
  Content-Type: application/json

      - /client/v4/zones/
      - ${zone_id}
      - /dns_records/
      - ${dns_id}
    Method: PUT
      type: ${dns_type}
      name: ${dns_name}
      content: ${dns_content}
      ttl: 1
      proxied: true

This will be verified against schemas/schema.yaml using pykwalify.

Global parameters

Global parameters for the API, usually API key and account stuff, are in schemas/cloudflare-params.yaml.example. You should duplicate it and remove the .example suffix and put in real credential.

auth_key: sample-api-key

Invoking an Action in the schema

To invoke the update_dns action defined in the schema, run:

./lapi --schema schemas/cloudflare --func update_dns --vars zone_id=xxx,dns_id=xxx,dns_type=A,,dns_content=

Please comment or raise an issue if this doesn't work for you.

Project details

Release history Release notifications | RSS feed

This version


Download files

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

Source Distribution

lastapi-0.2.tar.gz (4.1 kB view hashes)

Uploaded source

Built Distribution

lastapi-0.2-py3-none-any.whl (18.0 kB view hashes)

Uploaded py3

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