From a0f40578977bcbada38b1dde3fc5abf730316541 Mon Sep 17 00:00:00 2001 From: Vladislav Gruchik <4280527+vagruchi@users.noreply.github.com> Date: Tue, 28 May 2024 12:05:02 +0200 Subject: [PATCH 1/3] add curl example for the check storage endpoint --- .../video/docusaurus/docs/api/_common_/storage.mdx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx b/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx index 9a0bbfed..7ee0eca2 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx @@ -14,7 +14,9 @@ If you need support for a different storage provider, you can participate in the To use your own storage you need to: 1. Configure a new storage for your Stream application -2. Configure your call type(s) to use the new storage +2. (Optional) Check storage configuration for correctness. + Calling check endpoint will create a test markdown file in the storage to verify the configuration. It will return an error if the file is not created. 3 +3. Configure your call type(s) to use the new storage Once the setup is complete, call recordings and transcription files will be automatically stored in your own storage. @@ -83,6 +85,12 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP } }' +# 1a. (Optional) Check storage configuration for correctness +curl -X GET https://video.stream-io-api.com/video/external_storage/check?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" + + # 2. update the call type to use the new storage curl -X PUT https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE}?api_key=${API_KEY} \ -H "Authorization: ${TOKEN}" \ From cd98d2c487190543c39010905137468f35679eeb Mon Sep 17 00:00:00 2001 From: Vladislav Gruchik <4280527+vagruchi@users.noreply.github.com> Date: Wed, 29 May 2024 15:23:15 +0200 Subject: [PATCH 2/3] add python example for check storage endpoint --- .../docusaurus/docs/api/_common_/storage.mdx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx b/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx index 7ee0eca2..3ba98798 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx @@ -15,7 +15,8 @@ To use your own storage you need to: 1. Configure a new storage for your Stream application 2. (Optional) Check storage configuration for correctness. - Calling check endpoint will create a test markdown file in the storage to verify the configuration. It will return an error if the file is not created. 3 + Calling check endpoint will create a test markdown file in the storage to verify the configuration. It will return an error if the file is not created. + In case of success, the file with a name `stream-.md` will be uploaded to the storage. Every time you call this endpoint, a new file will be created. 3. Configure your call type(s) to use the new storage Once the setup is complete, call recordings and transcription files will be automatically stored in your own storage. @@ -46,10 +47,10 @@ await serverSideClient.updateCallType('my-call-type', { ```py -from getstream.models import S3Request - # 1. create a new storage with all the required parameters -client.create_external_storage( +from getstream.models.s_3_request import S3Request + +client.video.create_external_storage( name='my-s3', storage_type='s3', bucket='my-bucket', @@ -61,8 +62,12 @@ client.create_external_storage( ), ) -# 2. update the call type to use the new storage -client.video.update_call_type(name='allhands', external_storage= "my-s3") +# 2. (Optional) Check storage configuration for correctness +# In case of any errors, this will throw a StreamAPIException. +response = client.video.check_external_storage(name='my-s3') + +# 3. update the call type to use the new storage +client.video.update_call_type(name='allhands', external_storage='my-s3') ``` @@ -85,13 +90,13 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP } }' -# 1a. (Optional) Check storage configuration for correctness + # 2. (Optional) Check storage configuration for correctness curl -X GET https://video.stream-io-api.com/video/external_storage/check?api_key=${API_KEY} \ -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" -# 2. update the call type to use the new storage +# 3. update the call type to use the new storage curl -X PUT https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE}?api_key=${API_KEY} \ -H "Authorization: ${TOKEN}" \ -H "Content-Type: application/json" \ From 91bd9c61f8dbd3c5185afe4f7c0222538248dbbd Mon Sep 17 00:00:00 2001 From: Vladislav Gruchik <4280527+vagruchi@users.noreply.github.com> Date: Wed, 29 May 2024 15:48:37 +0200 Subject: [PATCH 3/3] add js example --- .../video/docusaurus/docs/api/_common_/storage.mdx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx b/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx index 3ba98798..a01a9a7b 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/storage.mdx @@ -16,7 +16,7 @@ To use your own storage you need to: 1. Configure a new storage for your Stream application 2. (Optional) Check storage configuration for correctness. Calling check endpoint will create a test markdown file in the storage to verify the configuration. It will return an error if the file is not created. - In case of success, the file with a name `stream-.md` will be uploaded to the storage. Every time you call this endpoint, a new file will be created. + In case of success, the file with`stream-.md` will be uploaded to the storage. Every time you call this endpoint, a new file will be created. 3. Configure your call type(s) to use the new storage Once the setup is complete, call recordings and transcription files will be automatically stored in your own storage. @@ -38,7 +38,13 @@ await serverSideClient.createExternalStorage({ }, }); -// 2. update the call type to use the new storage +// 2. (Optional) Check storage configuration for correctness +// In case of any errors, this will throw a ResponseError. +await serverSideClient.checkExternalStorage({ + name: 'my-s3' +}); + +// 3. update the call type to use the new storage await serverSideClient.updateCallType('my-call-type', { external_storage: "my-s3", });