Skip to content

Commit cd54808

Browse files
Apply suggestions from code review
1 parent d58528f commit cd54808

File tree

2 files changed

+61
-66
lines changed

2 files changed

+61
-66
lines changed

Bruno Collection - CDS Videos Publish Video.json

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"name": "Optional Change access of the video",
88
"seq": 8,
99
"request": {
10-
"url": "{{baseURl}}/api/deposits/video/{{video_id}}",
10+
"url": "{{baseURL}}/api/deposits/video/{{video_id}}",
1111
"method": "PUT",
1212
"headers": [
1313
{
@@ -19,7 +19,7 @@
1919
"params": [],
2020
"body": {
2121
"mode": "json",
22-
"json": "{\n \"_access\": {\n \"update\": [\n \"[email protected]\",\n \"atlas-outreach-cds-video@cern.ch\" //Update the access according to category\n ],\n // If you want to restrict the video, update access read\n \"read\": [\n \"atlas-readaccess-active-members@cern.ch\"\n ]\n\n }\n}\n\n",
22+
"json": "{\n \"_access\": {\n \"update\": [\n \"[email protected]\",\n \"your-egroup@cern.ch\" //Update the access according to category\n ],\n // If you want to restrict the video, update access read\n \"read\": [\n \"your-egroup@cern.ch\"\n ]\n\n }\n}\n\n",
2323
"formUrlEncoded": [],
2424
"multipartForm": []
2525
},
@@ -37,7 +37,7 @@
3737
"name": "Get project to check the flow is finished",
3838
"seq": 5,
3939
"request": {
40-
"url": "{{baseURl}}/api/deposits/project/{{project_id}}",
40+
"url": "{{baseURL}}/api/deposits/project/{{project_id}}",
4141
"method": "GET",
4242
"headers": [
4343
{
@@ -67,7 +67,7 @@
6767
"name": "Step 1- Create a project",
6868
"seq": 1,
6969
"request": {
70-
"url": "{{baseURl}}/api/deposits/project/",
70+
"url": "{{baseURL}}/api/deposits/project/",
7171
"method": "POST",
7272
"headers": [
7373
{
@@ -79,7 +79,7 @@
7979
"params": [],
8080
"body": {
8181
"mode": "json",
82-
"json": "{\n \"$schema\": \"https://localhost:5000/schemas/deposits/records/videos/project/project-v1.0.0.json\",\n \"_access\": {\n \"update\": [\n \"[email protected]\",\n \"atlas-outreach-cds-video@cern.ch\"\n ],\n \"read\": [ // If you want to restrict the project, add access read\n \"atlas-readaccess-active-members@cern.ch\"\n ]\n },\n // Add category and type\n \"category\": \"ATLAS\",\n \"type\": \"VIDEO\"\n}",
82+
"json": "{\n \"$schema\": \"https://localhost:5000/schemas/deposits/records/videos/project/project-v1.0.0.json\",\n \"_access\": {\n \"update\": [\n \"[email protected]\",\n \"your-egroup@cern.ch\"\n ],\n \"read\": [ // If you want to restrict the project, add access read\n \"your-egroup@cern.ch\"\n ]\n },\n // Add category and type\n \"category\": \"ATLAS\",\n \"type\": \"VIDEO\"\n}",
8383
"formUrlEncoded": [],
8484
"multipartForm": []
8585
},
@@ -99,7 +99,7 @@
9999
"name": "Step 2- Create a video",
100100
"seq": 2,
101101
"request": {
102-
"url": "{{baseURl}}/api/deposits/video/",
102+
"url": "{{baseURL}}/api/deposits/video/",
103103
"method": "POST",
104104
"headers": [
105105
{
@@ -111,7 +111,7 @@
111111
"params": [],
112112
"body": {
113113
"mode": "json",
114-
"json": "{\n \"$schema\":\"https://localhost:5000/schemas/deposits/records/videos/video/video-v1.0.0.json\",\n \"_project_id\":\"{{project_id}}\",\n \"title\":\n {\n \"title\":\"217490_medium\"\n },\n\n \"vr\": false,\n \"featured\": false,\n \"language\": \"en\",\n \"contributors\": [\n {\n \"name\": \"Civelek, Zubeyde\",\n \"ids\": [\n {\n \"value\": \"868056\",\n \"source\": \"cern\"\n }\n ],\n \"email\": \"zubeyde.civelek@cern.ch\",\n \"role\": \"Co-Producer\"\n }\n ],\n \"description\": \"Description\",\n \"date\": \"2024-11-12\"\n}",
114+
"json": "{\n \"$schema\":\"https://localhost:5000/schemas/deposits/records/videos/video/video-v1.0.0.json\",\n \"_project_id\":\"{{project_id}}\",\n \"title\":\n {\n \"title\":\"217490_medium\"\n },\n\n \"vr\": false,\n \"featured\": false,\n \"language\": \"en\",\n \"contributors\": [\n {\n \"name\": \"Surname, Name\",\n \"ids\": [\n {\n \"value\": \"868056\",\n \"source\": \"cern\"\n }\n ],\n \"email\": \"test@cern.ch\",\n \"role\": \"Co-Producer\"\n }\n ],\n \"description\": \"Description\",\n \"date\": \"2024-11-12\"\n}",
115115
"formUrlEncoded": [],
116116
"multipartForm": []
117117
},
@@ -131,7 +131,7 @@
131131
"name": "Step 3- Upload the video",
132132
"seq": 3,
133133
"request": {
134-
"url": "{{baseURl}}/api/files/{{bucket_id}}/{{video_name}}",
134+
"url": "{{baseURL}}/api/files/{{bucket_id}}/{{video_name}}",
135135
"method": "PUT",
136136
"headers": [
137137
{
@@ -151,20 +151,6 @@
151151
}
152152
],
153153
"params": [],
154-
"body": {
155-
"mode": "formUrlEncoded",
156-
"formUrlEncoded": [],
157-
"multipartForm": [
158-
{
159-
"type": "file",
160-
"name": "",
161-
"value": [
162-
"/Users/zubeydecivelek/Downloads/217490_medium.mp4"
163-
],
164-
"enabled": true
165-
}
166-
]
167-
},
168154
"script": {
169155
"req": "const fs = require('fs');\nconst path = require('path');\n\n// File details\nconst filename = \"CHANGE HERE\";\nconst filePath = \"CHANGE HERE\";\nbru.setEnvVar(\"video_name\",filename);\n\n// Read the file as raw binary data\nconst fileContent = fs.readFileSync(filePath);\n\n// Set request headers\nreq.setHeader(\"Content-Type\", \"video/mp4\"); // File content type\nreq.setHeader(\"Accept\", \"application/json, text/plain, */*\"); \nreq.setHeader(\"Accept-Encoding\", \"gzip, deflate, br, zstd\"); \nreq.setHeader(\"Content-Length\", fileContent.length);\n\n// Attach the file content as the request body\nreq.setBody(fileContent);\n",
170156
"res": "let data = res.body ;\nbru.setEnvVar(\"main_file_version_id\", data.version_id);\nbru.setEnvVar(\"video_key\", data.key);"
@@ -182,7 +168,7 @@
182168
"name": "Step 4- Create a flow",
183169
"seq": 4,
184170
"request": {
185-
"url": "{{baseURl}}/api/flows/",
171+
"url": "{{baseURL}}/api/flows/",
186172
"method": "POST",
187173
"headers": [
188174
{
@@ -212,7 +198,7 @@
212198
"name": "Step 5- Upload additional file",
213199
"seq": 6,
214200
"request": {
215-
"url": "{{baseURl}}/api/files/{{bucket_id}}/{{additional_file}}",
201+
"url": "{{baseURL}}/api/files/{{bucket_id}}/{{additional_file}}",
216202
"method": "PUT",
217203
"headers": [],
218204
"params": [],
@@ -238,7 +224,7 @@
238224
"name": "Step 6- Publish",
239225
"seq": 7,
240226
"request": {
241-
"url": "{{baseURl}}/api/deposits/video/{{video_id}}/actions/publish",
227+
"url": "{{baseURL}}/api/deposits/video/{{video_id}}/actions/publish",
242228
"method": "POST",
243229
"headers": [
244230
{
@@ -269,7 +255,7 @@
269255
{
270256
"variables": [
271257
{
272-
"name": "baseURl",
258+
"name": "baseURL",
273259
"value": "https://localhost:5000/",
274260
"enabled": true,
275261
"secret": false,

README.rst

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Table of Contents
2626
- `Step 3: Upload the Video <#step-3-upload-the-video>`_
2727
- `Step 4: Create a Flow <#step-4-create-a-flow>`_
2828
- `Step 5: (Optional) Upload Additional File <#step-5-optional-upload-additional-file>`_
29-
- `Step 6: Publish Video <#step-6-publish-video>`_
3029
- `Optional: Update the Access of the Video <#optional-update-the-access-of-the-video>`_
31-
- `Optional: Get Project Status <#optional-get-project-status>`_
30+
- `Step 6: Get Project to Check the Flow Status <#step-6-get-project-to-check-the-flow-status>`_
31+
- `Step 7: Publish Video <#step-7-publish-video>`_
3232
- `License <#license>`_
3333

3434

@@ -186,7 +186,7 @@ Generate a Personal Access Token
186186
---------------------------------
187187

188188
- Navigate to the ``CDS Videos`` platform.
189-
- Click your user info in the top-right corner.
189+
- Click on your user info in the top-right corner.
190190
- Go to **Applications** and create a new **Personal Access Token**.
191191
- Copy the token and store it securely.
192192

@@ -286,10 +286,10 @@ To restrict the project, add ``_access/read``:
286286
"_access": {
287287
"update": [
288288
289-
"atlas-outreach-cds-video@cern.ch"
289+
"your-egroup@cern.ch"
290290
],
291291
"read": [
292-
"atlas-readaccess-active-members@cern.ch"
292+
"your-egroup@cern.ch"
293293
]
294294
},
295295
"category": "ATLAS",
@@ -377,7 +377,7 @@ Step 2: Create a Video
377377
* - **vr**
378378
- boolean
379379
- body
380-
-
380+
- Indicates if the video is 360.
381381
- Optional
382382
* - **contributors**
383383
- array<object>
@@ -402,7 +402,7 @@ Step 2: Create a Video
402402
* - **featured**
403403
- boolean
404404
- body
405-
- Whether the video is featured.
405+
- Whether the video is featured. (Available to members of `these e-groups <./cds/config.py#L1277>`_)
406406
- Optional
407407
* - **keywords**
408408
- list<json>
@@ -428,6 +428,11 @@ To restrict the video, add ``_access/read``. The ``_access/update`` will be the
428428
{
429429
"title":"217490_medium"
430430
},
431+
"_access": {
432+
"read": [
433+
434+
]
435+
},
431436
"vr": false,
432437
"featured": false,
433438
"language": "en",
@@ -600,35 +605,6 @@ Step 5: (Optional) Upload Additional File
600605

601606
Uploaded additional file JSON.
602607

603-
Step 6: Publish Video
604-
----------------------
605-
606-
**Request:**
607-
608-
``POST`` ``{{baseURL}}/api/deposits/video/{{video_id}}/actions/publish``
609-
610-
**Headers:**
611-
612-
- ``content-type: application/json``
613-
614-
**Parameters:**
615-
616-
.. list-table::
617-
:header-rows: 1
618-
619-
* - **Name**
620-
- **Type**
621-
- **Location**
622-
- **Description**
623-
* - **video_id**
624-
- string
625-
- path
626-
- ID of the video to publish.
627-
628-
629-
**Response:**
630-
631-
Published video deposit JSON.
632608

633609
Optional: Update the Access of the Video
634610
----------------------------------------
@@ -665,10 +641,10 @@ To restrict the video, add ``_access/read``. If you want to change the access/up
665641
"_access": {
666642
"update": [
667643
668-
"atlas-outreach-cds-video@cern.ch"
644+
"your-egroup@cern.ch"
669645
],
670646
"read": [
671-
"atlas-readaccess-active-members@cern.ch"
647+
"your-egroup@cern.ch"
672648
]
673649
}
674650
}
@@ -678,8 +654,8 @@ To restrict the video, add ``_access/read``. If you want to change the access/up
678654
Updated video JSON.
679655

680656

681-
Optional: Get Project Status
682-
---------------------------
657+
Step 6: Get Project to Check the Flow Status
658+
--------------------------------------------
683659

684660
**Request:**
685661

@@ -721,6 +697,39 @@ Updated project JSON with flow status as ``state``:
721697
}
722698
723699
700+
Step 7: Publish Video
701+
----------------------
702+
703+
Before publishing the video, ensure that the workflow is complete.
704+
705+
**Request:**
706+
707+
``POST`` ``{{baseURL}}/api/deposits/video/{{video_id}}/actions/publish``
708+
709+
**Headers:**
710+
711+
- ``content-type: application/json``
712+
713+
**Parameters:**
714+
715+
.. list-table::
716+
:header-rows: 1
717+
718+
* - **Name**
719+
- **Type**
720+
- **Location**
721+
- **Description**
722+
* - **video_id**
723+
- string
724+
- path
725+
- ID of the video to publish.
726+
727+
728+
**Response:**
729+
730+
Published video deposit JSON.
731+
732+
724733
License
725734
=======
726735

0 commit comments

Comments
 (0)