You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clean-up markdown files a bit. Get section headers right, use `python`
block marker (instead of `Python`), make sure example code is formatted
uniformly, and a couple of capitalization fixes.
Copy file name to clipboardExpand all lines: README.md
+57-48Lines changed: 57 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,24 @@
1
+
# gridscale_api_client_python
2
+
1
3
This 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.
2
4
3
-
# Prerequisites
5
+
##Prerequisites
4
6
5
7
First, the Python programming language needs to be installed. This can be done by using the [official downloads](https://www.python.org/downloads/) page.
6
8
7
-
Once done, download and install via [pypi](https://pypi.org)
9
+
Once done, download and install via [PyPI](https://pypi.org)
10
+
11
+
```shell
12
+
$ pip3 install gs_api_client
13
+
```
8
14
9
-
`pip3 install gs_api_client`
15
+
## Introduction
10
16
11
-
# Introduction
12
17
First, you will need your [API credentials](https://my.gridscale.io/Easy/APIs/).
13
18
14
19
In the [examples.py](examples/examples.py) replace the `AUTH_TOKEN` & `USER_UUID` with your credentials.
15
20
16
-
# Authentication
21
+
##Authentication
17
22
18
23
These 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` & `GridscaleApiClient` respectively.
19
24
@@ -22,72 +27,76 @@ from gs_api_client import Configuration
22
27
from gs_api_client import SyncGridscaleApiClient, GridscaleApiClient
We provide two clients `SyncGridscaleApiClient`&`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.
41
+
We 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.
37
42
38
43
The main differences are:
44
+
39
45
-`GridscaleApiClient` exposes bare gridscale API functionality, while `SyncGridscaleApiClient` adds a convenience layer on top.
40
46
-`SyncGridscaleApiClient` determines whether the request is sync or async.
41
47
- Makes asynchronous operations behave as if they were synchronous:
42
48
- The client will block until the request has finished, successful or not.
43
49
- Throws an `AsynchronousApiError` exception, in the case of failure.
44
50
- With most `PATCH` and `POST` requests, the synchronous client will return the resulting object instead of an empty body or just the reference.
45
51
46
-
# Debugging
52
+
##Debugging
47
53
48
54
Adding this line below, will output further information for debugging
49
55
50
-
```Python
51
-
api_config.debug =True
56
+
```python
57
+
config.debug =True
52
58
```
53
59
54
-
# Access response header
60
+
##Access response header
55
61
56
62
Adding `http_info=True` when instantiating the client, return value will be a tuple of response, response code and response headers (dict).
Inside 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)
85
94
86
-
## Requests
95
+
###Requests
87
96
88
97
- get_request
89
98
90
-
## Locations
99
+
###Locations
91
100
92
101
- get_locations
93
102
- get_location
@@ -99,7 +108,7 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
99
108
- get_location_storages
100
109
- get_location_templates
101
110
102
-
## Servers
111
+
###Servers
103
112
104
113
- get_servers
105
114
- get_server
@@ -113,7 +122,7 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
113
122
- update_server_power
114
123
- server_power_shutdown
115
124
116
-
### Server Relations
125
+
### Server relations
117
126
118
127
- get_server_linked_ip
119
128
- get_server_linked_ips
@@ -135,7 +144,7 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
135
144
- unlink_network_from_server
136
145
- unlink_storage_from_server
137
146
138
-
## Storages
147
+
###Storages
139
148
140
149
- get_storages
141
150
- get_storage
@@ -172,7 +181,7 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
172
181
- get_template_events
173
182
- get_deleted_templates
174
183
175
-
### Marketplace Templates
184
+
### Marketplace templates
176
185
177
186
- get_marketplace_templates
178
187
- get_marketplace_template
@@ -181,7 +190,7 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
181
190
- delete_marketplace_template
182
191
- get_marketplace_template_events
183
192
184
-
## Networks
193
+
###Networks
185
194
186
195
- get_network
187
196
- get_networks
@@ -191,7 +200,7 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
191
200
- get_network_events
192
201
- get_deleted_networks
193
202
194
-
##IPs
203
+
### IP addresses
195
204
196
205
- get_ips
197
206
- get_ip
@@ -201,7 +210,7 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
201
210
- get_ip_events
202
211
- get_deleted_ips
203
212
204
-
## Load Balancers
213
+
###Load balancers
205
214
206
215
- get_loadbalancers
207
216
- get_loadbalancer
@@ -211,7 +220,7 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
211
220
- get_loadbalancer_events
212
221
- get_deleted_loadbalancers
213
222
214
-
## PaaS
223
+
###PaaS
215
224
216
225
- get_paas_services
217
226
- get_paas_service
@@ -228,7 +237,7 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
228
237
- get_paas_service_templates
229
238
- get_deleted_paas_services
230
239
231
-
## Firewalls
240
+
###Firewalls
232
241
233
242
- get_firewalls
234
243
- get_firewall
@@ -237,7 +246,7 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
237
246
- delete_firewall
238
247
- get_firewall_events
239
248
240
-
##Iso Images
249
+
### ISO images
241
250
242
251
- get_isoimages
243
252
- get_isoimage
@@ -247,12 +256,12 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
247
256
- get_isoimage_events
248
257
- get_deleted_isoimages
249
258
250
-
## Labels
259
+
###Labels
251
260
252
261
- get_labels
253
262
- get_label
254
263
255
-
## SSH Keys
264
+
###SSH keys
256
265
257
266
- get_ssh_keys
258
267
- get_ssh_key
@@ -261,11 +270,11 @@ Inside the [examples.py](examples/examples.py) file, you can see some example re
0 commit comments