Skip to content

Commit

Permalink
feat(vdp): add component definition list endpoint (#274)
Browse files Browse the repository at this point in the history
Because

- Component page requires unified filtering and pagination.

This commit

- Adds a "component list" endpoint to the public VDP API.
- Unifies the component view and removes connector and operator view
enums.
- Connector and operator definition messages are unified in
`component_definition.proto`
- Replaces `CONNECTOR_BLOCKCHAIN` by `CONNECTOR_APPLICATION`
([INS-3739](https://linear.app/instill-ai/issue/INS-3739/rename-blockhain-type-to-application))
- Removes operator / connector definition lookup endpoints (unused).

---------

Co-authored-by: droplet-bot <[email protected]>
  • Loading branch information
jvallesm and droplet-bot authored Feb 26, 2024
1 parent 3ec60b8 commit 16afda7
Show file tree
Hide file tree
Showing 9 changed files with 484 additions and 456 deletions.
175 changes: 117 additions & 58 deletions openapiv2/vdp/service.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2145,7 +2145,7 @@ paths:
- name: page_size
description: |-
The maximum number of connector definitions to return. If this parameter
is unspecified, at most 10 pipelines will be returned. The cap value for
is unspecified, at most 10 definitions will be returned. The cap value for
this parameter is 100 (i.e. any value above that will be coerced to 100).
in: query
required: false
Expand All @@ -2156,6 +2156,14 @@ paths:
in: query
required: false
type: string
- name: filter
description: |-
Filter can hold an [AIP-160](https://google.aip.dev/160)-compliant filter
expression.
- Example: `create_time>timestamp("2000-06-19T23:31:08.657Z")`.
in: query
required: false
type: string
- name: view
description: |-
View allows clients to specify the desired resource view in the response.
Expand All @@ -2169,14 +2177,6 @@ paths:
enum:
- VIEW_BASIC
- VIEW_FULL
- name: filter
description: |-
Filter can hold an [AIP-160](https://google.aip.dev/160)-compliant filter
expression.
- Example: `create_time>timestamp("2000-06-19T23:31:08.657Z")`.
in: query
required: false
type: string
tags:
- PipelinePublicService
/v1beta/{connector_definition_name}:
Expand Down Expand Up @@ -2253,6 +2253,64 @@ paths:
in: query
required: false
type: string
- name: filter
description: |-
Filter can hold an [AIP-160](https://google.aip.dev/160)-compliant filter
expression.
- Example: `create_time>timestamp("2000-06-19T23:31:08.657Z")`.
in: query
required: false
type: string
- name: view
description: |-
View allows clients to specify the desired resource view in the response.
- VIEW_BASIC: Default view, only includes basic information (removes the `spec`
field).
- VIEW_FULL: Full representation.
in: query
required: false
type: string
enum:
- VIEW_BASIC
- VIEW_FULL
tags:
- PipelinePublicService
/v1beta/component-definitions:
get:
summary: List component definitions
description: |-
Returns a paginated list of component definitions, regardless their type.
This offers a single source of truth, with pagination and filter
capabilities, for the components that might be used in a VDP pipeline.
operationId: PipelinePublicService_ListComponentDefinitions
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/v1betaListComponentDefinitionsResponse'
"401":
description: Returned when the client credentials are not valid.
schema: {}
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: page_size
description: |-
The maximum number of component definitions to return. If this parameter
is unspecified, at most 10 definitions will be returned. The cap value for
this parameter is 100 (i.e. any value above that will be coerced to 100).
in: query
required: false
type: integer
format: int32
- name: page_token
description: Page token.
in: query
required: false
type: string
- name: view
description: |-
View allows clients to specify the desired resource view in the response.
Expand All @@ -2270,7 +2328,8 @@ paths:
description: |-
Filter can hold an [AIP-160](https://google.aip.dev/160)-compliant filter
expression.
- Example: `create_time>timestamp("2000-06-19T23:31:08.657Z")`.
- Example: `component_type="COMPONENT_TYPE_CONNECTOR_AI"`.
- Example: `tasks:"TASK_TEXT_GENERATION"`.
in: query
required: false
type: string
Expand Down Expand Up @@ -4068,6 +4127,33 @@ definitions:
required:
- id
- definition_name
v1betaComponentDefinition:
type: object
properties:
type:
$ref: '#/definitions/v1betaComponentType'
description: Defines the type of task the component will perform.
readOnly: true
operator_definition:
$ref: '#/definitions/v1betaOperatorDefinition'
title: operator definition detail
readOnly: true
connector_definition:
$ref: '#/definitions/v1betaConnectorDefinition'
title: connector definition detail
readOnly: true
description: ComponentDefinition describes a certain type of Component.
v1betaComponentDefinitionView:
type: string
enum:
- VIEW_BASIC
- VIEW_FULL
description: |-
View defines how a component definition is presented.
- VIEW_BASIC: Default view, only includes basic information (removes the `spec`
field).
- VIEW_FULL: Full representation.
v1betaComponentTask:
type: object
properties:
Expand All @@ -4091,15 +4177,15 @@ definitions:
enum:
- COMPONENT_TYPE_CONNECTOR_AI
- COMPONENT_TYPE_CONNECTOR_DATA
- COMPONENT_TYPE_CONNECTOR_BLOCKCHAIN
- COMPONENT_TYPE_OPERATOR
- COMPONENT_TYPE_CONNECTOR_APPLICATION
description: |-
ComponentType defines the component type based on its task features.
- COMPONENT_TYPE_CONNECTOR_AI: Connect with an AI model.
- COMPONENT_TYPE_CONNECTOR_DATA: Connect with a remote data source.
- COMPONENT_TYPE_CONNECTOR_BLOCKCHAIN: Connect with a blockchain service.
- COMPONENT_TYPE_OPERATOR: Manipulate data.
- COMPONENT_TYPE_CONNECTOR_APPLICATION: Connect with an external application.
v1betaConnectOrganizationConnectorResponse:
type: object
properties:
Expand Down Expand Up @@ -4295,17 +4381,6 @@ definitions:
For more information, see
[Component](https://www.instill.tech/docs/latest/core/concepts/pipeline#pipeline-component)
in the official documentation.
v1betaConnectorDefinitionView:
type: string
enum:
- VIEW_BASIC
- VIEW_FULL
description: |-
View defines how a connector definition is presented.
- VIEW_BASIC: Default view, only includes basic information (removes the `spec`
field).
- VIEW_FULL: Full representation.
v1betaConnectorSpec:
type: object
properties:
Expand Down Expand Up @@ -4338,21 +4413,17 @@ definitions:
v1betaConnectorType:
type: string
enum:
- CONNECTOR_TYPE_SOURCE
- CONNECTOR_TYPE_DESTINATION
- CONNECTOR_TYPE_AI
- CONNECTOR_TYPE_BLOCKCHAIN
- CONNECTOR_TYPE_DATA
- CONNECTOR_TYPE_OPERATOR
- CONNECTOR_TYPE_APPLICATION
description: |-
ConnectorType defines the connector type based on its task features.
- CONNECTOR_TYPE_SOURCE: Source connector.
- CONNECTOR_TYPE_DESTINATION: Destination connector.
- CONNECTOR_TYPE_AI: AI connector.
- CONNECTOR_TYPE_BLOCKCHAIN: Blockchain connector.
- CONNECTOR_TYPE_DATA: Data connector.
- CONNECTOR_TYPE_OPERATOR: Operator connector.
- CONNECTOR_TYPE_APPLICATION: Application connector.
v1betaConnectorView:
type: string
enum:
Expand Down Expand Up @@ -4531,6 +4602,23 @@ definitions:
$ref: '#/definitions/v1betaPipeline'
description: The pipeline resource.
description: GetUserPipelineResponse contains the requested pipeline.
v1betaListComponentDefinitionsResponse:
type: object
properties:
component_definitions:
type: array
items:
type: object
$ref: '#/definitions/v1betaComponentDefinition'
description: A list of component definition resources.
next_page_token:
type: string
description: Next page token.
total_size:
type: integer
format: int32
description: Total number of connector definitions.
description: ListComponentDefinitionsResponse contains a list of component definitions.
v1betaListConnectorDefinitionsResponse:
type: object
properties:
Expand Down Expand Up @@ -4773,31 +4861,13 @@ definitions:
description: |-
LookUpConnectorAdminResponse represents a response for a
connector.
v1betaLookUpConnectorDefinitionAdminResponse:
type: object
properties:
connector_definition:
$ref: '#/definitions/v1betaConnectorDefinition'
description: The requested connector.
description: |-
LookUpConnectorDefinitionAdminResponse represents a response for a
connector definition.
v1betaLookUpConnectorResponse:
type: object
properties:
connector:
$ref: '#/definitions/v1betaConnector'
description: The requested connector.
description: LookUpConnectorResponse represents a response for a connector.
v1betaLookUpOperatorDefinitionAdminResponse:
type: object
properties:
operator_definition:
$ref: '#/definitions/v1betaOperatorDefinition'
description: The requested operator definition.
description: |-
LookUpOperatorDefinitionAdminResponse represents a response for an operator
definition.
v1betaLookUpPipelineAdminResponse:
type: object
properties:
Expand Down Expand Up @@ -4893,17 +4963,6 @@ definitions:
For more information, see
[Component](https://www.instill.tech/docs/latest/core/concepts/pipeline#pipeline-component)
in the official documentation.
v1betaOperatorDefinitionView:
type: string
enum:
- VIEW_BASIC
- VIEW_FULL
description: |-
View defines how an operator definition is presented.
- VIEW_BASIC: Default view, only includes basic information (removes the `spec`
field).
- VIEW_FULL: Full representation.
v1betaOperatorSpec:
type: object
properties:
Expand Down
18 changes: 18 additions & 0 deletions vdp/pipeline/v1beta/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,21 @@ message ComponentTask {
// Description contains information about the task.
string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// ComponentType defines the component type based on its task features.
enum ComponentType {
// Unspecified.
COMPONENT_TYPE_UNSPECIFIED = 0;
// Connect with an AI model.
COMPONENT_TYPE_CONNECTOR_AI = 1;
// Connect with a remote data source.
COMPONENT_TYPE_CONNECTOR_DATA = 2;
// 3 Is reserved for the connector blockchain type, deprecated by
// COMPONENT_TYPE_CONNECTOR_APPLICATION.
reserved 3;
// Manipulate data.
COMPONENT_TYPE_OPERATOR = 4;
// Connect with an external application.
COMPONENT_TYPE_CONNECTOR_APPLICATION = 5;

}
Loading

0 comments on commit 16afda7

Please sign in to comment.