Skip to content

Commit

Permalink
Merge pull request #174 from zqq454224016/test
Browse files Browse the repository at this point in the history
feat: update datasource api
  • Loading branch information
bjwswang authored Nov 6, 2023
2 parents 4286100 + 4684ebf commit b5ef8a9
Show file tree
Hide file tree
Showing 5 changed files with 1,357 additions and 958 deletions.
107 changes: 74 additions & 33 deletions graphql-server/go-server/graph/datasource.graphqls
Original file line number Diff line number Diff line change
@@ -1,60 +1,101 @@
scalar Time
scalar Map

type Condition {
type: String!
status: String!
lastTransitionTime: Time!
lastSuccessfulTime: Time
reason: String!
message: String
scalar Void
type TypedObjectReference {
apiGroup: String
kind: String!
Name: String!
Namespace: String
}

type DatasourceStatus {
conditions: [Condition!]
type Endpoint {
url: String
authSecret: TypedObjectReference
insecure: Boolean
}

type DatasourceSpec {
url: String
authsecret: String
type Oss {
bucket: String
Object: String
}

type Datasource {
name: String!
namespace: String!
labels: Map
annotations: Map
creator: String
displayName: String!
endpoint: Endpoint
oss: Oss
# 数据源连接状态
status: Boolean
fileCount: Int
#updateTimestamp: Time!
}

input TypedObjectReferenceInput {
apiGroup: String
kind: String!
apiVersion: String!
Name: String!
Namespace: String
}

input EndpointInput {
url: String
authSecret: TypedObjectReferenceInput
insecure: Boolean
}

input OssInput {
bucket: String
Object: String
}
input CreateDatasourceInput {
name: String!
namespace: String!
labels: Map
annotations: Map
displayName: String!
description: String
endpointinput: EndpointInput
ossinput: OssInput
}

input UpdateDatasourceInput {
name: String!
namespace: String!
uid: String!
resourceVersion: String!
generation: Int!
creationTimestamp: Time!
deletionTimestamp: Time
labels: Map
annotations: Map
finalizers: [String!]
spec: DatasourceSpec
status: DatasourceStatus
displayName: String!
description: String
}

input QueryDatasource {
# 有name直接根据name查询
input DeleteDatasourceInput {
name: String
namespace: String!
labelSelector: String
fieldSelector: String
}
type Query {
ds(input: QueryDatasource!): [Datasource!]
}

input CreateDatasource {
name: String!
input ListDatasourceInput {
name: String
namespace: String!
url: String
authsecret: String
insecure: Boolean
labelSelector: String
fieldSelector: String
from: Int
size: Int
# 搜索,name,displayname, description字段
keyword: String
}

# mutation
type Mutation {
createDatasource(input: CreateDatasource!): Datasource!
createDatasource(input: CreateDatasourceInput!): Datasource!
updateDatasource(input: UpdateDatasourceInput): Datasource!
deleteDatasource(input: DeleteDatasourceInput): Void
}
# query
type Query{
listDatasources(input: ListDatasourceInput): [Datasource!]
}
81 changes: 69 additions & 12 deletions graphql-server/go-server/graph/datasource.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b5ef8a9

Please sign in to comment.