From: elgekko Date: Fri, 15 Sep 2023 21:20:48 +0000 (+0200) Subject: Project initial setup with brightcove API reference X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=80e81ded3c62755c9e27d74e05f99b958e05a703;p=mediacube.git Project initial setup with brightcove API reference --- diff --git a/mc-vod-sync/.gitignore b/mc-vod-sync/.gitignore new file mode 100644 index 00000000..0b95dfbc --- /dev/null +++ b/mc-vod-sync/.gitignore @@ -0,0 +1,4 @@ +/lis-db/migrations/drivers/jcc-11.5.7.0.jar +.idea/ +target/ +.jpb/ diff --git a/mc-vod-sync/mc-vod-sync-app/pom.xml b/mc-vod-sync/mc-vod-sync-app/pom.xml new file mode 100644 index 00000000..e4717ec4 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-app/pom.xml @@ -0,0 +1,93 @@ + + + 4.0.0 + mc-vod-sync-app + 0.0.1-SNAPSHOT + + hu.user + mc-vod-sync + 0.0.1-SNAPSHOT + + + + + org.springframework.boot + spring-boot-maven-plugin + + + build-info + + build-info + + + + + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-web + + + org.apache.tomcat.embed + tomcat-embed-websocket + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + org.springframework.boot + spring-boot-starter-undertow + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.fusesource.jansi + jansi + 2.3.4 + + + hu.user + mc-vod-sync-brightcove + 0.0.1-SNAPSHOT + + + hu.user + mc-vod-sync-db + 0.0.1-SNAPSHOT + + + hu.user + mc-vod-sync-ui + 0.0.1-SNAPSHOT + + + hu.user + mc-vod-sync-service + 0.0.1-SNAPSHOT + + + junit + junit + test + + + diff --git a/mc-vod-sync/mc-vod-sync-app/src/main/java/hu/user/mcvodsync/VodSyncEntry.java b/mc-vod-sync/mc-vod-sync-app/src/main/java/hu/user/mcvodsync/VodSyncEntry.java new file mode 100644 index 00000000..9093e9bf --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-app/src/main/java/hu/user/mcvodsync/VodSyncEntry.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) $today.year-$today.month-24. + * By elGekko + */ + +package hu.user.mcvodsync; + +import lombok.extern.log4j.Log4j2; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.core.SpringVersion; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; + +@EnableWebMvc +@Log4j2 +@EnableJpaRepositories("hu.user.mcvodsync.db.repository") +@SpringBootApplication(scanBasePackages = {"hu.user.mcvodsync"}) +public class VodSyncEntry extends SpringBootServletInitializer { + + + public static void main(String[] args) { +// AnsiConsole.systemInstall(); +// System.out.println( ansi().eraseScreen()); + log.info("Spring version: {}", SpringVersion.getVersion()); + ApplicationContext applicationContext = SpringApplication.run(VodSyncEntry.class, args); +// AnsiConsole.systemUninstall(); + } + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { + logger.info("Starting configure"); + return builder.sources(VodSyncEntry.class); + } + +} 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 new file mode 100644 index 00000000..ce99c570 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-app/src/main/resources/application-dev.yaml @@ -0,0 +1,58 @@ +server: + port: 8080 + servlet: + context-path: / +zk: + homepage: index + zul-view-resolver-enabled: true +spring: + jpa: + # hibernate: + # use-new-id-generator-mappings: false + show-sql: false + properties: + hibernate: + format_sql: true + main: + banner-mode: off + output: + ansi: + enabled: always + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:db2://localhost:50000/vodsync + username: db2admin + password: password +camunda.bpm: + generic-properties.properties: + telemetry-reporter-activate: false + job-executor-acquire-by-priority: true + job-execution: + core-pool-size: 10 + #lock-time-in-millis: 600000 + database: + type: db2 + schema-update: false + table-prefix: CAMUNDA. + schema-name: CAMUNDA + webapp: + enabled: true + index-redirect-enabled: false + admin-user: + id: kermit + password: password + firstName: Kermit + filter: + create: All tasks + job-execution.enabled: true +logging: + level: + org.hibernate.engine.jdbc.spi.SqlExceptionHelper: ERROR +mc-vod-sync: + application: + user-name: user + password: password +# org.springframework.security.web: INFO +# pattern: +# console: "%d %-5level %logger : %msg%n" +# file: "%d %-5level [%thread] %logger : %msg%n" \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-app/src/main/resources/application.yaml b/mc-vod-sync/mc-vod-sync-app/src/main/resources/application.yaml new file mode 100644 index 00000000..39be7218 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-app/src/main/resources/application.yaml @@ -0,0 +1,56 @@ +server: + port: 8080 + servlet: + context-path: / +zk: + homepage: index + zul-view-resolver-enabled: true +spring: + jpa: + # hibernate: + # use-new-id-generator-mappings: true + show-sql: true + properties: + hibernate: + format_sql: true + main: + banner-mode: off + output: + ansi: + enabled: always + datasource: + type: com.zaxxer.hikari.HikariDataSource + url: jdbc:db2://dvdev.in.useribm.hu:50000/vodsync + username: db2admin + password: password +camunda.bpm: + generic-properties.properties: + telemetry-reporter-activate: false + job-executor-acquire-by-priority: true + job-execution: + core-pool-size: 10 + #lock-time-in-millis: 600000 + database: + type: db2 + schema-update: false + table-prefix: CAMUNDA. + schema-name: CAMUNDA + webapp: + enabled: true + index-redirect-enabled: false + admin-user: + id: kermit + password: password + firstName: Kermit + filter: + create: All tasks + job-execution.enabled: true +logging: + # config: classpath:log4j2.xml + level: + org.hibernate.engine.jdbc.spi.SqlExceptionHelper: ERROR +# org.springframework.security: DEBUG +# org.springframework.security.web: INFO +# pattern: +# console: "%d %-5level %logger : %msg%n" +# file: "%d %-5level [%thread] %logger : %msg%n" \ No newline at end of file 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 new file mode 100644 index 00000000..fdb5c5f7 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-app/src/main/resources/logback-spring.xml @@ -0,0 +1,33 @@ + + + + + + + + + %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable + + + + + + ${LOGS}/mc-safe-delete.log + + %d %p %C{1.} [%t] %m%n + + + ${LOGS}/archived/mc-safe-delete-%d{yyyy-MM-dd}.log.zip + + + + + + + + + + + + + \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/RepositoryIT.java b/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/RepositoryIT.java new file mode 100644 index 00000000..cc7ebb3d --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/RepositoryIT.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) $today.year-$today.month-24. + * By elGekko + */ + +package hu.user.mcvodsync; + +import lombok.extern.log4j.Log4j2; +import org.junit.Test; +import org.junit.runner.RunWith; +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; + + +@Log4j2 +@RunWith(SpringRunner.class) +@ComponentScan("hu.user.lis") +@SpringBootTest +@ActiveProfiles("dev") +//@Profile("dev") +@TestPropertySource("classpath:application-dev.yaml") +//@AutoConfigureMockMvc +public class RepositoryIT { +// @Autowired +// ServiceRecordRepository serviceRecordRepository; +// @Autowired +// ProjectRepository projectRepository; +// @Autowired +// ProjectService projectService; +// @Autowired +// TreasuryService treasuryService; +// @Autowired +// private TreasuryRepository treasuryRepository; + + @Test + public void listProjects() { +// List allItems = projectRepository.findAll(); +// log.info("Found {} items", allItems.size()); + } + +} diff --git a/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/VodSyncEntryTest.java b/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/VodSyncEntryTest.java new file mode 100644 index 00000000..b06d9e1c --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/VodSyncEntryTest.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) $today.year-$today.month-24. + * By elGekko + */ + +package hu.user.mcvodsync; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + + +@SpringBootTest +public class VodSyncEntryTest { + + + @Test + public void contextLoads() { + + } + +} diff --git a/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/VodXlsProcessorIT.java b/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/VodXlsProcessorIT.java new file mode 100644 index 00000000..89476882 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/VodXlsProcessorIT.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) $today.year-$today.month-24. + * By elGekko + */ + +package hu.user.mcvodsync; + +import hu.user.mcvodsync.db.UploadFile; +import hu.user.mcvodsync.service.xls.VodXlsProcessor; +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.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + + +@Log4j2 +@RunWith(SpringRunner.class) +@SpringBootTest +@ActiveProfiles("dev") +@TestPropertySource("classpath:application-dev.yaml") +public class VodXlsProcessorIT { + @Autowired + VodXlsProcessor vodXlsProcessor; + + @Test + public void listProjects() throws IOException { + Path xlsFile = Paths.get("src", "test", "resources", "AMC_Selekt_jogositott_tartalmak_20230906.xlsx"); + log.info(xlsFile.toAbsolutePath()); + UploadFile uploadFile = UploadFile.builder() + .file(Files.readAllBytes(xlsFile)) + .build(); + vodXlsProcessor.process(uploadFile); + } + +} diff --git a/mc-vod-sync/mc-vod-sync-app/src/test/resources/AMC_Selekt_jogositott_tartalmak_20230906.xlsx b/mc-vod-sync/mc-vod-sync-app/src/test/resources/AMC_Selekt_jogositott_tartalmak_20230906.xlsx new file mode 100644 index 00000000..ac221fbb Binary files /dev/null and b/mc-vod-sync/mc-vod-sync-app/src/test/resources/AMC_Selekt_jogositott_tartalmak_20230906.xlsx differ diff --git a/mc-vod-sync/mc-vod-sync-brightcove/README.md b/mc-vod-sync/mc-vod-sync-brightcove/README.md new file mode 100644 index 00000000..9c4a4900 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-brightcove/README.md @@ -0,0 +1,4 @@ +API kliens generalas maven plug-in leiras: +https://github.com/OpenAPITools/openapi-generator/tree/v5.4.0/modules/openapi-generator-maven-plugin +https://github.com/OpenAPITools/openapi-generator/blob/v5.4.0/docs/generators/spring.md +https://apis.support.brightcove.com/cms/references/reference.html#tag/Playlists/operation/UpdatePlaylist diff --git a/mc-vod-sync/mc-vod-sync-brightcove/mc-vod-sync-brightcove.iml b/mc-vod-sync/mc-vod-sync-brightcove/mc-vod-sync-brightcove.iml new file mode 100644 index 00000000..888959e2 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-brightcove/mc-vod-sync-brightcove.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-brightcove/pom.xml b/mc-vod-sync/mc-vod-sync-brightcove/pom.xml new file mode 100644 index 00000000..946d77e2 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-brightcove/pom.xml @@ -0,0 +1,148 @@ + + + 4.0.0 + mc-vod-sync-brightcove + + hu.user + mc-vod-sync + 0.0.1-SNAPSHOT + + + + + org.openapitools + openapi-generator-maven-plugin + 5.4.0 + + + + generate + + + + + java + ${project.basedir}/src/main/resources/openapi.yaml + + true + false + true + + false + com.brightcove.cms.client.api + com.brightcove.cms.client.model + resttemplate + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.springframework + spring-web + 5.3.24 + + + org.springframework + spring-context + 5.3.24 + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.5.22 + 5.2.5.RELEASE + 2.10.5 + 2.10.5.1 + 0.2.2 + 1.3.5 + 2.9.10 + 1.0.0 + 4.13.1 + + 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 new file mode 100644 index 00000000..ccd2ee8d --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-brightcove/src/main/resources/openapi.yaml @@ -0,0 +1,7463 @@ +openapi: 3.0.3 +x-bc-implicit-head: true +x-bc-implicit-options: true +x-bc-upstream: 'https://backend_server' +info: + title: Brightcove CMS API Reference + description: |- + Reference for the Brightcove CMS API, used to access and manage your media library. To test API requests, you can use our [API Testing Tools](/getting-started/concepts-testing-tools-brightcove-apis.html). For permissions needed for OAuth credentials, see [API Operations](/oauth/guides/api-operations-client-credentials-requests.html). For information on authenticating API requests, see the [OAuth Overview](/oauth/getting-started/overview-oauth-api-v4.html). + + For additional in-depth guides to features of the API, see the **[general documentation](/cms/index.html)**. + + **Base URL**: https://cms.api.brightcove.com + version: 1.0.0 + x-bc-access: public +servers: + - url: 'https://cms.api.brightcove.com' + variables: {} +tags: + - name: Videos + description: 'Operations for managing videos, video metadata, audio tracks, and more.' + - name: Media Sharing + description: >- + Operations for creating and managing hierarchical labels that can be associated with videos. + - name: Clear-Sources + description: |- + 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 + description: Operations for creating and managing custom fields. + - name: Playlists + description: Operations for managing video playlists. + - name: Folders + description: Operations for managing folders to organize your videos. + - name: Labels + description: Operations for managing folders to organize your videos. See [Working with Labels](/cms/managing-videos/working-with-labels.html) for more information. + - name: Notifications + description: >- + Operations for setting up and managing notifications of changes to your video library. + - name: Media Assets + description: >- + Operations for managing renditions, manifests, and other media assets. These operations are used mainly for remote assets. +paths: + '/v1/accounts/{{account_id}}/videos': + get: + tags: + - Videos + summary: Get Videos + description: 'Gets a page of video objects ' + operationId: GetVideos + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/VideoSort' + - $ref: '#/components/parameters/Search' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Video' + '400': + description: |- + INVALID_SORT: sort parameter specified and invalid field + ILLEGAL_QUERY: The search string syntax was invalid - example + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Videos + summary: Create Video + description: >- + Create a new video object in the account. Note: this does not ingest a video file - use the Dynamic Ingest API for ingestion + operationId: CreateVideo + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Create a new video object in the account. Note: this does not ingest a video file - use the Dynamic Ingest API for ingestion + content: + application/json: + schema: + $ref: '#/components/schemas/CreateVideoRequestBodyFields' + required: true + responses: + '201': + description: Video created + content: + application/json: + schema: + $ref: '#/components/schemas/Video' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: 'BAD_VALUE: Spelling error or other use of non-existent field ' + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: >- + REFERENCE_ID_IN_USE: You attempted to create a video with a reference id that is already in use, or add a reference id to a video which is already used by another video + '422': + description: 'ILLEGAL_FIELD: Spelling error or other use of non-existent field ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/create + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/counts/videos': + get: + tags: + - Videos + summary: Get Video Count + description: 'Gets count of videos for the account or a search ' + operationId: GetVideoCount + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/Search' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoCount' + '400': + description: 'INVALID_SORT: sort parameter specified and invalid field ' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos{video_ids}}': + get: + tags: + - Videos + summary: 'Get Videos by ID/Reference ID' + description: |- + Gets a video object - you can include **up to 10** video ids separated by commas. + operationId: GetVideoByIdOrReferenceId + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoIds' + - $ref: '#/components/parameters/include_variants' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Video' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Videos + summary: Delete Video + description: >- + 'Deletes one or more videos - note that for this operation you can specify a comma-delimited list of video ids to delete. A maximum of 10 videos can be deleted with one request. You can also delete a video by its reference id using `ref:video_reference_id` but only one at a time.' + operationId: DeleteVideo + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoIds' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: 'NO_CONTENT' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '409': + description: 'REFERENCES_EXIST: The video is in one or more manual playlists ' + '412': + description: >- + PRE_CONDITION_FAILED: usually this means the caller provided an ETag that didn't match the version of the video + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: 'INTERNAL_ERROR: Error in the backend ' + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/delete + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}': + patch: + tags: + - Videos + summary: Update Video + description: >- + Update video metadata - note that this API does not ingest any + media files - use the Dynamic Ingest API for ingestion. Also note that replacing WebVTT text tracks is a two-step operation - see Add WebVTT Captions for details. + operationId: UpdateVideo + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Update video metadata - note that this API does not ingest any media files - use the Dynamic Ingest API for ingestion. Also note that replacing WebVTT text tracks is a two-step operation - see Add WebVTT Captions for details. + content: + application/json: + schema: + $ref: '#/components/schemas/Video' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Video' + '202': + description: >- + 202 is returned as a success response in cases where text tracks are updated, because that is performed by a separate system. + '400': + description: >- + AD_CONFIG_INACTIVE: Ad configuration specified in an SSAI request is inactive + + AD_CONFIG_NOT_FOUND: Ad configuration specified in an SSAI request was not found + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: 'BAD_VALUE: Spelling error or other use of non-existent field ' + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: >- + REFERENCE_ID_IN_USE: You attempted to create a video with a reference id that is already in use, or add a reference id to a video which is already used by another video + '422': + description: >- + ILLEGAL_FIELD: Spelling error or other use of non-existent field + + VALIDATION_ERROR: the JSON data was not valid - error messages vary depending on the problem + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: >- + UNKNOWN: an unknown internal error occurred - this might be a temporary system issue, but if the problem persists, it is likely an uncaught error in the request - contact Support + '503': + description: 'TIMEOUT: Server likely too busy - try again later ' + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/sources': + get: + tags: + - Videos + summary: Get Video Sources + description: 'Gets an array of sources (renditions) for a video' + operationId: GetVideoSources + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoSources' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/images': + get: + tags: + - Videos + summary: Get Video Images + description: 'Gets the images for a video ' + operationId: GetVideoImages + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoImages' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/image_sources{label}}': + delete: + tags: + - Videos + summary: Delete video image + description: >- + Delete video image source by label. The label can be one of `poster`, `thumbnail`, `wide`, `ultra-wide`, `portrait`, `square`. + operationId: DeleteVideoImage + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/Label' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: >- + NO CONTENT: image source was deleted successfully. + '400': + description: >- + AD_CONFIG_INACTIVE: Ad configuration specified in an SSAI request is inactive + + AD_CONFIG_NOT_FOUND: Ad configuration specified in an SSAI request was not found + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: >- + UNKNOWN: an unknown internal error occurred - this might be a temporary system issue, but if the problem persists, it is likely an uncaught error in the request - contact Support + '503': + description: 'TIMEOUT: Server likely too busy - try again later ' + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/variants': + get: + tags: + - Videos + summary: Get All Video Variants + description: 'Gets the language variants for the video metadata' + operationId: GetVideoVariants + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoVariants' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Videos + summary: Create a Video Variant + description: 'Creates a language variant for a video metadata' + operationId: createVideoVariant + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Request body for a video variant + content: + application/json: + schema: + $ref: '#/components/schemas/VideoVariant' + responses: + '201': + description: '201' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoVariant' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/variants{language}}': + get: + tags: + - Videos + summary: Get a Video Variant + description: 'Gets the variant for the video metadata for the specified language' + operationId: GetVideoVariant + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/Language' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoVariant' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Videos + summary: Update a Video Variant + description: 'Updates a language variant for a video metadata' + operationId: updateVideoVariant + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/Language' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: + Request body for a video variant + content: + application/json: + schema: + $ref: '#/components/schemas/VideoVariant' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoVariant' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Videos + summary: Delete a Video Variant + description: 'Delete a language variant for a video metadata' + operationId: deleteVideoVariant + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/Language' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: '204 NO CONTENT' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/audio_tracks': + get: + tags: + - Videos + summary: Get Video Audio Tracks + description: 'Gets the audio tracks for a video Dynamic Delivery only ' + operationId: GetVideoAudioTracks + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/AudioTracks' + 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" }] + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/audio_tracks{audio_track_id}}': + get: + tags: + - Videos + summary: Get Video Audio Track + description: 'Gets one audio track for a video by its ID Dynamic Delivery only ' + operationId: GetVideoAudioTrack + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AudioTrackId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/AudioTrack' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Videos + summary: Update Video Audio Track + description: 'Updates audio track metadata for a video Dynamic Delivery only ' + operationId: UpdateVideoAudioTrack + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AudioTrackId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: Updates audio track metadata for a video Dynamic Delivery only + content: + application/json: + schema: + $ref: '#/components/schemas/AudioTrack' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/AudioTrack' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Videos + summary: Delete Video Audio Track + description: 'Deletes one audio track for a video by its ID Dynamic Delivery only ' + operationId: DeleteVideoAudioTrack + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AudioTrackId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/digital_master': + get: + tags: + - Videos + summary: Get Digital Master Info + description: 'Gets the stored digital master for a video, if any ' + operationId: GetDigitalMasterInfo + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/DigitalMaster' + '204': + description: >- + The video does not have a digital master + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Videos + summary: Delete Digital Master + description: >- + Deletes the archived digital master for a video. Be sure to read Digital Master Delete API before using this operation to understand the implications. + operationId: DeleteDigitalMaster + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/asset/delete + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/references': + get: + tags: + - Videos + summary: Get Playlists for Video + description: >- + Gets an array of Manual (EXPLICIT) playlists that contain a video object for the account + operationId: GetPlaylistsForVideo + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/PlaylistReferences' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Videos + summary: Remove Video from all Playlists + description: 'Removes the video from all EXPLICIT playlists for the account ' + operationId: RemoveVideoFromAllPlaylists + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/delete + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/ingest_jobs': + get: + tags: + - Videos + summary: Get Status of Ingest Jobs + description: |- + Get the status of all ingest jobs associated with a video (including the original ingestion, replacing and retranscoding the video). NOTE: this operation only works for videos that were ingested using **Dynamic Delivery** profiles. + + Possible states of jobs are: + * `processing` processing is underway, but no playable renditions have been created yet + * `publishing` at least one playable rendition has been created and is being published + * `published` at least one rendition is available for playback + * `finished` processing is complete + * `failed` processing failed - if you cannot figure what went wrong, contact Support + operationId: GetStatusOfIngestJobs + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/GetStatusVideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/IngestJobStatus' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: 'INTERNAL_ERROR: Error in the backend ' + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/ingest_jobs{job_id}}': + get: + tags: + - Videos + summary: Get Status of Ingest Job + description: |- + Get the status of an ingest job associated with a video (including the original ingestion, replacing and retranscoding the video). NOTE: this operation only works for videos that were ingested using **Dynamic Delivery** profiles. + + + Possible states of jobs are: + * `processing` processing is underway, but no playable renditions have been created yet + * `publishing` at least one playable rendition has been created and is being published + * `published` at least one rendition is available for playback + * `finished` processing is complete + * `failed` processing failed - if you cannot figure what went wrong, contact Support + operationId: GetStatusOfIngestJob + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/JobId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/IngestJobStatus' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: 'INTERNAL_ERROR: Error in the backend ' + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/clear_videos/{{video_id}}': + get: + tags: + - Clear-Sources + summary: Get Video with Clear Sources + description: |- + Get video data with unencrypted sources. + **Notes** + - 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. + - There will be egress bandwidth charges made to the customer when the sources are accessed. + operationId: GetClearVideo + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoSources' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/clear_sources': + get: + tags: + - Clear-Sources + summary: Get Video Clear Sources + description: |- + Get unencrypted sources for a video. + **Notes** + - 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. + - There will be egress bandwidth charges made to the customer when the sources are accessed. + - This endpoint requires the special permission `video-cloud/video/clear-sources` which is not available in the Studio UI. To generate credentials to get clear sources, this permission must be enabled for the account, and you must use the [OAuth API](/oauth/getting-started/overview-oauth-api-v4.html) + operationId: GetClearVideoSources + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoSources' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/clear-sources + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/video_fields': + get: + tags: + - Custom Fields + summary: Get Video Fields + description: 'Gets a list of custom fields for the account (note that this operation may later return standard fields as well - current it returns an empty array for `standard_fields`)' + operationId: GetVideoFields + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoFields' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/video_fields/custom_fields': + get: + tags: + - Custom Fields + summary: Get Custom Fields + description: 'Gets a list of custom fields for the account' + operationId: GetCustomFields + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/CustomFields' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Custom Fields + summary: Create a Custom Field + description: 'Create a new custom field for the account' + operationId: CreateCustomField + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: Properties for a new custom field + content: + application/json: + schema: + $ref: '#/components/schemas/customField' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/customField' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/video_fields/custom_fields/{{custom_field_id}}': + get: + tags: + - Custom Fields + summary: Get a Custom Field + description: 'Gets a list of custom fields for the account' + operationId: GetCustomField + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/custom_field_id' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/customField' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Custom Fields + summary: Update a Custom Field + description: 'Update a new custom field for the account' + operationId: UpdateCustomField + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/custom_field_id' + requestBody: + description: Update properties for a new custom field + content: + application/json: + schema: + $ref: '#/components/schemas/customFieldUpdate' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/customFieldUpdate' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Custom Fields + summary: Delete a Custom Field + description: 'Delete a new custom field for the account' + operationId: DeleteCustomField + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/custom_field_id' + responses: + '204': + description: '204 No Content' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/channels': + get: + tags: + - Media Sharing + summary: List Channels + description: >- + Gets a list of channels (currently there is only one default channel) - this is a Master account operation + operationId: ListChannels + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Channel' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact Support + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/sharing-relationships/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/channels{channel_name}}': + get: + tags: + - Media Sharing + summary: Get Channel Details + description: >- + Gets settings for a sharing channel (currently there is only one default channel) - this is a Master account operation + operationId: GetChannelDetails + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ChannelName' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Channel' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact Support + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/sharing-relationships/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Media Sharing + summary: Update Channel + description: >- + Updates settings for a sharing channel (currently there is only one default channel) - this is a Master account operation + operationId: UpdateChannel + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ChannelName' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Updates settings for a sharing channel (currently there is only one + default channel) - this is a Master account operation + content: + application/json: + schema: + $ref: '#/components/schemas/Channel' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Channel' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/sharing-relationships/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/channels{channel_name}}/members': + get: + tags: + - Media Sharing + summary: List Channel Affiliates + description: >- + Gets a list of affiliates for a channel - this is a Master account + operation + operationId: ListChannelAffiliates + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ChannelName' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChannelAffiliate' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/sharing-relationships/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/channels{channel_name}}/members/{{affiliate_account_id}}': + put: + tags: + - Media Sharing + summary: Add Affiliate + description: 'Adds an affiliate to a channel - this is a Master account operation ' + operationId: AddAffiliate + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ChannelName' + - $ref: '#/components/parameters/AffiliateAccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: Adds an affiliate to a channel - this is a Master account operation + content: + application/json: + schema: + $ref: '#/components/schemas/AddAffiliate' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/AddAffiliate' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/sharing-relationships/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Media Sharing + summary: Remove Affiliate + description: >- + Removes an affiliate from a channel - this is a Master account operation + operationId: RemoveAffiliate + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ChannelName' + - $ref: '#/components/parameters/AffiliateAccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/sharing-relationships/delete + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/contracts': + get: + tags: + - Media Sharing + summary: List Contracts + description: >- + Gets a list of available sharing contracts - this is an Affiliate account operation + operationId: ListContracts + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Contract' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/sharing-relationships/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/contracts/{{master_account_id}}': + get: + tags: + - Media Sharing + summary: Get Contract + description: >- + Gets a list of available sharing contracts - this is an Affiliate account operation + operationId: GetContract + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/MasterAccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Contract' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/sharing-relationships/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Media Sharing + summary: Approve Contract + description: 'Approve a contract - this is an Affiliate account operation ' + operationId: ApproveContract + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/MasterAccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Gets a list of available sharing contracts - this is an Affiliate + account operation + content: + application/json: + schema: + $ref: '#/components/schemas/Contract' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Contract' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/sharing-relationships/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/shares': + get: + tags: + - Media Sharing + summary: List Shares + description: >- + Lists the existing shares for an account - this is a Master account operation - do this before sharing to insure that you are not re-sharing to an affiliate, which would overwrite any affiliate metadata changes + operationId: ListShares + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VideoShare' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Media Sharing + summary: Share Video + description: >- + Shares a video to one or more affiliates - this is an Master account operation - if the video has already been shared to an affiliate, this operation will re-share it and overwrite any affiliate metadata changes + operationId: ShareVideo + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Shares a video to one or more affiliates - this is an Master account operation - if the video has already been shared to an affiliate, this operation will re-share it and overwrite any affiliate metadata + changes + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ShareVideoRequest' + description: >- + Shares a video to one or more affiliates - this is an Master account operation - if the video has already been shared to an affiliate, this operation will re-share it and overwrite any affiliate metadata changes + required: true + responses: + '202': + description: Share request accepted + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VideoShare' + description: Share request accepted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/create + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/shares/{{affiliate_account_id}}': + get: + tags: + - Media Sharing + summary: Get Share + description: >- + Lists the existing shares for an account - this is a Master account operation - do this before sharing to insure that you are not re-sharing to an affiliate, which would overwrite any affiliate metadata changes + operationId: GetShare + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AffiliateAccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoShare' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Media Sharing + summary: Unshare Video + description: >- + Un-shares a video with a specific affiliate - this is an Master account operation - do this before sharing to insure that you are not re-sharing to an affiliate, which would overwrite any affiliate metadata changes + operationId: UnshareVideo + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AffiliateAccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is unavailable - this may be a temporary condition while some kind of processing of the video is in progress, but if the message persists, contact + '404': + description: 'RESOURCE_NOT_FOUND: Resource not found ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/delete + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/playlists': + get: + tags: + - Playlists + summary: Get Playlists + description: 'Gets a page of playlist objects for the account ' + operationId: GetPlaylists + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/SearchPlaylists' + - $ref: '#/components/parameters/PlaylistSort' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Playlist' + '400': + description: >- + 'INVALID_SORT: sort parameter specified and invalid field + + INVALID_SEARCH: search string invalid (may not have been + URI-encoded)' + '401': + description: >- + UNAUTHORIZED: Authentication failed - check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/playlist/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Playlists + summary: Create Playlist + description: |- + Creates a new playlist. + + **A maximum of 1000 videos can be added to a playlist** (both Manual and Smart). There is no limit to the number of playlists that can be created. The videos that are initially loaded into a playlist in the player is determined by the type of playlist. + operationId: CreatePlaylist + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: Creates a new playlist + content: + application/json: + schema: + $ref: '#/components/schemas/PlaylistInputFields' + required: true + responses: + '201': + description: Playlist created + content: + application/json: + schema: + $ref: '#/components/schemas/Playlist' + '400': + description: 'BAD_VALUE: The JSON could not be parsed ' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: 'REFERENCE_ID_IN_USE: The specified reference id is already in use ' + '422': + description: 'ILLEGAL_FIELD: Spelling error or use of non-existent field ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/playlist/create + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/counts/playlists': + get: + tags: + - Playlists + summary: Get Playlist Count + description: 'Gets a count of playlists in the account for the account ' + operationId: GetPlaylistCount + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/Search' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/PlaylistCount' + '400': + description: >- + 'INVALID_SORT: sort parameter specified and invalid field + + INVALID_SEARCH: search string invalid (may not have been + URI-encoded)' + '401': + description: >- + UNAUTHORIZED: Authentication failed - check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/playlist/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/playlists/{{playlist_id}}': + get: + tags: + - Playlists + summary: Get Playlists by ID + description: 'Gets one or more playlist objects for the account ' + operationId: GetPlaylistById + parameters: + - $ref: '#/components/parameters/AccountId' + - name: playlist_id + in: path + description: >- + Video Cloud playlist ID, or multiple playlist ids separated by commas. + required: true + style: simple + explode: false + schema: + type: string + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Playlist' + '400': + description: >- + 'INVALID_SORT: sort parameter specified and invalid field + + INVALID_SEARCH: search string invalid (may not have been + URI-encoded)' + '401': + description: >- + UNAUTHORIZED: Authentication failed - check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/playlist/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Playlists + summary: Update Playlist + description: 'Updates a playlist for the account ' + operationId: UpdatePlaylist + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/PlaylistId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: Updates a playlist for the account + content: + application/json: + schema: + $ref: '#/components/schemas/PlaylistInputFields' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Playlist' + '400': + description: 'BAD_VALUE: The JSON could not be parsed ' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: 'REFERENCE_ID_IN_USE: The specified reference id is already in use ' + '422': + description: 'ILLEGAL_FIELD: Spelling error or use of non-existent field ' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/playlist/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Playlists + summary: Delete Playlist + description: 'Deletes a playlist ' + operationId: DeletePlaylists + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/PlaylistId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: 'NO_CONTENT' + '400': + description: >- + 'INVALID_SORT: sort parameter specified and invalid field + + INVALID_SEARCH: search string invalid (may not have been URI-encoded)' + '401': + description: >- + UNAUTHORIZED: Authentication failed - check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/playlist/delete + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/playlists/{{playlist_id}}/videos': + get: + tags: + - Playlists + summary: Get Videos in Playlist + description: 'Gets the video objects for videos in a playlist for the account ' + operationId: GetVideosInPlaylist + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/PlaylistId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/include_details' + - $ref: '#/components/parameters/Limit_Playlist_Videos' + - $ref: '#/components/parameters/Offset' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Video' + '400': + description: >- + 'INVALID_SORT: sort parameter specified and invalid field + + INVALID_SEARCH: search string invalid (may not have been URI-encoded)' + '401': + description: >- + UNAUTHORIZED: Authentication failed - check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/playlist/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/counts/playlists/{{playlist_id}}/videos': + get: + tags: + - Playlists + summary: Get Video Count in Playlist + description: 'Gets a count of the videos in a playlist for the account ' + operationId: GetVideoCountInPlaylist + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/PlaylistId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoCountInPlaylist' + '400': + description: >- + 'INVALID_SORT: sort parameter specified and invalid field + + INVALID_SEARCH: search string invalid (may not have been + URI-encoded)' + '401': + description: >- + UNAUTHORIZED: Authentication failed - check to make sure your client credentials were correct for the access token + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + deprecated: false + security: + - BC_OAuth2: + - video-cloud/playlist/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/folders': + get: + tags: + - Folders + summary: Get Folders + description: 'Gets list of folders for the account ' + operationId: GetFolders + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Folder' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Folders + summary: Create Folder + description: 'Create a new folder for the account - **note** that there is a limit of 1000 folders per account' + operationId: CreateFolder + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: Create a new folder for the account + content: + application/json: + schema: + $ref: '#/components/schemas/Folder' + required: true + responses: + '201': + description: Folder created + content: + application/json: + schema: + $ref: '#/components/schemas/Folder' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '409': + description: >- + MAXIMUM_FOLDER_COUNT_REACHED: You have exceeded the maximum number of folders + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/create + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/folders/{{folder_id}}': + get: + tags: + - Folders + summary: Get Folder Information + description: 'Gets information about a folder ' + operationId: GetFolderInformation + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/FolderId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Folder' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Folders + summary: Update Folder Name + description: 'Update the folder name ' + operationId: UpdateFolderName + parameters: + - $ref: '#/components/parameters/AccountId' + - name: folder_id + in: path + description: the folder ID + required: true + style: simple + explode: false + schema: + type: string + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: Update the folder name + content: + application/json: + schema: + $ref: '#/components/schemas/Folder' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Folder' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Folders + summary: Delete Folder + description: 'Delete a folder ' + operationId: DeleteFolder + parameters: + - $ref: '#/components/parameters/AccountId' + - name: folder_id + in: path + description: the folder ID + required: true + style: simple + explode: false + schema: + type: string + - name: name + in: query + description: 'name of the folder (must be unique in the account)' + required: true + style: form + explode: true + schema: + type: string + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '201': + description: '201' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/delete + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/folders/{{folder_id}}/videos': + get: + tags: + - Folders + summary: Get Videos in Folder + description: 'Gets list of video objects in a folder ' + operationId: GetVideosInFolder + parameters: + - $ref: '#/components/parameters/AccountId' + - name: folder_id + in: path + description: the folder ID. + required: true + style: simple + explode: false + schema: + type: string + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/Limit' + - $ref: '#/components/parameters/Offset' + - $ref: '#/components/parameters/VideoSort' + responses: + '200': + description: Videos in the folder + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Video' + description: Videos in the folder + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/folders/{{folder_id}}/videos/{{video_id}}': + put: + tags: + - Folders + summary: Add Video to Folder + description: 'Add a video to a folder ' + operationId: AddVideoToFolder + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/FolderId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: 'NO_CONTENT' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Folders + summary: Remove Video from Folder + description: 'Remove a video from a folder ' + operationId: RemoveVideoFromFolder + parameters: + - $ref: '#/components/parameters/AccountId' + - name: folder_id + in: path + description: the folder ID + required: true + style: simple + explode: false + schema: + type: string + - name: video_id + in: path + description: the video ID + required: true + style: simple + explode: false + schema: + type: string + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '201': + description: Video successfully removed from the folder + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/labels': + post: + tags: + - Labels + summary: Create a Label + description: 'Create a new label for the account ' + operationId: CreateLabel + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: Create a new label for the account + content: + application/json: + schema: + $ref: '#/components/schemas/LabelPath' + required: true + responses: + '201': + description: Label created + content: + application/json: + schema: + $ref: '#/components/schemas/LabelPath' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/create + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + get: + tags: + - Labels + summary: Get Labels + description: 'Gets list of labels for the account ' + operationId: GetLabels + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/LabelsList' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/labels/by_path/{{label_path}}': + patch: + tags: + - Labels + summary: Update a Label + description: 'Update a label for the account' + operationId: UpdateLabel + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/label_path' + requestBody: + description: Update a label for the account + content: + application/json: + schema: + $ref: '#/components/schemas/LabelUpdate' + required: true + responses: + '201': + description: Label updated + content: + application/json: + schema: + $ref: '#/components/schemas/LabelPath' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/create + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Labels + summary: Delete Label + description: 'Delete a label' + operationId: deleteLabel + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/Authorization' + - $ref: '#/components/parameters/label_path' + responses: + '204': + description: '204 No Content' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/subscriptions': + get: + tags: + - Notifications + summary: Get Subscriptions List + description: 'Get a list of all notification subscriptions for the account ' + operationId: GetSubscriptionsList + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Subscription' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/notifications/all + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Notifications + summary: Create Subscription + description: >- + Establishes up to 10 endpoints that video changes should be sent to. Any + change in video metadata will trigger a video change event and a + notification - changes to assets used by the video will not + trigger change events. + operationId: CreateSubscription + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Establishes up to 10 endpoints that video changes should be sent to. + Any change in video metadata will trigger a video change event and a + notification - changes to assets used by the video will not + trigger change events. + content: + application/json: + schema: + $ref: '#/components/schemas/Subscription' + required: true + responses: + '201': + description: Subscription created + content: + application/json: + schema: + $ref: '#/components/schemas/Subscription' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '422': + description: >- + Unprocessable_Entity: 1) You already have a subscription for the + video-change event that delivers to that address; 2) the endpoint or + events field is missing from the request; 3) you already have 10 + subscriptions to this event + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/notifications/all + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/subscriptions/{{subscription_id}}': + get: + tags: + - Notifications + summary: Get Subscription + description: 'Get a notification subscription for the account ' + operationId: GetSubscription + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/SubscriptionId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Subscription' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/notifications/all + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Notifications + summary: Delete Subscription + description: 'Delete a notification subscription for the account ' + operationId: DeleteSubscription + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/SubscriptionId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/notifications/all + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets': + get: + tags: + - Media Assets + summary: Get Assets + description: >- + Gets assets for a given video. Note: you can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetAssets + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VideoAsset' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/dynamic_renditions': + get: + tags: + - Media Assets + summary: 'Get Dynamic Renditions (renditions for Dynamic Delivery videos)' + description: >- + Gets a list of dynamic renditions for a Dynamic Delivery video. Note: + you can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetDynamicRenditions + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DynamicRendition' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/renditions': + post: + tags: + - Media Assets + summary: Add Rendition + description: >- + Add a remote rendition to the given video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: AddRendition + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Add a remote rendition to the given video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + content: + application/json: + schema: + $ref: '#/components/schemas/VideoAsset' + required: true + responses: + '201': + description: Rendition asset created + content: + application/json: + schema: + $ref: '#/components/schemas/VideoAsset' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + + MIXED_REMOTE_NOT_ALLOWED: Remote renditions may not be added to + ingested videos + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: 'REFERENCE_ID_IN_USE: The specified reference id is already in use ' + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/renditions/{{asset_id}}': + get: + tags: + - Media Assets + summary: Get Rendition + description: >- + Gets a specified rendition for a video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetRendition + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoAsset' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Media Assets + summary: Update Rendition + description: >- + Update the location for a remote rendition. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: UpdateRendition + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Update the location for a remote rendition. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + content: + application/json: + schema: + $ref: '#/components/schemas/VideoAsset' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/VideoAsset' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + + MIXED_REMOTE_NOT_ALLOWED: Remote renditions may not be added to + ingested videos + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: 'REFERENCE_ID_IN_USE: The specified reference id is already in use ' + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Media Assets + summary: Delete Rendition + description: >- + Deletes a remote rendition for the given video. Note: this operation is **only + for remote renditions for remote asset videos** do *not* use it for + renditions created by Video Cloud for ingested videos! + operationId: DeleteRendition + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/hls_manifest': + get: + tags: + - Media Assets + summary: Get HLS Manifest List + description: >- + Gets the `hls_manifest` for a given video. Notes: 1) you can use + `/videos/ref:reference_id` instead of `/videos/video_id` 2) this method only + returns a remote asset HLS manifest, not manifests for ingested videos + operationId: GetHlsManifestList + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Media Assets + summary: Add HLS Manifest + description: >- + Adds the location of an hls_manifest file for a remote asset. Note: you + can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: AddHlsManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Adds the location of an hls_manifest file for a remote asset. Note: + you can use `/videos/ref:reference_id` instead of `/videos/video_id` + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + required: true + responses: + '201': + description: Manifest asset created + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/hls_manifest/{{asset_id}}': + get: + tags: + - Media Assets + summary: Get HLS Manifest + description: >- + Gets an hls_manifest for a given video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetHlsManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Media Assets + summary: Update HLS Manifest + description: >- + Updates the location of a remote hls_manifest file for a remote asset. + Note: you can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: UpdateHlsManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Updates the location of a remote hls_manifest file for a remote asset. + Note: you can use `/videos/ref:reference_id` instead of `/videos/video_id` + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: 'REFERENCE_ID_IN_USE: The specified reference id is already in use ' + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Media Assets + summary: Delete HLS Manifest + description: >- + Deletes an hls_manifest file for a remote asset. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: DeleteHlsManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/dash_manifests': + get: + tags: + - Media Assets + summary: Get DASH Manifest List + description: >- + Gets the dash_manifests for a given video. Notes: 1. you can have + multiple dash manifests with profiles; you can have only one dash + manifest without a profile, but one manifest without a profile can be + combined with multiple manifests with profiles; 2. all manifests + intended to be used with the CMS API should include a profile - only + DASH manifests with profiles will be returned by the CMS API - + only a single DASH manifest without a profile will be returned by the + Media API 3. you can use /videos/ref:reference_id instead of + /videos/video_id + operationId: GetDashManifestList + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Media Assets + summary: Add DASH Manifest + description: >- + Adds a location for a remote DASH manifest Notes: 1. you can have + multiple dash manifests with profiles; you can have only one dash + manifest without a profile, but one manifest without a profile can be + combined with multiple manifests with profiles; 2. all manifests + intended to be used with the CMS API should include a profile - only + DASH manifests with profiles will be returned by the CMS API - + only a single DASH manifest without a profile will be returned by the + Media API 3. you can use /videos/ref:reference_id instead of + /videos/video_id + operationId: AddDashManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Adds a location for a remote DASH manifest Notes: 1. you can have + multiple dash manifests with profiles; you can have only one dash + manifest without a profile, but one manifest without a profile can be + combined with multiple manifests with profiles; 2. all manifests + intended to be used with the CMS API should include a profile - only + DASH manifests with profiles will be returned by the CMS API - + only a single DASH manifest without a profile will be returned by the + Media API 3. you can use /videos/ref:reference_id instead of + /videos/video_id + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + required: true + responses: + '201': + description: Manifest asset created + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/dash_manifests/{{asset_id}}': + get: + tags: + - Media Assets + summary: Get DASH Manifest + description: >- + Gets a dash_manifest for a given video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetDashManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Media Assets + summary: Update DASH Manifest + description: >- + Updates the location of a remote dash_manifest file for a remote asset. + Note: you can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: UpdateDashManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Updates the location of a remote dash_manifest file for a remote + asset. Note: you can use /videos/ref:reference_id instead of + /videos/video_id + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: 'REFERENCE_ID_IN_USE: The specified reference id is already in use ' + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Media Assets + summary: Delete DASH Manifest + description: >- + Deletes an dash_manifest file for a remote asset. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: DeleteDashManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/hds_manifest': + get: + tags: + - Media Assets + summary: Get HDS Manifest List + description: >- + Gets the hds_manifest file for a given video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetHdsManifestList + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Media Assets + summary: Add HDS Manifest + description: >- + Adds the location of an hds_manifest file for a remote asset. Note: you + can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: AddHdsManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Adds the location of an hds_manifest file for a remote asset. Note: + you can use `/videos/ref:reference_id` instead of `/videos/video_id` + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + required: true + responses: + '201': + description: Manifest asset created + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/hds_manifest/{{asset_id}}': + get: + tags: + - Media Assets + summary: Get HDS Manifest + description: >- + Gets the hds_manifest file for a given video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetHdsManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Media Assets + summary: Update HDS Manifest + description: >- + Updates the location of a remote hds_manifest file for a remote asset. + Note: you can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: UpdateHdsManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Updates the location of a remote hds_manifest file for a remote asset. + Note: you can use `/videos/ref:reference_id` instead of `/videos/video_id` + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: 'REFERENCE_ID_IN_USE: The specified reference id is already in use ' + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Media Assets + summary: Delete HDS Manifest + description: >- + Deletes an hds_manifest file for a remote asset. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: DeleteHdsManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/ism_manifest': + get: + tags: + - Media Assets + summary: Get ISM Manifest List + description: >- + Gets the ism_manifest for a given video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetIsmManifestList + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Media Assets + summary: Add ISM Manifest + description: >- + Adds the location of an ism_manifest file for a remote asset. Note: you + can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: AddIsmManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Adds the location of an ism_manifest file for a remote asset. Note: + you can use `/videos/ref:reference_id` instead of `/videos/video_id` + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + required: true + responses: + '201': + description: Manifest asset created + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/ism_manifest/{{asset_id}}': + get: + tags: + - Media Assets + summary: Get ISM Manifest + description: >- + Gets an ism_manifest for a given video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetIsmManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Media Assets + summary: Update ISM Manifest + description: >- + Updates the location of a remote ism_manifest file for a remote asset. + Note: you can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: UpdateIsmManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Updates the location of a remote ism_manifest file for a remote asset. + Note: you can use `/videos/ref:reference_id` instead of `/videos/video_id` + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: 'REFERENCE_ID_IN_USE: The specified reference id is already in use ' + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Media Assets + summary: Delete ISM Manifest + description: >- + Deletes an ism_manifest file for a remote asset. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: DeleteIsmManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/ismc_manifest': + get: + tags: + - Media Assets + summary: Get ISMC Manifest List + description: >- + Gets the ismc_manifest files for a given video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetIsmcManifestList + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + post: + tags: + - Media Assets + summary: Add ISMC Manifest + description: >- + Adds the location of an ismc_manifest file for a remote asset. Note: you + can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: AddIsmcManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Adds the location of an ismc_manifest file for a remote asset. Note: + you can use `/videos/ref:reference_id` instead of `/videos/video_id` + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + required: true + responses: + '201': + description: Manifest asset created + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + '/v1/accounts/{{account_id}}/videos/{{video_id}}/assets/ismc_manifest/{{asset_id}}': + get: + tags: + - Media Assets + summary: Get ISMC Manifest + description: >- + Gets the ismc_manifest file for a given video. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: GetIsmcManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/read + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + patch: + tags: + - Media Assets + summary: Update ISMC Manifest + description: >- + Updates the location of a remote ismc_manifest file for a remote asset. + Note: you can use `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: UpdateIsmcManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + requestBody: + description: >- + Updates the location of a remote ismc_manifest file for a remote + asset. Note: you can use /videos/ref:reference_id instead of + /videos/video_id + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + required: true + responses: + '200': + description: '200' + content: + application/json: + schema: + $ref: '#/components/schemas/Manifest' + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '409': + description: 'REFERENCE_ID_IN_USE: The specified reference id is already in use ' + '422': + description: 'VALIDATION_ERROR: remote_url' + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false + delete: + tags: + - Media Assets + summary: Delete ISMC Manifest + description: >- + Deletes an ismc_manifest file for a remote asset. Note: you can use + `/videos/ref:reference_id` instead of `/videos/video_id` + operationId: DeleteIsmcManifest + parameters: + - $ref: '#/components/parameters/AccountId' + - $ref: '#/components/parameters/VideoId' + - $ref: '#/components/parameters/AssetId' + - $ref: '#/components/parameters/ContentType' + - $ref: '#/components/parameters/Authorization' + responses: + '204': + description: Item was deleted + '401': + description: >- + UNAUTHORIZED: Authentication failed; check to make sure your client credentials were correct for the access token + '403': + description: >- + NOT_AVAILABLE: The resource you are requesting is temporarily unavailable + '404': + description: >- + RESOURCE_NOT_FOUND: The api could not find the resource you requested + '405': + description: >- + METHOD_NOT_ALLOWED: The HTTP method specified is not allowed for this endpoint + '429': + description: >- + TOO_MANY_REQUESTS: You are submitting too many simultaneous requests or too many requests per second + '500': + description: |- + UNKNOWN: Issue in Brightcove system; try again later. + TIMEOUT: Server likely too busy; try again later. + deprecated: false + security: + - BC_OAuth2: + - video-cloud/video/update + x-operation-settings: + CollectParameters: false + AllowDynamicQueryParameters: false + AllowDynamicFormParameters: false + IsMultiContentStreaming: false +components: + parameters: + AccountId: + description: Video Cloud account ID. + explode: false + in: path + name: account_id + required: true + schema: + type: string + style: simple + AffiliateAccountId: + description: Video Cloud affiliate account ID for media sharing relationships + explode: false + in: path + name: affiliate_account_id + required: true + schema: + type: string + style: simple + AssetId: + description: The asset ID + explode: false + in: path + name: asset_id + required: true + schema: + type: string + style: simple + AudioTrackId: + description: 'the id for the audio track, formed as `language_variant`' + explode: false + in: path + name: audio_track_id + required: true + schema: + type: string + style: simple + Authorization: + description: 'Authorization: Bearer {access_token} - see [Getting Access Tokens](/oauth/code-samples/oauth-api-sample-get-access-token.html)' + explode: false + in: header + name: Authorization + required: true + schema: + type: string + style: simple + ChannelName: + description: The name of the channel - usually `default` + explode: false + in: path + name: channel_name + required: true + schema: + type: string + style: simple + ContentType: + description: 'Content-Type: application/json' + example: application/json + explode: false + in: header + name: Content-Type + required: true + schema: + default: application/json + type: string + style: simple + FolderId: + description: Folder ID. + explode: false + in: path + name: folder_id + required: true + schema: + type: string + style: simple + custom_field_id: + description: Custom Field ID. + explode: false + in: path + name: custom_field_id + required: true + schema: + type: string + style: simple + GetStatusVideoId: + description: |- + Video ID. + + For example: + - https://cms.api.brightcove.com/v1/accounts/{{account_id}}/videos/9827342837937 + explode: false + in: path + name: video_id + required: true + schema: + type: string + style: simple + include_variants: + description: 'Whether to include the language variants in the response' + explode: true + in: query + name: include_variants + schema: + default: true + type: boolean + style: form + JobId: + description: The Job ID for the ingest job (returned in the response to an ingest request) + explode: false + in: path + name: job_id + required: true + schema: + type: string + style: simple + label_path: + description: >- + 'The path for a label to update or delete. Note that the operation performed is on the last item in the path, so for example, if you specify the path `/nature/birds/seabirds`, only the `seabirds` label will be updated/deleted, but if you specify the path as `/nature/birds`, `birds` and any sub-labels of `birds` will be updated/deleted.' + explode: false + in: path + name: label_path + required: true + schema: + type: string + style: simple + Language: + description: 'The language for the variant in the language-country code format (examples: en-US, es-ES)' + explode: false + in: path + name: language + required: true + schema: + type: string + style: simple + Limit: + description: 'Number of items to return - see [Paging Search Results](/cms/searching/using-cms-api-page-search-results.html) for more information' + explode: true + in: query + name: limit + schema: + default: 20 + example: 20 + format: int32 + maximum: 100 + minimum: 1 + type: integer + style: form + Limit_Playlist_Videos: + description: 'Number of items to return - see [Get videos in a playlist](/cms/managing-videos/managing-playlists-using-cms-api.html#get_count_of_videos) for more information' + explode: true + in: query + name: limit + schema: + default: 100 + example: 20 + format: int32 + maximum: 100 + minimum: 1 + type: integer + style: form + MasterAccountId: + description: Video Cloud master account ID for media sharing relationships + explode: false + in: path + name: master_account_id + required: true + schema: + type: string + style: simple + Offset: + description: 'Number of items to skip - see [Paging Search Results](/cms/searching/using-cms-api-page-search-results.html) for more information' + explode: true + in: query + name: offset + schema: + default: 0 + example: 20 + format: int32 + type: integer + style: form + PlaylistId: + description: Playlist ID. + explode: false + in: path + name: playlist_id + required: true + schema: + type: string + style: simple + PlaylistSort: + description: 'Field to sort results by - if absent and there is a search string, results are sorted by relevance or if there is no search string, results are sorted by `-updated_at` - note: to sort in descending order, preface the field name with a minus(`-`) sign. If the `q=` param is missing, the sort param will be ignored. Also if sort is set to an unsupported field, the quest will fail with an error' + explode: true + in: query + name: sort + schema: + default: '-updated_at' + enum: + - name + - -name + - updated_at + - -updated_at + example: name + type: string + x-enum-elements: + - description: The playlist name + name: name + - description: Date playlist was last updated (by a user or the system) + name: updated_at + style: form + Search: + description: 'Search string - see [search guide](/cms/searching/cms-and-playback-apis-video-search-v2.html) for details' + explode: true + in: query + name: query + schema: + example: '+name:Birds' + type: string + style: form + SearchPlaylists: + description: 'Search string - see [playlist search guide](/cms/searching/cms-api-playlists-search.html) for details' + explode: true + in: query + name: q + schema: + example: 'name:%28Really%20Short%20Videos%29%20type:EXPLICIT' + type: string + style: form + SubscriptionId: + description: Subscription ID. + explode: false + in: path + name: subscription_id + required: true + schema: + type: string + style: simple + Label: + description: 'Image type' + explode: false + in: path + name: label + required: true + schema: + type: string + enum: + - poster + - thumbnail + - wide + - ultra-wide + - portrait + - square + style: simple + VideoId: + description: 'Video ID (specified as `{video_id}}`) or reference id (specified as `/ref:{reference_id}`).' + explode: false + in: path + name: video_id + required: true + schema: + type: string + style: simple + VideoIds: + description: |- + 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 + explode: false + in: path + name: video_ids + required: true + schema: + type: string + style: simple + VideoSort: + description: |- + Field to sort results by - if absent and there is a search string, results are sorted by relevance or if there is no search string, results are sorted by `-updated_at`. + Notes: + - to sort in descending order, preface the field name with a minus (`-`) sign + - this parameter can be used to sort results both for a get videos request and for a get videos in folder request + explode: true + in: query + name: sort + schema: + default: '-updated_at' + enum: + - name + - -name + - reference_id + - -reference_id + - created_at + - -created_at + - published_at + - -published_at + - updated_at + - -updated_at + - schedule.starts_at + - -schedule.ends_at + - state + - -state + - plays_total + - -plays_total + - plays_trailing_week + - -plays_trailing_week + example: created_at + type: string + x-enum-elements: + - description: The video name + name: name + - description: The video reference id + name: reference_id + - description: Date video was created in the Video Cloud + name: created_at + - description: Date video was activated + name: published_at + - description: Date video was last updated (by a user or the system) + name: updated_at + - description: Date video scheduled to become available + name: schedule.starts_at + - description: Date video scheduled to become unavailable + name: schedule.ends_at + - description: Whether the video is playable (`ACTIVE` or `INACTIVE`) + name: state + - description: All time video views (this field can only be sorted on - it is not returned) + name: plays_total + - description: Trailing week video views (this field can only be sorted on - it is not returned) + name: plays_trailing_week + style: form + include_details: + description: When it's false, api call response won't include caption info in [text_tracks] at all and it makes the response returns quicker. + explode: true + in: query + name: include_details + schema: + default: true + type: boolean + style: form + schemas: + AddAffiliate: + example: + account_id: '1937897674001' + properties: + account_id: + description: affiliate account id + type: string + title: AddAffiliate + type: object + AudioTrack: + properties: + duration: + description: URL the duration of the audio track in milliseconds + example: 86053 + readOnly: true + type: integer + encoding_rates: + description: array of encoding rates for the audio track renditions in KBPS + readOnly: true + example: + - 64000 + - 96000 + - 127000 + - 192000 + items: + type: integer + type: array + id: + description: ID for the audio track formed as language_variant + example: en_alternate + readOnly: true + type: string + is_default: + description: Whether this is the default audio track + example: true + type: boolean + language: + description: language code for the audio track + example: en-US + type: string + variant: + description: the type of audio track (default can be set for the account by contacting Brightcove Support) + enum: + - main + - alternate + - commentary + - dub + - descriptive + example: main + type: string + title: AudioTrack + type: object + AudioTracks: + description: Audio tracks for the video + items: + $ref: '#/components/schemas/AudioTrack' + title: Audio Tracks + type: array + Channel: + description: the channel this contract belongs to + example: + - account_id: '1486906377' + account_name: Brightcove Training + created_at: '2017-09-27T13:54:08.661Z' + enforce_custom_fields: false + enforce_geo: true + name: default + updated_at: '2017-09-27T13:54:08.661Z' + properties: + account_id: + description: master account id + type: string + account_name: + description: master account name + type: string + created_at: + description: when the channel was created + readOnly: true + type: string + enforce_custom_fields: + description: 'if true, will allow sharing only if the affiliate account has all custom fields that have values for the video to be shared' + type: boolean + enforce_geo: + description: 'if true, and master account is enabled for geo-filtering' + type: boolean + name: + description: channel name + type: string + updated_at: + description: when the channel was last updated + type: string + title: Channel + type: object + ChannelAffiliate: + example: + - account_id: '57838016001' + account_name: BrightcoveLearning + approved: true + - account_id: '1481353044001' + account_name: BC - Samples + approved: true + - account_id: '301925175' + account_name: BC Home Page Player + approved: true + properties: + account_id: + description: affiliate account id + type: string + account_name: + description: affiliate account name + type: string + approved: + description: whether the affiliate has approved the relationship + type: boolean + required: + - account_id + - account_name + - approved + title: ChannelAffiliate + type: object + Contract: + example: + - account_id: '1485884786001' + approved: true + approved_at: '2017-08-27T12:27:21.582Z' + auto_accept: true + channel: + account_id: '57838016001' + name: default + channel_account_name: BrightcoveLearning + created_at: '2017-08-23T17:45:41.556Z' + updated_at: '2017-12-27T19:29:49.498Z' + properties: + account_id: + description: affiliate account id + type: string + approved: + description: whether the contract is approved + type: boolean + approved_at: + description: when the contract was approved + type: string + auto_accept: + description: whether shared videos will be automatically accepted + type: boolean + channel: + $ref: '#/components/schemas/Channel' + created_at: + description: when the contract was created + readOnly: true + type: string + updated_at: + description: when the contract was last updated + readOnly: true + type: string + title: Contract + type: object + CreateVideoRequestBodyFields: + description: 'Only certain video metadata fields can be set when you initially create the video, and are listed here. Other fields must be set through an update (`PATCH`) request type: object' + properties: + cue_points: + description: Array of cuepoint objects + items: + $ref: '#/components/schemas/CuePoint' + type: array + custom_fields: + description: 'map of `fieldname: value` pairs; values have a maximum length of 1024 single-byte characters Note: be sure to use the **internal** name for the field, not the display name' + example: + subject: birds + type: object + description: + description: Video short description + maxLength: 250 + example: Laughing Gull + type: string + drm_disabled: + description: Use to disable DRM packaging for this video - applies only to DRM-enabled accounts + example: true + type: boolean + economics: + description: whether the video supports ads + enum: + - AD_SUPPORTED + - FREE + example: AD_SUPPORTED + type: string + geo: + $ref: '#/components/schemas/Geo' + long_description: + description: A longer description of the video + example: 'Herring Gull near Fort Point Channel in Boston, MA, USA. 2019-04-25.' + maxLength: 5000 + type: string + name: + description: Title of the video video + example: A happy herring gull + maxLength: 250 + minLength: 1 + type: string + offline_enabled: + default: false + description: whether video is enabled for offline viewing + example: true + type: boolean + reference_id: + description: Reference id for the clip - must be unique within the account + example: laughing_gull_2019_04_25 + type: string + schedule: + $ref: '#/components/schemas/Schedule' + state: + description: Whether the video should be active or inactive + enum: + - ACTIVE + - INACTIVE + example: ACTIVE + type: string + tags: + description: >- + Array of tags for the video - note that tags are string that may not contain a comma or more than 128 characters + example: + - birds + - sea + items: + type: string + maxLength: 128 + type: array + required: + - name + title: Create Video Request Body Fields + CuePoint: + properties: + force_stop: + description: Whether playback should be stopped when the cuepoint is reached + type: boolean + metadata: + description: optional metadata string (512 single-byte characters maximum) + maxLength: 512 + type: string + name: + description: cue point name + type: string + time: + description: time of the cue point in seconds + example: 10.527 + type: number + type: + description: cue point type + enum: + - AD + - DATA + type: string + required: + - time + - type + title: cue_point + type: object + DigitalMaster: + properties: + created_at: + description: date/time created + example: 2019-04-30T10:09:12.548Z + readOnly: true + type: string + duration: + description: duration in milliseconds + example: 31431 + type: integer + encoding_rate: + description: encoding rate in bps + example: 23152000 + readOnly: true + type: integer + height: + description: frame height in pixels + example: 1080 + readOnly: true + type: integer + id: + description: the system id for the digital master + example: a0a2e032-4de4-4495-a59e-a806d52989 + readOnly: true + type: string + size: + description: file size in bytes + example: 90990884 + readOnly: true + type: integer + updated_at: + description: date/time last modified + example: 2019-04-30T10:09:12.548Z + readOnly: true + type: string + width: + description: frame width in pixels + example: 1920 + readOnly: true + type: integer + title: DigitalMaster + type: object + Drm: + description: DRM packaging details (not applicable to remote assets or Dynamic Delivery accounts) + nullable: true + properties: + metadata_cdn_origin_id: + type: string + metadata_sharded_directory: + type: string + packager_version: + type: string + state: + type: string + readOnly: true + title: Drm + type: object + DynamicRendition: + example: + - audio_configuration: L_R + created_at: '2016-11-14T15:05:56.209Z' + duration: 31488 + encoding_rate: 125000 + frame_height: null + frame_width: null + language: en + media_type: audio + rendition_id: default/audio128 + size: 506818 + updated_at: '2016-11-14T15:05:56.209Z' + variant: main + - created_at: '2016-11-14T15:06:17.295Z' + duration: 31465 + encoding_rate: 902000 + frame_height: 360 + frame_width: 640 + media_type: video + rendition_id: default/video900 + size: 3561912 + updated_at: '2016-11-14T15:06:17.295Z' + variant: main + properties: + audio_configuration: + description: The audio configuration of the audio track + readOnly: true + type: string + duration: + description: duration in milliseconds + readOnly: true + type: integer + encoding_rate: + description: average encoding rate in kbps + readOnly: true + type: integer + frame_height: + description: frame height in pixels + readOnly: true + type: integer + frame_width: + description: frame width in pixels + readOnly: true + type: integer + media_type: + description: media type for the rendition (audio or video) + enum: + - audio + - video + readOnly: true + type: string + rendition_id: + description: the rendition id + readOnly: true + type: string + size: + description: the size of the asset in bytes (integer) + readOnly: true + type: integer + updated_at: + description: when the video was last modified + readOnly: true + type: string + uploaded_at: + description: when the asset was added to the video in Video Cloud + readOnly: true + type: string + variant: + description: 'The variant of the HLS profile (baseline, main, or high)' + enum: + - baseline + - main + - high + readOnly: true + type: string + title: DynamicRendition + type: object + Folder: + properties: + account_id: + description: Video Cloud account id + example: 57838016001 + readOnly: true + type: string + created_at: + description: date/time folder created + example: 2017-11-23T19:53:59.687Z + readOnly: true + type: string + id: + description: system id for the folder + example: 5a17275782aca45b631295f9 + readOnly: true + type: string + name: + description: folder name + example: birds + type: string + updated_at: + description: date/time folder last modified + example: 2017-11-23T20:06:24.537Z + readOnly: true + type: string + video_count: + description: number of videos in the folder + example: 5 + readOnly: true + type: string + title: Folder + type: object + Geo: + description: map of geo-filtering properties + properties: + countries: + description: 'array of ISO 3166 list of 2-letter codes(https://www.iso.org/obp/ui/#home) (search for "country codes")' + example: + - us + - ca + - fr + items: + type: string + type: array + exclude_countries: + description: 'if true, country array is treated as a list of countries excluded from viewing' + type: boolean + restricted: + description: whether geo-restriction is enabled for this video + type: boolean + required: + - countries + - exclude_countries + - restricted + title: geo + type: object + Image: + description: map of image properties + properties: + asset_id: + description: asset id for the image + readOnly: true + type: string + sources: + description: array of image source maps + items: + $ref: '#/components/schemas/Image.sources' + type: array + src: + description: URL for the default image source image + readOnly: true + type: string + readOnly: true + required: + - sources + - src + title: image + type: object + Image.sources: + properties: + src: + description: URL for a image source image + type: string + required: + - src + title: image.sources + type: object + ImageAsset: + example: + account_id: '1752604059001' + audio_only: false + cdn_origin_id: '5602' + complete: true + controller_type: DEFAULT + current_filename: 1752604059001_5510492050001_5510487311001-vs.jpg + frame_height: 720 + frame_width: 1280 + id: '5510492050001' + key_systems: [] + name: Lightning-over-mosque-Utrecht.m4v Video Still + progressive_download: false + reference_id: '' + remote_stream_name: '' + remote_url: '' + size: 41742 + type: VIDEO_STILL + updated_at: '2017-07-26T07:02:42.077Z' + uploaded_at: '2017-07-17T17:46:17.295Z' + properties: + audio_only: + description: not applicable to posters + type: boolean + cdn_origin_id: + description: an internally used id (not applicable to remote assets) + type: string + complete: + description: whether processing is complete for the asset (will be true for remote assets if a remote_url is supplied) + type: boolean + controller_type: + description: the controller type for ingested renditions (not applicable to remote renditions or other types of assets) + type: string + current_filename: + description: the filename for an ingested asset in the Video Cloud system (not applicable to remote assets) + type: string + id: + description: the asset id + readOnly: true + type: string + name: + description: asset name + type: string + progressive_download: + description: whether ingested rendition is available by progressive download (not applicable to other asset types or remote renditions) + type: boolean + reference_id: + description: the asset reference id (must be unique within the account); this is **not** the same as the video reference id + type: string + remote_stream_name: + description: name for remote streams (not applicable to asset types other than rendition) + type: string + remote_url: + description: the url for a remote asset (not applicable to ingested assets); **`remote_url` is required when adding an asset (POST)** + maxLength: 250 + type: string + size: + description: the size of the asset in bytes (integer) + type: integer + type: + description: the type of the asset + type: string + updated_at: + description: when the video was last modified + type: string + uploaded_at: + description: when the asset was added to the video in Video Cloud + type: string + title: ImageAsset + type: object + IngestJobStatus: + properties: + account_id: + description: the Video Cloud account id + example: 57838016001 + readOnly: true + type: string + error_code: + description: the error code if the job failed + example: UnableToResolveHostError + readOnly: true + type: string + error_message: + description: the error message if the job failed + example: 'There was a problem resolving the host at https://some.site.comm/videos/mp4/IMG_0544.MOV. Please check that it is correct.' + readOnly: true + type: string + id: + description: the ingest job id returned when you submit the Dynamic Ingest API request + example: 879a3301-5c1a-4b1b-a368-58e200a6e64b + readOnly: true + type: string + priority: + description: priority of the job (normal or low) + example: normal + readOnly: true + type: string + started_at: + description: when processing started + example: 2018-11-14T19:30:36.265Z + readOnly: true + type: string + state: + description: |- + the current state of the ingest job - status: + - `processing` - video processing in progress - the video is not currently playable + - `publishing` - video processing in progress - publishing a playable rendition + - `published` - that at least one playable rendition is available for the video + - `finished` - that all processing is complete + - `failed` - video processing failed to complete + enum: + - processing + - publishing + - published + - finished + - failed + example: failed + readOnly: true + type: string + x-enum-elements: + - description: video processing in progress - the video is not currently playable + name: processing + - description: video processing in progress - publishing a playable rendition + name: publishing + - description: there is at least one playable rendition available for the video + name: published + - description: video processing is complete + name: finished + - description: video processing failed to complete + name: failed + submitted_at: + description: when the job was submitted + example: 2018-11-14T19:30:36.196Z + readOnly: true + type: string + updated_at: + description: when the status was last updated + example: 2018-11-14T19:43:08.641Z + readOnly: true + type: string + video_id: + description: the video id + example: 5966995221001 + readOnly: true + type: string + title: Ingest Job Status + type: object + LabelsList: + description: A list of labels for the account + type: object + properties: + account_id: + type: string + description: The Video Cloud account id + example: "57838016001" + labels: + type: array + description: Array of labels that exist for the account + items: + type: string + description: a full label path + example: [ + "/nature/birds", + "/nature/birds/shorebirds", + "/nature/birds/forestbirds", + "/nature/mammals/seamammals" + ] + version: + type: integer + description: An internal version tracker + LabelPath: + description: 'The full path for a label that can be assigned to videos' + title: label + type: object + properties: + path: + type: string + example: { + "path": "/nature/mammals/seamammals" + } + LabelUpdate: + description: 'Update Label request body' + title: label + type: object + properties: + new_label: + type: string + description: The new label which will replace **the last item in the label path** + example: { + "new_label": "forest_birds", + } + Link: + description: 'map of related link properties - can only be added on update, not creation' + properties: + text: + description: text for the link + maxLength: 255 + type: string + url: + description: URL for the link + maxLength: 255 + type: string + title: link + type: object + # Live: + # description: Properties for a live stream created by the Live Module or Live API + # properties: + # clip_ended_at: + # description: the ending point for a VOD clip + # example: 2018-08-12T15:34:30.047Z + # readOnly: true + # type: string + # clip_started_at: + # description: the starting point for a VOD clip + # example: 2018-08-12T15:24:30.047Z + # readOnly: true + # type: string + # ended_at: + # description: the date-time that the live stream ended + # example: 2018-08-12T15:34:30.047Z + # readOnly: true + # type: string + # job_id: + # description: the live job id + # example: 935808e9a3bb47ea825fe9276835a01e + # readOnly: true + # type: string + # job_state: + # description: the current state of the job + # enum: + # - error + # - standby + # - waiting + # - processing + # - disconnected + # - cancelling + # - finishing + # - cancelled + # - finished + # - failed + # example: finished + # readOnly: true + # type: string + # name: + # description: the name of the live job + # readOnly: true + # type: string + # type: + # description: the live stream type + # enum: + # - EVENT + # example: EVENT + # readOnly: true + # type: string + # updated_at: + # description: the date-time the live job was last updated + # example: 2018-08-12T15:34:30.047Z + # readOnly: true + # type: string + # title: live + # type: object + Manifest: + example: + account_id: '57838016001' + audio_only: false + cdn_origin_id: '8801' + complete: true + controller_type: DEFAULT + current_filename: 57838016001_5819043232001_5819044609001.m3u8 + id: '5819043232001' + key_systems: [] + name: greatblueheron.mp4 + progressive_download: false + reference_id: '' + remote_stream_name: '' + remote_url: '' + size: 0 + type: HLS_MANIFEST + updated_at: '2018-08-07T14:06:52.489Z' + uploaded_at: '2018-08-07T14:05:57.105Z' + video_duration: 0 + properties: + audio_only: + description: not applicable to ism_manifests + type: boolean + cdn_origin_id: + description: an internally used id (not applicable to remote assets) + type: string + complete: + description: whether processing is complete for the asset (will be true for remote assets if a remote_url is supplied) + type: boolean + controller_type: + description: the controller type for ingested renditions (not applicable to remote renditions or other types of assets) + type: string + current_filename: + description: the filename for an ingested asset in the Video Cloud system (not applicable to remote assets) + type: string + id: + description: the asset id + readOnly: true + type: string + name: + description: asset name + type: string + progressive_download: + description: whether ingested rendition is available by progressive download (not applicable to other asset types or remote renditions) + type: boolean + reference_id: + description: the asset reference id (must be unique within the account); this is **not** the same as the video reference id + type: string + remote_stream_name: + description: name for remote streams (not applicable to asset types other than rendition) + type: string + remote_url: + description: the url for a remote asset (not applicable to ingested assets); **`remote_url` is required when adding an asset (POST)** + maxLength: 250 + type: string + size: + description: the size of the asset in bytes (integer) + type: integer + type: + description: the type of the asset + type: string + updated_at: + description: when the video was last modified + type: string + uploaded_at: + description: when the asset was added to the video in Video Cloud + type: string + video_duration: + description: video duration in seconds (present if you included it when you created the asset) + type: integer + title: Manifest + type: object + Playlist: + properties: + account_id: + description: Video Cloud account id + example: 57838016001 + readOnly: true + type: string + created_at: + description: date/time created + example: 2018-11-14T19:30:36.196Z + format: date-time + readOnly: true + type: string + description: + description: playlist description + example: Sea bird playlist + maxLength: 255 + type: string + favorite: + default: false + description: whether playlist is in favorites list + example: false + type: boolean + id: + description: the playlist id + example: 1403635561001 + readOnly: true + type: string + name: + description: the playlist name + example: Sea Birds + maxLength: 255 + type: string + reference_id: + description: the playlist reference id (must be unique within the account) + example: sea_birds_playlist + type: string + search: + description: search string to retrieve the videos (smart playlists only) + example: '+tags:captions,training' + type: string + state: + description: >- + Applies to EXPLICIT (manual) playlists only; `UPDATING` means the list is updating its video members and `READY` means that all videos have been added + type: string + enum: + - READY + - UPDATING + readOnly: true + type: + description: 'the playlist type: EXPLICIT or smart playlist type' + enum: + - EXPLICIT + - ACTIVATED_OLDEST_TO_NEWEST + - ACTIVATED_NEWEST_TO_OLDEST + - ALPHABETICAL + - PLAYS_TOTAL + - PLAYS_TRAILING_WEEK + - START_DATE_OLDEST_TO_NEWEST + - START_DATE_NEWEST_TO_OLDEST + example: ACTIVATED_NEWEST_TO_OLDEST + type: string + updated_at: + description: date/time last modified + example: 2018-11-14T19:30:36.196Z + format: date-time + readOnly: true + type: string + video_ids: + description: array of video ids (EXPLICIT playlists only) + example: + - '4084164751001' + - '1532562858001' + - '734484322001' + - '1532530235001' + - '734462570001' + - '734462569001' + - '734451481001' + - '734445537001' + items: + type: string + type: array + 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\"" + } + PlaylistCount: + example: + count: 84 + properties: + count: + description: count of videos + type: integer + title: Get_Playlist_CountResponse + type: object + PlaylistInputFields: + properties: + description: + description: playlist description + example: Playlist of Birds that Live by the Sea + maxLength: 255 + type: string + favorite: + default: false + description: whether playlist is in favorites list + example: true + type: boolean + name: + description: the playlist name + example: Sea Bird Playlist + maxLength: 255 + type: string + reference_id: + description: the playlist reference id (must be unique within the account) + example: sea_bird_playlist + type: string + search: + description: search string to retrieve the videos (smart playlists only) + example: '+tags:birds,sea' + type: string + search_syntax: + description: the search syntax used for the search string; see [Managing Playlists](/cms/managing-videos/managing-playlists-using-cms-api.html) + type: string + default: v1 + enum: + - v1 + - v2 + type: + description: 'the playlist type: EXPLICIT or smart playlist type' + enum: + - EXPLICIT + - ACTIVATED_OLDEST_TO_NEWEST + - ACTIVATED_NEWEST_TO_OLDEST + - ALPHABETICAL + - PLAYS_TOTAL + - PLAYS_TRAILING_WEEK + - START_DATE_OLDEST_TO_NEWEST + - START_DATE_NEWEST_TO_OLDEST + example: START_DATE_NEWEST_TO_OLDEST + type: string + video_ids: + description: >- + array of video ids (EXPLICIT playlists only) - maximum length: 1000 + example: + - '4084164751001' + - '1532562858001' + - '734484322001' + - '1532530235001' + - '734462570001' + - '734462569001' + - '734451481001' + - '734445537001' + items: + type: string + type: array + 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" + } + PlaylistReferences: + properties: + playlists: + description: array of EXPLICIT playlist ids that contain the video + example: 749117323001 + items: + type: string + type: array + title: PlaylistReferences + type: object + Schedule: + description: map of scheduling properties + properties: + ends_at: + description: |- + 'End date-time of availability in ISO-8601(https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15) format. Note that you can input a date-time stamp with a time zone, such as `2021-05-01T18:00:00.000+08`, but it will be converted to and stored as a UTC data-time stamp: `2021-05-01T10:00:00.000Z`' + example: 2020-05-20T20:41:07.689Z + nullable: true + type: string + starts_at: + description: |- + 'Start date-time of availability in ISO-8601(https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15) format. Note that you can input a date-time stamp with a time zone, such as `2021-05-01T18:00:00.000+08`, but it will be converted to and stored as a UTC data-time stamp: `2021-05-01T10:00:00.000Z`' + example: 2019-05-20T20:41:07.689Z + nullable: true + type: string + title: schedule + type: object + ShareVideoRequest: + example: + - id: '47509719001' + properties: + id: + description: affiliate account id to share to + type: string + required: + - id + title: ShareVideoRequest + type: object + Sharing: + description: map of the sharing properties for the video + properties: + by_external_acct: + description: whether the video was shared from another account + example: true + readOnly: true + type: boolean + by_id: + description: 'id of the account that shared the video; note that this field is populated only for the shared copy, not for the original video' + example: 57838016001 + readOnly: true + type: string + by_reference: + description: whether the video is shared by reference + example: true + readOnly: true + type: boolean + source_id: + description: 'id of the video in its original account; note that this field is populated only for the shared copy, not for the original video' + example: 239487239487 + readOnly: true + type: string + to_external_acct: + description: whether the video is shared to another account + example: true + readOnly: true + type: boolean + readOnly: true + title: sharing + type: object + Subscription: + properties: + endpoint: + description: the notifications endpoint + example: 'https://solutions.brightcove.com/bcls/di-api/cms-callbacks.php' + type: string + events: + description: list of events subscribed to + example: ["video-change"] + type: array + items: + type: string + enum: + - video-change + id: + description: system id for the subscription + example: a0847083-79f4-4315-8a2c-403465a3d9bc + readOnly: true + type: string + service_account: + description: the Video Cloud account id + example: "57838016001" + readOnly: true + type: string + title: Subscription + type: object + TextTrack: + properties: + default: + default: false + description: whether this is the default track - should only be true for one text track + type: boolean + id: + description: System id for the text track + readOnly: true + type: string + kind: + default: captions + description: >- + How the track is meant to be used: `subtitles`, `captions`, `descriptions`, `chapters`, `metadata`. + enum: + - subtitles + - captions + - descriptions + - chapters + - metadata + - transcripts + type: string + label: + description: label for the track + type: string + mime_type: + description: mime-type for the track + type: string + src: + description: URL for the .vtt file + type: string + srclang: + description: '2-letter language code, such as "en" or "ko"' + type: string + status: + description: Indicates the actual situation of the track, if it is `published`, `draft`, or `null` for pre-existing text tracks. Draft tracks will not be displayed in the player. + Transcript: + properties: + id: + description: System id for the text track + readOnly: true + type: string + account_id: + description: The account id + readOnly: true + type: string + default: + description: Whether the transcript is the default - note that if there are multi-language transcripts, there can be a default per language + readOnly: true + type: boolean + label: + description: label for the track + type: string + sources: + description: sources for a client to retrieve the transcription + type: array + items: + type: string + description: URLs where the transcript can be retrieved - there will an http and https URL for each transcript + src: + description: URL for the transcription file + type: string + srclang: + description: '2-letter or 4-letter language code, such as `es` or `es-MX`' + type: string + status: + description: 'Either `draft` (unavailable to viewers) or `published`' + type: string + enum: + - draft + - published + required: + - src + - srclang + title: transcription + type: object + User: + description: 'information about who created or modified a video, if available' + properties: + email: + description: the user's email address in Video Cloud + type: string + id: + description: Video Cloud system id of the user + type: string + type: + description: |- + The type of the updater, either: + - `user` a user in Studio + - `api-key` a user via the APIs + - `internal` a Brightcove system or user + enum: + - user + - api_key + - internal + type: string + readOnly: true + title: User + type: object + VideoVariant: + description: Object containing language-specific metadata for a video + properties: + language: + type: string + description: 'The language for this variant in the language-country code format (examples: en-US, es-ES) **Note that `language` is only included when you create a variant - you must NOT include it when updating the variant**' + example: es-ES + name: + type: string + description: The title of the video in this language + description: + type: string + description: The video short description in this language + long_description: + type: string + description: The video long description in this language + custom_fields: + type: object + description: 'map of `fieldname: value` pairs, where values are for this language; values have a maximum length of 1024 single-byte characters. Note: be sure to use the **internal** name for the field, not the display name' + VideoVariants: + description: Array of video variants + type: array + items: + $ref: '#/components/schemas/VideoVariant' + Video: + description: Object containing metadata for a video + properties: + ad_keys: + description: 'string representing the ad key/value pairs assigned to the video. Key/value pairs are formatted as key=value and are separated by ampersands - can only be added on update, not creation' + example: ' "adKeys": "category=sports&live=true"' + nullable: true + type: string + clip_source_video_id: + description: The ID of the source video that was clipped to produce this video or null if this video is not a clip of another video + example: 4723947979 + readOnly: true + type: string + complete: + description: >- + whether the video has at least one rendition -Note: when you create a new video, the complete property is automatically set to false. As soon as one rendition exists for the video, the complete property will be automatically set to true. This does **not mean that all renditions are created and images and captions processed**. For the full status of ingestion, see [Dynamic Ingest API Notifications](/dynamic-ingest/general/notifications-dynamic-delivery-video-cloud.html) + example: true + readOnly: true + type: boolean + created_at: + description: when the video was created + example: '2015-09-17T16:08:37.108Z' + readOnly: true + type: string + created_by: + $ref: '#/components/schemas/User' + cue_points: + description: 'array of cue points - can be added on creation or update' + items: + $ref: '#/components/schemas/CuePoint' + type: array + custom_fields: + additionalProperties: + description: 'map of fieldname-value pairs; values have a maximum length of 1024 single-byte characters Note: be sure to use the internal name for the field, not the display name' + type: string + type: object + delivery_type: + description: |- + video delivery type: + - `remote`: a remote asset + - `dynamic_origin`: processed using the Dynamic Delivery ingest system + - `live_origin`: a live stream from Brightcove Live + - `unknown`: the delivery type could not be determined (may mean there are no playable renditions) + enum: + - remote + - dynamic_origin + - live_origin + - unknown + example: dynamic_origin + readOnly: true + type: string + description: + description: video short description + example: Herring gull on a wharf in Boston + maxLength: 248 + type: string + digital_master_id: + description: asset id of the digital master + example: 734462494001 + readOnly: true + type: string + drm_disabled: + description: 'if true, the video is not DRM-packaged - applies to accounts that are enabled for DRM only' + example: true + type: boolean + duration: + description: video duration in milliseconds + example: 18160 + readOnly: true + type: integer + economics: + default: AD_SUPPORTED + description: whether video is `AD_SUPPORTED` + enum: + - AD_SUPPORTED + - FREE + example: AD_SUPPORTED + type: string + folder_id: + description: id of the folder that contains the video + example: 560039e5e4b0e69e4b01cacd + readOnly: true + type: string + forensic_watermarking: + description: |- + Indicates whether the video has forensic watermarking + + possible values: + + - `ACTIVE` - the video was transcoded with forensic watermarking and should be used during delivery + - `UNAVAILABLE` - the video was not transcoded with forensic watermarking support and can’t be delivered using it + - `null` - the value is for forensic watermarking is not available for the account; in this case the field is not returned in API responses + + if the video was not ingested with forensic watermarking, this field will be set to `UNAVAILABLE` automatically; if the video was ingested or retranscoded with forensic watermarking, this field will be set to `ACTIVE` automatically + example: ACTIVE + readOnly: true + type: string + enum: + - ACTIVE + - UNAVAILABLE + # - null + geo: + $ref: '#/components/schemas/Geo' + has_digital_master: + description: whether video has an archived master than can be used for retranscoding + example: true + readOnly: true + type: boolean + id: + description: video id + example: 734462567001 + readOnly: true + type: string + images: + $ref: '#/components/schemas/VideoImages' + labels: + type: array + description: |- + Array of labels assigned to the video. See [Working with Labels](/cms/managing-videos/working-with-labels.html) for more information. + items: + type: string + description: full hierarchical path for a label. + link: + $ref: '#/components/schemas/Link' + # live: + # $ref: '#/components/schemas/Live' + long_description: + description: 'video long description - can only be added on update, not creation' + example: 'Herring Gull near Fort Point Channel in Boston, MA, USA. 2019-04-25.' + maxLength: 5000 + type: string + name: + description: video title + example: Laughing Gull + maxLength: 255 + minLength: 1 + type: string + offline_enabled: + default: false + description: whether video is enabled for offline viewing + example: true + type: boolean + original_filename: + description: the original file name for the uploaded video + example: gull-boston.mov + readOnly: true + type: string + playback_rights_id: + type: string + description: >- + Associates specified EPA playback rights with video. + projection: + description: used for 360 videos + enum: + - equirectangular + example: equirectangular + nullable: true + type: string + published_at: + description: 'start date-time of first activation in ISO-8601(https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15) format' + example: 2019-04-30T23:27:22.507Z + type: string + reference_id: + description: video reference-id (must be unique within the account) + example: laughing_gull_2019_04_25 + maxLength: 150 + nullable: true + type: string + schedule: + $ref: '#/components/schemas/Schedule' + sharing: + $ref: '#/components/schemas/Sharing' + state: + description: |- + The state of the video: + - ACTIVE: the video is playable + - INACTIVE: the video is not playable + - PENDING: + - DELETED: the video has been deleted (within the past 10 days; after that, the API won't return the video) + enum: + - ACTIVE + - INACTIVE + - PENDING + - DELETED + example: ACTIVE + type: string + tags: + description: array of tags - maximum characters per tag is 1000 + example: + - birds + - sea + items: + type: string + maxLength: 128 + type: array + text_tracks: + description: 'array of text tracks - can only be added on update, not creation' + items: + $ref: '#/components/schemas/TextTrack' + type: array + transcripts: + description: 'array of transcription objects - can only be added on update, not creation' + items: + $ref: '#/components/schemas/Transcript' + type: array + updated_at: + description: when the video was last modified + example: 2018-02-27T19:09:20.401Z + readOnly: true + type: string + updated_by: + $ref: '#/components/schemas/User' + variants: + $ref: '#/components/schemas/VideoVariants' + title: Video + type: object + VideoAsset: + example: + - account_id: '57838016001' + audio_only: false + cdn_origin_id: '8801' + complete: true + controller_type: DEFAULT + current_filename: 57838016001_5819042450001_5819044609001.zip + drm: null + encoding_rate: 512000 + frame_height: 270 + frame_width: 480 + hds: null + hls: null + id: '5819042450001' + key_systems: [] + name: greatblueheron.mp4 + progressive_download: true + reference_id: '' + remote_stream_name: '' + remote_url: '' + size: 2112932 + type: FULL_LENGTH + updated_at: '2018-08-07T14:05:47.045Z' + uploaded_at: '2018-08-07T14:05:44.835Z' + video_codec: H264 + video_container: M2TS + video_duration: 31398 + - account_id: '57838016001' + audio_only: false + cdn_origin_id: '6101' + complete: true + controller_type: DEFAULT + current_filename: 57838016001_5819042821001_5819044609001-th.jpg + frame_height: 90 + frame_width: 160 + id: '5819042821001' + key_systems: [] + name: greatblueheron.mp4 Thumbnail + progressive_download: false + reference_id: '' + remote_stream_name: '' + remote_url: '' + size: 5430 + type: THUMBNAIL + updated_at: '2018-08-15T06:03:41.209Z' + uploaded_at: '2018-08-07T14:05:33.672Z' + - account_id: '57838016001' + audio_only: false + cdn_origin_id: '' + complete: true + controller_type: DEFAULT + current_filename: 57838016001_5819043030001_5819044609001.mp4 + drm: null + encoding_rate: 23152000 + frame_height: 1080 + frame_width: 1920 + hds: null + hls: null + id: '5819043030001' + key_systems: [] + name: greatblueheron.mp4 + progressive_download: true + reference_id: '' + remote_stream_name: '' + remote_url: '' + size: 90990884 + type: DIGITAL_MASTER + updated_at: '2018-08-07T14:05:33.714Z' + uploaded_at: '2018-08-07T14:05:31.234Z' + video_codec: H264 + video_container: MP4 + video_duration: 31431 + - account_id: '57838016001' + audio_only: false + cdn_origin_id: '8801' + complete: true + controller_type: DEFAULT + current_filename: 57838016001_5819043232001_5819044609001.m3u8 + id: '5819043232001' + key_systems: [] + name: greatblueheron.mp4 + progressive_download: false + reference_id: '' + remote_stream_name: '' + remote_url: '' + size: 0 + type: HLS_MANIFEST + updated_at: '2018-08-07T14:06:52.489Z' + uploaded_at: '2018-08-07T14:05:57.105Z' + video_duration: 0 + - account_id: '57838016001' + audio_only: false + cdn_origin_id: '6101' + complete: true + controller_type: DEFAULT + current_filename: 57838016001_5819043394001_5819044609001-vs.jpg + frame_height: 720 + frame_width: 1280 + id: '5819043394001' + key_systems: [] + name: greatblueheron.mp4 Video Still + progressive_download: false + reference_id: '' + remote_stream_name: '' + remote_url: '' + size: 139316 + type: VIDEO_STILL + updated_at: '2018-08-15T06:03:41.210Z' + uploaded_at: '2018-08-07T14:05:35.253Z' + - account_id: '57838016001' + audio_only: false + cdn_origin_id: '' + complete: true + controller_type: DEFAULT + current_filename: '' + id: '5819491822001' + key_systems: [] + name: '' + profiles: null + progressive_download: false + reference_id: '' + remote_stream_name: '' + remote_url: 'https://some.site.com/videos/hls/greatblueheron/greatblueheron.mpd' + size: 0 + type: MPD_MANIFEST + updated_at: '2018-08-08T12:02:03.059Z' + uploaded_at: '2018-08-08T12:02:03.059Z' + video_duration: 31 + properties: + account_id: + description: the Video Cloud account id + type: string + audio_only: + description: 'this rendition contains only an audio track, no video track (a rendition for low bandwidth devices)' + type: boolean + cdn_origin_id: + description: an internally used id (not applicable to remote assets) + type: string + complete: + description: whether processing is complete for the asset (will be true for remote assets if a remote_url is supplied) + type: boolean + controller_type: + description: the controller type for ingested renditions (not applicable to remote renditions or other types of assets) + type: string + current_filename: + description: the filename for an ingested asset in the Video Cloud system (not applicable to remote assets) + type: string + drm: + $ref: '#/components/schemas/Drm' + encoding_rate: + description: average encoding rate in kbps + type: integer + frame_height: + description: frame height in pixels + type: integer + frame_width: + description: frame width in pixels + type: integer + id: + description: the asset id + readOnly: true + type: string + key_systems: + description: array of strings that denote the kind of encryption used for DRM packaged renditions + items: + type: string + type: array + name: + description: asset name + type: string + progressive_download: + description: whether ingested rendition is available by progressive download (not applicable to other asset types or remote renditions) + type: boolean + reference_id: + description: the media asset reference id (must be unique within the account) - this is **not** the same as the video reference id + type: string + remote_stream_name: + description: name for remote streams (not applicable to asset types other than rendition) + type: string + remote_url: + description: the url for a remote asset (not applicable to ingested assets); **`remote_url` is required when adding an asset (POST)** + maxLength: 250 + type: string + size: + description: the size of the asset in bytes (integer) + type: integer + type: + description: the type of the asset + type: string + updated_at: + description: when the video was last modified + type: string + uploaded_at: + description: when the asset was added to the video in Video Cloud + type: string + video_codec: + description: not applicable to remote assets + type: string + video_container: + description: not applicable to remote assets + type: string + video_duration: + description: duration in milliseconds + type: integer + title: VideoAsset + type: object + VideoCount: + example: + count: 7650 + properties: + count: + description: count of videos + type: integer + title: Get_Video_CountResponse + type: object + VideoCountInPlaylist: + example: + count: 5 + properties: + count: + description: count of videos + type: integer + title: Get_Video_Count_in_PlaylistResponse + type: object + VideoFields: + example: + custom_fields: + - description: Add a topic + display_name: Subject + enum_values: + - Reptiles + - Mammals + - Other + - wildlife + - Fish + - Birds + - Insects + id: subject + required: false + type: enum + - description: null + display_name: Uploader UserID + id: uploader-userid + required: false + type: string + - description: null + display_name: Rating + id: rating + required: false + type: string + - description: null + display_name: Duration + id: duration + required: false + type: string + - description: null + display_name: Associatedtopics + id: associated-topics + required: false + type: string + - description: null + display_name: Custom Theme Path + enum_values: + - 'https://files.brightcove.com/BCL_customLabelTheme2.css' + - 'https://files.brightcove.com/BCL_customLabelTheme.css' + id: customthemepath + required: false + type: enum + - description: null + display_name: Text Color + enum_values: + - '#4C4D4F' + - '#CF0050' + - '#F4901E' + - '#619FA8' + id: textcolor + required: false + type: enum + - description: null + display_name: Captions File URL + id: dfxppath + required: false + type: string + - description: null + display_name: Purpose + enum_values: + - Training + - Demo + - Sample + - Solution + id: purpose + required: false + type: enum + - description: null + display_name: Downloadable + enum_values: + - 'yes' + - 'no' + id: downloadable + required: false + type: enum + max_custom_fields: 10 + standard_fields: + - description: null + id: description + required: false + - description: null + id: tags + required: false + properties: + custom_fields: + description: array of standard field maps + items: + $ref: '#/components/schemas/Videofields.customField' + type: array + max_custom_fields: + description: maximum number of custom fields for the account + type: string + standard_fields: + description: array of standard field maps + items: + $ref: '#/components/schemas/Videofields.standardField' + type: array + title: VideoFields + type: object + CustomFields: + description: array of standard field maps + items: + $ref: '#/components/schemas/customField' + type: array + customField: + properties: + description: + description: description (instruction for user) + type: string + display_name: + description: display name + type: string + enum_values: + description: |- + Array of string values for select type fields (by default the maximum is 100 values; this can be increased up to 1000 by submitting a [request to Support](https://supportportal.brightcove.com/)). + + This field is **required** for `enum` types, and **not allowed** for `string` types. + items: + type: string + maxLength: 100 + type: array + id: + description: |- + Data name for the field (used to access it in searches, etc.) + + Note the following **requirements** for the custom field `id`: + - all lowercase + - no spaces (use underscore [_] instead) + - max length: 128 single-byte characters + - must be unique among all custom fields for the account + - must not be one of the [Reserved names](https://studio.support.brightcove.com/admin/creating-custom-metadata-fields.html#reserved) + + Note that updating it will trigger an internal process to update the `id` in any videos that have the custom field. + type: string + required: + description: whether field must have a value before video can be active + type: boolean + default: false + type: + description: custom field type (enum or string) + type: string + title: custom_field + type: object + customFieldUpdate: + properties: + description: + description: description (instruction for user) + type: string + display_name: + description: display name + type: string + enum_values: + description: |- + Array of string values for select type fields (by default the maximum is 100 values; this can be increased up to 1000 by submitting a [request to Support](https://supportportal.brightcove.com/)). + + This field is **required** for `enum` types, and **not allowed** for `string` types. + items: + type: string + maxLength: 100 + type: array + id: + description: |- + Data name for the field (used to access it in searches, etc.) + + Note the following **requirements** for the custom field `id`: + - all lowercase + - no spaces (use underscore [_] instead) + - max length: 128 single-byte characters + - must be unique among all custom fields for the account + - must not be one of the [Reserved names](https://studio.support.brightcove.com/admin/creating-custom-metadata-fields.html#reserved) + + Note that updating the `id` will trigger an internal process to update the `id` in any videos that have the custom field. + type: string + required: + description: whether field must have a value before video can be active + type: boolean + default: false + type: + description: custom field type (enum or string) + type: string + readOnly: true + title: custom_field + type: object + VideoImages: + 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 + } + ] + } + } + readOnly: true + title: VideoImages + type: object + VideoShare: + example: + - affiliate_id: '47509719001' + affiliate_video_id: '5766941108001' + error_message: null + shared_at: '2018-04-09T13:43:04.284Z' + status: COMPLETE + updated_at: '2018-04-09T13:43:13.687Z' + video_id: '5341769699001' + properties: + affiliate_id: + description: the id of the affiliate account the video is shared to + type: string + affiliate_video_id: + description: the id of the shared video in the affiliate account + type: string + shared_at: + description: when the video was shared + type: string + status: + description: 'the status of the sharing - either PROCESSING, COMPLETE, or FAILED' + type: string + updated_at: + description: the video was last updated in the affiliate account + type: string + video_id: + description: the video id + type: string + required: + - video_id + - affiliate_id + - affiliate_video_id + title: VideoShare + type: object + VideoSources: + example: + - ext_x_version: '4' + src: 'https://manifest.prod.boltdns.net/manifest/v1/hls/v4/clear/57838016001/853641cb-d66b-4f08-bb02-8489b5fba897/10s/master.m3u8?fastly_token=NWJiMmIyNmNfMWM3YmVhZTA5OTc4YjM4ZjZiZjU1OTk0ZTkzZTUyMzhhNGU5Zjc5YTNkZGYwYWQyNWZkMTcyMGM1MzlmMWVmZg%3D%3D' + type: application/x-mpegURL + uploaded_at: '2017-06-05T11:20:53.731Z' + - ext_x_version: '5' + src: 'https://manifest.prod.boltdns.net/manifest/v1/hls/v5/clear/57838016001/853641cb-d66b-4f08-bb02-8489b5fba897/10s/master.m3u8?fastly_token=NWJiMmIyNmNfNDc4YjJiNTM1YzkwYzcwNzliNmY3MDVjMzJmZjJhZjdmNjAxMzM0NWEzMTk3MzY2MGIwYWZhNzVhYjMyMzNhYg%3D%3D' + type: application/x-mpegURL + uploaded_at: '2017-06-05T11:20:53.731Z' + - profiles: 'urn:mpeg:dash:profile:isoff-live:2011' + src: 'https://manifest.prod.boltdns.net/manifest/v1/dash/live-baseurl/clear/57838016001/853641cb-d66b-4f08-bb02-8489b5fba897/2s/manifest.mpd?fastly_token=NWJiMmIyNmNfYjM3YTFiZjU5MmJjNzQzZjFkZTVlZmY0NTVhNmYxMzU3N2M2ODk5MmU1YjkyNDg5ZWRlNWRmMGNlODdjYjg5YQ%3D%3D' + type: application/dash+xml + uploaded_at: '2017-06-05T11:20:53.731Z' + - codec: H264 + container: MP4 + duration: 49690 + encoding_rate: 2129000 + height: 720 + remote: false + size: 13242064 + src: 'https://bcbolt446c5271-a.akamaihd.net/media/v1/pmp4/static/clear/57838016001/853641cb-d66b-4f08-bb02-8489b5fba897/high.mp4?akamai_token=exp=1538437740~acl=/media/v1/pmp4/static/clear/57838016001/853641cb-d66b-4f08-bb02-8489b5fba897/high.mp4*~hmac=619d67d75397e01c0bb9bd88ea047ace80bd03b56261337233b5d53f2632c690' + uploaded_at: '2017-06-05T11:20:53.731Z' + width: 1280 + - codec: H264 + container: MP4 + duration: 49690 + encoding_rate: 574000 + height: 270 + remote: false + size: 3586929 + src: 'https://bcbolt446c5271-a.akamaihd.net/media/v1/pmp4/static/clear/57838016001/853641cb-d66b-4f08-bb02-8489b5fba897/mid.mp4?akamai_token=exp=1538437740~acl=/media/v1/pmp4/static/clear/57838016001/853641cb-d66b-4f08-bb02-8489b5fba897/mid.mp4*~hmac=fde050eac8c8d3bb5b6c9141639a3dc770b8b8a3a3f88f5436c803b133d940fc' + uploaded_at: '2017-06-05T11:20:53.731Z' + width: 480 + properties: + app_name: + description: address for RTMP stream + readOnly: true + type: string + asset_id: + description: system id for the rendition + readOnly: true + type: string + codec: + description: the video codec for the rendition + type: string + container: + description: the video container for the rendition + type: string + duration: + description: duration in milliseconds + type: integer + encoding_rate: + description: encoding rate in bps + type: integer + height: + description: frame height in pixels + readOnly: true + type: integer + remote: + description: whether the source is a remote asset + type: boolean + size: + description: file size in bytes + type: integer + src: + description: URL for HTTP rendition + readOnly: true + type: string + stream_name: + description: the stream name on the CDN + readOnly: true + type: string + type: + description: the type for segmented streams + readOnly: true + type: string + uploaded_at: + description: date/time when the video was uploaded + readOnly: true + type: string + width: + description: frame width in pixels + readOnly: true + type: integer + title: VideoSources + type: object + Videofields.customField: + properties: + description: + description: description (instruction for user) + type: string + display_name: + description: display name + type: string + enum_values: + description: array of string values for select type fields + items: + type: string + type: array + id: + description: 'data name for the field (used to access it in searches, etc.)' + type: string + required: + description: whether field must have a value before video can be active + type: boolean + default: false + type: + description: custom field type (enum or string) + type: string + readOnly: true + title: VideoFields.custom_field + type: object + Videofields.standardField: + properties: + description: + description: description (instruction for user) + type: string + id: + description: 'data name for the field (used to access it in searches, etc.)' + type: string + required: + description: whether field must have a value before video can be active + type: boolean + title: VideoFields.standard_field + type: object + securitySchemes: + BC_OAuth2: + type: oauth2 + description: >- + Brightcove OAuth API. See the [support documentation](/oauth/index.html) or [Getting Access Tokens](/oauth/code-samples/oauth-api-sample-get-access-token.html) to learn more + flows: + clientCredentials: + tokenUrl: 'https://oauth.brightcove.com/v4/access_token' + scopes: + video-cloud/video/read: Video Read + video-cloud/video/create: Video Create + video-cloud/video/update: Video Update + video-cloud/video/delete: Video Delete + video-cloud/video/all: Video ALL + video-cloud/asset/delete: Digital Master Delete + video-cloud/playlist/read: Playlist Read + video-cloud/playlist/create: Playlist Create + video-cloud/playlist/update: Playlist Update + video-cloud/playlist/delete: Playlist Delete + video-cloud/playlist/all: Playlist All + video-cloud/sharing-relationships/read: Sharing Relationships Read + video-cloud/sharing-relationships/create: Sharing Relationships Create + video-cloud/sharing-relationships/update: Sharing Relationships Update + video-cloud/sharing-relationships/delete: Sharing Relationships Delete + video-cloud/sharing-relationships/all: Sharing Relationships All + video-cloud/notifications/all: Notifications All + video-cloud/video/clear-sources: Read clear sources \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-db/migrations/README b/mc-vod-sync/mc-vod-sync-db/migrations/README new file mode 100644 index 00000000..c1cb4870 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/migrations/README @@ -0,0 +1,63 @@ +Welcome! + +This is an MyBatis Migration repository. You can specify the repository +directory when running migrations using the --path= +option. The default path is the current working directory ("./"). + +The repository base directory contains three subdirectories as follows: + +./drivers + +Place your JDBC driver .jar or .zip files in this directory. Upon running a +migration, the drivers will be dynamically loaded. + +Download driver: + + com.ibm.db2 + jcc + 11.5.8.0 + + + +./environments + +In the environments folder you will find .properties files that represent +your database instances. By default a development.properties file is +created for you to configure your development time database properties. +You can also create test.properties and production.properties files. +The environment can be specified when running a migration by using +the --env= option (without the path or ".properties" part). + +The default environment is "development". + +./scripts + +This directory contains your migration SQL files. These are the files +that contain your DDL to both upgrade and downgrade your database +structure. By default, the directory will contain the script to +create the changelog table, plus one empty "first" migration script. +To create a new migration script, use the "new" command. To run +all pending migrations, use the "up" command. To undo the last +migration applied, use the "down" command etc. + +For more information about commands and options, run the MyBatis +Migration script with the --help option. + +Enjoy. + + + +DOCKER +docker run -itd --name lis --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INSTANCE=db2admin -e DB2INST1_PASSWORD=password -e DBNAME=lis -e PERSISTENT_HOME=false -v /Docker:/database ibmcom/db2 +docker logs -f lis +docker exec -it lis bash +docker stop lis +docker remove lis + +MIGRATE +migrate new create profile --idpattern=000 +migrate up --env=prod + +Move data +---------- +https://community.ibm.com/community/user/datamanagement/discussion/db2-docker-persistent-volume \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-db/migrations/bootstrap.sql b/mc-vod-sync/mc-vod-sync-db/migrations/bootstrap.sql new file mode 100644 index 00000000..99b70ec0 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/migrations/bootstrap.sql @@ -0,0 +1,3 @@ +-- // Bootstrap.sql +DROP DATABASE IF EXISTS VODSYNC; +CREATE DATABASE VODSYNC AUTOMATIC STORAGE YES USING CODESET UTF-8 TERRITORY hu COLLATE USING UCA500R1_S2 PAGESIZE 32 K; diff --git a/mc-vod-sync/mc-vod-sync-db/migrations/environments/development.properties b/mc-vod-sync/mc-vod-sync-db/migrations/environments/development.properties new file mode 100644 index 00000000..327afe6c --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/migrations/environments/development.properties @@ -0,0 +1,57 @@ +## Base time zone to ensure times are consistent across machines +time_zone=GMT+0:00 +## The character set that scripts are encoded with +script_char_set=UTF-8 +## JDBC connection properties. +driver=com.ibm.db2.jcc.DB2Driver +url=jdbc:db2://localhost:50000/vodsync +username=db2admin +password=password +# +# A NOTE ON STORED PROCEDURES AND DELIMITERS +# +# Stored procedures and functions commonly have nested delimiters +# that conflict with the schema migration parsing. If you tend +# to use procs, functions, triggers or anything that could create +# this situation, then you may want to experiment with +# send_full_script=true (preferred), or if you can't use +# send_full_script, then you may have to resort to a full +# line delimiter such as "GO" or "/" or "!RUN!". +# +# Also play with the autocommit settings, as some drivers +# or databases don't support creating procs, functions or +# even tables in a transaction, and others require it. +# +# This ignores the line delimiters and +# simply sends the entire script at once. +# Use with JDBC drivers that can accept large +# blocks of delimited text at once. +send_full_script=false +# This controls how statements are delimited. +# By default statements are delimited by an +# end of line semicolon. Some databases may +# (e.g. MS SQL Server) may require a full line +# delimiter such as GO. +# These are ignored if send_full_script is true. +delimiter=; +full_line_delimiter=false +# If set to true, each statement is isolated +# in its own transaction. Otherwise the entire +# script is executed in one transaction. +# Few databases should need this set to true, +# but some do. +auto_commit=false +# If set to false, warnings from the database will interrupt migrations. +ignore_warnings=true +# Custom driver path to allow you to centralize your driver files +# Default requires the drivers to be in the drivers directory of your +# initialized migration directory (created with "migrate init") +# driver_path= +# Name of the table that tracks changes to the database +changelog=CHANGELOG +# Migrations support variable substitutions in the form of ${variable} +# in the migration scripts. All of the above properties will be ignored though, +# with the exception of changelog. +# Example: The following would be referenced in a migration file as ${ip_address} +# ip_address=192.168.0.1 + diff --git a/mc-vod-sync/mc-vod-sync-db/migrations/environments/prod.properties b/mc-vod-sync/mc-vod-sync-db/migrations/environments/prod.properties new file mode 100644 index 00000000..9ff52ae7 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/migrations/environments/prod.properties @@ -0,0 +1,57 @@ +## Base time zone to ensure times are consistent across machines +time_zone=GMT+0:00 +## The character set that scripts are encoded with +script_char_set=UTF-8 +## JDBC connection properties. +driver=com.ibm.db2.jcc.DB2Driver +url=jdbc:db2://dvdev.in.useribm.hu:50000/vodsync +username=db2admin +password=password +# +# A NOTE ON STORED PROCEDURES AND DELIMITERS +# +# Stored procedures and functions commonly have nested delimiters +# that conflict with the schema migration parsing. If you tend +# to use procs, functions, triggers or anything that could create +# this situation, then you may want to experiment with +# send_full_script=true (preferred), or if you can't use +# send_full_script, then you may have to resort to a full +# line delimiter such as "GO" or "/" or "!RUN!". +# +# Also play with the autocommit settings, as some drivers +# or databases don't support creating procs, functions or +# even tables in a transaction, and others require it. +# +# This ignores the line delimiters and +# simply sends the entire script at once. +# Use with JDBC drivers that can accept large +# blocks of delimited text at once. +send_full_script=false +# This controls how statements are delimited. +# By default statements are delimited by an +# end of line semicolon. Some databases may +# (e.g. MS SQL Server) may require a full line +# delimiter such as GO. +# These are ignored if send_full_script is true. +delimiter=; +full_line_delimiter=false +# If set to true, each statement is isolated +# in its own transaction. Otherwise the entire +# script is executed in one transaction. +# Few databases should need this set to true, +# but some do. +auto_commit=false +# If set to false, warnings from the database will interrupt migrations. +ignore_warnings=true +# Custom driver path to allow you to centralize your driver files +# Default requires the drivers to be in the drivers directory of your +# initialized migration directory (created with "migrate init") +# driver_path= +# Name of the table that tracks changes to the database +changelog=CHANGELOG +# Migrations support variable substitutions in the form of ${variable} +# in the migration scripts. All of the above properties will be ignored though, +# with the exception of changelog. +# Example: The following would be referenced in a migration file as ${ip_address} +# ip_address=192.168.0.1 + diff --git a/mc-vod-sync/mc-vod-sync-db/migrations/scripts/001_create_changelog.sql b/mc-vod-sync/mc-vod-sync-db/migrations/scripts/001_create_changelog.sql new file mode 100644 index 00000000..2892d2af --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/migrations/scripts/001_create_changelog.sql @@ -0,0 +1,24 @@ +-- // Create Changelog + +-- Default DDL for changelog table that will keep +-- a record of the migrations that have been run. + +-- You can modify this to suit your database before +-- running your first migration. + +-- Be sure that ID and DESCRIPTION fields exist in +-- BigInteger and String compatible fields respectively. + +CREATE TABLE ${changelog} ( +ID NUMERIC(20,0) NOT NULL, +APPLIED_AT VARCHAR(25) NOT NULL, +DESCRIPTION VARCHAR(255) NOT NULL +); + +ALTER TABLE ${changelog} +ADD CONSTRAINT PK_${changelog} +PRIMARY KEY (id); + +-- //@UNDO + +DROP TABLE ${changelog}; diff --git a/mc-vod-sync/mc-vod-sync-db/migrations/scripts/002_create_initial_schema.sql b/mc-vod-sync/mc-vod-sync-db/migrations/scripts/002_create_initial_schema.sql new file mode 100644 index 00000000..f6f8da99 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/migrations/scripts/002_create_initial_schema.sql @@ -0,0 +1,25 @@ +-- // create_initial_schema +-- Migration SQL that makes the change goes here. +CREATE TABLE ASSOCIATE ( + id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, + name VARCHAR(255), + login VARCHAR(255), + password VARCHAR(255), + active SMALLINT NOT NULL, + CONSTRAINT pk_associate PRIMARY KEY (id) +); + +CREATE TABLE UPLOAD_FILE ( + id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, + created TIMESTAMP, + name VARCHAR(255), + size INTEGER NOT NULL, + file BLOB, + CONSTRAINT pk_uploadfile PRIMARY KEY (id) +); + + +-- //@UNDO +-- SQL to undo the change goes here. +DROP TABLE UPLOAD_FILE; +DROP TABLE ASSOCIATE; diff --git a/mc-vod-sync/mc-vod-sync-db/migrations/scripts/004_create_test_data.sql b/mc-vod-sync/mc-vod-sync-db/migrations/scripts/004_create_test_data.sql new file mode 100644 index 00000000..81e01ea4 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/migrations/scripts/004_create_test_data.sql @@ -0,0 +1,13 @@ +-- // create test data +-- Migration SQL that makes the change goes here. + +INSERT INTO ASSOCIATE + (name, login, password, active) +VALUES + ('Test User', 'user', 'password', 1); + + +-- //@UNDO +-- SQL to undo the change goes here. + +DELETE FROM ASSOCIATE; diff --git a/mc-vod-sync/mc-vod-sync-db/pom.xml b/mc-vod-sync/mc-vod-sync-db/pom.xml new file mode 100644 index 00000000..6af02d01 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + mc-vod-sync-db + + hu.user + mc-vod-sync + 0.0.1-SNAPSHOT + + + + + org.mybatis.maven + migrations-maven-plugin + 1.1.4 + + ${project.basedir}/migrations + + + + com.ibm.db2 + jcc + 11.5.8.0 + + + + + + + + org.springframework.boot + spring-boot-starter-data-jpa + 2.7.13 + + + com.ibm.db2 + jcc + 11.5.8.0 + + + org.hibernate + hibernate-core + 5.6.15.Final + + + \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/Associate.java b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/Associate.java new file mode 100644 index 00000000..9cbf6357 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/Associate.java @@ -0,0 +1,25 @@ +package hu.user.mcvodsync.db; + +import lombok.*; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.io.Serializable; + +@Getter +@Setter +@Entity +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class Associate implements Serializable { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + Long id; + String name; + String login; + String password; + boolean active; +} diff --git a/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/UploadFile.java b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/UploadFile.java new file mode 100644 index 00000000..79885a0c --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/UploadFile.java @@ -0,0 +1,26 @@ +package hu.user.mcvodsync.db; + +import lombok.*; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import java.io.Serializable; +import java.util.Date; + +@Getter +@Setter +@Entity +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class UploadFile implements Serializable { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + Long id; + Date created; + String name; + int size; + byte[] file; +} diff --git a/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/AssociateRepository.java b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/AssociateRepository.java new file mode 100644 index 00000000..4f5d4c82 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/AssociateRepository.java @@ -0,0 +1,10 @@ +package hu.user.mcvodsync.db.repository; + +import hu.user.mcvodsync.db.Associate; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AssociateRepository extends JpaRepository, AssociateRepositorySearch { + Associate findByLoginAndPassword(String login, String password); + + Associate findByLogin(String login); +} diff --git a/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/AssociateRepositorySearch.java b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/AssociateRepositorySearch.java new file mode 100644 index 00000000..d27d2e8f --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/AssociateRepositorySearch.java @@ -0,0 +1,16 @@ +package hu.user.mcvodsync.db.repository; + +import hu.user.mcvodsync.db.Associate; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +public interface AssociateRepositorySearch { + List search(String partialName, boolean filterShowActive, boolean filterShowInActive, Pageable pageable); + + long count(String partialName, boolean filterShowActive, boolean filterShowInActive); + +// List search(String partialName, boolean filterShowActive, Pageable pageable); +// +// long count(String partialName, boolean filterShowActive); +} diff --git a/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/AssociateRepositorySearchImpl.java b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/AssociateRepositorySearchImpl.java new file mode 100644 index 00000000..4ab20dfc --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/AssociateRepositorySearchImpl.java @@ -0,0 +1,63 @@ +package hu.user.mcvodsync.db.repository; + +import hu.user.mcvodsync.db.Associate; +import org.apache.commons.lang3.StringUtils; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.query.QueryUtils; +import org.springframework.stereotype.Repository; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.TypedQuery; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import java.util.ArrayList; +import java.util.List; + +@Repository +public class AssociateRepositorySearchImpl implements AssociateRepositorySearch { + @PersistenceContext + EntityManager entityManager; + + Predicate[] getPredicates(CriteriaBuilder cb, Root root, String partialName, boolean filterShowActive, boolean filterShowInActive) { + List predicates = new ArrayList<>(); + if (StringUtils.isNotBlank(partialName)) { + predicates.add(cb.like(cb.lower(root.get("name")), "%" + partialName.toLowerCase() + "%")); + } + if (filterShowActive && !filterShowInActive) { + predicates.add(cb.isTrue(root.get("active"))); + } + if (filterShowInActive && !filterShowActive) { + predicates.add(cb.isFalse(root.get("active"))); + } + return predicates.toArray(new Predicate[]{}); + } + + @Override + public List search(String partialName, boolean filterShowActive, boolean filterShowInActive, Pageable pageable) { + CriteriaBuilder cb = entityManager.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(Associate.class); + Root root = cq.from(Associate.class); + + cq.where(getPredicates(cb, root, partialName, filterShowActive, filterShowInActive)); + cq.orderBy(QueryUtils.toOrders(pageable.getSort(), root, cb)); + TypedQuery query = entityManager.createQuery(cq); + query.setMaxResults(pageable.getPageSize()); + query.setFirstResult(pageable.getPageSize() * pageable.getPageNumber()); + return query.getResultList(); + } + + @Override + public long count(String partialName, boolean filterShowActive, boolean filterShowInActive) { + CriteriaBuilder cb = entityManager.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(Long.class); + Root root = cq.from(Associate.class); + + cq.select(cb.count(root)); + cq.where(getPredicates(cb, root, partialName, filterShowActive, filterShowInActive)); + return entityManager.createQuery(cq).getSingleResult(); + } + +} diff --git a/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/UploadFileRepository.java b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/UploadFileRepository.java new file mode 100644 index 00000000..49c1123b --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/UploadFileRepository.java @@ -0,0 +1,7 @@ +package hu.user.mcvodsync.db.repository; + +import hu.user.mcvodsync.db.UploadFile; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface UploadFileRepository extends JpaRepository, UploadFileRepositorySearch { +} diff --git a/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/UploadFileRepositorySearch.java b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/UploadFileRepositorySearch.java new file mode 100644 index 00000000..b594fe05 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/UploadFileRepositorySearch.java @@ -0,0 +1,12 @@ +package hu.user.mcvodsync.db.repository; + +import hu.user.mcvodsync.db.UploadFile; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +public interface UploadFileRepositorySearch { + List search(String partialSearch, Pageable pageable); + + long count(String partialSearch); +} diff --git a/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/UploadFileRepositorySearchImpl.java b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/UploadFileRepositorySearchImpl.java new file mode 100644 index 00000000..1a8c4b58 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-db/src/main/java/hu/user/mcvodsync/db/repository/UploadFileRepositorySearchImpl.java @@ -0,0 +1,57 @@ +package hu.user.mcvodsync.db.repository; + +import hu.user.mcvodsync.db.UploadFile; +import org.apache.commons.lang3.StringUtils; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.query.QueryUtils; +import org.springframework.stereotype.Repository; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.TypedQuery; +import javax.persistence.criteria.CriteriaBuilder; +import javax.persistence.criteria.CriteriaQuery; +import javax.persistence.criteria.Predicate; +import javax.persistence.criteria.Root; +import java.util.ArrayList; +import java.util.List; + +@Repository +public class UploadFileRepositorySearchImpl implements UploadFileRepositorySearch { + @PersistenceContext + EntityManager entityManager; + + Predicate[] getPredicates(CriteriaBuilder cb, Root root, String partialSearch) { + List predicates = new ArrayList<>(); + if (StringUtils.isNotBlank(partialSearch)) { + predicates.add(cb.like(cb.lower(root.get("name")), "%" + partialSearch.toLowerCase() + "%")); + } + return predicates.toArray(new Predicate[]{}); + } + + @Override + public List search(String partialSearch, Pageable pageable) { + CriteriaBuilder cb = entityManager.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(UploadFile.class); + Root root = cq.from(UploadFile.class); + + cq.where(getPredicates(cb, root, partialSearch)); + cq.orderBy(QueryUtils.toOrders(pageable.getSort(), root, cb)); + TypedQuery query = entityManager.createQuery(cq); + query.setMaxResults(pageable.getPageSize()); + query.setFirstResult(pageable.getPageSize() * pageable.getPageNumber()); + return query.getResultList(); + } + + @Override + public long count(String partialSearch) { + CriteriaBuilder cb = entityManager.getCriteriaBuilder(); + CriteriaQuery cq = cb.createQuery(Long.class); + Root root = cq.from(UploadFile.class); + + cq.select(cb.count(root)); + cq.where(getPredicates(cb, root, partialSearch)); + return entityManager.createQuery(cq).getSingleResult(); + } + +} diff --git a/mc-vod-sync/mc-vod-sync-service/pom.xml b/mc-vod-sync/mc-vod-sync-service/pom.xml new file mode 100644 index 00000000..ee71d40a --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-service/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + mc-vod-sync-service + + hu.user + mc-vod-sync + 0.0.1-SNAPSHOT + + + + + + + + org.springframework + spring-web + 5.3.24 + + + hu.user + mc-vod-sync-db + 0.0.1-SNAPSHOT + + + org.springframework + spring-context + 5.3.24 + + + com.fasterxml.jackson.core + jackson-databind + + + org.skyscreamer + jsonassert + + + org.dhatim + fastexcel-reader + 0.15.7 + + + diff --git a/mc-vod-sync/mc-vod-sync-service/src/main/java/hu/user/mcvodsync/service/data/EntityDataService.java b/mc-vod-sync/mc-vod-sync-service/src/main/java/hu/user/mcvodsync/service/data/EntityDataService.java new file mode 100644 index 00000000..e7fc6e15 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-service/src/main/java/hu/user/mcvodsync/service/data/EntityDataService.java @@ -0,0 +1,87 @@ +package hu.user.mcvodsync.service.data; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.log4j.Log4j2; +import org.apache.commons.lang3.SerializationUtils; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.Serializable; +import java.util.Objects; + +@Log4j2 +@Service +public class EntityDataService extends EntityDataServiceBase { + @Autowired + ObjectMapper objectMapper; + + public T clone(T sourceEntity) { + return SerializationUtils.clone(sourceEntity); + } + + public T clone(T sourceEntity, String property, Object value) { + T result = clone(sourceEntity); + if (!setFieldValue(result, property, value)) { + result = null; + } + return result; + } + + + public String toJSON(T entity) { + String result = null; + try { + result = objectMapper.writeValueAsString(entity); + } catch (JsonProcessingException e) { + log.catching(e); + } + return result; + } + + public T fromJSON(String data, Class objectClass) { + T result = null; + try { + result = objectMapper.readValue(data, objectClass); + } catch (JsonProcessingException e) { + log.catching(e); + } + return result; + } + + public boolean areEquals(T entity1, T entity2) { + boolean result = true; + String json1 = toJSON(entity1); + String json2 = toJSON(entity2); + + try { + JSONAssert.assertEquals(json1, json2, JSONCompareMode.LENIENT); + } catch (Throwable e) { + result = false; + log.error(e); + } + + return result; + } + + public boolean areDifferent(T entity1, T entity2) { + boolean result = false; + if (Objects.isNull(entity1) && Objects.nonNull(entity2)) { + result = true; + } else { + String json1 = toJSON(entity1); + String json2 = toJSON(entity2); + + try { + JSONAssert.assertEquals(json1, json2, JSONCompareMode.LENIENT); + } catch (Throwable e) { + result = true; + log.error(e); + } + } + return result; + } + +} diff --git a/mc-vod-sync/mc-vod-sync-service/src/main/java/hu/user/mcvodsync/service/data/EntityDataServiceBase.java b/mc-vod-sync/mc-vod-sync-service/src/main/java/hu/user/mcvodsync/service/data/EntityDataServiceBase.java new file mode 100644 index 00000000..1975c93d --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-service/src/main/java/hu/user/mcvodsync/service/data/EntityDataServiceBase.java @@ -0,0 +1,49 @@ +package hu.user.mcvodsync.service.data; + +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Field; +import java.util.Arrays; + +@Log4j2 +@Service +public class EntityDataServiceBase { + + public boolean setFieldValue(Object entity, String property, Object value) { + boolean result = false; + Field field; + try { + boolean hasField = Arrays.stream(entity.getClass().getDeclaredFields()).anyMatch(f -> f.getName().equals(property)); + if (hasField) { + field = entity.getClass().getDeclaredField(property); + } else { + field = entity.getClass().getSuperclass().getDeclaredField(property); + } + field.setAccessible(true); + field.set(entity, value); + result = true; + } catch (Exception e) { + log.error(e); + } + return result; + } + + public Object getFieldValue(Object entity, String property) { + Object result = null; + Field field; + try { + boolean hasField = Arrays.stream(entity.getClass().getDeclaredFields()).anyMatch(f -> f.getName().equals(property)); + if (hasField) { + field = entity.getClass().getDeclaredField(property); + } else { + field = entity.getClass().getSuperclass().getDeclaredField(property); + } + field.setAccessible(true); + result = field.get(entity); + } catch (Exception e) { + log.error(e); + } + return result; + } +} diff --git a/mc-vod-sync/mc-vod-sync-service/src/main/java/hu/user/mcvodsync/service/xls/VodXlsProcessor.java b/mc-vod-sync/mc-vod-sync-service/src/main/java/hu/user/mcvodsync/service/xls/VodXlsProcessor.java new file mode 100644 index 00000000..d0b60fd1 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-service/src/main/java/hu/user/mcvodsync/service/xls/VodXlsProcessor.java @@ -0,0 +1,45 @@ +package hu.user.mcvodsync.service.xls; + +import hu.user.mcvodsync.db.UploadFile; +import lombok.extern.log4j.Log4j2; +import org.dhatim.fastexcel.reader.ReadableWorkbook; +import org.dhatim.fastexcel.reader.Row; +import org.dhatim.fastexcel.reader.Sheet; +import org.springframework.stereotype.Service; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +@Log4j2 +@Service +public class VodXlsProcessor { + private final boolean firstRowAsHeader = true; + private final List mappings = Collections.emptyList(); + + public void process(UploadFile uploadFile) { + try (InputStream is = new ByteArrayInputStream(uploadFile.getFile()); + ReadableWorkbook wb = new ReadableWorkbook(is)) { + Sheet sheet = wb.getFirstSheet(); + try (Stream rows = sheet.openStream()) { + rows.forEach(r -> { +// if (firstRowAsHeader && r.getRowNum() == 1) { +// continue; +// } + String str = r.getCellAsString(0).orElse(null); + log.info("{} {}", r.getRowNum(), str); +// BigDecimal num = r.getCellAsNumber(0).orElse(null); +// String str = r.getCellAsString(1).orElse(null); +// LocalDateTime date = r.getCellAsDate(2).orElse(null); + }); + } + } catch (IOException e) { + log.error("Excel file reading error from {}. System message: {}", uploadFile.getName(), e.getMessage()); + } + + } + +} diff --git a/mc-vod-sync/mc-vod-sync-ui/pom.xml b/mc-vod-sync/mc-vod-sync-ui/pom.xml new file mode 100644 index 00000000..5b1c8c38 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/pom.xml @@ -0,0 +1,117 @@ + + + 4.0.0 + mc-vod-sync-ui + + hu.user + mc-vod-sync + 0.0.1-SNAPSHOT + + + + ZK CE + ZK CE Repository + https://mavensync.zkoss.org/maven2 + + + + 2.7.7 + 9.6.0 + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security + spring-security-ldap + + + org.springframework.ldap + spring-ldap-core + + + org.javassist + javassist + 3.26.0-GA + + + org.beanshell + bsh + 2.0b5 + + + commons-fileupload + commons-fileupload + 1.3 + + + org.springframework + spring-beans + 5.3.24 + + + org.zkoss.zkspringboot + zkspringboot-starter + pom + ${zkspringboot.version} + + + org.zkoss.zk + zk + ${zk.version} + + + org.zkoss.zk + zkplus + ${zk.version} + + + org.zkoss.zk + zhtml + ${zk.version} + + + org.zkoss.theme + silvertail + ${zk.version} + + + org.zkoss.theme + breeze + ${zk.version} + + + org.zkoss.theme + iceblue_c + ${zk.version} + + + org.zkoss.theme + sapphire + ${zk.version} + + + org.zkoss.theme + atlantic + ${zk.version} + + + hu.user + mc-vod-sync-db + 0.0.1-SNAPSHOT + + + hu.user + mc-vod-sync-service + 0.0.1-SNAPSHOT + + + \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/ApplicationProperties.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/ApplicationProperties.java new file mode 100644 index 00000000..38624181 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/ApplicationProperties.java @@ -0,0 +1,15 @@ +package hu.user.mcvodsync.ui; + +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.application") +public class ApplicationProperties { + String userName; + String password; +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/Constants.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/Constants.java new file mode 100644 index 00000000..ea8760bd --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/Constants.java @@ -0,0 +1,12 @@ +package hu.user.mcvodsync.ui; + +public class Constants { + public static final String APPLICATION_NAME = "MC-VOD-SYNC"; + public static final String NAV_UPLOAD_FILES = "/upload-files"; + public static final String NAV_ASSOCIATES = "/associates"; + public static final String NAV_LOGIN = "/login"; + public static final String NAV_LOGOUT = "/logout"; + public static final String NAV_TIMEOUT = "/timeout"; + public static final String NAV_ROOT = "/"; + public static final String NAV_API = "/api"; +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/auth/CurrentProfile.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/auth/CurrentProfile.java new file mode 100644 index 00000000..0dc8b2ca --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/auth/CurrentProfile.java @@ -0,0 +1,13 @@ +package hu.user.mcvodsync.ui.auth; + +import hu.user.mcvodsync.db.Associate; +import lombok.Getter; +import lombok.Setter; +import org.springframework.stereotype.Service; + +@Service +@Getter +@Setter +public class CurrentProfile { + Associate associate; +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/auth/Guard.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/auth/Guard.java new file mode 100644 index 00000000..fa79c01f --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/auth/Guard.java @@ -0,0 +1,26 @@ +package hu.user.mcvodsync.ui.auth; + +import hu.user.mcvodsync.ui.Constants; +import lombok.extern.log4j.Log4j2; +import org.springframework.security.authentication.AnonymousAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.Page; +import org.zkoss.zk.ui.util.Initiator; + +import java.util.Map; + +@Log4j2 +public class Guard implements Initiator { + @Override + public void doInit(Page page, Map args) throws Exception { + //HttpServletRequest request = (HttpServletRequest) Executions.getCurrent().getNativeRequest(); + Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); + + if (authentication == null || authentication instanceof AnonymousAuthenticationToken) { + Executions.sendRedirect(Constants.NAV_LOGIN); + } + } + +} \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/auth/LocalAuthProvider.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/auth/LocalAuthProvider.java new file mode 100644 index 00000000..90a585d2 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/auth/LocalAuthProvider.java @@ -0,0 +1,48 @@ +package hu.user.mcvodsync.ui.auth; + +import hu.user.mcvodsync.db.Associate; +import hu.user.mcvodsync.db.repository.AssociateRepository; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.AuthenticationProvider; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.stereotype.Component; + +import java.util.Arrays; +import java.util.Objects; + +@Component +public class LocalAuthProvider implements AuthenticationProvider { + @Autowired + AssociateRepository associateRepository; + + @Autowired + CurrentProfile currentProfile; + + @Override + public Authentication authenticate(Authentication authentication) throws AuthenticationException { + UsernamePasswordAuthenticationToken result; + String name = authentication.getName(); + String password = authentication.getCredentials().toString(); + + Associate associate = null; + if (StringUtils.isNotBlank(password)) { + associate = associateRepository.findByLoginAndPassword(name, password); + } + if (Objects.nonNull(associate)) { + result = new UsernamePasswordAuthenticationToken(name, password, Arrays.asList()); + currentProfile.setAssociate(associate); + } else { + throw new BadCredentialsException("Local authentication failed!"); + } + return result; + } + + @Override + public boolean supports(Class authentication) { + return authentication.equals(UsernamePasswordAuthenticationToken.class); + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/config/DevelopmentConfig.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/config/DevelopmentConfig.java new file mode 100644 index 00000000..0d2df73b --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/config/DevelopmentConfig.java @@ -0,0 +1,39 @@ +package hu.user.mcvodsync.ui.config; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; +import org.zkoss.lang.Library; +import org.zkoss.zk.ui.WebApps; + +import javax.annotation.PostConstruct; +import java.util.Objects; + +@Configuration +@Profile("dev") +public class DevelopmentConfig { + private static final Logger logger = LoggerFactory.getLogger(DevelopmentConfig.class); + + @PostConstruct + public void initDevelopmentProperties() throws Exception { + logger.info("**************************************************************"); + logger.info("**** ZK-Springboot-Demo: development configuration active ****"); + logger.info("**************************************************************"); + + if (Objects.nonNull(WebApps.getCurrent())) { + // enable non minified js + WebApps.getCurrent().getConfiguration().setDebugJS(true); + } + + //disable various caches to avoid server restarts + Library.setProperty("org.zkoss.zk.ZUML.cache", "false"); + Library.setProperty("org.zkoss.zk.WPD.cache", "false"); + Library.setProperty("org.zkoss.zk.WCS.cache", "false"); + Library.setProperty("org.zkoss.web.classWebResource.cache", "false"); + Library.setProperty("org.zkoss.util.label.cache", "false"); + // enable for debugging MVVM commands and binding (very verbose) + Library.setProperty("org.zkoss.bind.DebuggerFactory.enable", "false"); + } + +} \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/config/ResourceConfigurer.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/config/ResourceConfigurer.java new file mode 100644 index 00000000..15b24661 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/config/ResourceConfigurer.java @@ -0,0 +1,23 @@ +package hu.user.mcvodsync.ui.config; + +import hu.user.mcvodsync.ui.Constants; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +public class ResourceConfigurer { + @GetMapping(Constants.NAV_TIMEOUT) + public String timeout() { + return "timeout"; + } + + @GetMapping(Constants.NAV_LOGIN) + public String login() { + return "login"; + } + + @GetMapping({Constants.NAV_UPLOAD_FILES}) + public String index() { + return "index"; + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/config/WebSecurityConfig.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/config/WebSecurityConfig.java new file mode 100644 index 00000000..d67f319c --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/config/WebSecurityConfig.java @@ -0,0 +1,58 @@ +package hu.user.mcvodsync.ui.config; + +import hu.user.mcvodsync.ui.Constants; +import hu.user.mcvodsync.ui.auth.LocalAuthProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.web.authentication.Http403ForbiddenEntryPoint; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; + +@Configuration +@EnableWebSecurity +public class WebSecurityConfig extends WebSecurityConfigurerAdapter { + + public static final String ZUL_FILES = "/zkau/web/**/*.zul"; + // allow desktop cleanup after logout or when reloading login page + public static final String REMOVE_DESKTOP_REGEX = "/zkau\\?dtid=.*&cmd_0=rmDesktop&.*"; + + + public static final String[] ZK_RESOURCES = {"/zkau/web/**/js/**", "/zkau/web/**/zul/css/**", "/zkau/web/**/img/**", "/zkau/web/**/static/**"}; + @Autowired + LocalAuthProvider localAuthProvider; + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.csrf().disable(); + //String[] navigation = NAVIGATION.keySet().toArray(new String[]{}); + http.headers().frameOptions().sameOrigin(); + http.authorizeRequests() + .antMatchers(ZUL_FILES).denyAll() // block direct access to zul files + .antMatchers(HttpMethod.GET, ZK_RESOURCES).permitAll() // allow zk resources + .antMatchers(HttpMethod.POST, "/zkau/upload/**").permitAll() // allow zk resources + .regexMatchers(HttpMethod.GET, REMOVE_DESKTOP_REGEX).permitAll() // allow desktop cleanup + .requestMatchers(req -> "rmDesktop".equals(req.getParameter("cmd_0"))).permitAll() // allow desktop cleanup from ZATS + .mvcMatchers(Constants.NAV_ROOT, Constants.NAV_LOGIN, Constants.NAV_LOGOUT, Constants.NAV_API + "/**").permitAll() + //mvcMatchers(navigation).hasRole("USER") + .anyRequest().authenticated() + .and() + .formLogin() + .loginPage(Constants.NAV_LOGIN).defaultSuccessUrl(Constants.NAV_UPLOAD_FILES) + .and() + .logout().logoutUrl(Constants.NAV_LOGOUT).logoutSuccessUrl(Constants.NAV_LOGIN) + .and() + .exceptionHandling() + .defaultAuthenticationEntryPointFor( + new Http403ForbiddenEntryPoint(), + new AntPathRequestMatcher("/zkau", "POST")); + } + + @Autowired + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.authenticationProvider(localAuthProvider); + } +} \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/AssociatesDataModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/AssociatesDataModel.java new file mode 100644 index 00000000..fc116436 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/AssociatesDataModel.java @@ -0,0 +1,97 @@ +package hu.user.mcvodsync.ui.data; + +import hu.user.mcvodsync.db.Associate; +import hu.user.mcvodsync.db.repository.AssociateRepository; +import hu.user.mcvodsync.service.data.EntityDataService; +import hu.user.mcvodsync.ui.data.common.CachedSpringDataModel; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.context.annotation.Scope; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Component; +import org.zkoss.zul.FieldComparator; + +import java.util.List; + +@Component +@Log4j2 +@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) +public class AssociatesDataModel extends CachedSpringDataModel { + @Autowired + AssociateRepository associateRepository; + + @Autowired + EntityDataService associateDataService; + private String partialName; + + private boolean listAll; + + private boolean filterShowInActive; + + private boolean filterShowActive; + + @Override + public List getResultSet(int page, int pageSize, FieldComparator sortComparator) { + Pageable pageable = createPageable(page, pageSize, sortComparator); + List result = listAll ? associateRepository.findAll(pageable).toList() : + associateRepository.search(partialName, filterShowActive, filterShowInActive, pageable); + return result; + } + + @Override + public int getResultSetCount() { + long result = listAll ? associateRepository.count() : + associateRepository.count(partialName, filterShowActive, filterShowInActive); + return (int) result; + } + + public void search(String partialName) { + log.info("Searching associate using filters: name LIKE {}", partialName); + listAll = false; + this.filterShowActive = true; + this.filterShowInActive = true; + this.partialName = partialName; + super.reset(); + } + + public void limitedSarch(String partialName) { + log.info("Litited searching associate using filters: name LIKE {}", partialName); + listAll = false; + this.filterShowActive = true; + this.filterShowInActive = false; + this.partialName = partialName; + super.reset(); + } + + public void search(boolean filterShowActive, boolean filterShowInActive) { + log.info("Searching associate using filters: filterShowActive {}, filterShowInActive {}", + filterShowActive, filterShowInActive); + listAll = false; + this.filterShowActive = filterShowActive; + this.filterShowInActive = filterShowInActive; + super.reset(); + } + + public void listAll() { + log.info("List all associates"); + listAll = true; + super.reset(); + } + + public Associate createNew() { + return Associate.builder().build(); + } + + public Associate clone(Associate selectedEntity) { + return associateDataService.clone(selectedEntity); + } + + public Associate save(Associate entity) { + return associateRepository.save(entity); + } + + public void delete(Associate selectedEntity) { + associateRepository.delete(selectedEntity); + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/UploadFileDataModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/UploadFileDataModel.java new file mode 100644 index 00000000..d4b5243c --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/UploadFileDataModel.java @@ -0,0 +1,60 @@ +package hu.user.mcvodsync.ui.data; + +import hu.user.mcvodsync.db.UploadFile; +import hu.user.mcvodsync.db.repository.UploadFileRepository; +import hu.user.mcvodsync.service.data.EntityDataService; +import hu.user.mcvodsync.ui.data.common.CachedSpringDataModel; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.context.annotation.Scope; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Component; +import org.zkoss.zul.FieldComparator; + +import java.util.List; + +@Component +@Log4j2 +@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) +public class UploadFileDataModel extends CachedSpringDataModel { + @Autowired + UploadFileRepository uploadFileRepository; + + @Autowired + EntityDataService entityDataService; + + private String partialSearch; + + @Override + public List getResultSet(int page, int pageSize, FieldComparator sortComparator) { + Pageable pageable = createPageable(page, pageSize, sortComparator); + return uploadFileRepository.search(partialSearch, pageable); + } + + @Override + public int getResultSetCount() { + long result = uploadFileRepository.count(partialSearch); + return (int) result; + } + + public void refresh() { + super.reset(); + } + + public UploadFile createNew() { + return UploadFile.builder().build(); + } + + public UploadFile clone(UploadFile selectedEntity) { + return entityDataService.clone(selectedEntity); + } + + public UploadFile save(UploadFile selectedEntity) { + return uploadFileRepository.save(selectedEntity); + } + + public void delete(UploadFile selectedEntity) { + uploadFileRepository.delete(selectedEntity); + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/common/CachedDataModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/common/CachedDataModel.java new file mode 100644 index 00000000..981cebff --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/common/CachedDataModel.java @@ -0,0 +1,173 @@ +package hu.user.mcvodsync.ui.data.common; + +import lombok.Setter; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Component; +import org.zkoss.bind.BindUtils; +import org.zkoss.zul.FieldComparator; +import org.zkoss.zul.ListModelList; +import org.zkoss.zul.event.ListDataEvent; + +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; + +@Component +@Log4j2 +public abstract class CachedDataModel extends ListModelList { + public static final String NATURAL = "natural"; + public static final String ASCENDING = "ascending"; + public static final String DESCENDING = "descending"; + private int CACHE_SIZE = 100; + private int cacheStart; + private int cacheEnd; + private int resultSetSize = -1; + private HashMap cache = new HashMap<>(); + @Setter + private FieldComparator sortComparator; + + public CachedDataModel() { + + setMultiple(false); + + } + + public void reset() { + this.resultSetSize = -1; + this.cacheStart = 0; + this.cacheEnd = 0; + + clearCache(); + try { + fireEvent(ListDataEvent.STRUCTURE_CHANGED, -1, -1); + BindUtils.postNotifyChange(null, null, this, "*"); + } catch (Exception e) { + log.warn(e.getMessage()); + } + } + + public void clearCache() { + cache.clear(); + //fireEvent(ListDataEvent.STRUCTURE_CHANGED, -1, -1); + } + + public int getCacheEnd() { + return cacheEnd; + } + + // zul felulet hasznalja kiirashoz + public int getCacheStart() { + return cacheStart; + } + + @Override + public T getElementAt(int index) { + // logger.debug("CachedListMode.getElementAt(): " + index); + T ret = cache.get(index); + if (ret == null) { + loadCache(index); + ret = cache.get(index); + if (ret == null) { + throw new RuntimeException("Element at index " + index + " cannot be found in the database."); + } + } + return ret; + } + + // ListModelList method felulirva + // after 1. searchByProject ++++++++++ + @Override + public int getSize() { + if (this.resultSetSize < 0) { + loadCache(0); + // logger.debug("CachedListMode.getSize(): " + this.resultSetSize); + } + return this.resultSetSize; + } + +// protected void loadCache(int forIndex) { +// try { +// int halfSize = this.CACHE_SIZE / 2; +// int rowLimit = this.CACHE_SIZE; +// int startPos = 0; +// if ((forIndex - halfSize) > 0) { +// startPos = (forIndex - halfSize); +// } +// +// int endPos = (startPos + rowLimit); +// endPos = ((this.resultSetSize < 0) || (endPos <= this.resultSetSize)) ? endPos : this.resultSetSize; +// +// +// if (this.resultSetSize < 0) { +// this.resultSetSize = getResultSetCount(); +// log.info("Result item count is {}", resultSetSize); +// } +// +// int limit = endPos - startPos; +// +// // (int) Math.ceil(this.resultSetSize / limit); +// int page = forIndex == 0 ? 0 : (int) Math.ceil(limit / forIndex); +// log.info("Query result from {} to {} for item {} | page {} pageSize {}", startPos, endPos, forIndex, page, limit); +// List resList = getResultSet(page, limit, sortComparator); +// +// if (resList != null) { +// log.info("Got {} records", resList.size()); +// for (int c = 0; c < resList.size(); c++) { +// cache.put(startPos + c, resList.get(c)); +// } +// } +// +// cacheStart = startPos + 1; +// cacheEnd = cacheStart + (cache.size() == 0 ? 0 : (cache.size() - 1)); +// } catch (Exception e) { +// log.error("", e); +// } +// } + + + protected void loadCache(int forIndex) { + try { + int page = forIndex == 0 ? 0 : (int) Math.ceil(forIndex / CACHE_SIZE); + log.info("{} query result for item {} | page {} pageSize {}", getClass().getSimpleName(), forIndex, page, CACHE_SIZE); + if (this.resultSetSize < 0) { + this.resultSetSize = getResultSetCount(); + log.info("Result item total count is {}", resultSetSize); + } + List resList = getResultSet(page, CACHE_SIZE, sortComparator); + + if (resList != null) { + log.info("Got {} records", resList.size()); + cacheStart = forIndex; + for (int c = 0; c < resList.size(); c++) { + cache.put(forIndex + c, resList.get(c)); + cacheEnd++; + } + } + + } catch (Exception e) { + log.error("", e); + } + } + + abstract public List getResultSet(int page, int pageSize, FieldComparator sortComparator); + + abstract public int getResultSetCount(); + + @Override + public String getSortDirection(Comparator comparator) { + FieldComparator fieldCmpr = (FieldComparator) comparator; + if (sortComparator == null) { + return NATURAL; + } + String sortDirection = sortComparator.isAscending() ? ASCENDING : DESCENDING; + return fieldCmpr.getRawOrderBy().equals(sortComparator.getRawOrderBy()) ? sortDirection : NATURAL; + } + + @Override + public void sort(Comparator cmpr, boolean ascending) { + sortComparator = (FieldComparator) cmpr; +// log.info("Sort {} {}", sortComparator.getOrderBy(), ascending); + reset(); + } +} + diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/common/CachedSpringDataModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/common/CachedSpringDataModel.java new file mode 100644 index 00000000..074a3632 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/common/CachedSpringDataModel.java @@ -0,0 +1,79 @@ +package hu.user.mcvodsync.ui.data.common; + +import hu.user.mcvodsync.service.data.EntityDataService; +import hu.user.mcvodsync.ui.auth.CurrentProfile; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Component; +import org.zkoss.json.JSONObject; +import org.zkoss.zul.FieldComparator; + +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +@Component +@Log4j2 +public abstract class CachedSpringDataModel extends CachedDataModel { + + @Getter + @Setter + JSONObject columnSettings = new JSONObject(); + + @Autowired + CurrentProfile currentProfile; + + @Autowired + EntityDataService entityDataService; + + public void addColumns(Map columns) { + columns.keySet().forEach(colName -> addColumn(colName, columns.get(colName))); + } + + private void addColumn(String name, String direction) { + JSONObject sort = new JSONObject(); + sort.put("sortDirection", direction); + columnSettings.put(name, sort); + + if (!direction.equals(NATURAL)) { + setSortComparator(new FieldComparator(name, direction.equals(ASCENDING))); + } + } + + protected Pageable createPageable(int page, int pageSize, FieldComparator sortComparator) { + Pageable pageable; + if (Objects.isNull(sortComparator)) { + pageable = PageRequest.of(page, pageSize); + } else { + String orderBy = sortComparator.getRawOrderBy(); + Sort.Direction direction = sortComparator.isAscending() ? Sort.Direction.ASC : Sort.Direction.DESC; + pageable = PageRequest.of(page, pageSize, Sort.by(direction, orderBy)); + } + log.info("{} {}", getClass().getSimpleName(), pageable); + return pageable; + } + + @Override + public void sort(Comparator cmpr, boolean ascending) { + super.sort(cmpr, ascending); + + FieldComparator sortComparator = (FieldComparator) cmpr; + columnSettings.keySet().forEach(colName -> { + LinkedHashMap col = (LinkedHashMap) columnSettings.get(colName); + if (colName.equals(sortComparator.getRawOrderBy())) { + col.put("sortDirection", ascending ? ASCENDING : DESCENDING); + } else { + col.put("sortDirection", NATURAL); + } + }); + log.info("Sort settings for {} : {}", getClass().getSimpleName(), columnSettings.toJSONString()); + } + +} + diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/common/FormDocument.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/common/FormDocument.java new file mode 100644 index 00000000..d8c36096 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/data/common/FormDocument.java @@ -0,0 +1,29 @@ +package hu.user.mcvodsync.ui.data.common; + +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.Builder; +import lombok.extern.log4j.Log4j2; +import org.zkoss.json.JSONObject; +import org.zkoss.json.parser.JSONParser; +import org.zkoss.lang.Strings; + +@Builder +@Log4j2 +public class FormDocument extends JSONObject { + + private Object data; + + public FormDocument setData(Object data) { + try { + ObjectMapper mapper = new ObjectMapper(); + String json = mapper.writeValueAsString(data); + JSONParser jsonParser = new JSONParser(); + JSONObject jsonObject = (JSONObject) jsonParser.parse(json); + putAll(jsonObject); + } catch (Exception e) { + log.error(Strings.EMPTY, e); + } + put("data", data); + return this; + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/AssociateEditorModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/AssociateEditorModel.java new file mode 100644 index 00000000..bf1f069e --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/AssociateEditorModel.java @@ -0,0 +1,27 @@ +package hu.user.mcvodsync.ui.editor; + +import hu.user.mcvodsync.db.Associate; +import hu.user.mcvodsync.ui.editor.common.EntityEditorModel; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.log4j.Log4j2; +import org.apache.commons.lang3.StringUtils; +import org.zkoss.bind.annotation.Init; + +@Log4j2 +@Getter +@Setter +public class AssociateEditorModel extends EntityEditorModel { + + @Init + public void init() { + super.init(); + } + + @Override + protected boolean canSave(Associate entity) { + return StringUtils.isNotBlank(entity.getName()) && + StringUtils.isNotBlank(entity.getLogin()) && + StringUtils.isNotBlank(entity.getPassword()); + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/PartnerEditorModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/PartnerEditorModel.java new file mode 100644 index 00000000..f0ae6f07 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/PartnerEditorModel.java @@ -0,0 +1,40 @@ +package hu.user.mcvodsync.ui.editor; + +import hu.user.mcvodsync.db.UploadFile; +import hu.user.mcvodsync.ui.editor.common.EntityEditorModel; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.log4j.Log4j2; +import org.apache.commons.lang3.StringUtils; +import org.zkoss.bind.annotation.Init; + +import java.util.Objects; + +@Log4j2 +@Getter +@Setter +public class PartnerEditorModel extends EntityEditorModel { + private static final String VAT_NR_PATTERN = "/^[0-9]{8}-[1-5]{1}-[02]|[22]|[03]|[23]|[04]|[24]|[05]|[25]|[06]|[26]|[07]|[27]|[08]|[28]|[09]|[29]|[10]|[30]|[11]|[31]|[12]|[32]|[13]|[33]|[14]|[34]|[15]|[35]|[16]|[36]|[17]|[37]|[18]|[38]|[19]|[39]|[20]|[40]|[41]|[42]|[43]|[44]|[51]$/s"; + + @Init + public void init() { + super.init(); + } + + @Override + protected boolean canSave(UploadFile entity) { + return StringUtils.isNotBlank(entity.getName()) && + Objects.nonNull(entity.getFile()) && + Objects.nonNull(entity.getCreated()) && + entity.getSize() > 0; + } + + private boolean isVatNumber(String vatNr) { + return true; + //TODO not working properly +// Pattern pattern = Pattern.compile(VAT_NR_PATTERN); +// boolean result = pattern.matcher(vatNr).matches(); +// log.info("Vat number regex match {}", result); +// return result; + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/common/EditCompleted.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/common/EditCompleted.java new file mode 100644 index 00000000..25c8da43 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/common/EditCompleted.java @@ -0,0 +1,7 @@ +package hu.user.mcvodsync.ui.editor.common; + +public interface EditCompleted { + + void done(E entity); + +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/common/Editors.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/common/Editors.java new file mode 100644 index 00000000..ef8fba82 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/common/Editors.java @@ -0,0 +1,46 @@ +package hu.user.mcvodsync.ui.editor.common; + +import com.google.common.collect.ImmutableMap; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zul.Window; + +import java.util.Map; +import java.util.Objects; + +public class Editors { + public static final String SERVICE_RECORD = "~./editor/service-record-editor.zul"; + public static final String INCOMING_INVOICE = "~./editor/incoming-invoice-editor.zul"; + public static final String OUTGOING_INVOICE = "~./editor/outgoing-invoice-editor.zul"; + public static final String TREASURY = "~./editor/treasury-editor.zul"; + public static final String ASSOCIATE = "~./editor/associate-editor.zul"; + public static final String PARTNER = "~./editor/partner-editor.zul"; + public static final String IMPORT_INVOICE_ASSIGN = "~./editor/import-invoice-assign-editor.zul"; + public static final String IMPORT_INVOICE_APPROVE = "~./editor/import-invoice-approve-editor.zul"; + public static final String PROJECT = "~./editor/project-editor.zul"; + + public static void doEdit(String page, E entity, EditCompleted editCompleted) { + doEdit(page, entity, null, editCompleted); + } + + public static void doEdit(String page, E entity, E original, EditCompleted editCompleted) { + Map arg; + if (Objects.isNull(entity)) { + //header double click + return; + } + + if (Objects.isNull(original)) { + arg = ImmutableMap.of("formDocument", entity); + } else { + arg = ImmutableMap.of("formDocument", entity, "origDocument", original); + } + Window editorWindow = (Window) Executions.createComponents(page, null, arg); + editorWindow.addEventListener("onClose", e -> { + if (e.getData() != null) { + editCompleted.done((E) e.getData()); + } + }); + editorWindow.doModal(); + editorWindow.setFocus(true); + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/common/EntityEditorModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/common/EntityEditorModel.java new file mode 100644 index 00000000..4fec31dc --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/editor/common/EntityEditorModel.java @@ -0,0 +1,101 @@ +package hu.user.mcvodsync.ui.editor.common; + +import hu.user.mcvodsync.service.data.EntityDataService; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.log4j.Log4j2; +import org.zkoss.bind.BindUtils; +import org.zkoss.bind.PropertyChangeEvent; +import org.zkoss.bind.ValidationContext; +import org.zkoss.bind.annotation.BindingParam; +import org.zkoss.bind.annotation.Command; +import org.zkoss.bind.validator.AbstractValidator; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.Events; +import org.zkoss.zk.ui.select.annotation.VariableResolver; +import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zkplus.spring.DelegatingVariableResolver; +import org.zkoss.zul.Window; + +import java.io.Serializable; +import java.util.Objects; + + +@Log4j2 +@VariableResolver(DelegatingVariableResolver.class) +public abstract class EntityEditorModel extends AbstractValidator { + + @Getter + @Setter + T formDocument; + + @Getter + @Setter + T origDocument; + + @Getter + boolean saveEnabled; + + @WireVariable + EntityDataService entityDataService; + + @Command + public void onCloseWindow(@BindingParam("target") Window target, @BindingParam("save") boolean save) { + if (save) { + if (saveEnabled) { + Events.postEvent(new Event("onClose", target, formDocument)); + } + } else { + Events.postEvent(new Event("onClose", target, null)); + } + } + + private void setSaveEnabled(boolean saveEnabled) { + this.saveEnabled = saveEnabled; + log.info("Document save enabled {}", saveEnabled); + BindUtils.postNotifyChange(this, "saveEnabled"); + } + + public void init() { + origDocument = (T) Executions.getCurrent().getArg().get("origDocument"); + formDocument = (T) Executions.getCurrent().getArg().get("formDocument"); + } + + @Override + public void validate(ValidationContext ctx) { + Component target = ctx.getBindContext().getComponent(); + String property = ctx.getProperty().getProperty(); + Object value = ctx.getProperty().getValue(); + log.info("Validating caused by {} {} {}", target.getId(), property, value); + try { + validate(entityDataService.clone(formDocument, property, value)); + } catch (Exception e) { + log.catching(e); + } + } + + protected abstract boolean canSave(T entity); + + protected boolean areDifferent(T entity) { + return entityDataService.areDifferent(origDocument, entity); + } + + protected void validate(T entity) { + boolean enable = areDifferent(entity) && canSave(entity); + setSaveEnabled(enable); + } + + protected void validate() { + validate(formDocument); + } + + protected boolean isEventForCurrentDocument(Event evt) { + if (evt instanceof PropertyChangeEvent) { + PropertyChangeEvent propertyEvent = (PropertyChangeEvent) evt; + return (Objects.nonNull(propertyEvent.getBase()) && Objects.nonNull(formDocument) && propertyEvent.getBase().equals(formDocument)); + } + return false; + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/session/SessionSettings.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/session/SessionSettings.java new file mode 100644 index 00000000..45af03df --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/session/SessionSettings.java @@ -0,0 +1,35 @@ +package hu.user.mcvodsync.ui.session; + +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.Sessions; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +@Service +@Log4j2 +public class SessionSettings { + + public SessionSettings() { + log.info("SessionSettings created"); + } + + private HttpServletRequest getNativeRequest() { + return (HttpServletRequest) Executions.getCurrent().getNativeRequest(); + } + + private HttpSession getNativeSession() { + return (HttpSession) Sessions.getCurrent().getNativeSession(); + } + + public String getCurrentPath() { + HttpServletRequest nativeRequest = getNativeRequest(); + return (String) Executions.getCurrent().getAttribute("javax.servlet.forward.servlet_path"); + } + + public String getSessionId() { + return getNativeSession().getId(); + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/AssociatesViewModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/AssociatesViewModel.java new file mode 100644 index 00000000..1e28c970 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/AssociatesViewModel.java @@ -0,0 +1,87 @@ +package hu.user.mcvodsync.ui.view; + +import com.google.common.collect.ImmutableMap; +import hu.user.mcvodsync.db.Associate; +import hu.user.mcvodsync.ui.Constants; +import hu.user.mcvodsync.ui.data.AssociatesDataModel; +import hu.user.mcvodsync.ui.data.common.CachedSpringDataModel; +import hu.user.mcvodsync.ui.editor.common.Editors; +import hu.user.mcvodsync.ui.view.common.FilterActiveViewModel; +import lombok.Getter; +import lombok.extern.log4j.Log4j2; +import org.zkoss.bind.annotation.Command; +import org.zkoss.bind.annotation.Init; +import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zul.Messagebox; + +import static hu.user.mcvodsync.ui.data.common.CachedDataModel.ASCENDING; +import static hu.user.mcvodsync.ui.data.common.CachedDataModel.NATURAL; + +@Log4j2 +public class AssociatesViewModel extends FilterActiveViewModel { + @WireVariable + @Getter + AssociatesDataModel associatesDataModel; + + @Override + protected CachedSpringDataModel getDataModel() { + return associatesDataModel; + } + + @Override + protected String getNavigation() { + return Constants.NAV_ASSOCIATES; + } + + @Init + public void init() { + super.init(); + addColumns(ImmutableMap.of( + "name", ASCENDING, + "login", NATURAL, + "active", NATURAL + )); + } + + + protected void refresh() { + associatesDataModel.clearSelection(); + setSelectedEntity(null); + if (isFilterShowBoth()) { + associatesDataModel.search(true, true); + } else { + associatesDataModel.search(isFilterShowActive(), isFilterShowInActive()); + } + } + + @Command + public void onAdd() { + Associate entity = associatesDataModel.createNew(); + Editors.doEdit(Editors.ASSOCIATE, entity, modifiedEntity -> { + associatesDataModel.save(modifiedEntity); + refresh(); + associatesDataModel.addToSelection(modifiedEntity); + }); + } + + @Command + public void onEdit() { + Associate entity = associatesDataModel.clone(getSelectedEntity()); + Editors.doEdit(Editors.ASSOCIATE, entity, getSelectedEntity(), modifiedEntity -> { + associatesDataModel.save(modifiedEntity); + refresh(); + }); + } + + @Command + public void onDelete() { + Messagebox.show("Biztosan törli a kijelölt elemet?", "Megerősítés", + Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION, e -> { + if (!e.getName().equals("onCancel")) { + associatesDataModel.delete(getSelectedEntity()); + refresh(); + } + }); + } + +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/IndexViewModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/IndexViewModel.java new file mode 100644 index 00000000..4349317e --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/IndexViewModel.java @@ -0,0 +1,56 @@ +package hu.user.mcvodsync.ui.view; + +import hu.user.mcvodsync.ui.Constants; +import hu.user.mcvodsync.ui.auth.CurrentProfile; +import hu.user.mcvodsync.ui.session.SessionSettings; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.log4j.Log4j2; +import org.springframework.boot.info.BuildProperties; +import org.zkoss.bind.BindUtils; +import org.zkoss.bind.annotation.BindingParam; +import org.zkoss.bind.annotation.Command; +import org.zkoss.bind.annotation.Init; +import org.zkoss.zk.ui.select.annotation.VariableResolver; +import org.zkoss.zk.ui.select.annotation.WireVariable; + + +@Log4j2 +@VariableResolver(org.zkoss.zkplus.spring.DelegatingVariableResolver.class) +@Getter +@Setter +public class IndexViewModel { + + @WireVariable + BuildProperties buildProperties; + + @WireVariable + SessionSettings sessionSettings; + + @WireVariable + CurrentProfile currentProfile; + + String page; + + @Init + public void init() { + log.info("Current session is {}", sessionSettings.getSessionId()); + String path = sessionSettings.getCurrentPath(); + route(path); + log.info("Init {}", path); + } + + private void route(String path) { + if (Constants.NAV_ROOT.equals(path)) + path = Constants.NAV_UPLOAD_FILES; + setPage("~." + path + ".zul"); + } + + + @Command + public void selectPage(@BindingParam("page") String page) { + setPage(page); + BindUtils.postNotifyChange(this, "page"); + } + +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/LoginViewModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/LoginViewModel.java new file mode 100644 index 00000000..684ce58c --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/LoginViewModel.java @@ -0,0 +1,23 @@ +package hu.user.mcvodsync.ui.view; + +import hu.user.mcvodsync.ui.ApplicationProperties; +import lombok.Getter; +import lombok.extern.log4j.Log4j2; +import org.springframework.boot.info.BuildProperties; +import org.zkoss.zk.ui.select.annotation.VariableResolver; +import org.zkoss.zk.ui.select.annotation.WireVariable; + +@Log4j2 +@VariableResolver(org.zkoss.zkplus.spring.DelegatingVariableResolver.class) +@Getter +public class LoginViewModel { + @WireVariable + BuildProperties buildProperties; + + @WireVariable + ApplicationProperties applicationProperties; + + public LoginViewModel() { + + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/UploadFilesViewModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/UploadFilesViewModel.java new file mode 100644 index 00000000..62ca3823 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/UploadFilesViewModel.java @@ -0,0 +1,75 @@ +package hu.user.mcvodsync.ui.view; + +import com.google.common.collect.ImmutableMap; +import hu.user.mcvodsync.db.UploadFile; +import hu.user.mcvodsync.ui.Constants; +import hu.user.mcvodsync.ui.data.UploadFileDataModel; +import hu.user.mcvodsync.ui.data.common.CachedSpringDataModel; +import hu.user.mcvodsync.ui.view.common.FilterActiveViewModel; +import lombok.Getter; +import lombok.extern.log4j.Log4j2; +import org.zkoss.bind.BindContext; +import org.zkoss.bind.annotation.Command; +import org.zkoss.bind.annotation.ContextParam; +import org.zkoss.bind.annotation.ContextType; +import org.zkoss.bind.annotation.Init; +import org.zkoss.zk.ui.event.UploadEvent; +import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zul.Messagebox; + +import java.time.Instant; +import java.util.Date; + +import static hu.user.mcvodsync.ui.data.common.CachedDataModel.DESCENDING; +import static hu.user.mcvodsync.ui.data.common.CachedDataModel.NATURAL; + +@Getter +@Log4j2 +public class UploadFilesViewModel extends FilterActiveViewModel { + @WireVariable + UploadFileDataModel uploadFileDataModel; + + @Override + protected CachedSpringDataModel getDataModel() { + return uploadFileDataModel; + } + + @Override + protected String getNavigation() { + return Constants.NAV_UPLOAD_FILES; + } + + @Init + public void init() { + super.init(); + addColumns(ImmutableMap.of( + "created", DESCENDING, + "name", NATURAL, + "size", NATURAL + )); + } + + protected void refresh() { + uploadFileDataModel.refresh(); + } + + @Command + public void onUploadFile(@ContextParam(ContextType.BIND_CONTEXT) BindContext ctx) { + UploadEvent evt = (UploadEvent) ctx.getTriggerEvent(); + String lowerCaseFileName = evt.getMedia().getName().toLowerCase(); + if (!lowerCaseFileName.endsWith(".xls") && !lowerCaseFileName.endsWith(".xlsx")) { + Messagebox.show("Excel file upload is expected!", "Error", Messagebox.OK, Messagebox.ERROR); + return; + } + UploadFile uploadFile = UploadFile.builder() + .name(evt.getMedia().getName()) + .size(evt.getMedia().getByteData().length) + .file(evt.getMedia().getByteData()) + .created(Date.from(Instant.now())) + .build(); + + uploadFileDataModel.save(uploadFile); + uploadFileDataModel.refresh(); + } + +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/AsyncBaseModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/AsyncBaseModel.java new file mode 100644 index 00000000..8f9c7e71 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/AsyncBaseModel.java @@ -0,0 +1,39 @@ +package hu.user.mcvodsync.ui.view.common; + +import org.zkoss.bind.BindUtils; +import org.zkoss.bind.annotation.Command; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class AsyncBaseModel { + private List uiTasks = new ArrayList<>(); + + protected void doKeepAlive() { + + } + + protected void notifyChange(String... names) { + List nameList = Arrays.asList(names); + nameList.forEach(name -> BindUtils.postNotifyChange(null, null, this, name)); + } + + protected void registerTask(UITask task) { + synchronized (uiTasks) { + uiTasks.add(task); + } + } + + @Command + public void uiTick() { + // logger.info("{} tick {}", this.getClass().getSimpleName(), System.currentTimeMillis()); + doKeepAlive(); + synchronized (uiTasks) { + for (UITask task : uiTasks) { + task.execute(); + } + uiTasks.clear(); + } + } +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/EntityViewModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/EntityViewModel.java new file mode 100644 index 00000000..732b62e1 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/EntityViewModel.java @@ -0,0 +1,75 @@ +package hu.user.mcvodsync.ui.view.common; + +import hu.user.mcvodsync.service.data.EntityDataService; +import hu.user.mcvodsync.ui.data.common.CachedSpringDataModel; +import lombok.Getter; +import lombok.Setter; +import lombok.extern.log4j.Log4j2; +import org.apache.commons.lang3.StringUtils; +import org.zkoss.bind.annotation.*; +import org.zkoss.json.JSONObject; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.select.Selectors; +import org.zkoss.zk.ui.select.annotation.VariableResolver; +import org.zkoss.zk.ui.select.annotation.WireVariable; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zkplus.spring.DelegatingVariableResolver; + +import java.io.Serializable; +import java.util.Map; +import java.util.Set; + + +@Log4j2 +@VariableResolver(DelegatingVariableResolver.class) +public abstract class EntityViewModel { + + @Getter + @Setter + T selectedEntity; + + @Getter + @WireVariable + EntityDataService entityDataService; + + protected void addColumns(Map columns) { + getDataModel().addColumns(columns); + } + + public JSONObject getCols() { + return getDataModel().getColumnSettings(); + } + + abstract protected CachedSpringDataModel getDataModel(); + + @AfterCompose + public void onAfterCompose(@ContextParam(ContextType.VIEW) Component view) { + Selectors.wireComponents(view, this, false); + Selectors.wireEventListeners(view, this); + } + + protected abstract String getNavigation(); + + protected void setNavigation(String nav) { + Clients.evalJavaScript(String.format("pushNav('%s')", nav)); + } + + @Init + public void init() { + if (StringUtils.isNotBlank(getNavigation())) { + setNavigation(getNavigation()); + } + } + + @Command + @NotifyChange("selectedEntity") + public void onListSelection() { + selectedEntity = null; + Set selections = getDataModel().getSelection(); + if (selections.size() == 1) { + selectedEntity = selections.iterator().next(); + log.info("Selected {}", selectedEntity); + } + } + +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/FilterActiveViewModel.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/FilterActiveViewModel.java new file mode 100644 index 00000000..1d6e4fe0 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/FilterActiveViewModel.java @@ -0,0 +1,62 @@ +package hu.user.mcvodsync.ui.view.common; + +import lombok.extern.log4j.Log4j2; +import org.zkoss.bind.annotation.Init; +import org.zkoss.bind.annotation.NotifyChange; + +import java.io.Serializable; + + +@Log4j2 +public abstract class FilterActiveViewModel extends EntityViewModel { + boolean filterShowInActive; + + boolean filterShowActive; + + boolean filterShowBoth; + + protected abstract void refresh(); + + @Init + public void init() { + super.init(); + setFilterShowActive(true); + } + + public boolean isFilterShowActive() { + return filterShowActive; + } + + @NotifyChange({"filterShowActive", "filterShowInActive", "filterShowBoth"}) + public void setFilterShowActive(boolean filterShowActive) { + this.filterShowBoth = false; + this.filterShowInActive = false; + this.filterShowActive = filterShowActive; + refresh(); + } + + public boolean isFilterShowInActive() { + return filterShowInActive; + } + + @NotifyChange({"filterShowActive", "filterShowInActive", "filterShowBoth"}) + public void setFilterShowInActive(boolean filterShowInActive) { + this.filterShowBoth = false; + this.filterShowActive = false; + this.filterShowInActive = filterShowInActive; + refresh(); + } + + public boolean isFilterShowBoth() { + return this.filterShowBoth; + } + + @NotifyChange({"filterShowActive", "filterShowInActive", "filterShowBoth"}) + public void setFilterShowBoth(boolean filterShowBoth) { + this.filterShowActive = false; + this.filterShowInActive = false; + this.filterShowBoth = filterShowBoth; + refresh(); + } + +} diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/UITask.java b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/UITask.java new file mode 100644 index 00000000..b28f9787 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/java/hu/user/mcvodsync/ui/view/common/UITask.java @@ -0,0 +1,5 @@ +package hu.user.mcvodsync.ui.view.common; + +public interface UITask { + void execute(); +} \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/resources/metainfo/zk-label.properties b/mc-vod-sync/mc-vod-sync-ui/src/main/resources/metainfo/zk-label.properties new file mode 100644 index 00000000..e69de29b diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/resources/metainfo/zk-label_hu.properties b/mc-vod-sync/mc-vod-sync-ui/src/main/resources/metainfo/zk-label_hu.properties new file mode 100644 index 00000000..e69de29b diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/resources/metainfo/zk/zk.xml b/mc-vod-sync/mc-vod-sync-ui/src/main/resources/metainfo/zk/zk.xml new file mode 100644 index 00000000..04e41f19 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/resources/metainfo/zk/zk.xml @@ -0,0 +1,69 @@ + + + + + 300 + /timeout + + + + ajax + 403 + /login + + + ajax + 410 + /timeout + server-push + + + + + + + + + + + + + + + + + + + + + + + + org.zkoss.theme.preferred + silvertail + + + org.zkoss.zul.grid.rod + false + + + org.zkoss.zul.grid.autohidePaging + false + + + org.zkoss.zul.listbox.rod + false + + + org.zkoss.zul.listbox.autohidePaging + false + + + org.zkoss.zul.nativebar + true + + + + + + \ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/resources/web/associates.zul b/mc-vod-sync/mc-vod-sync-ui/src/main/resources/web/associates.zul new file mode 100644 index 00000000..b83435c9 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/resources/web/associates.zul @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+
+ +
+
\ No newline at end of file diff --git a/mc-vod-sync/mc-vod-sync-ui/src/main/resources/web/editor/associate-editor.zul b/mc-vod-sync/mc-vod-sync-ui/src/main/resources/web/editor/associate-editor.zul new file mode 100644 index 00000000..bc192828 --- /dev/null +++ b/mc-vod-sync/mc-vod-sync-ui/src/main/resources/web/editor/associate-editor.zul @@ -0,0 +1,52 @@ + + + + + + +
+ + + + + + + + +
+ + +