ArmorIQ SDK

Configuration

Configuration

Environment Variables

# Required
export ARMORIQ_API_KEY="ak_live_<64_hex_chars>"
export ARMORIQ_USER_ID="user_12345"
export ARMORIQ_AGENT_ID="my_agent_v1"

# Optional
export ARMORIQ_PROXY_URL="https://proxy.armoriq.io"
export ARMORIQ_TIMEOUT="30"
export ARMORIQ_MAX_RETRIES="3"
export ARMORIQ_VERIFY_SSL="true"
export ARMORIQ_LOG_LEVEL="INFO"

Configuration File

Create armoriq.yaml:

api_key: ${ARMORIQ_API_KEY}
user_id: user_12345
agent_id: my_agent_v1

proxy:
  url: https://proxy.armoriq.io
  timeout: 30
  max_retries: 3
  verify_ssl: true

logging:
  level: INFO
  format: json
  file: armoriq.log

Load configuration:

import yaml
from armoriq_sdk import ArmorIQClient

with open("armoriq.yaml") as f:
    config = yaml.safe_load(f)

client = ArmorIQClient(
    api_key=config["api_key"],
    user_id=config["user_id"],
    agent_id=config["agent_id"],
    proxy_url=config["proxy"]["url"],
    timeout=config["proxy"]["timeout"],
    max_retries=config["proxy"]["max_retries"]
)

Logging Configuration

import logging

# Configure SDK logging
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)

# Get SDK logger
logger = logging.getLogger("armoriq_sdk")
logger.setLevel(logging.DEBUG)

# Add file handler
handler = logging.FileHandler("armoriq.log")
handler.setFormatter(logging.Formatter(
    '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
))
logger.addHandler(handler)

# Now SDK operations will be logged
client = ArmorIQClient(...)

On this page