Skip to content

Commit

Permalink
Document check storage endpoint (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbugli authored May 31, 2024
2 parents ab3d7ac + 963a9e0 commit 4554be8
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions docusaurus/video/docusaurus/docs/api/_common_/storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ 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.
In case of success, the file with`stream-<uuid>.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.

Expand All @@ -35,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",
});
Expand All @@ -44,10 +53,10 @@ await serverSideClient.updateCallType('my-call-type', {
<TabItem value="py" label="Python">

```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',
Expand All @@ -59,8 +68,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')
```
</TabItem>
<TabItem value="curl" label="cURL">
Expand All @@ -83,7 +96,13 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP
}
}'

# 2. update the call type to use the new storage
# 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"


# 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" \
Expand Down

0 comments on commit 4554be8

Please sign in to comment.