Cirun Python Client
Project description
Cirun Python Client and CLI
Table of Contents
Installation
pip install cirun
or via conda-forge
conda install -c conda-forge cirun
Usage
cirun-py can be used as a CLI as well as a Python client programmatically.
- Create an API key from the Cirun Dashboard https://cirun.io/admin/api
- Set that API Key as an environment variable named
CIRUN_API_KEY
export CIRUN_API_KEY=<your-api-key>
CLI
- List active repositories for Cirun
$ cirun repo list
──────────────────────────────────────────────────────────────────────────────────────────────────────────
{
"repos": [
{
"repository": "aktech/cirun-openstack-example",
"active": true,
"private": false
},
{
"repository": "aktechlabs/cirun-demo",
"active": true,
"private": true
}
]
}
──────────────────────────────────────────────────────────────────────────────────────────────────────────
- Active (add) a repository
$ cirun repo add aktech/sympy
──────────────────────────────────────────────────────────────────────────────────────────────────────────
{
"name": "aktech/sympy",
"active": true
}
──────────────────────────────────────────────────────────────────────────────────────────────────────────
- Deactivate (remove) a repository
$ cirun repo remove aktech/sympy
──────────────────────────────────────────────────────────────────────────────────────────────────────────
{
"name": "aktech/sympy",
"active": false
}
──────────────────────────────────────────────────────────────────────────────────────────────────────────
- Connect cloud provider with Cirun
cirun cloud connect aws --access-key AKIXXXXXXXXX --secret-key KFCF3yi+df0n12345678AMASDFGHJ
cirun cloud connect azure \
--subscription-id 31184337-0346-4782-ae59-eb185fd0cfa1 \
--tenant-id a66e466d-698b-4a91-b9e3-949f9cc04f11 \
--client-id 340d01fc-ba24-43ee-844e-d364899d29e7 \
--client-secret KFCF3yi+df0cirunIsAwesomeIsntIt?n1DFGHJ
cirun cloud connect gcp --key-file /path/to/service-account-key.json
Client
from cirun import Cirun
# Create cirun client object
# Pass the token or set `CIRUN_API_KEY` environment variable
c = Cirun(token='cirun-4cabcdbf-275c-4500-890d-712340663ddc')
# List repositories
c.get_repos()
# Active (add) a repository
c.set_repo('aktech/sympy', active=True)
# Deactivate (remove) a repository
c.set_repo('aktech/sympy', active=False)
License
cirun
is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cirun-0.26.tar.gz
(8.3 kB
view details)
Built Distribution
cirun-0.26-py3-none-any.whl
(9.7 kB
view details)
File details
Details for the file cirun-0.26.tar.gz
.
File metadata
- Download URL: cirun-0.26.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.24.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
bd33ba1ae26e1297d972f744d36521b29a628f19a0b7fb17d91bbba6cb99a43d
|
|
MD5 |
9666dc8d6dbab5933d4d7e80a737d30c
|
|
BLAKE2b-256 |
17695f6cc69a1d0f6aa2589e1fab4f8fbdd42630e6d227b7f9a3876deacde336
|
File details
Details for the file cirun-0.26-py3-none-any.whl
.
File metadata
- Download URL: cirun-0.26-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.24.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8dd9ec9660726549690dcfa302091a7d5fcddd8aa61fc9569d8fdc5b1582e9c7
|
|
MD5 |
9e3b3037897b0626a426adfa9df80274
|
|
BLAKE2b-256 |
4cb9d6fdfe3e184c2f361a25717aa0acbafe606b29363055016b214fdd3a25a5
|