Skip to main content

The official command line interface for Cycleops

Project description

Cycleops CLI

This is the official command line interface for the Cycleops API.

Requirements

  • Python 3.11 or later

Installation

The Cycleops CLI is available on PyPI and you can install it through your favorite package manager:

pip install cycleops

Usage

Authentication

To authenticate with the Cycleops CLI, you need to provide an API key.

You can find your API keys in the Cycleops UI, under the Team category. Alternatively you can create a new API key by visiting Team > Users > Add New > API key.

Environment variable

Set the CYCLEOPS_API_KEY environment variable to your API key.

export CYCLEOPS_API_KEY=<cycleops_api_key>

Command line option

Configure the Cycleops client through the command line interface.

cycleops --api-key=<cycleops_api_key> services update <service_id> --variable <key>=<value>

Note: If both the environment variable and command line option are set, the command line option will be used by default.

Units

List of all of the available units

cycleops units list

Services

List your services

cycleops services list

Retrieve a service

cycleops services retrieve <service_id>

Create a service

cycleops services create --name <service_name> --unit-id <unit_id>

Update a service

cycleops services update <service_id> --name <service_name> --description <service_description --unit-id <unit_id> --variable <key_1>=<value_1> --variable <key_2>=<value_2> ... --variable <key_n>=<value_n>

Delete a service

cycleops services delete <service_id>

Create a Container

cycleops services create-container <service_id> <container_name> --image <image_name>:<image_tag> --ports <ports>,<ports> --volumes <volume>,<volume>,<volume> --env-file <env_file_path> --command <command>

Update a Container

cycleops services update-container <service_id> <container_name> --name <new_container_name> --image <image_name>:<image_tag> --ports <ports>,<ports> --volumes <volume>,<volume>,<volume> --env-file <env_file_path> --command <command>

Stacks

List your stacks

cycleops stacks list

Retrieve a stack

cycleops stacks retrieve <stack_id>

Create a stack

cycleops stacks create --name <stack_name>

Update a stack

cycleops stacks update <stack_id> --name <stack_name> --description <stack_description> --unit-id <unit_id> ... --unit-id <unit_id>

Delete a stack

cycleops stacks delete <stack_id>

Setups

List your setups

cycleops setups list

Retrieve a setup

cycleops setups retrieve <setup_id>

Create a setup

cycleops setups create --name <setup_name>

Update a setup

cycleops setups update <setup_id> --name <setup_name> --stack-id <stack_id> --environment-id <environment_id> --host-id <host_id> ... --host-id <host_id> --hostgroup-id <hostgroup_id> ... --hostgroup-id <hostgroup_id> --service-id <service_id> ... --service-id <service_id>

Delete a setup

cycleops setups delete <setup_id>

Deploy a setup

cycleops setups deploy <setup_id>

GitHub Actions

You can use Cycleops with your GitHub Actions to deploy a setup right from GitHub. For example this is how you could update the Docker image of a service and deploy a setup:

 deploy:
    runs-on: ubuntu-latest
    env:
      CYCLEOPS_API_KEY: ${{ secrets.CYCLEOPS_API_KEY }}
    steps:
        run: pip install cycleops
        run: cycleops services update <service_id> --variable containers.0.image=<image_name>
        run: cycleops setups deploy <setup_id>

Example

You can update a service's image and deploy a setup as follows:

$ cycleops services update 17 --variable containers.0.image=nginx:1.23
$ cycleops setups deploy 44

License

This project is licensed under the MIT License

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

cycleops-0.3.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cycleops-0.3.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file cycleops-0.3.0.tar.gz.

File metadata

  • Download URL: cycleops-0.3.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.15.0-1041-azure

File hashes

Hashes for cycleops-0.3.0.tar.gz
Algorithm Hash digest
SHA256 876772e58d391941e11335efd7915d6d760ad45f773b9b8b894452c704a8823e
MD5 754fe34dbfc294e15c8875ef5f210a31
BLAKE2b-256 3cca3e08b85e2b947938b98ef9007511667d330f4918b410c04c3113f022accc

See more details on using hashes here.

File details

Details for the file cycleops-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: cycleops-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.6 Linux/5.15.0-1041-azure

File hashes

Hashes for cycleops-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfb5d13554db2eeb52d10b41d19ad7aca6446fbf8a42ac54ad251438ccb999fe
MD5 443960cc15344f4bcfceddc303b10a74
BLAKE2b-256 ca01cbefb7d85ca0fe1f6df9f4cce443dffb236aacdaaca87dbf3c72f4469801

See more details on using hashes here.

Supported by

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