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 isFak3Acc0unt1D.
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:
- Connectors: Documentation
- Old Connectors: Documentation
- Pipelines: Documentation
- Services: Documentation
- Templates: Documentation
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file harness_py_sdk-0.0.11.tar.gz.
File metadata
- Download URL: harness_py_sdk-0.0.11.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5bc0bcb448ff9c2db680d75955bbcf42ae9c05aa6b12f19f3af5fc3ced603da
|
|
| MD5 |
73cc9d80ed827e51eb29f125c43202d9
|
|
| BLAKE2b-256 |
2997a9310aac3e64db2b96f91b2ecfb28813a86f3882ede9612e2b7828101e53
|
File details
Details for the file harness_py_sdk-0.0.11-py3-none-any.whl.
File metadata
- Download URL: harness_py_sdk-0.0.11-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfe06bf5062b3cc9cfcf97ffeaf4e4af8cdfeb2f0c05810319f51047f4be0efe
|
|
| MD5 |
c16260d41fd5bcc47b924df5181c9133
|
|
| BLAKE2b-256 |
9d78eefc20373d36378ac3e902e8f7e74edc6f659017aa6e5f11ed729ac517bd
|