Skip to content

Commit

Permalink
feat(blob,catalog): add external_metadata field and correct the comme…
Browse files Browse the repository at this point in the history
…nt (#504)

Because:

1. We will support users attaching metadata to uploaded files.
2. The URL should support a non-expiring mode.

This commit:

1. Adds external_metadata in the file message.
2. Allows url_expire to be set to 0, meaning it does not expire.

ref: ins-6685

---------

Co-authored-by: droplet-bot <[email protected]>
  • Loading branch information
Yougigun and droplet-bot authored Oct 29, 2024
1 parent d8a26e2 commit 3cc5fbe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions artifact/artifact/v1alpha/artifact.proto
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ message File {
int32 total_chunks = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
// total tokens
int32 total_tokens = 16 [(google.api.field_behavior) = OUTPUT_ONLY];

// Custom metadata provided by the user during file upload
optional google.protobuf.Struct external_metadata = 17 [(google.api.field_behavior) = OPTIONAL];
}

// upload file request
Expand Down
6 changes: 3 additions & 3 deletions artifact/artifact/v1alpha/object.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ message GetObjectUploadURLRequest {
// name of the object with length limit to 1024 characters.
// this is the unique identifier of the object in the namespace
string object_name = 2 [(google.api.field_behavior) = REQUIRED];
// Expiration time in days for the URL.
// Minimum is 1 day and maximum is 7 days. If not set or set to 0, defaults to 1 day.
// expiration time in days for the URL.
// maximum is 7 days. if set to 0, URL will not expire.
int32 url_expire_days = 3 [(google.api.field_behavior) = OPTIONAL];
// last modified time this value is provided by the client when the object url is created
// it must be in RFC3339 formatted date-time string
Expand All @@ -72,7 +72,7 @@ message GetObjectDownloadURLRequest {
// uid of the object
string object_uid = 2 [(google.api.field_behavior) = REQUIRED];
// expiration time in days for the URL.
// minimum is 1 day. if not set or set to 0, defaults to 1 day.
// maximum is 7 days. if set to 0, URL will not expire.
int32 url_expire_days = 3 [(google.api.field_behavior) = OPTIONAL];
}

Expand Down
9 changes: 6 additions & 3 deletions openapi/v2/service.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1184,8 +1184,8 @@ paths:
type: string
- name: urlExpireDays
description: |-
Expiration time in days for the URL.
Minimum is 1 day and maximum is 7 days. If not set or set to 0, defaults to 1 day.
expiration time in days for the URL.
maximum is 7 days. if set to 0, URL will not expire.
in: query
required: false
type: integer
Expand Down Expand Up @@ -1239,7 +1239,7 @@ paths:
- name: urlExpireDays
description: |-
expiration time in days for the URL.
minimum is 1 day. if not set or set to 0, defaults to 1 day.
maximum is 7 days. if set to 0, URL will not expire.
in: query
required: false
type: integer
Expand Down Expand Up @@ -6615,6 +6615,9 @@ definitions:
format: int32
title: total tokens
readOnly: true
externalMetadata:
type: object
title: Custom metadata provided by the user during file upload
title: file
required:
- name
Expand Down

0 comments on commit 3cc5fbe

Please sign in to comment.