Linode api

From rawveg/skillsforge-marketplace · View interactive version

Linode api is an AI agent skill from the GitHub repository rawveg/skillsforge-marketplace. Linode API Documentation

How to use this skill

Skill file

Linode-Api Skill

Comprehensive assistance with the Linode API - a RESTful API for programmatically managing Linode cloud infrastructure including compute instances, networking, storage, domains, and billing.

When to Use This Skill

This skill should be triggered when:

Quick Reference

Authentication with Personal Access Token

from linode import LinodeClient

# Initialize client with your personal access token
token = "your-personal-access-token"
client = LinodeClient(token)

Getting a token: Log into cloud.linode.com → Profile → "Create a Personal Access Token"

List All Linode Instances

# Retrieve all Linodes on your account
my_linodes = client.linode.get_instances()

# Iterate and display instance labels
for linode in my_linodes:
    print(linode.label)

Create a New Linode Instance (Python)

# Get available regions
available_regions = client.get_regions()
chosen_region = available_regions[0]

# Create instance with region, type, and image
new_linode, password = client.linode.create_instance(
    chosen_region,
    'g5-standard-4',
    image='linode/debian9'
)

# Display SSH connection info
print(f"ssh root@{new_linode.ipv4[0]} - {password}")

Create a Linode Instance (cURL)

curl -X POST https://api.linode.com/v4/linode/instances \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "g5-standard-2",
    "region": "us-east",
    "image": "linode/debian12",
    "root_pass": "secure_password_here",
    "label": "prod-web-1"
  }'

Get Account Information

curl https://api.linode.com/v4/account \
  -H "Authorization: Bearer <your-token>"

List Invoices

curl https://api.linode.com/v4/account/invoices \
  -H "Authorization: Bearer <your-token>"

Check Regional Service Availability

curl https://api.linode.com/v4/account/availability \
  -H "Authorization: Bearer <your-token>"

Install Python Library

# Install the official Python library
pip install linode-api

# Or from source
git clone git@github.com:Linode/python-linode-api
cd python-linode-api
python setup.py install

Basic Python Setup Pattern

from linode import LinodeClient

# Initialize the client
token = "your-personal-access-token"
client = LinodeClient(token)

# Now you can access resources
regions = client.get_regions()
instances = client.linode.get_instances()

Authentication Header Format (REST)

All API requests to non-public resources must include an Authorization header:

Authorization: Bearer <your-personal-access-token>

Key Concepts

API Versions

Authentication

The Linode API uses Personal Access Tokens (PATs) for authentication. Tokens can have different permission scopes (read/write) for different resource types. Always keep tokens secure and never commit them to version control.

Pagination

API responses use envelope-based pagination with metadata:

Filtering

The API supports advanced filtering via the X-Filter header with operators:

Instance Types

Common Linode instance types:

Regions

Linode has global data centers. Common regions:

Images

Supported operating system images:

Reference Files

This skill includes comprehensive documentation in references/:

Use view references/api.md when you need:

Working with This Skill

For Beginners

  1. Start with authentication: Generate a Personal Access Token from cloud.linode.com
  2. Test basic endpoints: Try GET /account to verify your token works
  3. Use the Python library: It's easier than raw REST API calls for getting started
  4. Start small: List existing resources before creating new ones
  5. Check regional availability: Ensure services are available in your chosen region

For API Integration

  1. Review authentication patterns in the Quick Reference section
  2. Use the Python client library for rapid development
  3. Implement proper error handling for API rate limits and validation errors
  4. Store tokens securely using environment variables or secret management
  5. Test in non-production accounts first

For Infrastructure Automation

  1. Explore the full API specification in references/api.md
  2. Use filtering and pagination for large resource queries
  3. Implement idempotent operations where possible
  4. Monitor API usage to stay within rate limits
  5. Use OAuth for multi-user applications

Common Workflows

Basic Instance Management:

  1. List available regions → Choose region
  2. List available instance types → Choose type
  3. List available images → Choose image
  4. Create instance with chosen parameters
  5. Monitor instance status until "running"
  6. Retrieve IP address and connect

Account Management:

  1. Get account information
  2. List invoices and payment history
  3. Check service availability by region
  4. Manage OAuth clients for applications
  5. View notifications and events

Resources

Official Documentation

Code Libraries

references/

The references/api.md file contains:

Best Practices

Security

Error Handling

Performance

Code Organization

Notes

Common Operations Reference

Compute Instances

Account & Billing

Networking

Storage

Troubleshooting

Authentication Errors

Rate Limiting

Validation Errors

Installation Issues (Python)

Updating

This skill is based on the OpenAPI specification from the Linode API GitHub repository. To refresh with the latest API changes:

  1. The specification is automatically pulled from: https://github.com/linode/linode-api-docs
  2. Re-run the skill generation process to capture new endpoints and changes
  3. Review changelog for breaking changes before updating production code
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.