Skip to content

Commit

Permalink
chore: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
heiruwu committed Aug 27, 2023
1 parent 767f6c6 commit 355d29d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 27 deletions.
16 changes: 11 additions & 5 deletions model/model/v1alpha/model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ message CreateUserModelRequest {
// The model to be created
//
// The model `name` field is used to identify the model to create.
// Format: models/{model}
// Format: users/{user}/models/{model}
Model model = 1 [(google.api.field_behavior) = REQUIRED];
// The parent resource where this connector resource will be created.
// Format: users/{users}
Expand All @@ -199,6 +199,12 @@ message CreateUserModelBinaryFileUploadRequest {
Model model = 1 [(google.api.field_behavior) = REQUIRED];
// Model content in bytes
bytes content = 2 [(google.api.field_behavior) = REQUIRED];
// The parent resource where this connector resource will be created.
// Format: users/{users}
string parent = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {child_type: "api.instill.tech/Model"}
];
}

// CreateUserModelBinaryFileUploadResponse represents a response for a model
Expand Down Expand Up @@ -602,8 +608,8 @@ message TestUserModelBinaryFileUploadResponse {
repeated TaskOutput task_outputs = 2 [(google.api.field_behavior) = REQUIRED];
}

// GetUserModelOperationRequest represents a request to query a model operation
message GetUserModelOperationRequest {
// GerModelOperationRequest represents a request to query a model operation
message GetModelOperationRequest {
// The name of the operation resource.
string name = 1 [(google.api.field_behavior) = REQUIRED];
// View (default is VIEW_BASIC)
Expand All @@ -612,8 +618,8 @@ message GetUserModelOperationRequest {
optional View view = 2 [(google.api.field_behavior) = OPTIONAL];
}

// GetUserModelOperationResponse represents a response for a model operation
message GetUserModelOperationResponse {
// GetModelOperationResponse represents a response for a model operation
message GetModelOperationResponse {
// The retrieved model operation
google.longrunning.Operation operation = 1;
}
Expand Down
14 changes: 7 additions & 7 deletions model/model/v1alpha/model_public_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ service ModelPublicService {
//
// Endpoint: "POST /v1alpha/users/*/models:multipart"
rpc CreateUserModelBinaryFileUpload(stream CreateUserModelBinaryFileUploadRequest) returns (CreateUserModelBinaryFileUploadResponse) {
option (google.api.method_signature) = "id,model_definition,content";
option (google.api.method_signature) = "id,model_definition,content,parent";
}

// GetUserModel method receives a GetUserModelRequest message and returns a
Expand Down Expand Up @@ -106,7 +106,7 @@ service ModelPublicService {
// LookUpUserModel method receives a LookUpUserModelRequest message and returns a
// LookUpUserModelResponse
rpc LookUpUserModel(LookUpUserModelRequest) returns (LookUpUserModelResponse) {
option (google.api.http) = {get: "/v1alpha/{permalink=musers/*/odels/*}/lookUp"};
option (google.api.http) = {get: "/v1alpha/{permalink=users/*/models/*}/lookUp"};
option (google.api.method_signature) = "permalink";
}

Expand Down Expand Up @@ -211,11 +211,11 @@ service ModelPublicService {
option (google.api.method_signature) = "name,file";
}

// GetUserModelOperation method receives a
// GetUserModelOperationRequest message and returns a
// GetUserModelOperationResponse message.
rpc GetUserModelOperation(GetUserModelOperationRequest) returns (GetUserModelOperationResponse) {
option (google.api.http) = {get: "/v1alpha/{name=users/*/operations/*}"};
// GetModelOperation method receives a
// GetModelOperationRequest message and returns a
// GetModelOperationResponse message.
rpc GetModelOperation(GetModelOperationRequest) returns (GetModelOperationResponse) {
option (google.api.http) = {get: "/v1alpha/{name=operations/*}"};
option (google.api.method_signature) = "name";
}
}
30 changes: 15 additions & 15 deletions openapiv2/openapiv2.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -845,15 +845,15 @@ paths:
/v1alpha/{name}:
get:
summary: |-
GetUserModelOperation method receives a
GetUserModelOperationRequest message and returns a
GetUserModelOperationResponse message.
operationId: ModelPublicService_GetUserModelOperation
GetModelOperation method receives a
GetModelOperationRequest message and returns a
GetModelOperationResponse message.
operationId: ModelPublicService_GetModelOperation
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v1alphaGetUserModelOperationResponse'
$ref: '#/definitions/v1alphaGetModelOperationResponse'
default:
description: An unexpected error response.
schema:
Expand All @@ -864,7 +864,7 @@ paths:
in: path
required: true
type: string
pattern: users/[^/]+/operations/[^/]+
pattern: operations/[^/]+
- name: view
description: |-
View (default is VIEW_BASIC)
Expand Down Expand Up @@ -1584,7 +1584,7 @@ paths:
The model to be created
The model `name` field is used to identify the model to create.
Format: models/{model}
Format: users/{user}/models/{model}
in: body
required: true
schema:
Expand Down Expand Up @@ -1885,7 +1885,7 @@ paths:
in: path
required: true
type: string
pattern: musers/[^/]+/odels/[^/]+
pattern: users/[^/]+/models/[^/]+
- name: view
description: |-
Model view (default is VIEW_BASIC)
Expand Down Expand Up @@ -5609,6 +5609,13 @@ definitions:
GetModelOnlineSummaryRequest
required:
- summary
v1alphaGetModelOperationResponse:
type: object
properties:
operation:
$ref: '#/definitions/googlelongrunningOperation'
title: The retrieved model operation
title: GetModelOperationResponse represents a response for a model operation
v1alphaGetModelsResponse:
type: object
properties:
Expand Down Expand Up @@ -5778,13 +5785,6 @@ definitions:
$ref: '#/definitions/v1alphaModelCard'
title: Retrieved model card
title: GetUserModelCardResponse represents a response to fetch a model's README card
v1alphaGetUserModelOperationResponse:
type: object
properties:
operation:
$ref: '#/definitions/googlelongrunningOperation'
title: The retrieved model operation
title: GetUserModelOperationResponse represents a response for a model operation
v1alphaGetUserModelResponse:
type: object
properties:
Expand Down

0 comments on commit 355d29d

Please sign in to comment.