diff --git a/artifact/artifact/v1alpha/artifact.proto b/artifact/artifact/v1alpha/artifact.proto index ebcde6d9..b76589e8 100644 --- a/artifact/artifact/v1alpha/artifact.proto +++ b/artifact/artifact/v1alpha/artifact.proto @@ -215,4 +215,4 @@ message DeleteKnowledgeBaseResponse { string error_msg = 1; // The status code. int32 status_code = 2; -} \ No newline at end of file +} diff --git a/artifact/artifact/v1alpha/artifact_public_service.proto b/artifact/artifact/v1alpha/artifact_public_service.proto index 62bc5d46..5eb64a58 100644 --- a/artifact/artifact/v1alpha/artifact_public_service.proto +++ b/artifact/artifact/v1alpha/artifact_public_service.proto @@ -39,37 +39,33 @@ service ArtifactPublicService { option (google.api.method_visibility).restriction = "INTERNAL"; } - // Create a knowledge base - rpc CreateKnowledgeBase(CreateKnowledgeBaseRequest) returns (CreateKnowledgeBaseResponse) { - option (google.api.http) = { - post: "/v1alpha/artifact/kb" - body: "*" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "KnowledgeBase"}; - } - - // Get all knowledge bases info - rpc GetKnowledgeBases(GetKnowledgeBasesRequest) returns (GetKnowledgeBasesResponse) { - option (google.api.http) = { - get: "/v1alpha/artifact/kb" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "KnowledgeBase"}; - } - - // Update a knowledge base info - rpc UpdateKnowledgeBase(UpdateKnowledgeBaseRequest) returns (UpdateKnowledgeBaseResponse) { - option (google.api.http) = { - put: "/v1alpha/artifact/kb" - body: "*" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "KnowledgeBase"}; - } - - // Delete a knowledge base - rpc DeleteKnowledgeBase(DeleteKnowledgeBaseRequest) returns (DeleteKnowledgeBaseResponse) { - option (google.api.http) = { - delete: "/v1alpha/artifact/kb/{id}" - }; - option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "KnowledgeBase"}; - } + // Create a knowledge base + rpc CreateKnowledgeBase(CreateKnowledgeBaseRequest) returns (CreateKnowledgeBaseResponse) { + option (google.api.http) = { + post: "/v1alpha/artifact/kb" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "KnowledgeBase"}; + } + + // Get all knowledge bases info + rpc GetKnowledgeBases(GetKnowledgeBasesRequest) returns (GetKnowledgeBasesResponse) { + option (google.api.http) = {get: "/v1alpha/artifact/kb"}; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "KnowledgeBase"}; + } + + // Update a knowledge base info + rpc UpdateKnowledgeBase(UpdateKnowledgeBaseRequest) returns (UpdateKnowledgeBaseResponse) { + option (google.api.http) = { + put: "/v1alpha/artifact/kb" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "KnowledgeBase"}; + } + + // Delete a knowledge base + rpc DeleteKnowledgeBase(DeleteKnowledgeBaseRequest) returns (DeleteKnowledgeBaseResponse) { + option (google.api.http) = {delete: "/v1alpha/artifact/kb/{id}"}; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "KnowledgeBase"}; + } } diff --git a/model/model/v1alpha/model.proto b/model/model/v1alpha/model.proto index a913de0a..bcca098a 100644 --- a/model/model/v1alpha/model.proto +++ b/model/model/v1alpha/model.proto @@ -256,6 +256,9 @@ message ListModelsRequest { optional string filter = 5 [(google.api.field_behavior) = OPTIONAL]; // Limit results to pipelines with the specified visibility. optional Model.Visibility visibility = 6 [(google.api.field_behavior) = OPTIONAL]; + // Order by field, with options for ordering by `id`, `create_time` or `update_time`. + // Format: `order_by=id` or `order_by=create_time desc`, default is `asc`. + optional string order_by = 7 [(google.api.field_behavior) = OPTIONAL]; } // ListModelsResponse contains a list of models. @@ -331,6 +334,9 @@ message ListUserModelsRequest { optional string filter = 6 [(google.api.field_behavior) = OPTIONAL]; // Limit results to pipelines with the specified visibility. optional Model.Visibility visibility = 7 [(google.api.field_behavior) = OPTIONAL]; + // Order by field, with options for ordering by `id`, `create_time` or `update_time`. + // Format: `order_by=id` or `order_by=create_time desc`, default is `asc`. + optional string order_by = 8 [(google.api.field_behavior) = OPTIONAL]; } // ListUserModelsResponse contains a list of models. @@ -513,6 +519,31 @@ message WatchUserModelResponse { string message = 3; } +// WatchUserLatestModelRequest represents a request to fetch current state of +// the latest model version. +message WatchUserLatestModelRequest { + // The resource name of the model, which allows its access by parent user + // and ID. + // - Format: `users/{user.id}/models/{model.id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "api.instill.tech/Model", + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + field_configuration: {path_param_name: "user_model_name"} + } + ]; +} + +// WatchUserLatestModelResponse contains the state of the latest model version. +message WatchUserLatestModelResponse { + // State. + State state = 1; + // Deprecated field `progress` + reserved 2; + // Detail description of the state + string message = 3; +} + // ListUserModelVersionsRequest represents a request to list all the versions // of a model namespace of a user. message ListUserModelVersionsRequest { @@ -827,6 +858,9 @@ message ListOrganizationModelsRequest { optional string filter = 6 [(google.api.field_behavior) = OPTIONAL]; // Limit results to pipelines with the specified visibility. optional Model.Visibility visibility = 7 [(google.api.field_behavior) = OPTIONAL]; + // Order by field, with options for ordering by `id`, `create_time` or `update_time`. + // Format: `order_by=id` or `order_by=create_time desc`, default is `asc`. + optional string order_by = 8 [(google.api.field_behavior) = OPTIONAL]; } // ListOrganizationModelsResponse contains a list of models. @@ -1009,6 +1043,31 @@ message WatchOrganizationModelResponse { string message = 3; } +// WatchOrganizationLatestModelRequest represents a request to fetch current state of +// the latest model version +message WatchOrganizationLatestModelRequest { + // The resource name of the model, which allows its access by parent organization + // and ID. + // - Format: `organizations/{organization.id}/models/{model.id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference).type = "api.instill.tech/Model", + (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + field_configuration: {path_param_name: "organization_model_name"} + } + ]; +} + +// WatchOrganizationLatestModelResponse contains the state of the latest model version. +message WatchOrganizationLatestModelResponse { + // State. + State state = 1; + // Deprecated field `progress` + reserved 2; + // Detail description of the state + string message = 3; +} + // ListOrganizationModelVersionsRequest represents a request to list all the versions // of a model namespace of an organization. message ListOrganizationModelVersionsRequest { diff --git a/model/model/v1alpha/model_public_service.proto b/model/model/v1alpha/model_public_service.proto index e03f0595..1c5236a0 100644 --- a/model/model/v1alpha/model_public_service.proto +++ b/model/model/v1alpha/model_public_service.proto @@ -196,7 +196,7 @@ service ModelPublicService { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Model"}; } - // Watch the state of a model + // Watch the state of a model version // // Returns the state of a model. The deploy / undeploy actions take some // time, during which a model will be in an UNSPECIFIED state. This endpoint @@ -207,6 +207,17 @@ service ModelPublicService { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Model"}; } + // Watch the state of the latest model version + // + // Returns the state of the latest model version. The deploy / undeploy actions take some + // time, during which a model will be in an UNSPECIFIED state. This endpoint + // allows clients to track the state and progress of the model. + rpc WatchUserLatestModel(WatchUserLatestModelRequest) returns (WatchUserLatestModelResponse) { + option (google.api.http) = {get: "/v1alpha/{name=users/*/models/*}/watch"}; + option (google.api.method_signature) = "name"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Model"}; + } + // List user model versions // // Returns a paginated list of version of a model namespace that belong to the specified user. @@ -391,7 +402,7 @@ service ModelPublicService { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Model"}; } - // Watch the state of a model + // Watch the state of a model version // // Returns the state of a model. The deploy / undeploy actions take some // time, during which a model will be in an UNSPECIFIED state. This endpoint @@ -402,6 +413,17 @@ service ModelPublicService { option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Model"}; } + // Watch the state of the latest model version + // + // Returns the state of the latest model version. The deploy / undeploy actions take some + // time, during which a model will be in an UNSPECIFIED state. This endpoint + // allows clients to track the state and progress of the model. + rpc WatchOrganizationLatestModel(WatchOrganizationLatestModelRequest) returns (WatchOrganizationLatestModelResponse) { + option (google.api.http) = {get: "/v1alpha/{name=organizations/*/models/*}/watch"}; + option (google.api.method_signature) = "name"; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {tags: "Model"}; + } + // List organization model versions // // Returns a paginated list of version of a model namespace that belong to the specified organization. diff --git a/openapiv2/model/service.swagger.yaml b/openapiv2/model/service.swagger.yaml index 2646d76f..04b166e8 100644 --- a/openapiv2/model/service.swagger.yaml +++ b/openapiv2/model/service.swagger.yaml @@ -195,6 +195,13 @@ paths: enum: - VISIBILITY_PRIVATE - VISIBILITY_PUBLIC + - name: order_by + description: |- + Order by field, with options for ordering by `id`, `create_time` or `update_time`. + Format: `order_by=id` or `order_by=create_time desc`, default is `asc`. + in: query + required: false + type: string tags: - Model /v1alpha/{permalink}/lookUp: @@ -317,6 +324,13 @@ paths: enum: - VISIBILITY_PRIVATE - VISIBILITY_PUBLIC + - name: order_by + description: |- + Order by field, with options for ordering by `id`, `create_time` or `update_time`. + Format: `order_by=id` or `order_by=create_time desc`, default is `asc`. + in: query + required: false + type: string tags: - Model post: @@ -711,7 +725,7 @@ paths: - Model /v1alpha/{user_model_name}/versions/{version}/watch: get: - summary: Watch the state of a model + summary: Watch the state of a model version description: |- Returns the state of a model. The deploy / undeploy actions take some time, during which a model will be in an UNSPECIFIED state. This endpoint @@ -747,6 +761,38 @@ paths: pattern: '[^/]+' tags: - Model + /v1alpha/{user_model_name}/watch: + get: + summary: Watch the state of the latest model version + description: |- + Returns the state of the latest model version. The deploy / undeploy actions take some + time, during which a model will be in an UNSPECIFIED state. This endpoint + allows clients to track the state and progress of the model. + operationId: ModelPublicService_WatchUserLatestModel + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v1alphaWatchUserLatestModelResponse' + "401": + description: Returned when the client credentials are not valid. + schema: {} + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: user_model_name + description: |- + The resource name of the model, which allows its access by parent user + and ID. + - Format: `users/{user.id}/models/{model.id}`. + in: path + required: true + type: string + pattern: users/[^/]+/models/[^/]+ + tags: + - Model /v1alpha/{user_model_name}/versions: get: summary: List user model versions @@ -1030,6 +1076,13 @@ paths: enum: - VISIBILITY_PRIVATE - VISIBILITY_PUBLIC + - name: order_by + description: |- + Order by field, with options for ordering by `id`, `create_time` or `update_time`. + Format: `order_by=id` or `order_by=create_time desc`, default is `asc`. + in: query + required: false + type: string tags: - Model post: @@ -1424,7 +1477,7 @@ paths: - Model /v1alpha/{organization_model_name}/versions/{version}/watch: get: - summary: Watch the state of a model + summary: Watch the state of a model version description: |- Returns the state of a model. The deploy / undeploy actions take some time, during which a model will be in an UNSPECIFIED state. This endpoint @@ -1460,6 +1513,38 @@ paths: pattern: '[^/]+' tags: - Model + /v1alpha/{organization_model_name}/watch: + get: + summary: Watch the state of the latest model version + description: |- + Returns the state of the latest model version. The deploy / undeploy actions take some + time, during which a model will be in an UNSPECIFIED state. This endpoint + allows clients to track the state and progress of the model. + operationId: ModelPublicService_WatchOrganizationLatestModel + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v1alphaWatchOrganizationLatestModelResponse' + "401": + description: Returned when the client credentials are not valid. + schema: {} + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: organization_model_name + description: |- + The resource name of the model, which allows its access by parent organization + and ID. + - Format: `organizations/{organization.id}/models/{model.id}`. + in: path + required: true + type: string + pattern: organizations/[^/]+/models/[^/]+ + tags: + - Model /v1alpha/{user_model_name_1}/versions: get: summary: List organization model versions @@ -3651,6 +3736,16 @@ definitions: description: |- VisualQuestionAnsweringOutput contains the result of a visual question-answering task. + v1alphaWatchOrganizationLatestModelResponse: + type: object + properties: + state: + $ref: '#/definitions/modelv1alphaState' + description: State. + message: + type: string + title: Detail description of the state + description: WatchOrganizationLatestModelResponse contains the state of the latest model version. v1alphaWatchOrganizationModelResponse: type: object properties: @@ -3661,6 +3756,16 @@ definitions: type: string title: Detail description of the state description: WatchOrganizationModelResponse contains the state of a model. + v1alphaWatchUserLatestModelResponse: + type: object + properties: + state: + $ref: '#/definitions/modelv1alphaState' + description: State. + message: + type: string + title: Detail description of the state + description: WatchUserLatestModelResponse contains the state of the latest model version. v1alphaWatchUserModelResponse: type: object properties: