-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(artifact): provide object download and upload (#490)
Because artifact will support object management on behalf of minIO This commit 1. provide get upload url API 2. provide get download url API --------- Co-authored-by: droplet-bot <[email protected]>
- Loading branch information
1 parent
8c1bb9a
commit d8ed886
Showing
4 changed files
with
283 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
syntax = "proto3"; | ||
|
||
package artifact.artifact.v1alpha; | ||
|
||
// Google API | ||
import "google/api/field_behavior.proto"; | ||
// Protocol Buffers Well-Known Types | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
// Object | ||
message Object { | ||
// uid | ||
string uid = 1; | ||
// name of the object | ||
string name = 2; | ||
// size in bytes | ||
int64 size = 3; | ||
// content type | ||
// this is from content-type header of http request | ||
string content_type = 4; | ||
// namespace uid | ||
string namespace_uid = 6; | ||
// creator | ||
string creator = 7; | ||
// if file is uploaded | ||
bool is_uploaded = 8; | ||
// object path(optional) | ||
optional string path = 9; | ||
// object live time in days | ||
// minimum is 1 day. if not set, the object will not be deleted automatically | ||
int32 object_expire_days = 10; | ||
// created time | ||
google.protobuf.Timestamp created_time = 11; | ||
// updated time | ||
google.protobuf.Timestamp updated_time = 12; | ||
} | ||
|
||
// GetObjectUploadURLRequest | ||
message GetObjectUploadURLRequest { | ||
// id of the namespace | ||
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED]; | ||
// 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 minutes for the URL with a default value of 1440 minutes (1 day). | ||
// minimum is 60 minutes (1 hour) and maximum is 20160 minutes (14 days) | ||
int32 expiration_time = 3 [(google.api.field_behavior) = OPTIONAL]; | ||
// last modified time this value is provided by the client when the object url is created | ||
google.protobuf.Timestamp last_modified_time = 4 [(google.api.field_behavior) = OPTIONAL]; | ||
// object live time in days | ||
// minimum is 1 day. if not set, the object will not be deleted automatically | ||
int32 object_expire_days = 5 [(google.api.field_behavior) = OPTIONAL]; | ||
} | ||
|
||
// GetObjectUploadURLResponse | ||
message GetObjectUploadURLResponse { | ||
// upload url | ||
string upload_url = 1; | ||
// expire at in UTC (UTC+0) | ||
google.protobuf.Timestamp url_expire_at = 2; | ||
// object | ||
Object object = 3; | ||
} | ||
|
||
// GetObjectDownloadURLRequest | ||
message GetObjectDownloadURLRequest { | ||
// id of the namespace | ||
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED]; | ||
// uid of the object | ||
// if provided, object name is not required | ||
// uid has priority over name | ||
string object_uid = 2 [(google.api.field_behavior) = OPTIONAL]; | ||
// object name | ||
// if provided, object uid is not required | ||
string object_name = 3 [(google.api.field_behavior) = OPTIONAL]; | ||
// expiration time in minutes for url with default value to 1440 minutes (1 day). | ||
// minimum is 60 minutes (1 hour) and maximum is 20160 minutes (14 days) | ||
int32 expiration_time = 4 [(google.api.field_behavior) = OPTIONAL]; | ||
} | ||
|
||
// GetObjectDownloadURLResponse | ||
message GetObjectDownloadURLResponse { | ||
// download url | ||
string download_url = 1; | ||
// expire at in UTC (UTC+0) | ||
google.protobuf.Timestamp url_expire_at = 2; | ||
// object | ||
Object object = 4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters