Skip to main content

A small nttblink connector package

Project description

NTTBlink: An Elegant Solution for Secrets and Documents Management

NTTBlink Python is a sophisticated Python module that presents a seamless way to handle automation secrets and documents

Installation

The installation of NTTBlink is a walk in the park, facilitated by pip:

pip install nttblink

Now, NTTBlink stands ready for your command.

Usage

The charm of Python lies in its simplicity and power, traits that NTTBlink embodies fully. Here's a step-by-step guide on how to wield this power:

Import the Package

Start your journey by invoking the magic of NTTBlink.

from nttblink import Blink
blink = Blink()

Set Environment Variables for Secrets

With a single command, normalize your secrets - remove spaces, transform to uppercase, and set them as environment variables. This is a easy one liner to get your secrets into your environment.

blink.secret_set_to_env()

Create a New Secret

Creating a new secret is as easy as whispering to a trusted friend. Provide the key, a description, and the secret itself as a dictionary.

new_secret = blink.secret_create('secretname', 'secret description', {'key': 'value'})

List All Secrets

Summon the catalogue of all secrets at your disposal.

secrets = blink.secret_list()
for secret in secrets:
    print(secret)

Unveil Secret Details

Peek into the contents of each secret, illuminating the hidden truth.

for secret in secrets:
    secret_details = blink.secret_get(secret['id'])
    print(secret_details)

Enumerate All Documents

With NTTBlink, documents are at your fingertips. List them with ease.

documents = blink.document_list()
for document in documents:
    print(document)

Store Each Document

Let no document be left unread. NTTBlink empowers you to retrieve each document and save it to your local directory.

for document in documents:
    blink.document_download(document['id'],document['name'])

Upload a New Document

With NTTBlink, you can upload a new document to your project. Simply provide the path to the document and the name you wish to give it.

blink.document_upload('path/to/document', 'documentname.txt')

With NTTBlink, you have a versatile tool to manage secrets and documents effortlessly. Enjoy this power responsibly.

Environment Variables

To breathe life into NTTBlink, we need to supply it with the correct environment variables. These variables serve as the keys to the realm, enabling interactions with the Blink project.

To establish these variables, you'll need to venture to the developer panel on your project page in Blink and collect the correct values. As a guiding beacon, we provide a sample environment file for testing your Python scripts:

# Sample .env file

BLINK_PROJECT_ID = "622a1fab001900435372fecfb8fd8a13"
BLINK_TOKEN = "qwk23q8aaskqwu2iqasmasdf"
BLINK_BASE_URL = "https://am-automate.nttltd.global.ntt"
BLINK_AUTOMATION_ID = 9

Here's a brief explanation of each variable:

BLINK_PROJECT_ID: This is the unique identifier of your Blink project. It tells NTTBlink which project it should interact with.

BLINK_TOKEN: This is your authorization token. It's like the passport for NTTBlink, granting it permission to perform operations in your Blink project.

BLINK_BASE_URL: This is the base URL for your Blink instance. It's the address that NTTBlink will visit to carry out your commands.

BLINK_AUTOMATION_ID: This is the identifier for the specific automation you are working with. Remember to replace the values in the sample .env file with your actual data.

For safety reasons, never expose these environment variables publicly as they can provide unrestricted access to your project. Use .env files for local development, but ensure they're included in your .gitignore file. For deployment, use secure environment variables provided by your hosting service.

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

nttblink-0.1.3.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

nttblink-0.1.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

Supported by

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