Skip to content

Commit 8986902

Browse files
author
faustas@techconsult.lt
committed
Small documentation edit
1 parent d511c3d commit 8986902

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

docs/server-mixin.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ manager.method()
2020
```python
2121
def get_servers(self, populate=False):
2222
"""
23-
Returns a list of (populated or unpopulated) Server instances.
23+
Returns a list of (populated or unpopulated) Server instances.
2424
Populate = False (default) => 1 API request, returns unpopulated Server instances.
2525
Populate = True => Does 1 + n API requests (n = # of servers), returns populated Server instances.
2626
"""
@@ -36,14 +36,14 @@ def get_server(self, UUID):
3636
```python
3737
def create_server(self, server):
3838
"""
39-
Creates a server and its storages based on a (locally created) Server object.
39+
Creates a server and its storages based on a (locally created) Server object.
4040
Populates the given Server instance with the API response.
4141
4242
Example:
4343
server1 = Server( core_number = 1,
44-
memory_amount = 1024,
45-
hostname = "my.example.1",
46-
zone = ZONE.London,
44+
memory_amount = 1024,
45+
hostname = "my.example.1",
46+
zone = ZONE.London,
4747
storage_devices = [
4848
Storage(os = "Ubuntu 14.04", size=10, tier=maxiops, title='The OS drive'),
4949
Storage(size=10),
@@ -56,7 +56,7 @@ def create_server(self, server):
5656
- size defaults to 10,
5757
- title defaults to hostname + " OS disk" and hostname + " storage disk id" (id is a running starting from 1)
5858
- tier defaults to maxiops
59-
- valid operating systems are:
59+
- valid operating systems are:
6060
"CentOS 6.5", "CentOS 7.0"
6161
"Debian 7.8"
6262
"Ubuntu 12.04", "Ubuntu 14.04"
@@ -76,17 +76,25 @@ def modify_server(self, UUID, **kwargs):
7676
```python
7777
def delete_server(self, UUID):
7878
"""
79-
DELETE '/server/UUID'. Permanently destroys the virtual machine.
79+
DELETE '/server/UUID'. Permanently destroys the virtual machine.
8080
DOES NOT remove the storage disks.
8181
8282
Returns an empty object.
8383
"""
8484
```
8585

86+
```python
87+
def get_server_by_ip(self, ip_address):
88+
"""
89+
Return a (populated) Server instance by its IP.
90+
Uses GET '/ip_address/x.x.x.x' to retrieve machine UUID using IP-address.
91+
"""
92+
```
93+
8694
```python
8795
def get_server_data(self, UUID):
8896
"""
89-
Returns '/server/uuid' data in Python dict.
97+
Returns '/server/uuid' data in Python dict.
9098
Creates object representations of any IP-address and Storage.
9199
"""
92-
```
100+
```

0 commit comments

Comments
 (0)