Skip to main content

Run Kinto HTTP migrations.

Project description

CLI tool to perform high level migrations using the HTTP API on a Kinto Server.

Installation

With pip:

$ pip install kinto-migrations

Getting stated

Let’s imagine we want to create initialize our Kinto server with some stuff:

$buckets:

    private_data:
        description: Data that is mine and I may share with frieds.

        $groups:
            frieds:
                members:
                    - portier:myfriend@gmail.com

        $collections:
            expenses:
                description: Money stuff.

            pictures:
                $permissions:
                    read:
                        - "/buckets/private_data/friends"

    public_data:
        description: My public data.

        $permissions:
            read:
                - "system.Everyone"

        $collections:
            blog_posts:
                url: "me.github.io"

                $records:
                    hello_world: {}

Let’s save this to a YAML file and run:

$ kinto-migrate --file models.yml --server https://kinto.dev.mozaws.net/v1/ --auth admin:pass

You should specify the server and an authentication token. By default the migrate tool will prompt for a models.yml file on the current directory or you can specify a file using –file` or -f.

This will crete if not exist all the listed endpoints on the Kinto API.

Schema reference

Resources and other reserved words start with a dollar-sign ($). This package supports the basic structure of the Kinto HTTP API.

$buckets:
    (...)
    $groups:
        (...)
    $collections:
        (...)
        $records:
            (...)

Any resource data can be included inline under the resource attributes. By default, if no collection schema is provided, any attribute is accepted as in the Kinto API.

$buckets:
    my_bucket:
        name: My Bucket
        tags:
            - Mine
            - Not yours

Permissions can be setted under any resource using the $permissions attribute.

$buckets:
    my_public_bucket:
        $permissions:
            read:
                - system.Everyone

Changelog

0.1.0 (2017-03-12)

  • First release with basic functionalities.

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

kinto-migrations-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

File details

Details for the file kinto-migrations-0.1.0.tar.gz.

File metadata

File hashes

Hashes for kinto-migrations-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7cc821237a54dc06d787ad46882b96dff5cea50ac9353b5efeee93ab72f79f61
MD5 cc1a94a791ea4bf41155c477cc45ed6f
BLAKE2b-256 fb7d320a211dd9e2417e22342fcded61acb66e48284ef03ab5443483ed8f5836

See more details on using hashes here.

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