{"id":24326876,"url":"https://github.com/webinarium/linode-api3","last_synced_at":"2025-09-27T11:30:39.741Z","repository":{"id":25878388,"uuid":"29318653","full_name":"webinarium/linode-api3","owner":"webinarium","description":"Linode API v3 Client Library for PHP.","archived":false,"fork":false,"pushed_at":"2018-11-09T01:38:59.000Z","size":200,"stargazers_count":31,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-29T02:29:19.326Z","etag":null,"topics":["api","linode","php"],"latest_commit_sha":null,"homepage":"https://www.linode.com/api","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webinarium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-15T21:17:28.000Z","updated_at":"2024-07-07T15:54:20.000Z","dependencies_parsed_at":"2022-08-24T01:00:47.431Z","dependency_job_id":null,"html_url":"https://github.com/webinarium/linode-api3","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webinarium%2Flinode-api3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webinarium%2Flinode-api3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webinarium%2Flinode-api3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webinarium%2Flinode-api3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webinarium","download_url":"https://codeload.github.com/webinarium/linode-api3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234429244,"owners_count":18831241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","linode","php"],"created_at":"2025-01-17T21:14:50.867Z","updated_at":"2025-09-27T11:30:34.454Z","avatar_url":"https://github.com/webinarium.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PHP](https://img.shields.io/badge/PHP-5.6%2B-blue.svg)](https://secure.php.net/migration56)\n[![Latest Stable Version](https://poser.pugx.org/webinarium/linode-api3/v/stable)](https://packagist.org/packages/webinarium/linode-api3)\n[![Build Status](https://travis-ci.org/webinarium/linode-api3.svg?branch=master)](https://travis-ci.org/webinarium/linode-api3)\n[![Code Coverage](https://scrutinizer-ci.com/g/webinarium/linode-api3/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/webinarium/linode-api3/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/webinarium/linode-api3/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/webinarium/linode-api3/?branch=master)\n\n# Linode API v3 Client Library for PHP\n\nThis library implements full spec of Linode API v3 (in accordance with https://www.linode.com/api/utility/api.spec),\nincluding functions which are not described at the [Linode's site](https://www.linode.com/api) yet (the documentation seems to be slightly outdated at the moment).\n\nThe library wasn't actually implemented, but autogenerated from the [spec](https://api.linode.com/?api_action=api.spec).\nThis approach provides several advantages as:\n * we can be sure that nothing from the spec is missed,\n * no implementation errors which could be caused by human factor,\n * in case of the spec extension it's fast and easy to update the library's code.\n\nAlso please note that \"[test.echo](https://www.linode.com/api/utility/test.echo)\" is skipped from the implementation.\n\n## Warning\n\nThe library addresses Linode's legacy API. For most recent API please refer to [this library](https://github.com/webinarium/linode-api).\n\n## Requirements\n\nPHP needs to be a minimum version of PHP 5.6.\n\n## Installation\n\nThe recommended way to install is via Composer:\n\n```bash\ncomposer require \"webinarium/linode-api3\"\n```\n\n## Usage Example\n\nBelow is a complete example of how to create a new Linode host using the library:\n\n```php\nuse Linode\\LinodeApi;\nuse Linode\\LinodeException;\nuse Linode\\PaymentTerm;\n\n// Your API key from the Linode profile.\n$key = '...';\n\n// Hardcode some IDs to make the example shorter.\n// Normally you might want to use \"Linode\\AvailApi\" class functions.\n$datacenter = 3;    // Fremont datacenter\n$plan       = 1;    // we will use the cheapest plan\n\n// Create new linode.\ntry {\n    $api = new LinodeApi($key);\n    $res = $api-\u003ecreate($datacenter, $plan, PaymentTerm::ONE_MONTH);\n\n    printf(\"Linode #%d has been created.\\n\", $res['LinodeID']);\n}\ncatch (LinodeException $e) {\n    printf(\"Error #%d: %s.\\n\", $e-\u003egetCode(), $e-\u003egetMessage());\n}\n```\n\n## Batching Requests\n\nThe Linode API also supports a batched mode, whereby you supply multiple request sets and receive back an array of responses.\nExample batch request using the library:\n\n```php\nuse Linode\\Batch;\nuse Linode\\LinodeApi;\nuse Linode\\PaymentTerm;\n\n// Your API key from the Linode profile.\n$key = '...';\n\n// Hardcode some IDs to make the example shorter.\n// Normally you might want to use \"Linode\\AvailApi\" class functions.\n$datacenters = [2, 3, 4, 6];    // all four US datacenters\n$plan        = 1;               // we will use the cheapest plan\n\n// Create a batch.\n$batch = new Batch($key);\n\n// Create new linode on each of US datacenters.\n$api = new LinodeApi($batch);\n\nforeach ($datacenters as $datacenter) {\n    $api-\u003ecreate($datacenter, $plan, PaymentTerm::ONE_MONTH);\n}\n\n// Execute batch.\n$results = $batch-\u003eexecute();\n\nforeach ($results as $res) {\n    printf(\"Linode #%d has been created.\\n\", $res['DATA']['LinodeID']);\n}\n```\n\n## Tests\n\nAlmost all tests are mocked so you don't have to use a real API key and no real linodes are affected.\nThe only tests which make a complete API call are `TestTest` (for \"[test.echo](https://www.linode.com/api/utility/test.echo)\") and `ApiTest` (for \"[api.spec](https://www.linode.com/api/utility/api.spec)\"):\n\n```bash\n./bin/phpunit --coverage-text\n```\n\n## Library regeneration\n\nIf you would like to regenerate the library code, you can do it with two simple steps:\n\n```bash\nphp ./generator/generator\nphp ./bin/php-cs-fixer fix\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebinarium%2Flinode-api3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebinarium%2Flinode-api3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebinarium%2Flinode-api3/lists"}