tourze/digital-ocean-account-bundle

DO接口

0.1.1 2025-05-28 07:06 UTC

This package is auto-updated.

Last update: 2025-06-03 06:39:15 UTC


README

Latest Version Build Status Total Downloads

A Symfony bundle for integrating with DigitalOcean API, providing account management, SSH key management, and configuration services.

English | 中文

Features

  • Complete DigitalOcean API v2 integration
  • Account information management and synchronization
  • SSH key management (create, list, delete)
  • Configuration management for DigitalOcean API access
  • Doctrine ORM integration for data persistence
  • Symfony Bundle integration with autowiring support

Installation

composer require tourze/digital-ocean-account-bundle

Register the bundle in your config/bundles.php file:

<?php

return [
    // ...
    DigitalOceanAccountBundle\DigitalOceanAccountBundle::class => ['all' => true],
    // ...
];

Quick Start

Usage Examples

Accessing Account Information

<?php

use DigitalOceanAccountBundle\Service\AccountService;

class YourController
{
    public function index(AccountService $accountService)
    {
        // Get account information from DigitalOcean API
        $accountData = $accountService->getAccount();
        
        // Synchronize account information to database
        $account = $accountService->syncAccount();
        
        // Use account data...
    }
}

API Documentation

The bundle provides several services for interacting with the DigitalOcean API:

  • AccountService: Account information management
  • SSHKeyService: SSH key management
  • DigitalOceanConfigService: API configuration management
  • DigitalOceanClient: Low-level API client

Each service is automatically registered and can be autowired in your Symfony application.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

The MIT License (MIT). Please see License File for more information.