Skip to content

Commit bf9de39

Browse files
author
Elias Nygren
committed
Update README.md with 0.3.0 specific information
1 parent 235d35a commit bf9de39

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

README.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# UpCloud-python-api
2-
Python client for [UpCloud's API](https://www.upcloud.com/documentation/api/).
1+
# UpCloud's Python API Client
2+
OOP-based api client for [UpCloud's API](https://www.upcloud.com/documentation/api/). Features most of the API's functionality and some convenience functions that combine several API endpoints and logic.
33

4-
NOTE: This Python client is still work-in-progress and is not considered production ready.
4+
NOTE: This Python client is still evolving. Please test all of your use cases thoroughly before actual production use. Using a separate UpCloud account for testing / developing the client is recommended.
55

66
## Installation
77

88
```
9-
pip install --pre upcloud-api-python
9+
pip install --pre upcloud-api
1010
1111
# with older pip:
12-
pip install upcloud-api-python
12+
pip install upcloud-api
1313
```
1414

1515
Alternatively, clone the project and run
1616
```
1717
python setup.py install
1818
```
1919

20-
**Supported versions** (offline tests pass with tox):
20+
**Supported versions as of 0.3.0** (offline tests pass with tox):
2121

2222
* python 2.6
2323
* python 2.7
@@ -112,6 +112,11 @@ for server in cluster:
112112

113113
```
114114

115+
New in 0.3.0: servers can now be defined as dicts without using Server or Storage classes.
116+
The syntax/attributes are exactly like above and under the hood they are converted to Server and Storage classes.
117+
This feature is mainly for easier usage of the module from Ansible, but may provide useful elsewhere.
118+
119+
115120
### Stop / Start / Destroy Servers
116121
```python
117122

@@ -126,6 +131,18 @@ for server in cluster:
126131

127132
```
128133

134+
New in 0.3.0: as the success of server.start() or server.destroy() and storage.destroy()
135+
depend on the Server's `state`, new helpers have been added. The helpers may be called regardless of
136+
the server's current state.
137+
138+
```python
139+
# makes sure that the server is stopped (blocking wait) and then destroys the server and its storages
140+
server.stop_and_destroy()
141+
142+
# makes sure that the server is started (blocking wait)
143+
server.ensure_started()
144+
```
145+
129146
### Upgrade a Server
130147
```python
131148

@@ -138,6 +155,20 @@ server.start()
138155

139156
```
140157

158+
### Easy access to servers and their information:
159+
160+
New in 0.3.0.
161+
162+
```python
163+
164+
# returns a public IPv4 (preferred) IPv6 (no public IPv4 was attached) address
165+
server.get_public_ip()
166+
167+
# returns a JSON serializable dict with the server's information (storages and ip-addresses included)
168+
server.to_dict()
169+
170+
```
171+
141172
### GET resources:
142173
```python
143174

0 commit comments

Comments
 (0)