1# Generated from root api
2
3import gql
4
5CreateDefaultUserWorkspace = gql.gql(
6 """
7mutation CreateDefaultUserWorkspace($user_id: String!, $workspace_name: String!, $user_type: String) { insert_workspace_one( object: { name: $workspace_name, created_by: $user_id, users: { data: { user_id: $user_id, user_type: $user_type } }, archived: false, user_default_workspaces: { data: { user_id: $user_id } } }, on_conflict: { constraint: workspace_name_key, update_columns: [] } ) { id } }
8"""
9)
10
11CreateDeployment = gql.gql(
12 """
13mutation CreateDeployment($deploy_id: String!, $pipeline_id: bigint, $deployed: Boolean, $engine_config: jsonb) { insert_deployment( objects: { deployed: $deployed, deploy_id: $deploy_id, pipeline_id: $pipeline_id, engine_config: $engine_config} on_conflict: { constraint: deployment_pipeline_id_key, update_columns: [updated_at, deployed, engine_config] } ) { returning { id deployed deployment_name: deploy_id engine_config created_at } } }
14"""
15)
16
17CreatePipelineWithDefinition = gql.gql(
18 """
19mutation CreatePipelineWithDefinition( $pipeline_id: String!, $definition: jsonb!, $visibility: String, $workspace_id: bigint! ) { insert_pipeline( objects: { pipeline_versions: { data: { definition: $definition } } pipeline_id: $pipeline_id visibility: $visibility workspace_id: $workspace_id } on_conflict: { constraint: pipeline_pipeline_id_workspace_id_key, update_columns: [updated_at, visibility] } ) { returning { id, pipeline_versions(order_by: {id: desc}, limit: 1) { id } } } }
20"""
21)
22
23CreateTag = gql.gql(
24 """
25mutation CreateTag($tag_text: String!) { insert_tag(objects: {tag: $tag_text}) { returning { id tag } } }
26"""
27)
28
29CreateWorkspace = gql.gql(
30 """
31mutation CreateWorkspace($user_id: String!, $workspace_name: String!, $user_type:String) { insert_workspace_one(object: {name: $workspace_name, created_by: $user_id, users: {data: {user_id: $user_id, user_type: $user_type}}, archived: false}) { id } }
32"""
33)
34
35DeleteWorkspaceUser = gql.gql(
36 """
37mutation DeleteWorkspaceUser($user_id: String!, $workspace_id: bigint!) { delete_workspace_users(where: {user_id: {_eq: $user_id}, _and: {workspace_id: {_eq: $workspace_id}}}) { affected_rows } }
38"""
39)
40
41GetDeploymentForPipeline = gql.gql(
42 """
43query GetDeploymentForPipeline($pipeline_id: bigint!) { pipeline_by_pk(id: $pipeline_id) { deployment { id deploy_id deployed } } }
44"""
45)
46
47GetModelConfigs = gql.gql(
48 """
49query GetModelConfigs($workspace_id: bigint!) { model_config(where: {model: {model: {workspace_id: {_eq: $workspace_id}}}}) { id model { id file_name model_id model_version models_pk_id sha updated_at owner_id } } }
50"""
51)
52
53GetModels = gql.gql(
54 """
55query GetModels($workspace_id: bigint!) { models(where: {workspace_id: {_eq: $workspace_id}}) { id models { sha models_pk_id model_version owner_id model_id id file_name } } }
56"""
57)
58
59GetPipelineAndWorkspace = gql.gql(
60 """
61query GetPipelineAndWorkspace($pk_id: bigint!) { pipeline_by_pk(id: $pk_id) { workspace_id pipeline_id } }
62"""
63)
64
65GetPipelineByName = gql.gql(
66 """
67fragment pipelineFields on pipeline { id pipeline_id owner_id created_at updated_at visibility pipeline_tags { id pipeline_pk_id tag_pk_id tag { id tag } } pipeline_versions { version created_at updated_at deployment_pipeline_versions { deployment { deployed engine_config } } } } query GetPipelineByName($pipeline_id: String, $workspace_id: bigint) { pipeline(where: { pipeline_id: { _eq: $pipeline_id }, workspace_id: { _eq: $workspace_id } }) { ...pipelineFields } }
68"""
69)
70
71GetPipelinesForModels = gql.gql(
72 """
73query GetPipelinesForModels($id: bigint!) { deployment_model_configs(where: {model_config: {model_id: {_eq: $id}}}) { model_config { model { id model_id model_version models_pk_id } } pipeline_version { pipeline { id pipeline_id } updated_at version } } }
74"""
75)
76
77GetPipelineVersionDeploymentDetails = gql.gql(
78 """
79query GetPipelineVersionDeploymentDetails($pipeline_version_pk_id: bigint) { deployment_pipeline_version(where: {pipeline_version_pk_id: {_eq: $pipeline_version_pk_id}}) { pipeline_version { pipeline_pk_id definition pipeline { workspace_id pipeline_id } } } }
80"""
81)
82
83InsertDeploymentModelConfig = gql.gql(
84 """
85mutation InsertDeploymentModelConfig( $deployment_id: bigint $model_config_id: bigint $pipeline_version_pk_id: bigint ) { insert_deployment_model_configs( objects: { deployment_id: $deployment_id model_config_id: $model_config_id pipeline_version_pk_id: $pipeline_version_pk_id } ) { returning { id } } }
86"""
87)
88
89InsertDeploymentModelConfigMultiple = gql.gql(
90 """
91mutation InsertDeploymentModelConfigs($objects: [deployment_model_configs_insert_input!]!) { insert_deployment_model_configs(objects: $objects) { returning { id } } }
92"""
93)
94
95InsertDeploymentPipelineVersion = gql.gql(
96 """
97mutation InsertDeploymentPipelineVersion( $deployment_id: bigint $pipeline_version_pk_id: bigint ) { insert_deployment_pipeline_version( objects: { deployment_id: $deployment_id pipeline_version_pk_id: $pipeline_version_pk_id } ) { returning { id } } }
98"""
99)
100
101InsertModelConfig = gql.gql(
102 """
103mutation InsertModelConfig($model_id: bigint!, $runtime: String!) { insert_model_config_one(object: {model_id: $model_id, runtime: $runtime}) { id } }
104"""
105)
106
107InsertWorkspaceUser = gql.gql(
108 """
109mutation InsertWorkspaceUser($user_id: String!, $user_type: String!, $workspace_id: bigint) { insert_workspace_users_one(object: {user_id: $user_id, user_type: $user_type, workspace_id: $workspace_id}, on_conflict: {constraint: workspace_users_workspace_id_user_id_key, update_columns: user_type}) { id } }
110"""
111)
112
113ListDeployments = gql.gql(
114 """
115query ListDeployments { deployment { id deploy_id deployed deployment_model_configs { model_config { id } } } }
116"""
117)
118
119ListModelConversions = gql.gql(
120 """
121query ListModelConversions { model_conversion { id name workspace_id name comment } }
122"""
123)
124
125ListModels = gql.gql(
126 """
127query ListModels { model(order_by: {id: desc}) { id model_id model_version file_name updated_at } }
128"""
129)
130
131ListPipelines = gql.gql(
132 """
133query ListPipelines { pipeline(order_by: {id: desc}) { id pipeline_tags { tag { tag } } } }
134"""
135)
136
137ListWorkspaces = gql.gql(
138 """
139query ListWorkspaces { workspace { id name created_at created_by archived models { models { id } } pipelines { id } } }
140"""
141)
142
143ModelByName = gql.gql(
144 """
145query ModelByName($model_id: String!, $model_version: String!) { model(where: {_and: [{model_id: {_eq: $model_id}}, {model_version: {_eq: $model_version}}]}) { id model_id model_version } }
146"""
147)
148
149PipelineModels = gql.gql(
150 """
151query PipelineModels($pipeline_id: bigint!) { pipeline_by_pk(id: $pipeline_id) { id deployment { deployment_model_configs_aggregate(distinct_on: deployment_id) { nodes { model_config { model { model { name } } } } } } } }
152"""
153)
154
155PipelineVariantById = gql.gql(
156 """
157query PipelineVariantById($variant_id: bigint!) { pipeline_version_by_pk(id: $variant_id) { id created_at updated_at version definition pipeline { id } deployment_pipeline_versions { created_at updated_at deployment { id } } } }
158"""
159)
160
161Undeploy = gql.gql(
162 """
163mutation Undeploy($id: bigint!) { update_deployment_by_pk(pk_columns: {id: $id} _set: { deployed: false }) { id deploy_id deployed } }
164"""
165)
166
167UpdateModelConversionMetaData = gql.gql(
168 """
169mutation UpdateModelConversionMetaData( $model_id: bigint! $name: String! $workspace_id: bigint! $minio_path: String! $updated_at: timestamptz! $comment: String ) { insert_model_conversion_one( object: { model_id: $model_id workspace_id: $workspace_id name: $name minio_path: $minio_path updated_at: $updated_at comment: $comment } on_conflict: { constraint: model_conversion_name_workspace_id_key update_columns: [model_id, workspace_id, name, comment, minio_path] } ) { id model_id workspace_id } }
170"""
171)
172
173UserDefaultWorkspace = gql.gql(
174 """
175query UserDefaultWorkspace($user_id: String = "") { user_default_workspace(where: {user_id: {_eq: $user_id}}) { workspace { archived created_at created_by name id users { user_id } pipelines { id } models { models { id } } } } }
176"""
177)
178
179WorkspaceById = gql.gql(
180 """
181query WorkspaceById($id: bigint!) { workspace_by_pk(id: $id) { archived created_at created_by id name users { user_id } models { models { id } } pipelines { id } } }
182"""
183)
184
185WorkspaceByName = gql.gql(
186 """
187query WorkspaceByName($name: string!) { workspace(where: {name: {_eq: $name}}) { archived created_at created_by id name users { user_id } models { models { id } } pipelines { id } } }
188"""
189)
190
191WorkspaceNameById = gql.gql(
192 """
193query GetWorkspaceNameById($id: bigint!) { workspace_by_pk(id: $id) { id name } }
194"""
195)