{"id":37003680,"url":"https://github.com/anktx/cloud-dns-client","last_synced_at":"2026-01-14T00:34:34.112Z","repository":{"id":252137559,"uuid":"839511108","full_name":"anktx/cloud-dns-client","owner":"anktx","description":"Cloud.ru DNS API client","archived":false,"fork":false,"pushed_at":"2024-08-16T17:15:24.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-29T18:17:29.227Z","etag":null,"topics":["api","client","cloud","dns"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anktx.png","metadata":{"files":{"readme":"README.en.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-07T18:57:07.000Z","updated_at":"2024-08-16T17:15:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"74449c5d-f963-4d1e-96ca-ea27990839b7","html_url":"https://github.com/anktx/cloud-dns-client","commit_stats":null,"previous_names":["anktx/cloud-dns-client"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/anktx/cloud-dns-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anktx%2Fcloud-dns-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anktx%2Fcloud-dns-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anktx%2Fcloud-dns-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anktx%2Fcloud-dns-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anktx","download_url":"https://codeload.github.com/anktx/cloud-dns-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anktx%2Fcloud-dns-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","client","cloud","dns"],"created_at":"2026-01-14T00:34:33.543Z","updated_at":"2026-01-14T00:34:34.104Z","avatar_url":"https://github.com/anktx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloud.ru DNS API client\n\n[![Latest Stable Version](https://poser.pugx.org/anktx/cloud-dns-client/v)](https://packagist.org/packages/anktx/cloud-dns-client)\n[![Total Downloads](https://poser.pugx.org/anktx/cloud-dns-client/downloads)](https://packagist.org/packages/anktx/cloud-dns-client)\n\nThe package provides a PHP wrapper to interact with the Cloud.ru DNS API.\n\n## Requirements\n\n- PHP 8.2 or higher.\n\n## Installation\n\n```shell\ncomposer require anktx/cloud-dns-client\n```\n\n## General usage\n\nTo interact with the [Cloud.ru DNS API](https://cloud.ru/docs/clouddns/ug/topics/api-ref.html),\nyou need to create an instance of the `CloudDnsApi` class. This class requires a\n[PSR-18](https://www.php-fig.org/psr/psr-18/) `ClientInterface` implementation and `HttpAdapter`,\nwhich in turn requires [PSR-17](https://www.php-fig.org/psr/psr-17/) `RequestFactoryInterface`\nand `StreamFactoryInterface`.\n\nYou can use the [kriswallsmith/buzz](https://github.com/kriswallsmith/Buzz) and [nyholm/psr7](https://github.com/Nyholm/psr7) packages for this:\n\n```shell\ncomposer require kriswallsmith/buzz nyholm/psr7\n```\n\nHere's now you can create an instance of `CloudDnsApi`:\n\n```php\nuse Anktx\\Cloud\\Dns\\Client\\Client\\HttpAdapter;\nuse Anktx\\Cloud\\Dns\\Client\\CloudDnsApi;\nuse Buzz\\Client\\Curl;\nuse Nyholm\\Psr7\\Factory\\Psr17Factory;\n\n// Dependencies\n$psr17Factory = new Psr17Factory();\n$httpAdapter = new HttpAdapter($psr17Factory, $psr17Factory);\n$httpClient = new Curl($psr17Factory);\n\n// API\n$api = new CloudDnsApi(\n    client: $httpClient,\n    httpAdapter: $httpAdapter,\n);\n```\n\nFirst, obtain an authentication token and pass it to `HttpAdapter`:\n```php\n$token = $api-\u003eauthenticate('CLIENT_ID', 'CLIENT_SECRET');\n$httpAdapter-\u003esetToken($token);\n```\n\nNow you can use the `$api` instance to interact with the Cloud.ru DNS API.\n\n```php\n// Get zones\n$api-\u003egetZones('PROJECT_ID');\n\n// Create zone\n$api-\u003ecreateZone('New zone', 'PROJECT_ID');\n```\n\nThe result will be either `FailResult` instance (on error) or an object of the corresponding type (on success). For example:\n\n```php\n// Result is a collection of `Record` objects\n$records = $api-\u003egetRecords('ZONE_ID');\n\nforeach ($records as $record) {\n    echo 'name: ' . $record-\u003ename . ' ttl: ' . $record-\u003ettl . \\PHP_EOL;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanktx%2Fcloud-dns-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanktx%2Fcloud-dns-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanktx%2Fcloud-dns-client/lists"}