Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove File Transcode endpoint #511

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ func NewCatalystAPIRouter(vodEngine *pipeline.Coordinator, apiToken string) *htt
),
)

router.POST("/api/transcode/file",
withLogging(
withAuth(
apiToken,
withCapacityChecking(
vodEngine,
catalystApiHandlers.TranscodeSegment(),
),
),
),
)

// Endpoint to receive "Triggers" (callbacks) from Mist
router.POST("/api/mist/trigger", withLogging(mistCallbackHandlers.Trigger()))

Expand Down
87 changes: 0 additions & 87 deletions handlers/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,93 +42,6 @@ func TestOKHandler(t *testing.T) {
require.Equal(rr.Body.String(), "OK")
}

func TestSegmentBodyFormat(t *testing.T) {
require := require.New(t)

badRequests := [][]byte{
// missing source_location
[]byte(`{
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"name": "t","width": 1280,"height": 720,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing callback_url
[]byte(`{
"source_location": "http://localhost/input",
"manifestID": "somestream",
"profiles": [{"name": "t","width": 1280,"height": 720,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing manifestID
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"profiles": [{"name": "t","width": 1280,"height": 720,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing profiles
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"verificationFreq": 1
}`),
// missing name
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"width": 1280,"height": 720,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing width
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"name": "t","height": 720,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing height
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"name": "t","width": 1280,"bitrate": 70000,"fps": 30}],
"verificationFreq": 1
}`),
// missing bitrate
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"name": "t","width": 1280,"height": 720,"fps": 30}],
"verificationFreq": 1
}`),
// missing verificationFreq
[]byte(`{
"source_location": "http://localhost/input",
"callback_url": "http://localhost:8080/callback",
"manifestID": "somestream",
"profiles": [{"name": "t","width": 1280,"height": 720,"bitrate": 70000,"fps": 30}]
}`),
}

catalystApiHandlers := CatalystAPIHandlersCollection{VODEngine: pipeline.NewStubCoordinator()}
router := httprouter.New()

router.POST("/api/transcode/file", catalystApiHandlers.TranscodeSegment())
for _, payload := range badRequests {
req, _ := http.NewRequest("POST", "/api/transcode/file", bytes.NewBuffer(payload))
req.Header.Set("Content-Type", "application/json")

rr := httptest.NewRecorder()
router.ServeHTTP(rr, req)
require.Equal(400, rr.Result().StatusCode, string(payload))
}
}

func TestVODHandlerProfiles(t *testing.T) {
// Create temporary manifest + segment files on the local filesystem
inputUrl, outputUrl := createTempManifests(t)
Expand Down
97 changes: 0 additions & 97 deletions handlers/schemas/TranscodeSegment.yaml

This file was deleted.

46 changes: 0 additions & 46 deletions handlers/transcode.go

This file was deleted.