teamdrive_api 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +6 -0
- data/README.md +5 -1
- data/lib/teamdrive_api.rb +1 -0
- data/lib/teamdrive_api/host.rb +25 -0
- data/lib/teamdrive_api/register.rb +11 -0
- data/lib/teamdrive_api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmExODczMzRhYzlhZmVkNGUzZjU5NzY3MjU2NjBmMTk2NjIyMGIzNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDBiMzlhZTEyYTdjY2UyNDNiNDQyNmMwYTNjYmQyZTEwZmFhOTU3Yw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTk5ZWJlOWQwNjk5MGIwM2Q2YjliOWM4MzRiYTg0NDI4NzM1YmRmZjczOGM3
|
10
|
+
ZGEyNmZkZTYyZGUwN2MxOTczMjQxYTcxYmE1YTAxNTcyYjEzYmJlMGY2ZTRm
|
11
|
+
NjIzMGEwZDQ1ZmQ3NWQ1NDIxMWU1NGQ3ZGZmMDBlMmVjZWZiMzE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDg2OTFjNDVlZWVkM2JkZGYzNDZkMWM4YmFiMWI3MDk3NWIzYjMyNDlmMmY1
|
14
|
+
OTI0MDJmNTJkYmYxYWQ4NmQ2MGMwZmY3NzYxOGUzN2YzZTAzMDRjNGM5ODVj
|
15
|
+
ZDdjZWU2NzdjZDhjOWNjM2Q4ZTgzZjBkMmQxZTBkMzRhZmM2OTE=
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
**0.5.0** (2015-11-23)
|
2
|
+
|
3
|
+
* added module for the Host Server API!
|
4
|
+
* added `Host: set depot limits (setdepot)`
|
5
|
+
* added `Register: Get default depot URL by username (getdefaultdepotdata)`
|
6
|
+
|
1
7
|
**0.4.0** (2015-11-09)
|
2
8
|
|
3
9
|
* **BREAKING** You now have to provide the complete URI to the TD-API, not only the host name!
|
data/README.md
CHANGED
@@ -30,10 +30,14 @@ Or install it yourself as:
|
|
30
30
|
|
31
31
|
## Usage
|
32
32
|
|
33
|
-
**Note about the URI:** For Pre-3.5-Versions of TeamDrive, this is usually `https://server/pbas/td2api/api/api.htm
|
33
|
+
**Note about the URI:** For Pre-3.5-Versions of TeamDrive, this is usually `https://server/pbas/td2api/api/api.htm` for the Reg Server API and `https://server/pbas/p1_as/api/api.htm` for the Host Server API. From 3.5 onward, it is usually `https://server/yvva/td2api/api/api.htm` for the Reg Server API and `https://server/yvva/api/api.htm` for the Host Server API.
|
34
34
|
|
35
35
|
```ruby
|
36
36
|
api = TeamdriveApi::Register.new('example.com/yvva/api/api.htm', 'd3b07384d113edec49eaa6238ad5ff00', '1.0.005')
|
37
|
+
# Parameters for TeamdriveApi::Register.new and TeamdriveApi::Host.new:
|
38
|
+
# - URI (will use https if no schema is provided)
|
39
|
+
# - api_checksum_salt (from your Register/Host server)
|
40
|
+
# - api_version (has no effect but is included in requests to the servers)
|
37
41
|
|
38
42
|
api.remove_user 'foobar'
|
39
43
|
#=> true
|
data/lib/teamdrive_api.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
module TeamdriveApi
|
2
|
+
# API Client for the TeamDrive Host Server. See the TeamDrive Host
|
3
|
+
# docs for more informations on specific commands.
|
4
|
+
class Host < Base
|
5
|
+
# Set Depot Limits (added in 3.0.003)
|
6
|
+
#
|
7
|
+
# The values of +<disclimit>+ and +<trafficlimit>+ is in Bytes:
|
8
|
+
# +1 KB = 1024 Bytes+.
|
9
|
+
#
|
10
|
+
# @param [String] username
|
11
|
+
# @param [#to_s] depot_id
|
12
|
+
# @param [Hash] args
|
13
|
+
# @return [Boolean] success?
|
14
|
+
def set_depot(username, depot_id, args)
|
15
|
+
require_all of: [:disclimit], in_hash: args
|
16
|
+
args = args.merge(
|
17
|
+
username: username,
|
18
|
+
depotid: depot_id
|
19
|
+
)
|
20
|
+
|
21
|
+
res = send_request :setdepot, args
|
22
|
+
res[:intresult].eql?('0')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -126,6 +126,17 @@ module TeamdriveApi
|
|
126
126
|
distributor: distributor
|
127
127
|
end
|
128
128
|
|
129
|
+
# Get Default depot data
|
130
|
+
#
|
131
|
+
# @param [String] username
|
132
|
+
# @param [String] distributor (optional)
|
133
|
+
# @return [Hash] the default depot data
|
134
|
+
def get_default_depot_data(username, distributor = nil)
|
135
|
+
send_request :getdefaultdepotdata,
|
136
|
+
username: username,
|
137
|
+
distributor: distributor
|
138
|
+
end
|
139
|
+
|
129
140
|
# Create a new Account
|
130
141
|
#
|
131
142
|
# @note The range of possible Usernames depend on the +RegNameComplexity+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamdrive_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Hutter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- lib/teamdrive_api/core_ext/array.rb
|
138
138
|
- lib/teamdrive_api/core_ext/hash.rb
|
139
139
|
- lib/teamdrive_api/error.rb
|
140
|
+
- lib/teamdrive_api/host.rb
|
140
141
|
- lib/teamdrive_api/register.rb
|
141
142
|
- lib/teamdrive_api/version.rb
|
142
143
|
homepage: https://github.com/mhutter/teamdrive_api
|