Skip to content

Commit b31be1a

Browse files
authored
feat(controller): add rpc methods for controller (#144)
Because - support controller service for model resource state monitoring This commit - add rpc methods for controller - update admin/private wording - fix trailing whitespaces and end of file line
1 parent 5c41f5e commit b31be1a

File tree

17 files changed

+556
-85
lines changed

17 files changed

+556
-85
lines changed

openapiv2/openapiv2.swagger.yaml

Lines changed: 248 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ tags:
66
- name: PlanService
77
- name: ConnectorPrivateService
88
- name: ConnectorPublicService
9+
- name: ControllerPrivateService
910
- name: PipelineService
1011
- name: ModelService
1112
- name: MgmtPrivateService
@@ -463,6 +464,32 @@ paths:
463464
pattern: models/[^/]+/instances/[^/]+/readme
464465
tags:
465466
- ModelPublicService
467+
/v1alpha/{model_instance.name/watch}/watch:
468+
get:
469+
summary: |-
470+
WatchModelInstance method receives a WatchModelInstanceRequest message
471+
and returns a WatchModelInstanceResponse
472+
operationId: ModelPublicService_WatchModelInstance
473+
responses:
474+
"200":
475+
description: A successful response.
476+
schema:
477+
$ref: '#/definitions/v1alphaWatchModelInstanceResponse'
478+
default:
479+
description: An unexpected error response.
480+
schema:
481+
$ref: '#/definitions/rpcStatus'
482+
parameters:
483+
- name: model_instance.name/watch
484+
description: |-
485+
Resource name of the model instance.
486+
For example "models/{model}/instances/{instance}"
487+
in: path
488+
required: true
489+
type: string
490+
pattern: models/[^/]+/instances/[^/]+
491+
tags:
492+
- ModelPublicService
466493
/v1alpha/{model_instance.name}:
467494
get:
468495
summary: |-
@@ -1711,6 +1738,105 @@ paths:
17111738
type: string
17121739
tags:
17131740
- PipelinePublicService
1741+
/v1alpha/{resource.name}:
1742+
get:
1743+
summary: |-
1744+
GetResource method receives a GetResourceRequest message
1745+
and returns a GetResourceResponse
1746+
operationId: ControllerPrivateService_GetResource
1747+
responses:
1748+
"200":
1749+
description: A successful response.
1750+
schema:
1751+
$ref: '#/definitions/v1alphaGetResourceResponse'
1752+
default:
1753+
description: An unexpected error response.
1754+
schema:
1755+
$ref: '#/definitions/rpcStatus'
1756+
parameters:
1757+
- name: resource.name
1758+
description: Resource name
1759+
in: path
1760+
required: true
1761+
type: string
1762+
pattern: resources/[^/]+/types/[^/]+
1763+
tags:
1764+
- ControllerPrivateService
1765+
delete:
1766+
summary: |-
1767+
DeleteResource method receives a DeleteResourceRequest message
1768+
and returns a DeleteResourceResponse
1769+
operationId: ControllerPrivateService_DeleteResource
1770+
responses:
1771+
"200":
1772+
description: A successful response.
1773+
schema:
1774+
$ref: '#/definitions/v1alphaDeleteResourceResponse'
1775+
default:
1776+
description: An unexpected error response.
1777+
schema:
1778+
$ref: '#/definitions/rpcStatus'
1779+
parameters:
1780+
- name: resource.name
1781+
description: Resource name
1782+
in: path
1783+
required: true
1784+
type: string
1785+
pattern: resources/[^/]+/types/[^/]+
1786+
tags:
1787+
- ControllerPrivateService
1788+
patch:
1789+
summary: |-
1790+
UpdateResource method receives a UpdateResourceRequest message
1791+
and returns a UpdateResourceResponse
1792+
operationId: ControllerPrivateService_UpdateResource
1793+
responses:
1794+
"200":
1795+
description: A successful response.
1796+
schema:
1797+
$ref: '#/definitions/v1alphaUpdateResourceResponse'
1798+
default:
1799+
description: An unexpected error response.
1800+
schema:
1801+
$ref: '#/definitions/rpcStatus'
1802+
parameters:
1803+
- name: resource.name
1804+
description: Resource name.
1805+
in: path
1806+
required: true
1807+
type: string
1808+
pattern: resources/[^/]+/types/[^/]+
1809+
- name: resource
1810+
description: Resource state
1811+
in: body
1812+
required: true
1813+
schema:
1814+
type: object
1815+
properties:
1816+
model_instance_state:
1817+
$ref: '#/definitions/v1alphaModelInstanceState'
1818+
title: Model instance state
1819+
pipeline_state:
1820+
$ref: '#/definitions/v1alphaPipelineState'
1821+
title: Pipeline state
1822+
connector_state:
1823+
$ref: '#/definitions/v1alphaConnectorState'
1824+
title: Connector state
1825+
backend_state:
1826+
$ref: '#/definitions/HealthCheckResponseServingStatus'
1827+
title: Backend service state
1828+
progress:
1829+
type: integer
1830+
format: int32
1831+
title: Resource longrunning progress
1832+
title: Resource state
1833+
- name: workflow_id
1834+
description: Resource longrunnning workflow id
1835+
in: query
1836+
required: false
1837+
type: string
1838+
tags:
1839+
- ControllerPrivateService
17141840
/v1alpha/{source_connector.name}:
17151841
get:
17161842
summary: |-
@@ -1987,6 +2113,32 @@ paths:
19872113
default: VIEW_UNSPECIFIED
19882114
tags:
19892115
- ModelPrivateService
2116+
/v1alpha/admin/{name}/check:
2117+
get:
2118+
summary: |-
2119+
CheckModelInstance method receives a CheckModelInstanceRequest message and returns a
2120+
CheckModelInstanceResponse
2121+
operationId: ModelPrivateService_CheckModelInstance
2122+
responses:
2123+
"200":
2124+
description: A successful response.
2125+
schema:
2126+
$ref: '#/definitions/v1alphaCheckModelInstanceResponse'
2127+
default:
2128+
description: An unexpected error response.
2129+
schema:
2130+
$ref: '#/definitions/rpcStatus'
2131+
parameters:
2132+
- name: name
2133+
description: |-
2134+
Resource name of the model instance.
2135+
For example "models/{model}/instances/{instance}"
2136+
in: path
2137+
required: true
2138+
type: string
2139+
pattern: models/[^/]+/instances/[^/]+
2140+
tags:
2141+
- ModelPrivateService
19902142
/v1alpha/admin/{permalink_1}/lookUp:
19912143
get:
19922144
summary: |-
@@ -2564,10 +2716,17 @@ paths:
25642716
properties:
25652717
uid:
25662718
type: string
2567-
description: "User ID in UUIDv4. This field is optionally set by users \n(optional on resource creation, server-generated if unset)."
2719+
description: |-
2720+
User ID in UUIDv4. This field is optionally set by users
2721+
(optional on resource creation, server-generated if unset).
25682722
id:
25692723
type: string
2570-
description: "Resource ID (the last segment of the resource name), also the user username. \nThis conforms to RFC-1034, which restricts to letters, numbers,\nand hyphen, with the first character a letter, the last a letter or a\nnumber, and a 63 character maximum.\nNote that the ID can be updated."
2724+
description: |-
2725+
Resource ID (the last segment of the resource name), also the user username.
2726+
This conforms to RFC-1034, which restricts to letters, numbers,
2727+
and hyphen, with the first character a letter, the last a letter or a
2728+
number, and a 63 character maximum.
2729+
Note that the ID can be updated.
25712730
type:
25722731
$ref: '#/definitions/v1alphaOwnerType'
25732732
title: 'Owner type: fixed to `OWNER_TYPE_USER`'
@@ -4204,6 +4363,15 @@ definitions:
42044363
title: |-
42054364
CancelModelOperationResponse represents a response for canceling a model
42064365
operation
4366+
v1alphaCheckModelInstanceResponse:
4367+
type: object
4368+
properties:
4369+
state:
4370+
$ref: '#/definitions/v1alphaModelInstanceState'
4371+
title: Retrieved model instance state
4372+
title: |-
4373+
CheckModelInstanceResponse represents a response to fetch a model
4374+
instance's current state and longrunning progress
42074375
v1alphaClassificationInput:
42084376
type: object
42094377
properties:
@@ -4520,6 +4688,9 @@ definitions:
45204688
v1alphaDeletePlanResponse:
45214689
type: object
45224690
title: DeletePlanResponse represents an empty response
4691+
v1alphaDeleteResourceResponse:
4692+
type: object
4693+
title: DeleteResourceResponse represents an empty response
45234694
v1alphaDeleteSourceConnectorResponse:
45244695
type: object
45254696
title: DeleteSourceConnectorResponse represents an empty response
@@ -5090,6 +5261,13 @@ definitions:
50905261
$ref: '#/definitions/v1alphaPlan'
50915262
title: A plan resource
50925263
title: GetPlanResponse represents a response for a plan resource
5264+
v1alphaGetResourceResponse:
5265+
type: object
5266+
properties:
5267+
resource:
5268+
$ref: '#/definitions/v1alphaResource'
5269+
title: Retrieved resource state
5270+
title: GetResourceResponse represents a response to fetch a resource's state
50935271
v1alphaGetSourceConnectorAdminResponse:
50945272
type: object
50955273
properties:
@@ -6514,6 +6692,31 @@ definitions:
65146692
$ref: '#/definitions/v1alphaNullMessage'
65156693
title: Null message for empty response
65166694
title: ReportPipelineTriggersResponse represents a respond to a pipeline-trigger-records reporting bulk request
6695+
v1alphaResource:
6696+
type: object
6697+
properties:
6698+
name:
6699+
type: string
6700+
description: Resource name.
6701+
model_instance_state:
6702+
$ref: '#/definitions/v1alphaModelInstanceState'
6703+
title: Model instance state
6704+
pipeline_state:
6705+
$ref: '#/definitions/v1alphaPipelineState'
6706+
title: Pipeline state
6707+
connector_state:
6708+
$ref: '#/definitions/v1alphaConnectorState'
6709+
title: Connector state
6710+
backend_state:
6711+
$ref: '#/definitions/HealthCheckResponseServingStatus'
6712+
title: Backend service state
6713+
progress:
6714+
type: integer
6715+
format: int32
6716+
title: Resource longrunning progress
6717+
title: Resource represents the current information of a resource
6718+
required:
6719+
- name
65176720
v1alphaSemanticSegmentationInput:
65186721
type: object
65196722
properties:
@@ -7103,6 +7306,13 @@ definitions:
71037306
$ref: '#/definitions/v1alphaPlan'
71047307
title: A plan resource
71057308
title: UpdatePlanResponse represents a response for a plan resource
7309+
v1alphaUpdateResourceResponse:
7310+
type: object
7311+
properties:
7312+
resource:
7313+
$ref: '#/definitions/v1alphaResource'
7314+
title: Updated resource state
7315+
title: UpdateResourceResponse represents a response to update a resource's state
71067316
v1alphaUpdateSourceConnectorResponse:
71077317
type: object
71087318
properties:
@@ -7145,10 +7355,17 @@ definitions:
71457355
readOnly: true
71467356
uid:
71477357
type: string
7148-
description: "User ID in UUIDv4. This field is optionally set by users \n(optional on resource creation, server-generated if unset)."
7358+
description: |-
7359+
User ID in UUIDv4. This field is optionally set by users
7360+
(optional on resource creation, server-generated if unset).
71497361
id:
71507362
type: string
7151-
description: "Resource ID (the last segment of the resource name), also the user username. \nThis conforms to RFC-1034, which restricts to letters, numbers,\nand hyphen, with the first character a letter, the last a letter or a\nnumber, and a 63 character maximum.\nNote that the ID can be updated."
7363+
description: |-
7364+
Resource ID (the last segment of the resource name), also the user username.
7365+
This conforms to RFC-1034, which restricts to letters, numbers,
7366+
and hyphen, with the first character a letter, the last a letter or a
7367+
number, and a 63 character maximum.
7368+
Note that the ID can be updated.
71527369
type:
71537370
$ref: '#/definitions/v1alphaOwnerType'
71547371
title: 'Owner type: fixed to `OWNER_TYPE_USER`'
@@ -7215,6 +7432,19 @@ definitions:
72157432
title: User records definition
72167433
required:
72177434
- uid
7435+
v1alphaWatchModelInstanceResponse:
7436+
type: object
7437+
properties:
7438+
state:
7439+
$ref: '#/definitions/v1alphaModelInstanceState'
7440+
title: Retrieved model instance state
7441+
progress:
7442+
type: integer
7443+
format: int32
7444+
title: Retrieved model instance logrunning progress
7445+
title: |-
7446+
WatchModelInstanceResponse represents a public response to
7447+
fetch a model instance's current state and longrunning progress
72187448
v1alphaWriteDestinationConnectorResponse:
72197449
type: object
72207450
title: |-
@@ -7291,6 +7521,20 @@ definitions:
72917521
- VIEW_BASIC: View: BASIC
72927522
- VIEW_FULL: View: FULL
72937523
title: View enumerates the definition views
7524+
vdpcontrollerv1alphaLivenessResponse:
7525+
type: object
7526+
properties:
7527+
health_check_response:
7528+
$ref: '#/definitions/v1alphaHealthCheckResponse'
7529+
title: HealthCheckResponse message
7530+
title: LivenessResponse represents a response for a service liveness status
7531+
vdpcontrollerv1alphaReadinessResponse:
7532+
type: object
7533+
properties:
7534+
health_check_response:
7535+
$ref: '#/definitions/v1alphaHealthCheckResponse'
7536+
title: HealthCheckResponse message
7537+
title: ReadinessResponse represents a response for a service readiness status
72947538
vdpmgmtv1alphaLivenessResponse:
72957539
type: object
72967540
properties:

vdp/billing/v1alpha/plan.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,4 @@ message LookUpPlanRequest {
183183
message LookUpPlanResponse {
184184
// A plan resource
185185
Plan plan = 1;
186-
}
186+
}

vdp/billing/v1alpha/plan_service.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ service PlanService {
2222
additional_bindings : [ {get : "/v1alpha/health/billing"} ]
2323
};
2424
}
25-
25+
2626
// Readiness method receives a ReadinessRequest message and returns a
2727
// ReadinessResponse message.
2828
// See https://github.com/grpc/grpc/blob/master/doc/health-checking.md
@@ -33,7 +33,7 @@ service PlanService {
3333
};
3434
}
3535

36-
// ========== Admin API: create, get, update and delete billing plans
36+
// ========== Private API: create, get, update and delete billing plans
3737

3838
// ListPlans method receives a ListPlansRequest message and returns a
3939
// ListPlansResponse message.
@@ -89,4 +89,4 @@ service PlanService {
8989
};
9090
option (google.api.method_signature) = "permalink";
9191
}
92-
}
92+
}

vdp/connector/v1alpha/connector.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ message WriteDestinationConnectorRequest {
543543
// DestinationConnector resource
544544
message WriteDestinationConnectorResponse {}
545545

546-
// ========== Admin endpoints
546+
// ========== Private endpoints
547547

548548
// ListSourceConnectorsAdminRequest represents a request to list
549549
// SourceConnector resources from all users by admin

0 commit comments

Comments
 (0)