Skip to main content

This is a non-official package that leverages the Harness API using Python.

Project description

Harness Python SDK

Welcome to the Harness Python SDK! This SDK provides a convenient way to interact with the Harness platform's APIs using Python.

Prerequisites

Before using the SDK, ensure you have the following:

  • Harness Platform API Key: You'll need an API key to authenticate with the Harness API. You can create a personal API key.
  • Python 3 or higher: This SDK requires Python 3 or higher to run.
  • Account Identifier: The account identifier is required for authenticating with the Harness API. You can find this identifier in the URL when you're logged into your Harness account. For example, in the URL https://app.harness.io/ng/account/Fak3Acc0unt1D/settings/overview, the account identifier is Fak3Acc0unt1D.

Install the SDK using the following command:

pip install harness-py-sdk

Getting Started

To get started with the SDK, you'll need to authenticate with the Harness API. Here's how you can do it:

import os
from harness_py_sdk import sdk

harness_service = sdk.HarnessService(os.environ.get('HARNESS_PLATFORM_API_KEY'), "my-account-identifier")

Example 1 - Listing Services

Use the following code to list all services:

harness_service.services.fetch_services()

Example 2 - Listing Connectors using the old API

To list connectors using the old API, use the following code:

harness_service.connectors.old.fetch_connectors_listV2(
    data={
        "types": ["HttpHelmRepo"],
        "filterType": "Connector"
    },
    org_identifier=org_identifier,
    project_identifier=project_identifier
)

Reference

Here's a reference to the available classes in the SDK:

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

harness_py_sdk-0.0.12.tar.gz (126.4 kB view details)

Uploaded Source

Built Distribution

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

harness_py_sdk-0.0.12-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file harness_py_sdk-0.0.12.tar.gz.

File metadata

  • Download URL: harness_py_sdk-0.0.12.tar.gz
  • Upload date:
  • Size: 126.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for harness_py_sdk-0.0.12.tar.gz
Algorithm Hash digest
SHA256 e82815e832c730f82b1f8f52c21723361675fc5f0048c9dd884fbc93fe2cd923
MD5 92ed58bb313b737ff62cdc70284a56b0
BLAKE2b-256 d87a8a7f6a862134fe11a8027ac0acd552b7f1e310d9e2f0fd04954c49eb09f8

See more details on using hashes here.

File details

Details for the file harness_py_sdk-0.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for harness_py_sdk-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1fe5c01627e17f1c76ebd3abae6220faa70effaeff98959a83c01490c174aab5
MD5 2818d299cad987223241146ccf0b76a6
BLAKE2b-256 22de5543388b8d23e36d35a29088707af5e483fb9a85f048332fbb85608c6909

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