Skip to content

Commit cb2974b

Browse files
authored
Merge pull request #3 from Spredzy/__init__
Organization: Move c14.py to __init__.py
2 parents cf3eeda + 8c4f2da commit cb2974b

File tree

3 files changed

+559
-412
lines changed

3 files changed

+559
-412
lines changed

README.rst

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,150 @@ This module is a python wrapper around the Online.net `C14`_ storage solution.
66
This module implements every publicly made available by Online.net API calls.
77

88
.. _C14: https://www.online.net/en/c14
9+
10+
11+
Usage
12+
-----
13+
14+
.. code-block::
15+
16+
from c14 import C14
17+
18+
token = 'thisismyprivatetoken'
19+
20+
c14api = C14(token)
21+
22+
# Create a safe
23+
c14api.create_safe('My Safe', 'This is the description of my safe')
24+
25+
# List all safes
26+
c14api.list_safes()
27+
28+
29+
List of available methods
30+
-------------------------
31+
32+
``def list_platforms(self)``: Get a list of links to the platforms.
33+
34+
``def get_platform(self, id)``: Get information on a platform.
35+
36+
- ``id``: ID of the platform.
37+
38+
``def list_protocols(self)`` Get a list of available file transfer protocols.
39+
40+
``def create_safe(self, name, description=None)``: Create a safe.
41+
42+
- ``name``: Name of the safe.
43+
- ``description``: Description of the safe.
44+
45+
``def get_safe(self, uuid)``: Get information on a safe.
46+
47+
- ``uuid``: Id of the safe.
48+
49+
``def update_safe(self, uuid, name=None, description=None)``: Edit a safe.
50+
51+
- ``uuid``: Id of the safe.
52+
- ``name``: Name of the safe.
53+
- ``description``: Description of the safe.
54+
55+
``def list_safes(self)``: Get a list of links to the user's safes."""
56+
57+
``def delete_safe(self, uuid)``: Delete a safe.
58+
59+
- ``uuid``: Id of the safe.
60+
61+
``def create_archive(self, safe_id, name, description, protocols, platforms, parity=None, ssh_keys=None, days=None)``: Create an archive.
62+
63+
- ``safe_id``: Id of the safe.
64+
- ``name``: Name of the archive.
65+
- ``description``: Description of the archive.
66+
- ``protocols``: File transfer protocols used.
67+
- ``platforms``: Ids of platforms where the archive will be stored.
68+
- ``parity``: Parity (standard, or enterprise; default: standard).
69+
- ``ssh_keys``: UUIDs of SSH keys.
70+
- ``days``: Number of days until the files are archived automatically (2, 5, or 7; default: 7).
71+
72+
73+
``def get_archive(self, safe_id, uuid)``: Get information on an Archive.
74+
75+
- ``safe_id``: Id of the safe.
76+
- ``uuid``: Id of the archive.
77+
78+
``def update_archive(self, uuid, name=None, description=None)``: Edit an archive.
79+
80+
- ``safe_id``: Id of the safe.
81+
- ``uuid``: Id of the archive.
82+
- ``name``: Name of the archive.
83+
- ``description``: Description of the archive.
84+
85+
``def list_archives(self, safe_id)``: Get a list of archives in the user's safe.
86+
87+
- ``safe_id``: Id of the safe.
88+
89+
``def delete_archive(self, safe_id, uuid)``: Delete an archive.
90+
91+
- ``safe_id``: Id of the safe.
92+
- ``uuid``: Id of the archive.
93+
94+
``def archive_archive(self, safe_id, uuid)``: Archive files from temporary storage.
95+
96+
- ``safe_id``: Id of the safe.
97+
- ``uuid``: Id of the archive.
98+
99+
``def archive_informations(self, safe_id, uuid)``: Get information on an archive's temporary storage.
100+
101+
- ``safe_id``: Id of the safe.
102+
- ``uuid``: Id of the archive.
103+
104+
``def archive_list_jobs(self, safe_id, uuid)``: Get list of archive jobs.
105+
106+
- ``safe_id``: Id of the safe.
107+
- ``uuid: Id`` of the archive.
108+
109+
``def archive_get_job(self, safe_id, uuid, job_id)``: Get informations of a job.
110+
111+
- ``safe_id``: Id of the safe.
112+
- ``uuid: Id`` of the archive.
113+
- ``job_id``: Id of the job.
114+
115+
``def archive_get_encryption_key(self, safe_id, uuid)``: Get an archive's encryption key.
116+
117+
- ``safe_id``: Id of the safe.
118+
- ``uuid``: Id of the archive.
119+
120+
``def archive_set_encryption_key(self, safe_id, uuid, key)``: Set an archive's encryption key.
121+
122+
- ``safe_id``: Id of the safe.
123+
- ``uuid``: Id of the archive.
124+
- ``key``: Encryption key.
125+
126+
``def archive_delete_encryption_key(self, safe_id, uuid)``: Delete an archive's encryption key.
127+
128+
- ``safe_id``: Id of the safe.
129+
- ``uuid``: Id of the archive.
130+
131+
``def archive_list_locations(self, safe_id, uuid)``: Get a list of locations on the user's archive.
132+
133+
- ``safe_id``: Id of the safe.
134+
- ``uuid``: Id of the archive.
135+
136+
``def archive_get_location(self, safe_id, uuid, location_id)``: Get information on an archive location.
137+
138+
- ``safe_id``: Id of the safe.
139+
- ``uuid``: Id of the archive.
140+
141+
``def verify_archive(self, safe_id, uuid, location_id)``: Verify the files on an archive's location.
142+
143+
- ``safe_id``: Id of the safe.
144+
- ``uuid``: Id of the archive.
145+
- ``location_id``: Id of the location.
146+
147+
``def unarchive(self, safe_id, uuid, location_id, protocols, rearchive=None, key=None, ssh_keys=None)``: Unarchive files into temporary storage.
148+
149+
- ``safe_id``: Id of the safe.
150+
- ``uuid``: Id of the archive.
151+
- ``location_id``: Id of the location.
152+
- ``protocols``: File transfer protocols used.
153+
- ``rearchive``: Rearchive the data after 7 days (default: true).
154+
- ``key``: Encryption key.
155+
- ``ssh_keys``: UUIDs of SSH keys.

0 commit comments

Comments
 (0)