Skip to main content

httpie-astra

Astra plugin for HTTPie.

Installation

To install from sources:

$ python setup.py install

If using python 3 on Mac, replace python with python3:

$ python3 setup.py install

Or, if you like, you can just use pip:

$ pip install httpie-astra

Usage

The Astra plugin relies on a .astrarc credentials file that will be created in your home directory and organized by [section] following the format below. Each [section] can contain a different credentials set allowing you to store all of your credentials in a single file.

[default]
ASTRA_DB_REGION = *******
ASTRA_DB_ID = *********************
ASTRA_DB_USERNAME = *********
ASTRA_DB_PASSWORD = *********
ASTRA_DB_KEYBASE = tutorial
ASTRA_DB_TOKEN = xxxx
ASTRA_DB_TOKEN_TIME = X

[section1]
ASTRA_DB_REGION = *******
ASTRA_DB_ID = *********************
ASTRA_DB_USERNAME = *********
ASTRA_DB_PASSWORD = *********
ASTRA_DB_KEYBASE = tutorial
ASTRA_DB_TOKEN = xxxx
ASTRA_DB_TOKEN_TIME = X

Once you have the credentials set up, here is an example of what an Astra Call call would look like:

% http --auth-type astra -a default: :/rest/v2/schemas/keyspaces
or
% http :/graphql/tutorial query='query { products(value: { id: "65cad0df-4fc8-42df-90e5-4effcd221ef7" }) { values { id name description price created } } }'

When you run the command, if your authentication token has expired it will refresh it for you.

I have made a change to how httpie processes json data. To pass JSON in the request, just use something like this:

http --auth-type astra -a default: POST :/rest/v2/schemas/keyspaces/KS/tables \
json:='{"name":"products","ifNotExists":true,"columnDefinitions": [\
{"name":"id","typeDefinition":"uuid","static":false}, {"name":"name","typeDefinition":"text","static":false}, \
{"name":"description","typeDefinition":"text","static":false}, {"name":"price","typeDefinition":"decimal","static":false}, \
{"name":"created","typeDefinition":"timestamp","static":false}],"primaryKey": {"partitionKey":["id"]},"tableOptions":{"defaultTimeToLive":0}}'

Note that you can create a configuration file to simplify the command further

File: ~/.config/httpie/config.json

{
       "default_options": [
               "--style=fruity",
               "--auth-type=astra",
               "--auth=default:"
       ]
}

Release files for httpie-astra 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for httpie-astra 0.1.3
File Size Uploaded
httpie-astra-0.1.3.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for httpie-astra 0.1.3
File Interpreter ABI Platform
httpie_astra-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 18.4 kB

Release files / httpie-astra-0.1.3.tar.gz

Download URL httpie-astra-0.1.3.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
65fd873fa3d8342ff8ecf5f116801bf9ed2e74e58239d27ca6988e9113b24596
BLAKE2b-256 checksum
How to use checksums
cda6ac0494b1932e673ee5cee3f46bc53e77bf5b83db98aaae22edb91f7ec57a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Release files / httpie_astra-0.1.3-py3-none-any.whl

Download URL httpie_astra-0.1.3-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51fbb46441d3df5b2e253e25fe06cb0f97312dbc189632f4846a38d6c4fd4a14
BLAKE2b-256 checksum
How to use checksums
9c502cebe2c8bc643ce998adb3be88f62b11d49ac482a04195d6814a263379fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.0

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

3 release files

0.0.12

1 release file

0.0.11

1 release file

0.0.9

1 release file

0.0.7

2 release files

0.0.6

1 release file

0.0.5

1 release file

0.0.4

2 release files

0.0.3

3 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page