Skip to main content

Upsource API

Project description

Upsource API

A Python client library for accessing Upsource APIs. These client library are not complete and are in developing mode.

Index

  1. Install
  2. Usage

Install

You can run Upsource API through Docker:

docker run -it --rm vanyaland/upsourceapi --help

Build by your own:

docker build -t upsourceapi .
docker run -it --rm upsourceapi --help

or install it using the Python package manager:

pip install .

Usage

Command line usage

In this section we cover in detail each of the commands implemented in upsourceapi.

upsourceapi --help

Commands

Get all projects

With this command you can the list of all short project infos.

  • --base-url: Base URL of the Upsource API.
  • --auth-token: Upsource authorization token, provide it to see private projects. optional

Example:

upsourceapi get-all-projects \
  --base-url "https://example.com/~rpc" \
  --auth-token "AUTH_TOKEN"

Create a project

You must have configured your SSH previously.

With this command you can create upsource project.

  • --base-url: Base URL of the Upsource API.
  • --auth-token: Upsource authorization token. To see private projects.
  • --project-name: Name for the new Upsource project.
  • --project-url: The URL to the repo, e.g. ssh://git@example.com/example-repo.git.
  • --ssh-key: Private SSH key in OpenSSH format.
  • --ssh-key-passphrase: SSH key passphrase.
  • --sync-token: Anonymous access to the GitLab/GitHub API is forbidden. Please provide an OAuth 2.0 token (recommended) or a personal access token, which we'll use to read data from GitLab/GitHub. Write requests will be performed on behalf of each individual Upsource user.

Example:

upsourceapi create-project \
  --auth-token "AUTH_TOKEN" \
  --base-url "https://example.com/~rpc" \
  --project-name "example-project" \
  --project-url "ssh://git@example.com/example-project.git" \
  --ssh-key "$(cat ~/.ssh/id_rsa)" \
  --ssh-key-passphrase "ssh-key-passphrase" \
  --sync-token "OAuth 2.0 token"

Find projects

With this command you can get the list of projects matching a given search criteria.

  • --base-url: Base URL of the Upsource API.
  • --auth-token: Upsource authorization token, provide it to see private projects. optional
  • --pattern: Search query, e.g. part of the name.
  • --limit: Number of projects to return.

Example:

docker run -it --rm upsourceapi find-projects \
  --base-url "https://example.com/~rpc" \
  --auth-token "AUTH_TOKEN" \
  --pattern "query" \
  --limit 10

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

upsourceapi-0.1.2.tar.gz (14.3 kB view details)

Uploaded Source

File details

Details for the file upsourceapi-0.1.2.tar.gz.

File metadata

  • Download URL: upsourceapi-0.1.2.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for upsourceapi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f3203e025ec3a104173cd77993740499393bebdfbc1e89240427932b8949a3ca
MD5 172a737c8294979b361f23e316814124
BLAKE2b-256 63cde35cd568c3eee51f739658cbe65f41b83e60f494185784aeb3ec87abbab5

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