-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
342 additions
and
4 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
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,226 @@ | ||
syntax = "proto3"; | ||
|
||
package vdp.pipeline.v1beta; | ||
|
||
// Google API | ||
import "google/api/field_behavior.proto"; | ||
import "google/api/resource.proto"; | ||
// Protocol Buffers Well-Known Types | ||
import "google/protobuf/field_mask.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
// OpenAPI definition | ||
import "protoc-gen-openapiv2/options/annotations.proto"; | ||
|
||
// API secrets allow users to make requests to the Instill AI API. | ||
message Secret { | ||
option (google.api.resource) = { | ||
type: "api.instill.tech/Secret" | ||
pattern: "user/secrets/{secret.id}" | ||
pattern: "organizations/{organization.id}/secrets/{secret.id}" | ||
}; | ||
|
||
// The name of the secret, define by its ID. | ||
// - Format: `secrets/{secret.id}`. | ||
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
// Secret UUID. | ||
string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
// Secret resource ID (used in `name` as the last segment). This conforms | ||
// to RFC-1034, which restricts to letters, numbers, and hyphen, with the | ||
// first character a letter, the last a letter or a number, and a 63 | ||
// character maximum. | ||
string id = 3 [(google.api.field_behavior) = IMMUTABLE]; | ||
// Creation time. | ||
google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
// Update time. | ||
google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
// The value of the secret, which is input-only and will never be returned in API responses. | ||
optional string value = 6 [(google.api.field_behavior) = INPUT_ONLY]; | ||
// Description | ||
string description = 7 [(google.api.field_behavior) = OPTIONAL]; | ||
} | ||
|
||
// CreateUserSecretRequest represents a request to create a secret. | ||
message CreateUserSecretRequest { | ||
// The properties of the secret to be created. | ||
Secret secret = 1; | ||
} | ||
|
||
// CreateUserSecretResponse contains the created secret. | ||
message CreateUserSecretResponse { | ||
// The created secret resource. | ||
Secret secret = 1; | ||
} | ||
|
||
// ListUserSecretsRequest represents a request to list the secrets of a user. | ||
message ListUserSecretsRequest { | ||
// The maximum number of secrets to return. If this parameter is unspecified, | ||
// at most 10 pipelines will be returned. The cap value for this parameter is | ||
// 100 (i.e. any value above that will be coerced to 100). | ||
optional int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; | ||
// Page secret. | ||
optional string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; | ||
} | ||
|
||
// ListUserSecretsResponse contains a list of secrets. | ||
message ListUserSecretsResponse { | ||
// A list of secret resources. | ||
repeated Secret secrets = 1; | ||
// Next page secret. | ||
string next_page_token = 2; | ||
// Total number of secret resources. | ||
int32 total_size = 3; | ||
} | ||
|
||
// GetUserSecretRequest represents a request to fetch the details of a secret | ||
message GetUserSecretRequest { | ||
// The resource name of the secret, which allows its access by ID. | ||
// - Format: `user/secrets/{secret.id}`. | ||
string name = 1 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = {type: "api.instill.tech/Secret"}, | ||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||
field_configuration: {path_param_name: "user_secret_name"} | ||
} | ||
]; | ||
} | ||
|
||
// GetUserSecretResponse contains the requested secret. | ||
message GetUserSecretResponse { | ||
// The secret resource. | ||
Secret secret = 1; | ||
} | ||
|
||
// UpdateUserSecretRequest represents a request to update a user secret. | ||
message UpdateUserSecretRequest { | ||
// The secret fields to update. | ||
Secret secret = 1 [(google.api.field_behavior) = REQUIRED]; | ||
// The update mask specifies the subset of fields that should be modified. | ||
// | ||
// For more information about this field, see | ||
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#field-mask. | ||
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; | ||
} | ||
|
||
// UpdateUserSecretResponse contains the updated secret. | ||
message UpdateUserSecretResponse { | ||
// The updated secret resource. | ||
Secret secret = 1; | ||
} | ||
|
||
// DeleteUserSecretRequest represents a request to delete a secret resource. | ||
message DeleteUserSecretRequest { | ||
// The resource name of the secret, which allows its access by ID. | ||
// - Format: `user/secrets/{secret.id}`. | ||
string name = 1 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = {type: "api.instill.tech/Secret"}, | ||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||
field_configuration: {path_param_name: "user_secret_name"} | ||
} | ||
]; | ||
} | ||
|
||
// DeleteUserSecretResponse is an empty response. | ||
message DeleteUserSecretResponse {} | ||
|
||
// CreateOrganizationSecretRequest represents a request to create a secret. | ||
message CreateOrganizationSecretRequest { | ||
// The properties of the secret to be created. | ||
Secret secret = 1; | ||
// The parent resource, i.e., the organization that creates the secret. | ||
// - Format: `organizations/{organization.id}`. | ||
string parent = 2 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = {child_type: "api.instill.tech/Secret"}, | ||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||
field_configuration: {path_param_name: "organization_name"} | ||
} | ||
]; | ||
} | ||
|
||
// CreateOrganizationSecretResponse contains the created secret. | ||
message CreateOrganizationSecretResponse { | ||
// The created secret resource. | ||
Secret secret = 1; | ||
} | ||
|
||
// ListOrganizationSecretsRequest represents a request to list the secrets of a user. | ||
message ListOrganizationSecretsRequest { | ||
// The maximum number of secrets to return. If this parameter is unspecified, | ||
// at most 10 pipelines will be returned. The cap value for this parameter is | ||
// 100 (i.e. any value above that will be coerced to 100). | ||
optional int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; | ||
// Page secret. | ||
optional string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; | ||
// The parent resource, i.e., the organization that creates the secret. | ||
// - Format: `organizations/{organization.id}`. | ||
string parent = 3 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = {child_type: "api.instill.tech/Secret"}, | ||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||
field_configuration: {path_param_name: "organization_name"} | ||
} | ||
]; | ||
} | ||
|
||
// ListOrganizationSecretsResponse contains a list of secrets. | ||
message ListOrganizationSecretsResponse { | ||
// A list of secret resources. | ||
repeated Secret secrets = 1; | ||
// Next page secret. | ||
string next_page_token = 2; | ||
// Total number of secret resources. | ||
int32 total_size = 3; | ||
} | ||
|
||
// GetOrganizationSecretRequest represents a request to fetch the details of a secret | ||
message GetOrganizationSecretRequest { | ||
// The resource name of the secret, which allows its access by ID. | ||
// - Format: `organizations/{organization.id}/secrets/{secret.id}`. | ||
string name = 1 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = {type: "api.instill.tech/Secret"}, | ||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||
field_configuration: {path_param_name: "organization_secret_name"} | ||
} | ||
]; | ||
} | ||
|
||
// GetOrganizationSecretResponse contains the requested secret. | ||
message GetOrganizationSecretResponse { | ||
// The secret resource. | ||
Secret secret = 1; | ||
} | ||
|
||
// UpdateOrganizationSecretRequest represents a request to update a user secret. | ||
message UpdateOrganizationSecretRequest { | ||
// The secret fields to update. | ||
Secret secret = 1 [(google.api.field_behavior) = REQUIRED]; | ||
// The update mask specifies the subset of fields that should be modified. | ||
// | ||
// For more information about this field, see | ||
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#field-mask. | ||
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; | ||
} | ||
|
||
// UpdateOrganizationSecretResponse contains the updated secret. | ||
message UpdateOrganizationSecretResponse { | ||
// The updated secret resource. | ||
Secret secret = 1; | ||
} | ||
|
||
// DeleteOrganizationSecretRequest represents a request to delete a secret resource. | ||
message DeleteOrganizationSecretRequest { | ||
// The resource name of the secret, which allows its access by ID. | ||
// - Format: `organizations/{organization.id}/secrets/{secret.id}`. | ||
string name = 1 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = {type: "api.instill.tech/Secret"}, | ||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||
field_configuration: {path_param_name: "organization_secret_name"} | ||
} | ||
]; | ||
} | ||
|
||
// DeleteOrganizationSecretResponse is an empty response. | ||
message DeleteOrganizationSecretResponse {} |