{"id":21732163,"url":"https://github.com/jbelien/ovh-cloud-snapshot","last_synced_at":"2025-10-18T04:35:14.305Z","repository":{"id":37587939,"uuid":"94311116","full_name":"jbelien/OVH-Cloud-Snapshot","owner":"jbelien","description":"Create snapshots of your OVH Cloud instances and volumes via OVH API","archived":false,"fork":false,"pushed_at":"2023-05-01T15:57:31.000Z","size":138,"stargazers_count":28,"open_issues_count":3,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T00:36:22.940Z","etag":null,"topics":["cloud","ovh","ovh-api","php"],"latest_commit_sha":null,"homepage":"https://api.ovh.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbelien.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":"jbelien","liberapay":"jbelien"}},"created_at":"2017-06-14T09:00:29.000Z","updated_at":"2022-09-16T21:25:56.000Z","dependencies_parsed_at":"2024-11-26T04:48:18.904Z","dependency_job_id":null,"html_url":"https://github.com/jbelien/OVH-Cloud-Snapshot","commit_stats":{"total_commits":106,"total_committers":8,"mean_commits":13.25,"dds":0.7169811320754718,"last_synced_commit":"f2e3c8e5ae1e7f34ea067b3d3cfe26c818e11464"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbelien%2FOVH-Cloud-Snapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbelien%2FOVH-Cloud-Snapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbelien%2FOVH-Cloud-Snapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbelien%2FOVH-Cloud-Snapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbelien","download_url":"https://codeload.github.com/jbelien/OVH-Cloud-Snapshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650417,"owners_count":21139671,"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":["cloud","ovh","ovh-api","php"],"created_at":"2024-11-26T04:29:05.175Z","updated_at":"2025-10-18T04:35:14.201Z","avatar_url":"https://github.com/jbelien.png","language":"PHP","funding_links":["https://github.com/sponsors/jbelien","https://liberapay.com/jbelien"],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/jbelien/ovh-cloud-snapshot/v/stable)](https://packagist.org/packages/jbelien/ovh-cloud-snapshot)\r\n[![Total Downloads](https://poser.pugx.org/jbelien/ovh-cloud-snapshot/downloads)](https://packagist.org/packages/jbelien/ovh-cloud-snapshot)\r\n[![Monthly Downloads](https://poser.pugx.org/jbelien/ovh-cloud-snapshot/d/monthly.png)](https://packagist.org/packages/jbelien/ovh-cloud-snapshot)\r\n\r\n# OVH Cloud Automated Snapshot\r\n\r\n## Requirements\r\n\r\n* [PHP](https://www.php.net/)\r\n* [Composer](https://getcomposer.org/)\r\n\r\n## Installation\r\n\r\n```shell\r\ncomposer create-project jbelien/ovh-cloud-snapshot\r\n```\r\n\r\n## Configuration\r\n\r\n### First step\r\n\r\nCreate credentials by clicking [here](https://api.ovh.com/createToken/index.cgi?POST=/cloud/project/*/instance/*/snapshot\u0026POST=/cloud/project/*/volume/*/snapshot\u0026GET=/cloud/project/*/snapshot\u0026GET=/cloud/project/*/volume/snapshot\u0026DELETE=/cloud/project/*/snapshot/*\u0026DELETE=/cloud/project/*/volume/snapshot/*) !\r\n\r\n- POST: `/cloud/project/*/instance/*/snapshot`\r\n- POST: `/cloud/project/*/volume/*/snapshot`\r\n- GET: `/cloud/project/*/snapshot`\r\n- GET: `/cloud/project/*/volume/snapshot`\r\n- DELETE: `/cloud/project/*/snapshot/*`\r\n- DELETE: `/cloud/project/*/volume/snapshot/*`\r\n\r\n### Second step\r\n\r\nCreate `snapshot.yml` in root directory with your credentials and the list of your instances/volumes :\r\n\r\n```yaml\r\n---\r\napplicationKey: \u003covh_application_key\u003e\r\napplicationSecret: \u003covh_application_secret\u003e\r\nconsumerKey: \u003covh_consumer_key\u003e\r\n\r\nduration: \u003cdate-interval\u003e\r\n\r\nprojects:\r\n  - id: \"\u003cproject-1-id\u003e\"\r\n    instances:\r\n      - \u0026myinstance\r\n          id: \"\u003cinstance-id\u003e\"\r\n          name: \"My Instance\"\r\n    volumes:\r\n      - \u0026myvolume\r\n        id: \"\u003cvolume-id\u003e\"\r\n        name: \"My Volume\"\r\n    protected:\r\n      instances:\r\n        - \"\u003cinstance-id\u003e\"\r\n      volumes:\r\n  - id: \"\u003cproject-2-id\u003e\"\r\n    instances:\r\n      ...\r\n    volumes:\r\n      ...\r\n    protected:\r\n      instances:\r\n      volumes:\r\n  ...\r\n```\r\n\r\n#### Configure `duration`\r\n\r\nTo determine after how many days/weeks/months/... you want snapshots to be delete, use `duration` option.  \r\nThis option uses PHP `DateInterval` format : \u003chttp://php.net/manual/en/dateinterval.construct.php\u003e\r\n\r\nThe format starts with the letter P, for \"period.\" Each duration period is represented by an integer value followed by a period designator. If the duration contains time elements, that portion of the specification is preceded by the letter T.\r\n\r\nHere are some simple examples. Two days is `P2D`. Two seconds is `PT2S`. Six years and five minutes is `P6YT5M`.\r\n\r\nYou can protect snapshots from deletion by setting its id in `protected.instances` or `protected.volumes`.\r\n\r\n## Run\r\n\r\n    php snapshot.php\r\n\r\nDry-run mode (simulates the query) :\r\n\r\n    php snapshot.php --dry-run\r\n\r\n## Crontab\r\n\r\nYou can automate the snapshot creation by creating a crontab making a call to this tool.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbelien%2Fovh-cloud-snapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbelien%2Fovh-cloud-snapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbelien%2Fovh-cloud-snapshot/lists"}