{"id":19140941,"url":"https://github.com/gridscale/gridscale_api_client_python","last_synced_at":"2025-09-03T18:45:36.714Z","repository":{"id":35120884,"uuid":"196579331","full_name":"gridscale/gridscale_api_client_python","owner":"gridscale","description":"The official gridscale API client written in Python","archived":false,"fork":false,"pushed_at":"2024-04-24T06:19:58.000Z","size":1185,"stargazers_count":5,"open_issues_count":8,"forks_count":1,"subscribers_count":6,"default_branch":"develop","last_synced_at":"2025-05-06T23:17:48.467Z","etag":null,"topics":["api","gridscale","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/gridscale.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-12T12:55:03.000Z","updated_at":"2023-11-06T20:23:41.000Z","dependencies_parsed_at":"2023-01-15T14:15:10.226Z","dependency_job_id":null,"html_url":"https://github.com/gridscale/gridscale_api_client_python","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridscale%2Fgridscale_api_client_python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridscale%2Fgridscale_api_client_python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridscale%2Fgridscale_api_client_python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gridscale%2Fgridscale_api_client_python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gridscale","download_url":"https://codeload.github.com/gridscale/gridscale_api_client_python/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252782835,"owners_count":21803410,"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","gridscale","python"],"created_at":"2024-11-09T07:19:30.148Z","updated_at":"2025-05-06T23:17:56.812Z","avatar_url":"https://github.com/gridscale.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gridscale_api_client_python\n\nThis the official Python wrapper for gridscale's [API](https://gridscale.io/en//api-documentation/index.html). Allowing you to manage your own infrastructure from your own applications.\n\n## Prerequisites\n\nFirst, the Python programming language needs to be installed. This can be done by using the [official downloads](https://www.python.org/downloads/) page.\n\nOnce done, download and install via [PyPI](https://pypi.org)\n\n```shell\n$ pip3 install gs_api_client\n```\n\n## Introduction\n\nFirst, you will need your [API credentials](https://my.gridscale.io/Easy/APIs/).\n\nIn the [examples.py](https://github.com/gridscale/gridscale_api_client_python/blob/develop/examples/examples.py) replace the `AUTH_TOKEN` \u0026 `USER_UUID` with your credentials.\n\n## Authentication\n\nThese imports and configs need to be setup before other commands can be run. If you do not need synchronous or asynchronous requests, you can leave out `SyncGridscaleApiClient` \u0026 `GridscaleApiClient` respectively.\n\n```python\nfrom gs_api_client import Configuration\nfrom gs_api_client import SyncGridscaleApiClient, GridscaleApiClient\n\n# Initiate the configuration\nconfig = Configuration()\nconfig.api_key['X-Auth-Token'] = \"AUTH_TOKEN\"\nconfig.api_key['X-Auth-UserId'] = \"USER_UUID\"\n\n# Setup the client\nsync_api = SyncGridscaleApiClient(configuration=config)\nasync_api = GridscaleApiClient(configuration=config)\n```\n\n## Async vs. sync client\n\nWe provide two clients `SyncGridscaleApiClient` and `GridscaleApiClient`. gridscale's API performs long running operations asynchronously in the background while returning a 202 response code, with the request identifier in the `x-request-id` response header.\n\nThe main differences are:\n\n- `GridscaleApiClient` exposes bare gridscale API functionality, while `SyncGridscaleApiClient` adds a convenience layer on top.\n- `SyncGridscaleApiClient` determines whether the request is sync or async.\n- Makes asynchronous operations behave as if they were synchronous:\n  - The client will block until the request has finished, successful or not.\n  - Throws an `AsynchronousApiError` exception, in the case of failure.\n- With most `PATCH` and `POST` requests, the synchronous client will return the resulting object instead of an empty body or just the reference.\n\n## Debugging\n\nAdding this line below, will output further information for debugging\n\n```python\nconfig.debug = True\n```\n\n## Access response header\n\nAdding `http_info=True` when instantiating the client, return value will be a tuple of response, response code and response headers (dict).\n\n```python\nsync_api = SyncGridscaleApiClient(http_info=True)\nasync_api = GridscaleApiClient(http_info=True)\n```\n\n## Basic request examples\n\n```python\nfrom pprint import pprint\n\n# Get all servers\npprint(async_api.get_servers())\n\n# Create a server\npprint(async_api.create_server({'name':'test', 'cores': 1, 'memory': 2}))\n\n# Update a server\npprint(async_api.update_server('\u003cUUID\u003e', {\n    'name':'windows production Server',\n    'cores': 2,\n    'memory': 4\n    }))\n\n# Delete a server\npprint(client.delete_storage('\u003cUUID\u003e'))\n```\n\n## Exhaustive list of all functions\n\nInside the [examples.py](examples/examples.py) file, you can see some example requests to get your started. All endpoints are fully documented in our [API](https://gridscale.io/en//api-documentation/index.html)\n\n### Requests\n\n- get_request\n\n### Locations\n\n- get_locations\n- get_location\n\n### Servers\n\n- get_servers\n- get_server\n- create_server\n- update_server\n- delete_server\n- get_deleted_servers\n- get_server_events\n- get_server_metrics\n- get_server_power\n- update_server_power\n- server_power_shutdown\n\n### Server relations\n\n- get_server_linked_ip\n- get_server_linked_ips\n- get_server_linked_isoimage\n- get_server_linked_isoimages\n- get_server_linked_network\n- get_server_linked_networks\n- get_server_linked_storage\n- get_server_linked_storages\n- link_ip_to_server\n- link_isoimage_to_server\n- link_network_to_server\n- link_storage_to_server\n- update_server_linked_isoimage\n- update_server_linked_network\n- update_server_linked_storage\n- unlink_ip_from_server\n- unlink_isoimage_from_server\n- unlink_network_from_server\n- unlink_storage_from_server\n\n### Storages\n\n- get_storages\n- get_storage\n- create_storage\n- delete_storage\n- get_deleted_storages\n- storage_clone\n- storage_rollback\n- update_storage\n- get_storage_events\n\n### Backups\n\n- get_storage_backups\n- delete_storage_backup\n- rollback_storage_backup\n\n### Storage Backup Schedule\n\n- get_storage_backup_chedules\n- create_storage_backup_schedule\n- get_storage_backup_schedule\n- delete_storage_backup_schedule\n- update_storage_backup_schedule\n\n### Snapshots\n\n- get_snapshots\n- get_snapshot\n- create_snapshot\n- delete_snapshot\n- get_snapshot_schedule\n- get_snapshot_schedules\n- update_snapshot\n- create_snapshot_schedule\n- update_snapshot_schedule\n- delete_snapshot_schedule\n- snapshot_export_to_s3\n- get_deleted_snapshots\n\n### Templates\n\n- get_templates\n- get_template\n- create_template\n- update_template\n- delete_template\n- get_template_events\n- get_deleted_templates\n\n### Marketplace applications\n\n- get_marketplace_applications\n- get_marketplace_application\n- create_marketplace_application\n- update_marketplace_application\n- delete_marketplace_application\n- get_marketplace_application_events\n\n### Networks\n\n- get_network\n- get_networks\n- create_network\n- update_network\n- delete_network\n- get_network_events\n- get_deleted_networks\n- get_network_pinned_servers()\n- update_network_pinned_server()\n- delete_network_pinned_server()\n\n### IP addresses\n\n- get_ips\n- get_ip\n- create_ip\n- update_ip\n- delete_ip\n- get_ip_events\n- get_deleted_ips\n\n### Load balancers\n\n- get_loadbalancers\n- get_loadbalancer\n- create_loadbalancer\n- update_loadbalancer\n- delete_loadbalancer\n- get_loadbalancer_events\n- get_deleted_loadbalancers\n\n### PaaS\n\n- get_paas_services\n- get_paas_service\n- create_paas_service\n- update_paas_service\n- delete_paas_service\n- renew_paas_service_credentials\n- get_paas_service_metrics\n- get_paas_security_zones\n- get_paas_security_zone\n- create_paas_security_zone\n- update_paas_security_zone\n- delete_paas_security_zone\n- get_paas_service_templates\n- get_deleted_paas_services\n\n### Firewalls\n\n- get_firewalls\n- get_firewall\n- create_firewall\n- update_firewall\n- delete_firewall\n- get_firewall_events\n\n### ISO images\n\n- get_isoimages\n- get_isoimage\n- create_isoimage\n- update_isoimage\n- delete_isoimage\n- get_isoimage_events\n- get_deleted_isoimages\n\n### Labels\n\n- get_labels\n- get_label\n\n### SSH keys\n\n- get_ssh_keys\n- get_ssh_key\n- create_ssh_key\n- update_ssh_key\n- delete_ssh_key\n- get_ssh_key_events\n\n### Events\n\n- event_get_all\n\n### Object storage\n\n- get_buckets\n- get_access_keys\n- get_access_key\n- create_access_key\n- delete_access_key\n\n### Certificates\n\n- get_certificates()\n- create_certificate()\n- get_certificate()\n- delete_certificate()\n\n### Usages\n\n- project_level_usage_get()\n- project_level_server_usage_get()\n- project_level_distributed_storage_usage_get()\n- project_level_rocket_storage_usage_get()\n- project_level_storage_backup_usage_get()\n- project_level_snapshot_usage_get()\n- project_level_template_usage_get()\n- project_level_isoimage_usage_get()\n- project_level_ip_usage_get()\n- project_level_loadbalancer_usage_get()\n- project_level_paas_service_usage_get()\n- contract_level_usage_get()\n- contract_level_server_usage_get()\n- contract_level_distributed_storage_usage_get()\n- contract_level_rocket_storage_usage_get()\n- contract_level_storage_backup_usage_get()\n- contract_level_snapshot_usage_get()\n- contract_level_template_usage_get()\n- contract_level_isoimage_usage_get()\n- contract_level_ip_usage_get()\n- contract_level_loadbalancer_usage_get()\n- contract_level_paas_service_usage_get()\n\n## Development\n\nCreate a virtual environment with all necessary dependencies and run the tests as follows:\n\n```shell\n$ python -m venv .venv\n$ source .venv/bin/activate\n$ python -m pip install -r dev-requirements.txt\n$ pytest\n```\n\nHave fun!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridscale%2Fgridscale_api_client_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgridscale%2Fgridscale_api_client_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgridscale%2Fgridscale_api_client_python/lists"}