From b23d29912ba8c855c71be51dd34bd3e02e42d2b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Wed, 18 Oct 2023 21:17:16 +0200 Subject: [PATCH] BrightCove Auth + Playlist API query tested --- mc-vod-sync/mc-vod-sync-app/pom.xml | 5 - .../src/main/resources/application-dev.yaml | 5 + .../src/main/resources/logback-spring.xml | 20 +- .../hu/user/mcvodsync/BrightCoveClientIT.java | 51 +++ mc-vod-sync/mc-vod-sync-brightcove/pom.xml | 12 +- .../mcvodsync/brightcove/ApiProperties.java | 21 + .../brightcove/BrightCoveClient.java | 52 +++ .../src/main/resources/openapi.yaml | 360 +++++++++--------- mc-vod-sync/pom.xml | 16 + 9 files changed, 344 insertions(+), 198 deletions(-) create mode 100644 mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/BrightCoveClientIT.java create mode 100644 mc-vod-sync/mc-vod-sync-brightcove/src/main/java/hu/user/mcvodsync/brightcove/ApiProperties.java create mode 100644 mc-vod-sync/mc-vod-sync-brightcove/src/main/java/hu/user/mcvodsync/brightcove/BrightCoveClient.java diff --git a/mc-vod-sync/mc-vod-sync-app/pom.xml b/mc-vod-sync/mc-vod-sync-app/pom.xml index e4717ec4..7bf9f2ce 100644 --- a/mc-vod-sync/mc-vod-sync-app/pom.xml +++ b/mc-vod-sync/mc-vod-sync-app/pom.xml @@ -84,10 +84,5 @@ mc-vod-sync-service 0.0.1-SNAPSHOT - - junit - junit - test - diff --git a/mc-vod-sync/mc-vod-sync-app/src/main/resources/application-dev.yaml b/mc-vod-sync/mc-vod-sync-app/src/main/resources/application-dev.yaml index dcc1edac..e37ada87 100644 --- a/mc-vod-sync/mc-vod-sync-app/src/main/resources/application-dev.yaml +++ b/mc-vod-sync/mc-vod-sync-app/src/main/resources/application-dev.yaml @@ -53,6 +53,11 @@ mc-vod-sync: application: user-name: user password: password + api: + token-request-url: https://oauth.brightcove.com/v4/access_token + client-id: 0337034f-bde3-44d4-81ba-6a4566ca8ba0 + client-secret: 03Az2W6BSj4sTPSU7SVnRcJ6NDmeaFmB7EPbmuZFnt5slaC2bbscBOMvKR03CGVMxaVXUo9ao6e_gLvxUCjtgg + account-id: 6302605131001 # org.springframework.security.web: INFO # pattern: # console: "%d %-5level %logger : %msg%n" diff --git a/mc-vod-sync/mc-vod-sync-app/src/main/resources/logback-spring.xml b/mc-vod-sync/mc-vod-sync-app/src/main/resources/logback-spring.xml index fdb5c5f7..153ccc4f 100644 --- a/mc-vod-sync/mc-vod-sync-app/src/main/resources/logback-spring.xml +++ b/mc-vod-sync/mc-vod-sync-app/src/main/resources/logback-spring.xml @@ -1,7 +1,7 @@ - + @@ -11,15 +11,15 @@ - - ${LOGS}/mc-safe-delete.log - - %d %p %C{1.} [%t] %m%n - - - ${LOGS}/archived/mc-safe-delete-%d{yyyy-MM-dd}.log.zip - - + + + + + + + + + diff --git a/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/BrightCoveClientIT.java b/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/BrightCoveClientIT.java new file mode 100644 index 00000000..54cc4eb3 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/BrightCoveClientIT.java @@ -0,0 +1,51 @@ +package hu.user.mcvodsync; + +import com.brightcove.cms.client.model.Playlist; +import hu.user.mcvodsync.brightcove.BrightCoveClient; +import lombok.extern.log4j.Log4j2; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +import static org.junit.Assert.assertNotNull; + +@Log4j2 +@RunWith(SpringRunner.class) +@ComponentScan("hu.user.mcvodsync") +@SpringBootTest +@ActiveProfiles("dev") +@TestPropertySource("classpath:application-dev.yaml") +public class BrightCoveClientIT { + @Autowired + private BrightCoveClient bcClient; + + @Test + public void testOAuth() { + String authToken = bcClient.createToken(); + log.info("Token created {}", authToken); + assertNotNull(authToken); + } + + @Test + public void testGetPlayLists() { + String authToken = bcClient.createToken(); + try { + List playLists = bcClient.getPlayLists(authToken, 0, 10); + + playLists.forEach(playList -> { + log.info(playList.getName()); + }); + + } catch (Exception e) { + log.error(e); + } + } + +} diff --git a/mc-vod-sync/mc-vod-sync-brightcove/pom.xml b/mc-vod-sync/mc-vod-sync-brightcove/pom.xml index 946d77e2..9702cd7d 100644 --- a/mc-vod-sync/mc-vod-sync-brightcove/pom.xml +++ b/mc-vod-sync/mc-vod-sync-brightcove/pom.xml @@ -59,6 +59,11 @@ + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + 0.31 + org.springframework spring-web @@ -126,11 +131,13 @@ ${jakarta-annotation-version} provided + + org.springframework.boot + spring-boot + junit junit - ${junit-version} - test @@ -143,6 +150,5 @@ 1.3.5 2.9.10 1.0.0 - 4.13.1 diff --git a/mc-vod-sync/mc-vod-sync-brightcove/src/main/java/hu/user/mcvodsync/brightcove/ApiProperties.java b/mc-vod-sync/mc-vod-sync-brightcove/src/main/java/hu/user/mcvodsync/brightcove/ApiProperties.java new file mode 100644 index 00000000..0a1fe4b7 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-brightcove/src/main/java/hu/user/mcvodsync/brightcove/ApiProperties.java @@ -0,0 +1,21 @@ +package hu.user.mcvodsync.brightcove; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Getter +@Setter +@Component +@ConfigurationProperties(prefix = "mc-vod-sync.api") +public class ApiProperties { + + private String tokenRequestUrl; + + private String clientId; + + private String clientSecret; + + private String accountId; +} diff --git a/mc-vod-sync/mc-vod-sync-brightcove/src/main/java/hu/user/mcvodsync/brightcove/BrightCoveClient.java b/mc-vod-sync/mc-vod-sync-brightcove/src/main/java/hu/user/mcvodsync/brightcove/BrightCoveClient.java new file mode 100644 index 00000000..d5285bb4 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-brightcove/src/main/java/hu/user/mcvodsync/brightcove/BrightCoveClient.java @@ -0,0 +1,52 @@ +package hu.user.mcvodsync.brightcove; + +import com.brightcove.cms.client.api.PlaylistsApi; +import com.brightcove.cms.client.model.Playlist; +import lombok.extern.log4j.Log4j2; +import org.apache.oltu.oauth2.client.OAuthClient; +import org.apache.oltu.oauth2.client.URLConnectionClient; +import org.apache.oltu.oauth2.client.request.OAuthClientRequest; +import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; +import org.apache.oltu.oauth2.common.message.types.GrantType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestClientException; + +import java.util.List; + +@Log4j2 +@Service +public class BrightCoveClient { + private final PlaylistsApi playListApi = new PlaylistsApi(); + + @Autowired + private ApiProperties apiProperties; + + public String createToken() { + String token = null; + try { + OAuthClient client = new OAuthClient(new URLConnectionClient()); + + OAuthClientRequest request = OAuthClientRequest.tokenLocation(apiProperties.getTokenRequestUrl()) + .setGrantType(GrantType.CLIENT_CREDENTIALS) + .setClientId(apiProperties.getClientId()) + .setClientSecret(apiProperties.getClientSecret()) + .buildQueryMessage(); + + token = client.accessToken(request, OAuthJSONAccessTokenResponse.class).getAccessToken(); + + } catch (Exception e) { + log.error(e.getMessage()); + } + return token; + } + + + public List getPlayLists(String authToken, int offset, int limit) throws RestClientException { + String q = null; + String sort = null; + return playListApi.getPlaylists(apiProperties.getAccountId(), MediaType.APPLICATION_JSON_VALUE, + "Bearer " + authToken, limit, offset, q, sort); + } +} diff --git a/mc-vod-sync/mc-vod-sync-brightcove/src/main/resources/openapi.yaml b/mc-vod-sync/mc-vod-sync-brightcove/src/main/resources/openapi.yaml index ccd2ee8d..0fc120cb 100644 --- a/mc-vod-sync/mc-vod-sync-brightcove/src/main/resources/openapi.yaml +++ b/mc-vod-sync/mc-vod-sync-brightcove/src/main/resources/openapi.yaml @@ -14,7 +14,7 @@ info: x-bc-access: public servers: - url: 'https://cms.api.brightcove.com' - variables: {} + variables: { } tags: - name: Videos description: 'Operations for managing videos, video metadata, audio tracks, and more.' @@ -26,7 +26,7 @@ tags: Clear_sources endpoints expose unencrypted sources to the preview players in the studio for customers who are using [Playback Rights](/playback-restrictions/references/index.html) to protect DRM and HLSe video content. This endpoint is also useful for customers who want to make their protected source files available to 3rd parties or internal users who have access to their API credentials. **Important Notes:** - + 1. Once the unprotected URL is made available, Brightcove and the client have no control over who has access to the content or how it is used. 2. There will be egress bandwidth charges made to your account when the sources are accessed. - name: Custom Fields @@ -44,7 +44,7 @@ tags: description: >- Operations for managing renditions, manifests, and other media assets. These operations are used mainly for remote assets. paths: - '/v1/accounts/{{account_id}}/videos': + '/v1/accounts/{account_id}/videos': get: tags: - Videos @@ -150,7 +150,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/counts/videos': + '/v1/accounts/{account_id}/counts/videos': get: tags: - Videos @@ -199,7 +199,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos{video_ids}}': + '/v1/accounts/{account_id}/videos{video_ids}': get: tags: - Videos @@ -278,7 +278,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}': + '/v1/accounts/{account_id}/videos/{video_id}': patch: tags: - Videos @@ -351,7 +351,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/sources': + '/v1/accounts/{account_id}/videos/{video_id}/sources': get: tags: - Videos @@ -391,7 +391,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/images': + '/v1/accounts/{account_id}/videos/{video_id}/images': get: tags: - Videos @@ -431,7 +431,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/image_sources{label}}': + '/v1/accounts/{account_id}/videos/{video_id}/image_sources{label}': delete: tags: - Videos @@ -480,7 +480,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/variants': + '/v1/accounts/{account_id}/videos/{video_id}/variants': get: tags: - Videos @@ -566,7 +566,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/variants{language}}': + '/v1/accounts/{account_id}/videos/{video_id}/variants{language}': get: tags: - Videos @@ -690,7 +690,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/audio_tracks': + '/v1/accounts/{account_id}/videos/{video_id}/audio_tracks': get: tags: - Videos @@ -712,7 +712,7 @@ paths: examples: audio_track: summary: Sample audio track object - value: [{ "duration": 86053, "encoding_rates": [ 64000, 96000, 127000, 192000 ], "id": "en_alternate", "is_default": true, "language": "en", "variant": "main" }] + value: [ { "duration": 86053, "encoding_rates": [ 64000, 96000, 127000, 192000 ], "id": "en_alternate", "is_default": true, "language": "en", "variant": "main" } ] '401': description: >- UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token @@ -734,7 +734,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/audio_tracks{audio_track_id}}': + '/v1/accounts/{account_id}/videos/{video_id}/audio_tracks{audio_track_id}': get: tags: - Videos @@ -858,7 +858,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/digital_master': + '/v1/accounts/{account_id}/videos/{video_id}/digital_master': get: tags: - Videos @@ -944,7 +944,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/references': + '/v1/accounts/{account_id}/videos/{video_id}/references': get: tags: - Videos @@ -1020,7 +1020,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/ingest_jobs': + '/v1/accounts/{account_id}/videos/{video_id}/ingest_jobs': get: tags: - Videos @@ -1066,7 +1066,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/ingest_jobs{job_id}}': + '/v1/accounts/{account_id}/videos/{video_id}/ingest_jobs{job_id}': get: tags: - Videos @@ -1112,7 +1112,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/clear_videos/{{video_id}}': + '/v1/accounts/{account_id}/clear_videos/{video_id}': get: tags: - Clear-Sources @@ -1163,7 +1163,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/clear_sources': + '/v1/accounts/{account_id}/videos/{video_id}/clear_sources': get: tags: - Clear-Sources @@ -1215,7 +1215,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/video_fields': + '/v1/accounts/{account_id}/video_fields': get: tags: - Custom Fields @@ -1261,7 +1261,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/video_fields/custom_fields': + '/v1/accounts/{account_id}/video_fields/custom_fields': get: tags: - Custom Fields @@ -1359,7 +1359,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/video_fields/custom_fields/{{custom_field_id}}': + '/v1/accounts/{account_id}/video_fields/custom_fields/{custom_field_id}': get: tags: - Custom Fields @@ -1501,7 +1501,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/channels': + '/v1/accounts/{account_id}/channels': get: tags: - Media Sharing @@ -1546,7 +1546,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/channels{channel_name}}': + '/v1/accounts/{account_id}/channels{channel_name}': get: tags: - Media Sharing @@ -1642,7 +1642,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/channels{channel_name}}/members': + '/v1/accounts/{account_id}/channels{channel_name}/members': get: tags: - Media Sharing @@ -1689,7 +1689,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/channels{channel_name}}/members/{{affiliate_account_id}}': + '/v1/accounts/{account_id}/channels{channel_name}/members/{affiliate_account_id}': put: tags: - Media Sharing @@ -1780,7 +1780,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/contracts': + '/v1/accounts/{account_id}/contracts': get: tags: - Media Sharing @@ -1823,7 +1823,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/contracts/{{master_account_id}}': + '/v1/accounts/{account_id}/contracts/{master_account_id}': get: tags: - Media Sharing @@ -1918,7 +1918,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/shares': + '/v1/accounts/{account_id}/videos/{video_id}/shares': get: tags: - Media Sharing @@ -2023,7 +2023,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/shares/{{affiliate_account_id}}': + '/v1/accounts/{account_id}/videos/{video_id}/shares/{affiliate_account_id}': get: tags: - Media Sharing @@ -2108,7 +2108,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/playlists': + '/v1/accounts/{account_id}/playlists': get: tags: - Playlists @@ -2213,7 +2213,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/counts/playlists': + '/v1/accounts/{account_id}/counts/playlists': get: tags: - Playlists @@ -2259,7 +2259,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/playlists/{{playlist_id}}': + '/v1/accounts/{account_id}/playlists/{playlist_id}': get: tags: - Playlists @@ -2405,7 +2405,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/playlists/{{playlist_id}}/videos': + '/v1/accounts/{account_id}/playlists/{playlist_id}/videos': get: tags: - Playlists @@ -2455,7 +2455,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/counts/playlists/{{playlist_id}}/videos': + '/v1/accounts/{account_id}/counts/playlists/{playlist_id}/videos': get: tags: - Playlists @@ -2501,7 +2501,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/folders': + '/v1/accounts/{account_id}/folders': get: tags: - Folders @@ -2602,7 +2602,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/folders/{{folder_id}}': + '/v1/accounts/{account_id}/folders/{folder_id}': get: tags: - Folders @@ -2768,7 +2768,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/folders/{{folder_id}}/videos': + '/v1/accounts/{account_id}/folders/{folder_id}/videos': get: tags: - Folders @@ -2828,7 +2828,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/folders/{{folder_id}}/videos/{{video_id}}': + '/v1/accounts/{account_id}/folders/{folder_id}/videos/{video_id}': put: tags: - Folders @@ -2929,7 +2929,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/labels': + '/v1/accounts/{account_id}/labels': post: tags: - Labels @@ -3026,7 +3026,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/labels/by_path/{{label_path}}': + '/v1/accounts/{account_id}/labels/by_path/{label_path}': patch: tags: - Labels @@ -3121,7 +3121,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/subscriptions': + '/v1/accounts/{account_id}/subscriptions': get: tags: - Notifications @@ -3235,7 +3235,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/subscriptions/{{subscription_id}}': + '/v1/accounts/{account_id}/subscriptions/{subscription_id}': get: tags: - Notifications @@ -3324,7 +3324,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets': + '/v1/accounts/{account_id}/videos/{video_id}/assets': get: tags: - Media Assets @@ -3374,7 +3374,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/dynamic_renditions': + '/v1/accounts/{account_id}/videos/{video_id}/assets/dynamic_renditions': get: tags: - Media Assets @@ -3425,7 +3425,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/renditions': + '/v1/accounts/{account_id}/videos/{video_id}/assets/renditions': post: tags: - Media Assets @@ -3490,7 +3490,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/renditions/{{asset_id}}': + '/v1/accounts/{account_id}/videos/{video_id}/assets/renditions/{asset_id}': get: tags: - Media Assets @@ -3651,7 +3651,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/hls_manifest': + '/v1/accounts/{account_id}/videos/{video_id}/assets/hls_manifest': get: tags: - Media Assets @@ -3762,7 +3762,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/hls_manifest/{{asset_id}}': + '/v1/accounts/{account_id}/videos/{video_id}/assets/hls_manifest/{asset_id}': get: tags: - Media Assets @@ -3919,7 +3919,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/dash_manifests': + '/v1/accounts/{account_id}/videos/{video_id}/assets/dash_manifests': get: tags: - Media Assets @@ -4050,7 +4050,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/dash_manifests/{{asset_id}}': + '/v1/accounts/{account_id}/videos/{video_id}/assets/dash_manifests/{asset_id}': get: tags: - Media Assets @@ -4208,7 +4208,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/hds_manifest': + '/v1/accounts/{account_id}/videos/{video_id}/assets/hds_manifest': get: tags: - Media Assets @@ -4318,7 +4318,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/hds_manifest/{{asset_id}}': + '/v1/accounts/{account_id}/videos/{video_id}/assets/hds_manifest/{asset_id}': get: tags: - Media Assets @@ -4475,7 +4475,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/ism_manifest': + '/v1/accounts/{account_id}/videos/{video_id}/assets/ism_manifest': get: tags: - Media Assets @@ -4585,7 +4585,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/ism_manifest/{{asset_id}}': + '/v1/accounts/{account_id}/videos/{video_id}/assets/ism_manifest/{asset_id}': get: tags: - Media Assets @@ -4742,7 +4742,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/ismc_manifest': + '/v1/accounts/{account_id}/videos/{video_id}/assets/ismc_manifest': get: tags: - Media Assets @@ -4852,7 +4852,7 @@ paths: AllowDynamicQueryParameters: false AllowDynamicFormParameters: false IsMultiContentStreaming: false - '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/ismc_manifest/{{asset_id}}': + '/v1/accounts/{account_id}/videos/{video_id}/assets/ismc_manifest/{asset_id}': get: tags: - Media Assets @@ -5100,7 +5100,7 @@ components: Video ID. For example: - - https://cms.api.brightcove.com/v1/accounts/{{account_id}}/videos/9827342837937 + - https://cms.api.brightcove.com/v1/accounts/{account_id}/videos/9827342837937 explode: false in: path name: video_id @@ -5264,7 +5264,7 @@ components: - square style: simple VideoId: - description: 'Video ID (specified as `{video_id}}`) or reference id (specified as `/ref:{reference_id}`).' + description: 'Video ID (specified as `{video_id}`) or reference id (specified as `/ref:{reference_id}`).' explode: false in: path name: video_id @@ -5277,9 +5277,9 @@ components: One or more video ids or one reference id. If reference ids, the syntax is `ref:my_ref_id`. Note that you may include multiple video ids, but only one reference id. For example: - - https://cms.api.brightcove.com/v1/accounts/{{account_id}}/videos/9827342837937 - - https://cms.api.brightcove.com/v1/accounts/{{account_id}}/videos/9827342837937,47584736360 - - https://cms.api.brightcove.com/v1/accounts/{{account_id}}/videos/ref:my_ref_id + - https://cms.api.brightcove.com/v1/accounts/{account_id}/videos/9827342837937 + - https://cms.api.brightcove.com/v1/accounts/{account_id}/videos/9827342837937,47584736360 + - https://cms.api.brightcove.com/v1/accounts/{account_id}/videos/ref:my_ref_id explode: false in: path name: video_ids @@ -5843,7 +5843,7 @@ components: frame_height: 720 frame_width: 1280 id: '5510492050001' - key_systems: [] + key_systems: [ ] name: Lightning-over-mosque-Utrecht.m4v Video Still progressive_download: false reference_id: '' @@ -5995,11 +5995,11 @@ components: type: string description: a full label path example: [ - "/nature/birds", - "/nature/birds/shorebirds", - "/nature/birds/forestbirds", - "/nature/mammals/seamammals" - ] + "/nature/birds", + "/nature/birds/shorebirds", + "/nature/birds/forestbirds", + "/nature/mammals/seamammals" + ] version: type: integer description: An internal version tracker @@ -6011,8 +6011,8 @@ components: path: type: string example: { - "path": "/nature/mammals/seamammals" - } + "path": "/nature/mammals/seamammals" + } LabelUpdate: description: 'Update Label request body' title: label @@ -6022,8 +6022,8 @@ components: type: string description: The new label which will replace **the last item in the label path** example: { - "new_label": "forest_birds", - } + "new_label": "forest_birds", + } Link: description: 'map of related link properties - can only be added on update, not creation' properties: @@ -6103,7 +6103,7 @@ components: controller_type: DEFAULT current_filename: 57838016001_5819043232001_5819044609001.m3u8 id: '5819043232001' - key_systems: [] + key_systems: [ ] name: greatblueheron.mp4 progressive_download: false reference_id: '' @@ -6252,18 +6252,18 @@ components: title: Playlist type: object example: { - "id": "5716873476001", - "account_id": "57838016001", - "created_at": "2018-01-23T12:55:29.674Z", - "description": "My new sea playlist", - "favorite": false, - "name": "Sea Videos", - "reference_id": null, - "type": "ACTIVATED_NEWEST_TO_OLDEST", - "updated_at": "2018-01-23T12:55:29.677Z", - "limit": 20, - "search": "+tags:\"birds\"" - } + "id": "5716873476001", + "account_id": "57838016001", + "created_at": "2018-01-23T12:55:29.674Z", + "description": "My new sea playlist", + "favorite": false, + "name": "Sea Videos", + "reference_id": null, + "type": "ACTIVATED_NEWEST_TO_OLDEST", + "updated_at": "2018-01-23T12:55:29.677Z", + "limit": 20, + "search": "+tags:\"birds\"" + } PlaylistCount: example: count: 84 @@ -6336,12 +6336,12 @@ components: title: Create/Update Playlist Fields type: object example: { - "description": "My new sea playlist", - "name": "Sea Videos", - "type": "ACTIVATED_NEWEST_TO_OLDEST", - "limit": 20, - "search": "tags:birds" - } + "description": "My new sea playlist", + "name": "Sea Videos", + "type": "ACTIVATED_NEWEST_TO_OLDEST", + "limit": 20, + "search": "tags:birds" + } PlaylistReferences: properties: playlists: @@ -6419,7 +6419,7 @@ components: type: string events: description: list of events subscribed to - example: ["video-change"] + example: [ "video-change" ] type: array items: type: string @@ -6747,7 +6747,7 @@ components: example: ACTIVE type: string tags: - description: array of tags - maximum characters per tag is 1000 + description: array of tags - maximum characters per tag is 1000 example: - birds - sea @@ -6791,7 +6791,7 @@ components: hds: null hls: null id: '5819042450001' - key_systems: [] + key_systems: [ ] name: greatblueheron.mp4 progressive_download: true reference_id: '' @@ -6813,7 +6813,7 @@ components: frame_height: 90 frame_width: 160 id: '5819042821001' - key_systems: [] + key_systems: [ ] name: greatblueheron.mp4 Thumbnail progressive_download: false reference_id: '' @@ -6836,7 +6836,7 @@ components: hds: null hls: null id: '5819043030001' - key_systems: [] + key_systems: [ ] name: greatblueheron.mp4 progressive_download: true reference_id: '' @@ -6856,7 +6856,7 @@ components: controller_type: DEFAULT current_filename: 57838016001_5819043232001_5819044609001.m3u8 id: '5819043232001' - key_systems: [] + key_systems: [ ] name: greatblueheron.mp4 progressive_download: false reference_id: '' @@ -6876,7 +6876,7 @@ components: frame_height: 720 frame_width: 1280 id: '5819043394001' - key_systems: [] + key_systems: [ ] name: greatblueheron.mp4 Video Still progressive_download: false reference_id: '' @@ -6893,7 +6893,7 @@ components: controller_type: DEFAULT current_filename: '' id: '5819491822001' - key_systems: [] + key_systems: [ ] name: '' profiles: null progressive_download: false @@ -7190,87 +7190,87 @@ components: description: |- map of image maps - the map name is in the form `label.language` where the label is one of `poster`, `thumbnail`, `portrait`, `square`, `wide` or `ultra-wide`, and the `language` is a language identifier such as 'en', 'de', or `ko` example: { - "thumbnail": { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/main/160x90/20s629ms/match/image.jpg", - "sources": [ - { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/main/160x90/20s629ms/match/image.jpg", - "height": 90, - "width": 160 - } - ] - }, - "poster": { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/main/1280x720/20s629ms/match/image.jpg", - "sources": [ - { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/main/1280x720/20s629ms/match/image.jpg", - "height": 720, - "width": 1280 - } - ] - }, - "portrait.es": { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/bac8717a-43db-4fa8-a6f0-189c80ee4c4e/800x1200/match/image.jpg", - "sources": [ - { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/bac8717a-43db-4fa8-a6f0-189c80ee4c4e/800x1200/match/image.jpg", - "height": 1200, - "width": 800 - } - ] - }, - "thumbnail.en": { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/0ce2da4d-ca36-469b-9024-0273d79feeeb/292x108/match/image.jpg", - "sources": [ - { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/0ce2da4d-ca36-469b-9024-0273d79feeeb/292x108/match/image.jpg", - "height": 108, - "width": 292 - } - ] - }, - "poster.en": { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/a7cb150d-c84a-48e0-9469-5b4ce80fba53/1920x1080/match/image.jpg", - "sources": [ - { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/a7cb150d-c84a-48e0-9469-5b4ce80fba53/1920x1080/match/image.jpg", - "height": 1080, - "width": 1920 - } - ] - }, - "square.de": { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/22209955-e136-4f17-914c-e19ec4c58886/570x570/match/image.jpg", - "sources": [ - { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/22209955-e136-4f17-914c-e19ec4c58886/570x570/match/image.jpg", - "height": 570, - "width": 570 - } - ] - }, - "ultra-wide.hi": { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/72fd489f-d978-44ba-8d04-1e33c7c36cef/3840x1646/match/image.jpg", - "sources": [ - { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/72fd489f-d978-44ba-8d04-1e33c7c36cef/3840x1646/match/image.jpg", - "height": 1646, - "width": 3840 - } - ] - }, - "wide.fr": { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/4405a5d5-8b9e-4c2b-be71-cf4e2c153e87/2560x1440/match/image.jpg", - "sources": [ - { - "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/4405a5d5-8b9e-4c2b-be71-cf4e2c153e87/2560x1440/match/image.jpg", - "height": 1440, - "width": 2560 - } - ] - } + "thumbnail": { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/main/160x90/20s629ms/match/image.jpg", + "sources": [ + { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/main/160x90/20s629ms/match/image.jpg", + "height": 90, + "width": 160 + } + ] + }, + "poster": { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/main/1280x720/20s629ms/match/image.jpg", + "sources": [ + { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/jit/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/main/1280x720/20s629ms/match/image.jpg", + "height": 720, + "width": 1280 + } + ] + }, + "portrait.es": { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/bac8717a-43db-4fa8-a6f0-189c80ee4c4e/800x1200/match/image.jpg", + "sources": [ + { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/bac8717a-43db-4fa8-a6f0-189c80ee4c4e/800x1200/match/image.jpg", + "height": 1200, + "width": 800 + } + ] + }, + "thumbnail.en": { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/0ce2da4d-ca36-469b-9024-0273d79feeeb/292x108/match/image.jpg", + "sources": [ + { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/0ce2da4d-ca36-469b-9024-0273d79feeeb/292x108/match/image.jpg", + "height": 108, + "width": 292 + } + ] + }, + "poster.en": { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/a7cb150d-c84a-48e0-9469-5b4ce80fba53/1920x1080/match/image.jpg", + "sources": [ + { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/a7cb150d-c84a-48e0-9469-5b4ce80fba53/1920x1080/match/image.jpg", + "height": 1080, + "width": 1920 + } + ] + }, + "square.de": { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/22209955-e136-4f17-914c-e19ec4c58886/570x570/match/image.jpg", + "sources": [ + { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/22209955-e136-4f17-914c-e19ec4c58886/570x570/match/image.jpg", + "height": 570, + "width": 570 + } + ] + }, + "ultra-wide.hi": { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/72fd489f-d978-44ba-8d04-1e33c7c36cef/3840x1646/match/image.jpg", + "sources": [ + { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/72fd489f-d978-44ba-8d04-1e33c7c36cef/3840x1646/match/image.jpg", + "height": 1646, + "width": 3840 + } + ] + }, + "wide.fr": { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/4405a5d5-8b9e-4c2b-be71-cf4e2c153e87/2560x1440/match/image.jpg", + "sources": [ + { + "src": "https://cf-images.us-east-1.prod.boltdns.net/v1/static/57838016001/ee705e97-3fb5-409c-99d8-703e9f57bd0a/4405a5d5-8b9e-4c2b-be71-cf4e2c153e87/2560x1440/match/image.jpg", + "height": 1440, + "width": 2560 + } + ] } + } readOnly: true title: VideoImages type: object diff --git a/mc-vod-sync/pom.xml b/mc-vod-sync/pom.xml index 243eef56..29435db4 100644 --- a/mc-vod-sync/pom.xml +++ b/mc-vod-sync/pom.xml @@ -94,5 +94,21 @@ guava 31.1-jre + + junit + junit + 4.13.2 + test + + + org.springframework + spring-test + test + + + org.springframework.boot + spring-boot-test + test + -- 2.54.0