vzaar_api 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +4 -0
- data/.tool-versions +1 -0
- data/.travis.yml +3 -0
- data/Changelog +50 -0
- data/Gemfile +3 -0
- data/Guardfile +25 -0
- data/README.md +55 -0
- data/Rakefile +26 -0
- data/examples/README.md +33 -0
- data/examples/api_envs.yml.example +31 -0
- data/examples/category/create_update_delete_spec.rb +100 -0
- data/examples/category/list_spec.rb +38 -0
- data/examples/category/list_subtree_spec.rb +40 -0
- data/examples/category/lookup_spec.rb +35 -0
- data/examples/encoding_preset/list_spec.rb +38 -0
- data/examples/encoding_preset/lookup_spec.rb +35 -0
- data/examples/ingest_recipe/create_update_delete_spec.rb +70 -0
- data/examples/ingest_recipe/list_spec.rb +38 -0
- data/examples/ingest_recipe/lookup_spec.rb +35 -0
- data/examples/playlist/create_update_delete_spec.rb +97 -0
- data/examples/playlist/list_spec.rb +37 -0
- data/examples/playlist/lookup_spec.rb +34 -0
- data/examples/rate_limit_spec.rb +18 -0
- data/examples/spec_helper.rb +17 -0
- data/examples/support/helpers.rb +16 -0
- data/examples/support/videos/medium.mp4 +0 -0
- data/examples/support/videos/small.mp4 +0 -0
- data/examples/video/create_update_delete_spec.rb +73 -0
- data/lib/vzaar_api/abstract.rb +9 -0
- data/lib/vzaar_api/category.rb +39 -0
- data/lib/vzaar_api/encoding_preset.rb +19 -0
- data/lib/vzaar_api/ingest_recipe.rb +35 -0
- data/lib/vzaar_api/legacy_rendition.rb +11 -0
- data/lib/vzaar_api/lib/active_object.rb +92 -0
- data/lib/vzaar_api/lib/api.rb +54 -0
- data/lib/vzaar_api/lib/api_response.rb +61 -0
- data/lib/vzaar_api/lib/has_attributes.rb +49 -0
- data/lib/vzaar_api/lib/has_collection_builder.rb +17 -0
- data/lib/vzaar_api/lib/has_resource_url.rb +24 -0
- data/lib/vzaar_api/lib/paged_resource.rb +80 -0
- data/lib/vzaar_api/lib/will_paginate.rb +22 -0
- data/lib/vzaar_api/link_upload.rb +14 -0
- data/lib/vzaar_api/playlist.rb +29 -0
- data/lib/vzaar_api/rendition.rb +16 -0
- data/lib/vzaar_api/signature/abstract.rb +40 -0
- data/lib/vzaar_api/signature/factory.rb +39 -0
- data/lib/vzaar_api/signature/multipart.rb +23 -0
- data/lib/vzaar_api/signature/single.rb +17 -0
- data/lib/vzaar_api/strategy/video/create.rb +46 -0
- data/lib/vzaar_api/upload/s3.rb +90 -0
- data/lib/vzaar_api/upload/virtual_file.rb +14 -0
- data/lib/vzaar_api/version.rb +4 -0
- data/lib/vzaar_api/video.rb +38 -0
- data/lib/vzaar_api.rb +60 -0
- data/spec/fixtures/vcr_cassettes/categories/each_item.yml +363 -0
- data/spec/fixtures/vcr_cassettes/categories/find.yml +61 -0
- data/spec/fixtures/vcr_cassettes/categories/find_404.yml +49 -0
- data/spec/fixtures/vcr_cassettes/categories/paginate_first.yml +61 -0
- data/spec/fixtures/vcr_cassettes/categories/paginate_last.yml +119 -0
- data/spec/fixtures/vcr_cassettes/categories/paginate_next.yml +120 -0
- data/spec/fixtures/vcr_cassettes/categories/paginate_previous.yml +120 -0
- data/spec/fixtures/vcr_cassettes/categories/subtree.yml +127 -0
- data/spec/fixtures/vcr_cassettes/categories/subtree_paginate_first.yml +123 -0
- data/spec/fixtures/vcr_cassettes/categories/subtree_paginate_last.yml +185 -0
- data/spec/fixtures/vcr_cassettes/categories/subtree_paginate_next.yml +184 -0
- data/spec/fixtures/vcr_cassettes/categories/subtree_paginate_previous.yml +184 -0
- data/spec/fixtures/vcr_cassettes/encoding_presets/each_item.yml +299 -0
- data/spec/fixtures/vcr_cassettes/encoding_presets/find.yml +62 -0
- data/spec/fixtures/vcr_cassettes/encoding_presets/find_404.yml +51 -0
- data/spec/fixtures/vcr_cassettes/encoding_presets/paginate_first.yml +62 -0
- data/spec/fixtures/vcr_cassettes/encoding_presets/paginate_last.yml +121 -0
- data/spec/fixtures/vcr_cassettes/encoding_presets/paginate_next.yml +121 -0
- data/spec/fixtures/vcr_cassettes/encoding_presets/paginate_previous.yml +121 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/create_200.yml +63 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/create_422.yml +52 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/delete_204.yml +166 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/delete_422.yml +112 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/each_item.yml +182 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/find.yml +62 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/find_404.yml +51 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/paginate_first.yml +62 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/paginate_last.yml +122 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/paginate_next.yml +121 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/paginate_previous.yml +122 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/update_200.yml +242 -0
- data/spec/fixtures/vcr_cassettes/ingest_recipes/update_422.yml +113 -0
- data/spec/fixtures/vcr_cassettes/playlists/each_item.yml +607 -0
- data/spec/fixtures/vcr_cassettes/playlists/find.yml +66 -0
- data/spec/fixtures/vcr_cassettes/playlists/find_404.yml +51 -0
- data/spec/fixtures/vcr_cassettes/playlists/paginate_first.yml +74 -0
- data/spec/fixtures/vcr_cassettes/playlists/paginate_last.yml +146 -0
- data/spec/fixtures/vcr_cassettes/playlists/paginate_next.yml +145 -0
- data/spec/fixtures/vcr_cassettes/playlists/paginate_previous.yml +145 -0
- data/spec/fixtures/vcr_cassettes/signature/multipart_201.yml +62 -0
- data/spec/fixtures/vcr_cassettes/signature/multipart_422.yml +52 -0
- data/spec/fixtures/vcr_cassettes/signature/single_201.yml +62 -0
- data/spec/fixtures/vcr_cassettes/signature/single_422.yml +51 -0
- data/spec/fixtures/vcr_cassettes/upload/multipart_201.yml +279868 -0
- data/spec/fixtures/vcr_cassettes/upload/multipart_403.yml +116578 -0
- data/spec/fixtures/vcr_cassettes/upload/single_201.yml +23388 -0
- data/spec/fixtures/vcr_cassettes/upload/single_403.yml +23374 -0
- data/spec/fixtures/vcr_cassettes/videos/create/error.yml +51 -0
- data/spec/fixtures/vcr_cassettes/videos/create/guid_201.yml +65 -0
- data/spec/fixtures/vcr_cassettes/videos/create/guid_error.yml +52 -0
- data/spec/fixtures/vcr_cassettes/videos/create/link_201.yml +65 -0
- data/spec/fixtures/vcr_cassettes/videos/create/link_error.yml +51 -0
- data/spec/fixtures/vcr_cassettes/videos/create/path_201.yml +23509 -0
- data/spec/fixtures/vcr_cassettes/videos/delete_204.yml +168 -0
- data/spec/fixtures/vcr_cassettes/videos/find.yml +66 -0
- data/spec/fixtures/vcr_cassettes/videos/find_404.yml +51 -0
- data/spec/fixtures/vcr_cassettes/videos/paginate_first.yml +71 -0
- data/spec/fixtures/vcr_cassettes/videos/paginate_last.yml +137 -0
- data/spec/fixtures/vcr_cassettes/videos/paginate_next.yml +139 -0
- data/spec/fixtures/vcr_cassettes/videos/paginate_previous.yml +139 -0
- data/spec/spec_helper.rb +103 -0
- data/spec/support/files/video-1.0MB.mp4 +0 -0
- data/spec/support/files/video-12.0MB.mp4 +0 -0
- data/spec/support/files/video-4.9MB.mp4 +0 -0
- data/spec/support/files/video-5.0MB.mp4 +0 -0
- data/spec/support/helpers.rb +16 -0
- data/spec/vzaar_api/category_spec.rb +141 -0
- data/spec/vzaar_api/encoding_preset_spec.rb +92 -0
- data/spec/vzaar_api/ingest_recipe_spec.rb +197 -0
- data/spec/vzaar_api/lib/api_spec.rb +28 -0
- data/spec/vzaar_api/playlist_spec.rb +97 -0
- data/spec/vzaar_api/rendition_spec.rb +55 -0
- data/spec/vzaar_api/signature/factory_spec.rb +68 -0
- data/spec/vzaar_api/signature/multipart_spec.rb +81 -0
- data/spec/vzaar_api/signature/single_spec.rb +72 -0
- data/spec/vzaar_api/upload/s3_spec.rb +112 -0
- data/spec/vzaar_api/video_spec.rb +248 -0
- data/spec/vzaar_api/vzaar_api_spec.rb +18 -0
- data/spec/vzaar_api_helper.rb +19 -0
- data/vzaar.png +0 -0
- data/vzaar_api.gemspec +35 -0
- metadata +413 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://app.vzaar.localhost/api/v2/signature/multipart
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"filename":"video.mp4","filesize":25165824,"uploader":"Ruby-2.0.0-alpha"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.2.4, ruby 2.3.1 (2016-04-26))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Thu, 03 Nov 2016 17:12:08 GMT
|
16
|
+
X-Auth-Token:
|
17
|
+
- TUGXzNL17ypaougMYpR3
|
18
|
+
X-Client-Id:
|
19
|
+
- lair-tend72
|
20
|
+
Content-Type:
|
21
|
+
- application/json
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 201
|
25
|
+
message: Created
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- nginx/1.10.1
|
29
|
+
Date:
|
30
|
+
- Thu, 03 Nov 2016 17:12:10 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json
|
33
|
+
Content-Length:
|
34
|
+
- '1018'
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
X-RateLimit-Limit:
|
38
|
+
- '200'
|
39
|
+
X-RateLimit-Remaining:
|
40
|
+
- '199'
|
41
|
+
X-RateLimit-Reset:
|
42
|
+
- '1478193188'
|
43
|
+
X-RateLimit-Reset-In:
|
44
|
+
- 60 seconds
|
45
|
+
Cache-Control:
|
46
|
+
- no-store, must-revalidate, private, max-age=0
|
47
|
+
X-Request-Id:
|
48
|
+
- a63fc572-b759-4a88-a6e3-6a2311612cb1
|
49
|
+
X-Runtime:
|
50
|
+
- '1.670516'
|
51
|
+
Set-Cookie:
|
52
|
+
- __profilin=p%3Dt; path=/
|
53
|
+
- __profilin=p%3Dt; path=/
|
54
|
+
- __profilin=p%3Dt; path=/
|
55
|
+
X-Miniprofiler-Ids:
|
56
|
+
- '["1yxtukjg4moaigyh1xsu","4cgrjuu9znv5flechaye","xnttqh4f6tb6mlow6fqp","51m8dv0qththvbewgq13","x64kuijqm7wvs2v4hn7w","huk6yekaaonvewr8gorm","vbeuauig2dkult7iwd88","20346z4sk0xdmgjxe013","ojqf7ud6fx3fp4ugy5qy","a3g9j8ng0wd0z95f8byp"]'
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"data":{"access_key_id":"access_key_id","key":"vzaar/t8d/ec9/source/t8dec9434bcc64622b68d1dc16f3ddffap/${filename}","acl":"private","policy":"policy","signature":"signature","success_action_status":"201","content_type":"binary/octet-stream","guid":"guid","bucket":"vzaar-upload-development","upload_hostname":"https://vzaar-upload-development.s3.amazonaws.com","part_size":"5MB","part_size_in_bytes":5242880,"parts":5}}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 03 Nov 2016 17:12:10 GMT
|
62
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://app.vzaar.localhost/api/v2/signature/multipart
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"filename":"video.mp4","filesize":null,"uploader":"Ruby-2.0.0-alpha"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.2.4, ruby 2.3.1 (2016-04-26))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Thu, 03 Nov 2016 17:25:50 GMT
|
16
|
+
X-Auth-Token:
|
17
|
+
- TUGXzNL17ypaougMYpR3
|
18
|
+
X-Client-Id:
|
19
|
+
- lair-tend72
|
20
|
+
Content-Type:
|
21
|
+
- application/json
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 422
|
25
|
+
message: Unprocessable Entity
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- nginx/1.10.1
|
29
|
+
Date:
|
30
|
+
- Thu, 03 Nov 2016 17:25:50 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json
|
33
|
+
Content-Length:
|
34
|
+
- '93'
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
Cache-Control:
|
38
|
+
- no-cache
|
39
|
+
X-Request-Id:
|
40
|
+
- bfb53109-118e-47b8-9afd-abee3e4305f4
|
41
|
+
X-Runtime:
|
42
|
+
- '0.050045'
|
43
|
+
Set-Cookie:
|
44
|
+
- __profilin=p%3Dt; path=/
|
45
|
+
- __profilin=p%3Dt; path=/
|
46
|
+
body:
|
47
|
+
encoding: UTF-8
|
48
|
+
string: '{"errors":[{"message":"Invalid parameters","detail":"Filesize must
|
49
|
+
be between 5MB and 5TB"}]}'
|
50
|
+
http_version:
|
51
|
+
recorded_at: Thu, 03 Nov 2016 17:25:50 GMT
|
52
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://app.vzaar.localhost/api/v2/signature/single
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"filename":"video.mp4","filesize":25165824,"uploader":"Ruby-2.0.0-alpha"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.2.4, ruby 2.3.1 (2016-04-26))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Thu, 03 Nov 2016 17:41:18 GMT
|
16
|
+
X-Auth-Token:
|
17
|
+
- TUGXzNL17ypaougMYpR3
|
18
|
+
X-Client-Id:
|
19
|
+
- lair-tend72
|
20
|
+
Content-Type:
|
21
|
+
- application/json
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 201
|
25
|
+
message: Created
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- nginx/1.10.1
|
29
|
+
Date:
|
30
|
+
- Thu, 03 Nov 2016 17:41:18 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json
|
33
|
+
Content-Length:
|
34
|
+
- '961'
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
X-RateLimit-Limit:
|
38
|
+
- '200'
|
39
|
+
X-RateLimit-Remaining:
|
40
|
+
- '199'
|
41
|
+
X-RateLimit-Reset:
|
42
|
+
- '1478194938'
|
43
|
+
X-RateLimit-Reset-In:
|
44
|
+
- 60 seconds
|
45
|
+
Cache-Control:
|
46
|
+
- no-store, must-revalidate, private, max-age=0
|
47
|
+
X-Request-Id:
|
48
|
+
- c5be2375-35ce-4834-a000-656ea69b414d
|
49
|
+
X-Runtime:
|
50
|
+
- '0.060239'
|
51
|
+
Set-Cookie:
|
52
|
+
- __profilin=p%3Dt; path=/
|
53
|
+
- __profilin=p%3Dt; path=/
|
54
|
+
- __profilin=p%3Dt; path=/
|
55
|
+
X-Miniprofiler-Ids:
|
56
|
+
- '["t6b82brzobr1bsjkl2kr","4cgrjuu9znv5flechaye","xnttqh4f6tb6mlow6fqp","51m8dv0qththvbewgq13","x64kuijqm7wvs2v4hn7w","huk6yekaaonvewr8gorm","vbeuauig2dkult7iwd88","20346z4sk0xdmgjxe013","ojqf7ud6fx3fp4ugy5qy","a3g9j8ng0wd0z95f8byp"]'
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"data":{"access_key_id":"access_key_id","key":"vzaar/t8d/ec9/source/t8dec9434bcc64622b68d1dc16f3ddffap/${filename}","acl":"private","policy":"policy","signature":"signature","success_action_status":"201","content_type":"binary/octet-stream","guid":"guid","bucket":"vzaar-upload-development","upload_hostname":"https://vzaar-upload-development.s3.amazonaws.com"}}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 03 Nov 2016 17:41:18 GMT
|
62
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://app.vzaar.localhost/api/v2/signature/single
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"filename":"video.mp4"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.2.4, ruby 2.3.1 (2016-04-26))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Thu, 03 Nov 2016 17:43:51 GMT
|
16
|
+
X-Auth-Token:
|
17
|
+
- TUGXzNL17ypaougMYpR3
|
18
|
+
X-Client-Id:
|
19
|
+
- lair-tend72
|
20
|
+
Content-Type:
|
21
|
+
- application/json
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 422
|
25
|
+
message: Unprocessable Entity
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- nginx/1.10.1
|
29
|
+
Date:
|
30
|
+
- Thu, 03 Nov 2016 17:43:51 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json
|
33
|
+
Content-Length:
|
34
|
+
- '76'
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
Cache-Control:
|
38
|
+
- no-cache
|
39
|
+
X-Request-Id:
|
40
|
+
- d07ac4e8-0d80-47f1-b9bb-80696ddc42be
|
41
|
+
X-Runtime:
|
42
|
+
- '0.050492'
|
43
|
+
Set-Cookie:
|
44
|
+
- __profilin=p%3Dt; path=/
|
45
|
+
- __profilin=p%3Dt; path=/
|
46
|
+
body:
|
47
|
+
encoding: UTF-8
|
48
|
+
string: '{"errors":[{"message":"Invalid parameters","detail":"uploader is missing"}]}'
|
49
|
+
http_version:
|
50
|
+
recorded_at: Thu, 03 Nov 2016 17:43:51 GMT
|
51
|
+
recorded_with: VCR 3.0.3
|