Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: use connectrpc openapi generator (#18700)

p0nyb88c6cf18724
diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml
index 0beb4a2f08..d6817097eb 100644
--- a/proto/buf.gen.yaml
+++ b/proto/buf.gen.yaml
@@ -33,9 +33,11 @@ plugins:
- remote: buf.build/community/pseudomuto-doc:v1.5.1
out: gen/grpc-doc
opt: html,index.html,source_relative
- - remote: buf.build/community/google-gnostic-openapi:v0.7.0
+ - remote: buf.build/community/sudorandom-connect-openapi
out: gen/grpc-doc
- opt: paths=source_relative,enum_type=string
+ opt:
+ - features=connectrpc;google.api.http;gnostic;protovalidate
+ - path=openapi.yaml
types:
- bytebase.v1
- remote: buf.build/community/sudorandom-connect-openapi
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index bd71f0fa03..e2e8be1154 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -1,15360 +1,22988 @@
-# Generated with protoc-gen-openapi
-# https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi
-
-openapi: 3.0.3
-info:
- title: ""
- version: 0.0.1
+openapi: 3.1.0
+info: {}
paths:
- /v1/actuator/cache:
- delete:
- tags:
- - ActuatorService
+ /v1/actuator/cache:
+ delete:
+ tags:
+ - bytebase.v1.ActuatorService
+ summary: DeleteCache
+ description: |-
+ Clears the system cache to force data refresh.
+ Permissions required: None
+ operationId: bytebase.v1.ActuatorService.DeleteCache
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ /v1/actuator/info:
+ get:
+ tags:
+ - bytebase.v1.ActuatorService
+ summary: GetActuatorInfo
+ description: |-
+ Gets system information and health status of the Bytebase instance.
+ Permissions required: None
+ operationId: bytebase.v1.ActuatorService.GetActuatorInfo
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ActuatorInfo'
+ patch:
+ tags:
+ - bytebase.v1.ActuatorService
+ summary: UpdateActuatorInfo
+ description: |-
+ Updates system configuration settings for the Bytebase instance.
+ Permissions required: bb.settings.set
+ operationId: bytebase.v1.ActuatorService.UpdateActuatorInfo
+ parameters:
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the actuator is not found, a new actuator will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Clears the system cache to force data refresh.
- Permissions required: None
- operationId: ActuatorService_DeleteCache
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/actuator/info:
- get:
- tags:
- - ActuatorService
+ If set to true, and the actuator is not found, a new actuator will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: The actuator to update.
+ content:
+ application/json:
+ schema:
+ title: actuator
+ description: The actuator to update.
+ $ref: '#/components/schemas/bytebase.v1.ActuatorInfo'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ActuatorInfo'
+ /v1/actuator/resources:
+ get:
+ tags:
+ - bytebase.v1.ActuatorService
+ summary: GetResourcePackage
+ description: |-
+ Gets custom branding resources such as logos.
+ Permissions required: None
+ operationId: bytebase.v1.ActuatorService.GetResourcePackage
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ResourcePackage'
+ /v1/actuator:setupSample:
+ post:
+ tags:
+ - bytebase.v1.ActuatorService
+ summary: SetupSample
+ description: |-
+ Sets up sample data for demonstration and testing purposes.
+ Permissions required: bb.projects.create
+ operationId: bytebase.v1.ActuatorService.SetupSample
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ /v1/auditLogs:export:
+ post:
+ tags:
+ - bytebase.v1.AuditLogService
+ summary: ExportAuditLogs
+ description: |-
+ Exports audit logs in a specified format for external analysis.
+ Permissions required: bb.auditLogs.export
+ operationId: bytebase.v1.AuditLogService.ExportAuditLogs2
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ExportAuditLogsRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ExportAuditLogsResponse'
+ /v1/auditLogs:search:
+ post:
+ tags:
+ - bytebase.v1.AuditLogService
+ summary: SearchAuditLogs
+ description: |-
+ Searches audit logs with optional filtering and pagination.
+ Permissions required: bb.auditLogs.search
+ operationId: bytebase.v1.AuditLogService.SearchAuditLogs2
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchAuditLogsRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchAuditLogsResponse'
+ /v1/auth/login:
+ post:
+ tags:
+ - bytebase.v1.AuthService
+ summary: Login
+ description: |-
+ Authenticates a user and returns access tokens.
+ Permissions required: None
+ operationId: bytebase.v1.AuthService.Login
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.LoginRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.LoginResponse'
+ /v1/auth/logout:
+ post:
+ tags:
+ - bytebase.v1.AuthService
+ summary: Logout
+ description: |-
+ Logs out the current user session.
+ Permissions required: None
+ operationId: bytebase.v1.AuthService.Logout
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.LogoutRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ /v1/auth/refresh:
+ post:
+ tags:
+ - bytebase.v1.AuthService
+ summary: Refresh
+ description: |-
+ Refreshes the access token using the refresh token cookie.
+ Permissions required: None (validates via refresh token cookie)
+ operationId: bytebase.v1.AuthService.Refresh
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.RefreshRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.RefreshResponse'
+ /v1/auth:exchangeToken:
+ post:
+ tags:
+ - bytebase.v1.AuthService
+ summary: ExchangeToken
+ description: |-
+ Exchanges an external OIDC token for a Bytebase access token.
+ Used by CI/CD pipelines with Workload Identity Federation.
+ Permissions required: None (validates via OIDC token)
+ operationId: bytebase.v1.AuthService.ExchangeToken
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ExchangeTokenRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ExchangeTokenResponse'
+ /v1/cel/batchDeparse:
+ post:
+ tags:
+ - bytebase.v1.CelService
+ summary: BatchDeparse
+ description: |-
+ Converts multiple CEL AST representations back into expression strings.
+ Permissions required: None
+ operationId: bytebase.v1.CelService.BatchDeparse
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchDeparseRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchDeparseResponse'
+ /v1/cel/batchParse:
+ post:
+ tags:
+ - bytebase.v1.CelService
+ summary: BatchParse
+ description: |-
+ Parses multiple CEL expression strings into AST representations.
+ Permissions required: None
+ operationId: bytebase.v1.CelService.BatchParse
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchParseRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchParseResponse'
+ /v1/environments/{environment}/policies:
+ get:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: ListPolicies
+ description: |-
+ Lists policies at a specified resource level.
+ Permissions required: bb.policies.list
+ operationId: bytebase.v1.OrgPolicyService.ListPolicies3
+ parameters:
+ - name: environment
+ in: path
+ description: The environment id.
+ required: true
+ schema:
+ type: string
+ - name: policyType
+ in: query
+ description: Filter by specific policy type.
+ schema:
+ title: policy_type
+ description: Filter by specific policy type.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ - name: showDeleted
+ in: query
+ description: Show deleted policies if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted policies if specified.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListPoliciesResponse'
+ post:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: CreatePolicy
+ description: |-
+ Creates a new organizational policy.
+ Permissions required: bb.policies.create
+ operationId: bytebase.v1.OrgPolicyService.CreatePolicy3
+ parameters:
+ - name: environment
+ in: path
+ description: The environment id.
+ required: true
+ schema:
+ type: string
+ - name: type
+ in: query
+ description: The type of policy to create.
+ schema:
+ title: type
+ description: The type of policy to create.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ requestBody:
+ description: The policy to create.
+ content:
+ application/json:
+ schema:
+ title: policy
+ description: The policy to create.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ /v1/environments/{environment}/policies/{policy}:
+ get:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: GetPolicy
+ description: |-
+ Retrieves a policy by name.
+ Permissions required: bb.policies.get
+ operationId: bytebase.v1.OrgPolicyService.GetPolicy3
+ parameters:
+ - name: environment
+ in: path
+ description: The environment id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ delete:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: DeletePolicy
+ description: |-
+ Deletes an organizational policy.
+ Permissions required: bb.policies.delete
+ operationId: bytebase.v1.OrgPolicyService.DeletePolicy3
+ parameters:
+ - name: environment
+ in: path
+ description: The environment id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: UpdatePolicy
+ description: |-
+ Updates an existing organizational policy.
+ Permissions required: bb.policies.update
+ operationId: bytebase.v1.OrgPolicyService.UpdatePolicy3
+ parameters:
+ - name: environment
+ in: path
+ description: The environment id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Gets system information and health status of the Bytebase instance.
- Permissions required: None
- operationId: ActuatorService_GetActuatorInfo
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ActuatorInfo'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - ActuatorService
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ content:
+ application/json:
+ schema:
+ title: policy
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ /v1/groups:
+ get:
+ tags:
+ - bytebase.v1.GroupService
+ summary: ListGroups
+ description: |-
+ Lists all groups in the workspace.
+ Permissions required: bb.groups.list
+ operationId: bytebase.v1.GroupService.ListGroups
+ parameters:
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of groups to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 groups will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Updates system configuration settings for the Bytebase instance.
- Permissions required: bb.settings.set
- operationId: ActuatorService_UpdateActuatorInfo
- parameters:
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the actuator is not found, a new actuator will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ActuatorInfo'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ActuatorInfo'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/actuator/resources:
- get:
- tags:
- - ActuatorService
+ The maximum number of groups to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 groups will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListGroups` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListGroups` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Gets custom branding resources such as logos.
- Permissions required: None
- operationId: ActuatorService_GetResourcePackage
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ResourcePackage'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/actuator:setupSample:
- post:
- tags:
- - ActuatorService
+ A page token, received from a previous `ListGroups` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListGroups` must match
+ the call that provided the page token.
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter groups returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - title: the group title, support "==" and ".matches()" operator.
+ - email: the group email, support "==" and ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+
+ For example:
+ title == "dba"
+ email == "[email protected]"
+ title.matches("dba")
+ email.matches("dba")
+ project == "projects/sample-project"
+ You can combine filter conditions like:
+ title.matches("dba") || email.matches("dba")
+ schema:
+ type: string
+ title: filter
description: |-
- Sets up sample data for demonstration and testing purposes.
- Permissions required: bb.projects.create
- operationId: ActuatorService_SetupSample
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/auditLogs:export:
- post:
- tags:
- - AuditLogService
+ Filter is used to filter groups returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - title: the group title, support "==" and ".matches()" operator.
+ - email: the group email, support "==" and ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+
+ For example:
+ title == "dba"
+ email == "[email protected]"
+ title.matches("dba")
+ email.matches("dba")
+ project == "projects/sample-project"
+ You can combine filter conditions like:
+ title.matches("dba") || email.matches("dba")
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListGroupsResponse'
+ post:
+ tags:
+ - bytebase.v1.GroupService
+ summary: CreateGroup
+ description: |-
+ Creates a new group.
+ Permissions required: bb.groups.create
+ operationId: bytebase.v1.GroupService.CreateGroup
+ parameters:
+ - name: groupEmail
+ in: query
+ description: |-
+ The email to use for the group, which will become the final component
+ of the group's resource name.
+ required: true
+ schema:
+ type: string
+ title: group_email
description: |-
- Exports audit logs in a specified format for external analysis.
- Permissions required: bb.auditLogs.export
- operationId: AuditLogService_ExportAuditLogs
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportAuditLogsRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportAuditLogsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/auditLogs:search:
- post:
- tags:
- - AuditLogService
+ The email to use for the group, which will become the final component
+ of the group's resource name.
+ requestBody:
+ description: The group to create.
+ content:
+ application/json:
+ schema:
+ title: group
+ description: The group to create.
+ $ref: '#/components/schemas/bytebase.v1.Group'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Group'
+ /v1/groups/{group}:
+ get:
+ tags:
+ - bytebase.v1.GroupService
+ summary: GetGroup
+ description: |-
+ Gets a group by name.
+ Permissions required: bb.groups.get
+ operationId: bytebase.v1.GroupService.GetGroup
+ parameters:
+ - name: group
+ in: path
+ description: The group id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Group'
+ delete:
+ tags:
+ - bytebase.v1.GroupService
+ summary: DeleteGroup
+ description: |-
+ Deletes a group. Group owners or users with bb.groups.delete permission can delete.
+ Permissions required: bb.groups.delete OR caller is group owner
+ operationId: bytebase.v1.GroupService.DeleteGroup
+ parameters:
+ - name: group
+ in: path
+ description: The group id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.GroupService
+ summary: UpdateGroup
+ description: |-
+ Updates a group. Group owners or users with bb.groups.update permission can update.
+ Permissions required: bb.groups.update OR caller is group owner
+ When allow_missing=true, also requires: bb.groups.create
+ operationId: bytebase.v1.GroupService.UpdateGroup
+ parameters:
+ - name: group
+ in: path
+ description: The group id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the group is not found, a new group will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Searches audit logs with optional filtering and pagination.
- Permissions required: bb.auditLogs.search
- operationId: AuditLogService_SearchAuditLogs
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchAuditLogsRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchAuditLogsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/auth/login:
- post:
- tags:
- - AuthService
+ If set to true, and the group is not found, a new group will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The group to update.
+
+ The group's `name` field is used to identify the group to update.
+ Format: groups/{email}
+ content:
+ application/json:
+ schema:
+ title: group
+ description: |-
+ The group to update.
+
+ The group's `name` field is used to identify the group to update.
+ Format: groups/{email}
+ $ref: '#/components/schemas/bytebase.v1.Group'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Group'
+ /v1/groups:batchGet:
+ get:
+ tags:
+ - bytebase.v1.GroupService
+ summary: BatchGetGroups
+ description: |-
+ Gets multiple groups in a single request.
+ Permissions required: bb.groups.get
+ operationId: bytebase.v1.GroupService.BatchGetGroups
+ parameters:
+ - name: names
+ in: query
+ description: |-
+ The group names to retrieve.
+ Format: groups/{email}
+ required: true
+ schema:
+ type: array
+ items:
+ type: string
+ title: names
description: |-
- Authenticates a user and returns access tokens.
- Permissions required: None
- operationId: AuthService_Login
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/LoginRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/LoginResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/auth/logout:
- post:
- tags:
- - AuthService
+ The group names to retrieve.
+ Format: groups/{email}
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchGetGroupsResponse'
+ /v1/idps:
+ get:
+ tags:
+ - bytebase.v1.IdentityProviderService
+ summary: ListIdentityProviders
+ description: |-
+ Lists all configured identity providers (public endpoint for login page).
+ Permissions required: None
+ operationId: bytebase.v1.IdentityProviderService.ListIdentityProviders
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListIdentityProvidersResponse'
+ post:
+ tags:
+ - bytebase.v1.IdentityProviderService
+ summary: CreateIdentityProvider
+ description: |-
+ Creates a new identity provider.
+ Permissions required: bb.identityProviders.create
+ operationId: bytebase.v1.IdentityProviderService.CreateIdentityProvider
+ parameters:
+ - name: identityProviderId
+ in: query
+ description: |-
+ The ID to use for the identity provider, which will become the final component of
+ the identity provider's resource name.
+
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ schema:
+ type: string
+ title: identity_provider_id
description: |-
- Logs out the current user session.
- Permissions required: None
- operationId: AuthService_Logout
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/LogoutRequest'
- required: true
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/auth/refresh:
- post:
- tags:
- - AuthService
+ The ID to use for the identity provider, which will become the final component of
+ the identity provider's resource name.
+
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ - name: validateOnly
+ in: query
+ description: If set to true, the request will be validated without actually creating the identity provider.
+ schema:
+ type: boolean
+ title: validate_only
+ description: If set to true, the request will be validated without actually creating the identity provider.
+ requestBody:
+ description: The identity provider to create.
+ content:
+ application/json:
+ schema:
+ title: identity_provider
+ description: The identity provider to create.
+ $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
+ /v1/idps/*:test:
+ post:
+ tags:
+ - bytebase.v1.IdentityProviderService
+ summary: TestIdentityProvider
+ description: |-
+ Tests the connection and configuration of an identity provider.
+ Permissions required: bb.identityProviders.update
+ operationId: bytebase.v1.IdentityProviderService.TestIdentityProvider
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.TestIdentityProviderRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.TestIdentityProviderResponse'
+ /v1/idps/{idp}:
+ get:
+ tags:
+ - bytebase.v1.IdentityProviderService
+ summary: GetIdentityProvider
+ description: |-
+ Gets an identity provider by name.
+ Permissions required: bb.identityProviders.get
+ operationId: bytebase.v1.IdentityProviderService.GetIdentityProvider
+ parameters:
+ - name: idp
+ in: path
+ description: The idp id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
+ delete:
+ tags:
+ - bytebase.v1.IdentityProviderService
+ summary: DeleteIdentityProvider
+ description: |-
+ Deletes an identity provider.
+ Permissions required: bb.identityProviders.delete
+ operationId: bytebase.v1.IdentityProviderService.DeleteIdentityProvider
+ parameters:
+ - name: idp
+ in: path
+ description: The idp id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.IdentityProviderService
+ summary: UpdateIdentityProvider
+ description: |-
+ Updates an identity provider.
+ Permissions required: bb.identityProviders.update
+ When allow_missing=true, also requires: bb.identityProviders.create
+ operationId: bytebase.v1.IdentityProviderService.UpdateIdentityProvider
+ parameters:
+ - name: idp
+ in: path
+ description: The idp id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the identity provider is not found, a new identity provider will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Refreshes the access token using the refresh token cookie.
- Permissions required: None (validates via refresh token cookie)
- operationId: AuthService_Refresh
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RefreshRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RefreshResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/auth:exchangeToken:
- post:
- tags:
- - AuthService
+ If set to true, and the identity provider is not found, a new identity provider will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The identity provider to update.
+
+ The identity provider's `name` field is used to identify the identity provider to update.
+ Format: idps/{identity_provider}
+ content:
+ application/json:
+ schema:
+ title: identity_provider
+ description: |-
+ The identity provider to update.
+
+ The identity provider's `name` field is used to identify the identity provider to update.
+ Format: idps/{identity_provider}
+ $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
+ /v1/instances:
+ get:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: ListInstances
+ description: |-
+ Lists all database instances.
+ Permissions required: bb.instances.list
+ operationId: bytebase.v1.InstanceService.ListInstances
+ parameters:
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of instances to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 instances will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Exchanges an external OIDC token for a Bytebase access token.
- Used by CI/CD pipelines with Workload Identity Federation.
- Permissions required: None (validates via OIDC token)
- operationId: AuthService_ExchangeToken
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExchangeTokenRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExchangeTokenResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/cel/batchDeparse:
- post:
- tags:
- - CelService
+ The maximum number of instances to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 instances will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListInstances` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListInstances` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Converts multiple CEL AST representations back into expression strings.
- Permissions required: None
- operationId: CelService_BatchDeparse
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchDeparseRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchDeparseResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/cel/batchParse:
- post:
- tags:
- - CelService
+ A page token, received from a previous `ListInstances` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListInstances` must match
+ the call that provided the page token.
+ - name: showDeleted
+ in: query
+ description: Show deleted instances if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted instances if specified.
+ - name: filter
+ in: query
+ description: |-
+ Filter the instance.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - name: the instance name, support "==" and ".matches()" operator.
+ - resource_id: the instance id, support "==" and ".matches()" operator.
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - state: the instance state, check State enum for values, support "==" operator.
+ - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - host: the instance host, support "==" and ".matches()" operator.
+ - port: the instance port, support "==" and ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - labels.{key}: the instance label, support "==" and "in" operators.
+
+ For example:
+ name == "sample instance"
+ name.matches("sample")
+ resource_id == "sample-instance"
+ resource_id.matches("sample")
+ state == "DELETED"
+ environment == "environments/test"
+ environment == "" (find instances which environment is not set)
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ host == "127.0.0.1"
+ host.matches("127.0")
+ port == "54321"
+ port.matches("543")
+ labels.org_group == "infrastructure"
+ labels.environment in ["prod", "production"]
+ project == "projects/sample-project"
+ You can combine filter conditions like:
+ name.matches("sample") && environment == "environments/test"
+ host == "127.0.0.1" && port == "54321"
+ schema:
+ type: string
+ title: filter
description: |-
- Parses multiple CEL expression strings into AST representations.
- Permissions required: None
- operationId: CelService_BatchParse
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchParseRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchParseResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/environments/{environment}/policies:
- get:
- tags:
- - OrgPolicyService
+ Filter the instance.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - name: the instance name, support "==" and ".matches()" operator.
+ - resource_id: the instance id, support "==" and ".matches()" operator.
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - state: the instance state, check State enum for values, support "==" operator.
+ - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - host: the instance host, support "==" and ".matches()" operator.
+ - port: the instance port, support "==" and ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - labels.{key}: the instance label, support "==" and "in" operators.
+
+ For example:
+ name == "sample instance"
+ name.matches("sample")
+ resource_id == "sample-instance"
+ resource_id.matches("sample")
+ state == "DELETED"
+ environment == "environments/test"
+ environment == "" (find instances which environment is not set)
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ host == "127.0.0.1"
+ host.matches("127.0")
+ port == "54321"
+ port.matches("543")
+ labels.org_group == "infrastructure"
+ labels.environment in ["prod", "production"]
+ project == "projects/sample-project"
+ You can combine filter conditions like:
+ name.matches("sample") && environment == "environments/test"
+ host == "127.0.0.1" && port == "54321"
+ - name: orderBy
+ in: query
+ description: |-
+ The order by of instances.
+ Support title, environment. The default sorting order is ascending.
+ For example:
+ - order_by = "title"
+ - order_by = "title desc"
+ - order_by = "title desc, environment asc"
+ schema:
+ type: string
+ title: order_by
description: |-
- Lists policies at a specified resource level.
- Permissions required: bb.policies.list
- operationId: OrgPolicyService_ListPolicies
- parameters:
- - name: environment
- in: path
- description: The environment id.
- required: true
- schema:
- type: string
- - name: policyType
- in: query
- description: Filter by specific policy type.
- schema:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- format: enum
- - name: showDeleted
- in: query
- description: Show deleted policies if specified.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListPoliciesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - OrgPolicyService
+ The order by of instances.
+ Support title, environment. The default sorting order is ascending.
+ For example:
+ - order_by = "title"
+ - order_by = "title desc"
+ - order_by = "title desc, environment asc"
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListInstancesResponse'
+ post:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: CreateInstance
+ description: |-
+ Creates a new database instance.
+ Permissions required: bb.instances.create
+ operationId: bytebase.v1.InstanceService.CreateInstance
+ parameters:
+ - name: instanceId
+ in: query
+ description: |-
+ The ID to use for the instance, which will become the final component of
+ the instance's resource name.
+
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ schema:
+ type: string
+ title: instance_id
description: |-
- Creates a new organizational policy.
- Permissions required: bb.policies.create
- operationId: OrgPolicyService_CreatePolicy
- parameters:
- - name: environment
- in: path
- description: The environment id.
- required: true
- schema:
- type: string
- - name: type
- in: query
- description: The type of policy to create.
- schema:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- format: enum
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/environments/{environment}/policies/{policy}:
- get:
- tags:
- - OrgPolicyService
+ The ID to use for the instance, which will become the final component of
+ the instance's resource name.
+
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ - name: validateOnly
+ in: query
+ description: Validate only also tests the data source connection.
+ schema:
+ type: boolean
+ title: validate_only
+ description: Validate only also tests the data source connection.
+ requestBody:
+ description: The instance to create.
+ content:
+ application/json:
+ schema:
+ title: instance
+ description: The instance to create.
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ /v1/instances/{instance}:
+ get:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: GetInstance
+ description: |-
+ Gets a database instance by name.
+ Permissions required: bb.instances.get
+ operationId: bytebase.v1.InstanceService.GetInstance
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ delete:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: DeleteInstance
+ description: |-
+ Deletes or soft-deletes a database instance.
+ Permissions required: bb.instances.delete
+ operationId: bytebase.v1.InstanceService.DeleteInstance
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: force
+ in: query
+ description: If set to true, any databases and sheets from this project will also be moved to default project, and all open issues will be closed.
+ schema:
+ type: boolean
+ title: force
+ description: If set to true, any databases and sheets from this project will also be moved to default project, and all open issues will be closed.
+ - name: purge
+ in: query
+ description: |-
+ If set to true, permanently purge the soft-deleted instance and all related resources.
+ This operation is irreversible. Following AIP-165, this should only be used for
+ administrative cleanup of old soft-deleted instances.
+ The instance must already be soft-deleted for this to work.
+ schema:
+ type: boolean
+ title: purge
description: |-
- Retrieves a policy by name.
- Permissions required: bb.policies.get
- operationId: OrgPolicyService_GetPolicy
- parameters:
- - name: environment
- in: path
- description: The environment id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - OrgPolicyService
+ If set to true, permanently purge the soft-deleted instance and all related resources.
+ This operation is irreversible. Following AIP-165, this should only be used for
+ administrative cleanup of old soft-deleted instances.
+ The instance must already be soft-deleted for this to work.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: UpdateInstance
+ description: |-
+ Updates a database instance.
+ Permissions required: bb.instances.update
+ operationId: bytebase.v1.InstanceService.UpdateInstance
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the instance is not found, a new instance will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Deletes an organizational policy.
- Permissions required: bb.policies.delete
- operationId: OrgPolicyService_DeletePolicy
- parameters:
- - name: environment
- in: path
- description: The environment id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - OrgPolicyService
+ If set to true, and the instance is not found, a new instance will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The instance to update.
+
+ The instance's `name` field is used to identify the instance to update.
+ Format: instances/{instance}
+ content:
+ application/json:
+ schema:
+ title: instance
+ description: |-
+ The instance to update.
+
+ The instance's `name` field is used to identify the instance to update.
+ Format: instances/{instance}
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ /v1/instances/{instance}/databases:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: ListDatabases
+ description: |-
+ Lists databases in a project, instance, or workspace.
+ Permissions required: bb.projects.get (for project parent), bb.databases.list (for workspace parent), or bb.instances.get (for instance parent)
+ operationId: bytebase.v1.DatabaseService.ListDatabases2
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of databases to return. The service may return fewer
+ than this value.
+ If unspecified, at most 10 databases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Updates an existing organizational policy.
- Permissions required: bb.policies.update
- operationId: OrgPolicyService_UpdatePolicy
- parameters:
- - name: environment
- in: path
- description: The environment id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the policy is not found, a new policy will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/groups:
- get:
- tags:
- - GroupService
+ The maximum number of databases to return. The service may return fewer
+ than this value.
+ If unspecified, at most 10 databases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListDatabases` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListDatabases` must
+ match the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Lists all groups in the workspace.
- Permissions required: bb.groups.list
- operationId: GroupService_ListGroups
- parameters:
- - name: pageSize
- in: query
- description: |-
- The maximum number of groups to return. The service may return fewer than
- this value.
- If unspecified, at most 10 groups will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListGroups` call.
- Provide this to retrieve the subsequent page.
+ A page token, received from a previous `ListDatabases` call.
+ Provide this to retrieve the subsequent page.
- When paginating, all other parameters provided to `ListGroups` must match
- the call that provided the page token.
- schema:
- type: string
- - name: filter
- in: query
- description: |-
- Filter is used to filter groups returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ When paginating, all other parameters provided to `ListDatabases` must
+ match the call that provided the page token.
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- Supported filter:
- - title: the group title, support "==" and ".matches()" operator.
- - email: the group email, support "==" and ".matches()" operator.
- - project: the project full name in "projects/{id}" format, support "==" operator.
+ Supported filter:
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - name: the database name, support ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
+ - table: filter by the database table, support "==" and ".matches()" operator.
+ - labels.{key}: the database label, support "==" and "in" operators.
- For example:
- title == "dba"
- email == "[email protected]"
- title.matches("dba")
- email.matches("dba")
- project == "projects/sample-project"
- You can combine filter conditions like:
- title.matches("dba") || email.matches("dba")
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListGroupsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - GroupService
+ For example:
+ environment == "environments/{environment resource id}"
+ environment == "" (find databases which environment is not set)
+ project == "projects/{project resource id}"
+ instance == "instances/{instance resource id}"
+ name.matches("database name")
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ exclude_unassigned == true
+ drifted == true
+ table == "sample"
+ table.matches("sam")
+ labels.environment == "production"
+ labels.region == "asia"
+ labels.region in ["asia", "europe"]
+
+ You can combine filter conditions like:
+ environment == "environments/prod" && name.matches("employee")
+ schema:
+ type: string
+ title: filter
description: |-
- Creates a new group.
- Permissions required: bb.groups.create
- operationId: GroupService_CreateGroup
- parameters:
- - name: groupEmail
- in: query
- description: |-
- The email to use for the group, which will become the final component
- of the group's resource name.
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Group'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Group'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/groups/{group}:
- get:
- tags:
- - GroupService
+ Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - name: the database name, support ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
+ - table: filter by the database table, support "==" and ".matches()" operator.
+ - labels.{key}: the database label, support "==" and "in" operators.
+
+ For example:
+ environment == "environments/{environment resource id}"
+ environment == "" (find databases which environment is not set)
+ project == "projects/{project resource id}"
+ instance == "instances/{instance resource id}"
+ name.matches("database name")
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ exclude_unassigned == true
+ drifted == true
+ table == "sample"
+ table.matches("sam")
+ labels.environment == "production"
+ labels.region == "asia"
+ labels.region in ["asia", "europe"]
+
+ You can combine filter conditions like:
+ environment == "environments/prod" && name.matches("employee")
+ - name: showDeleted
+ in: query
+ description: Show deleted database if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted database if specified.
+ - name: orderBy
+ in: query
+ description: |-
+ The order by of databases.
+ Support name, project, instance. The default sorting order is ascending.
+ For example:
+ - order_by = "name" - order by name ascending
+ - order_by = "name desc"
+ - order_by = "name desc, project asc"
+ schema:
+ type: string
+ title: order_by
description: |-
- Gets a group by name.
- Permissions required: bb.groups.get
- operationId: GroupService_GetGroup
- parameters:
- - name: group
- in: path
- description: The group id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Group'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - GroupService
+ The order by of databases.
+ Support name, project, instance. The default sorting order is ascending.
+ For example:
+ - order_by = "name" - order by name ascending
+ - order_by = "name desc"
+ - order_by = "name desc, project asc"
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListDatabasesResponse'
+ /v1/instances/{instance}/databases/{database}:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: GetDatabase
+ description: |-
+ Retrieves a database by name.
+ Permissions required: bb.databases.get
+ operationId: bytebase.v1.DatabaseService.GetDatabase
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Database'
+ patch:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: UpdateDatabase
+ description: |-
+ Updates database properties such as labels and project assignment.
+ Permissions required: bb.databases.update
+ operationId: bytebase.v1.DatabaseService.UpdateDatabase
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the database is not found, a new database will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Deletes a group. Group owners or users with bb.groups.delete permission can delete.
- Permissions required: bb.groups.delete OR caller is group owner
- operationId: GroupService_DeleteGroup
- parameters:
- - name: group
- in: path
- description: The group id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - GroupService
+ If set to true, and the database is not found, a new database will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The database to update.
+
+ The database's `name` field is used to identify the database to update.
+ Format: instances/{instance}/databases/{database}
+ content:
+ application/json:
+ schema:
+ title: database
+ description: |-
+ The database to update.
+
+ The database's `name` field is used to identify the database to update.
+ Format: instances/{instance}/databases/{database}
+ $ref: '#/components/schemas/bytebase.v1.Database'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Database'
+ /v1/instances/{instance}/databases/{database}/catalog:
+ get:
+ tags:
+ - bytebase.v1.DatabaseCatalogService
+ summary: GetDatabaseCatalog
+ description: |-
+ Gets the catalog metadata for a database.
+ Permissions required: bb.databaseCatalogs.get
+ operationId: bytebase.v1.DatabaseCatalogService.GetDatabaseCatalog
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
+ patch:
+ tags:
+ - bytebase.v1.DatabaseCatalogService
+ summary: UpdateDatabaseCatalog
+ description: |-
+ Updates catalog metadata such as classifications and labels.
+ Permissions required: bb.databaseCatalogs.update
+ operationId: bytebase.v1.DatabaseCatalogService.UpdateDatabaseCatalog
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the database catalog is not found, a new database catalog will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Updates a group. Group owners or users with bb.groups.update permission can update.
- Permissions required: bb.groups.update OR caller is group owner
- When allow_missing=true, also requires: bb.groups.create
- operationId: GroupService_UpdateGroup
- parameters:
- - name: group
- in: path
- description: The group id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the group is not found, a new group will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Group'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Group'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/groups:batchGet:
- get:
- tags:
- - GroupService
+ If set to true, and the database catalog is not found, a new database catalog will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The database catalog to update.
+
+ The catalog's `name` field is used to identify the database catalog to update.
+ Format: instances/{instance}/databases/{database}/catalog
+ content:
+ application/json:
+ schema:
+ title: catalog
+ description: |-
+ The database catalog to update.
+
+ The catalog's `name` field is used to identify the database catalog to update.
+ Format: instances/{instance}/databases/{database}/catalog
+ $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
+ /v1/instances/{instance}/databases/{database}/changelogs:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: ListChangelogs
+ description: |-
+ Lists migration history for a database.
+ Permissions required: bb.changelogs.list
+ operationId: bytebase.v1.DatabaseService.ListChangelogs
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of changelogs to return. The service may return fewer
+ than this value. If unspecified, at most 10 changelogs will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Gets multiple groups in a single request.
- Permissions required: bb.groups.get
- operationId: GroupService_BatchGetGroups
- parameters:
- - name: names
- in: query
- description: |-
- The group names to retrieve.
- Format: groups/{email}
- schema:
- type: array
- items:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchGetGroupsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/idps:
- get:
- tags:
- - IdentityProviderService
+ The maximum number of changelogs to return. The service may return fewer
+ than this value. If unspecified, at most 10 changelogs will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from the previous call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Lists all configured identity providers (public endpoint for login page).
- Permissions required: None
- operationId: IdentityProviderService_ListIdentityProviders
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListIdentityProvidersResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - IdentityProviderService
+ A page token, received from the previous call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided must match
+ the call that provided the page token.
+ - name: view
+ in: query
+ schema:
+ title: view
+ $ref: '#/components/schemas/bytebase.v1.ChangelogView'
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter changelogs returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ status: the changelog status, support "==" operation. check Changelog.Status for available values.
+ type: the changelog type, support "in" and "==" operation. check Changelog.Type for available values.
+
+ Example:
+ status == "DONE"
+ type in ["BASELINE", "MIGRATE"]
+ status == "FAILED" && type == "SDL"
+ schema:
+ type: string
+ title: filter
description: |-
- Creates a new identity provider.
- Permissions required: bb.identityProviders.create
- operationId: IdentityProviderService_CreateIdentityProvider
- parameters:
- - name: identityProviderId
- in: query
- description: |-
- The ID to use for the identity provider, which will become the final component of
- the identity provider's resource name.
+ Filter is used to filter changelogs returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- This value should be 4-63 characters, and valid characters
- are /[a-z][0-9]-/.
- schema:
- type: string
- - name: validateOnly
- in: query
- description: If set to true, the request will be validated without actually creating the identity provider.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IdentityProvider'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IdentityProvider'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/idps/*:test:
- post:
- tags:
- - IdentityProviderService
+ Supported filter:
+ status: the changelog status, support "==" operation. check Changelog.Status for available values.
+ type: the changelog type, support "in" and "==" operation. check Changelog.Type for available values.
+
+ Example:
+ status == "DONE"
+ type in ["BASELINE", "MIGRATE"]
+ status == "FAILED" && type == "SDL"
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListChangelogsResponse'
+ /v1/instances/{instance}/databases/{database}/changelogs/{changelog}:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: GetChangelog
+ description: |-
+ Retrieves a specific changelog entry.
+ Permissions required: bb.changelogs.get
+ operationId: bytebase.v1.DatabaseService.GetChangelog
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: changelog
+ in: path
+ description: The changelog id.
+ required: true
+ schema:
+ type: string
+ - name: view
+ in: query
+ schema:
+ title: view
+ $ref: '#/components/schemas/bytebase.v1.ChangelogView'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Changelog'
+ /v1/instances/{instance}/databases/{database}/changelogs/{changelog}:diffSchema:
+ post:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: DiffSchema
+ description: |-
+ Compares and generates migration statements between two schemas.
+ Permissions required: bb.databases.get
+ operationId: bytebase.v1.DatabaseService.DiffSchema2
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: changelog
+ in: path
+ description: The changelog id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DiffSchemaResponse'
+ /v1/instances/{instance}/databases/{database}/metadata:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: GetDatabaseMetadata
+ description: |-
+ Retrieves database metadata including tables, columns, and indexes.
+ Permissions required: bb.databases.getSchema
+ operationId: bytebase.v1.DatabaseService.GetDatabaseMetadata
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - schema: the schema name, support "==" operator.
+ - table: the table name, support "==" and ".matches()" operator.
+
+ For example:
+ schema == "schema-a"
+ table == "table-a"
+ table.matches("table-a")
+ schema == "schema-a" && table.matches("sample")
+ The filter used to search table with wildcard "sample" in the schema "schemas/schema-a".
+ The column masking level will only be returned when a table filter is used.
+ schema:
+ type: string
+ title: filter
description: |-
- Tests the connection and configuration of an identity provider.
- Permissions required: bb.identityProviders.update
- operationId: IdentityProviderService_TestIdentityProvider
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TestIdentityProviderRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TestIdentityProviderResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/idps/{idp}:
- get:
- tags:
- - IdentityProviderService
+ Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - schema: the schema name, support "==" operator.
+ - table: the table name, support "==" and ".matches()" operator.
+
+ For example:
+ schema == "schema-a"
+ table == "table-a"
+ table.matches("table-a")
+ schema == "schema-a" && table.matches("sample")
+ The filter used to search table with wildcard "sample" in the schema "schemas/schema-a".
+ The column masking level will only be returned when a table filter is used.
+ - name: limit
+ in: query
+ description: |-
+ Limit the response size of returned table metadata per schema.
+ For example, if the database has 3 schemas, and each schema has 100 tables,
+ if limit is 20, then only 20 tables will be returned for each schema, total 60 tables.
+ Default 0, means no limit.
+ schema:
+ type: integer
+ title: limit
+ format: int32
description: |-
- Gets an identity provider by name.
- Permissions required: bb.identityProviders.get
- operationId: IdentityProviderService_GetIdentityProvider
- parameters:
- - name: idp
- in: path
- description: The idp id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IdentityProvider'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - IdentityProviderService
+ Limit the response size of returned table metadata per schema.
+ For example, if the database has 3 schemas, and each schema has 100 tables,
+ if limit is 20, then only 20 tables will be returned for each schema, total 60 tables.
+ Default 0, means no limit.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DatabaseMetadata'
+ /v1/instances/{instance}/databases/{database}/policies:
+ get:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: ListPolicies
+ description: |-
+ Lists policies at a specified resource level.
+ Permissions required: bb.policies.list
+ operationId: bytebase.v1.OrgPolicyService.ListPolicies5
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: policyType
+ in: query
+ description: Filter by specific policy type.
+ schema:
+ title: policy_type
+ description: Filter by specific policy type.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ - name: showDeleted
+ in: query
+ description: Show deleted policies if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted policies if specified.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListPoliciesResponse'
+ post:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: CreatePolicy
+ description: |-
+ Creates a new organizational policy.
+ Permissions required: bb.policies.create
+ operationId: bytebase.v1.OrgPolicyService.CreatePolicy5
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: type
+ in: query
+ description: The type of policy to create.
+ schema:
+ title: type
+ description: The type of policy to create.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ requestBody:
+ description: The policy to create.
+ content:
+ application/json:
+ schema:
+ title: policy
+ description: The policy to create.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ /v1/instances/{instance}/databases/{database}/policies/{policy}:
+ get:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: GetPolicy
+ description: |-
+ Retrieves a policy by name.
+ Permissions required: bb.policies.get
+ operationId: bytebase.v1.OrgPolicyService.GetPolicy5
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ delete:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: DeletePolicy
+ description: |-
+ Deletes an organizational policy.
+ Permissions required: bb.policies.delete
+ operationId: bytebase.v1.OrgPolicyService.DeletePolicy5
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: UpdatePolicy
+ description: |-
+ Updates an existing organizational policy.
+ Permissions required: bb.policies.update
+ operationId: bytebase.v1.OrgPolicyService.UpdatePolicy5
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Deletes an identity provider.
- Permissions required: bb.identityProviders.delete
- operationId: IdentityProviderService_DeleteIdentityProvider
- parameters:
- - name: idp
- in: path
- description: The idp id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - IdentityProviderService
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ content:
+ application/json:
+ schema:
+ title: policy
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ /v1/instances/{instance}/databases/{database}/revisions:
+ get:
+ tags:
+ - bytebase.v1.RevisionService
+ summary: ListRevisions
+ description: |-
+ Lists schema revisions for a database.
+ Permissions required: bb.revisions.list
+ operationId: bytebase.v1.RevisionService.ListRevisions
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of revisions to return. The service may return fewer
+ than this value. If unspecified, at most 10 revisions will be returned. The
+ maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Updates an identity provider.
- Permissions required: bb.identityProviders.update
- When allow_missing=true, also requires: bb.identityProviders.create
- operationId: IdentityProviderService_UpdateIdentityProvider
- parameters:
- - name: idp
- in: path
- description: The idp id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the identity provider is not found, a new identity provider will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IdentityProvider'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IdentityProvider'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances:
- get:
- tags:
- - InstanceService
+ The maximum number of revisions to return. The service may return fewer
+ than this value. If unspecified, at most 10 revisions will be returned. The
+ maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListRevisions` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListRevisions` must
+ match the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Lists all database instances.
- Permissions required: bb.instances.list
- operationId: InstanceService_ListInstances
- parameters:
- - name: pageSize
- in: query
- description: |-
- The maximum number of instances to return. The service may return fewer than
- this value.
- If unspecified, at most 10 instances will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListInstances` call.
- Provide this to retrieve the subsequent page.
+ A page token, received from a previous `ListRevisions` call.
+ Provide this to retrieve the subsequent page.
- When paginating, all other parameters provided to `ListInstances` must match
- the call that provided the page token.
- schema:
- type: string
- - name: showDeleted
- in: query
- description: Show deleted instances if specified.
- schema:
- type: boolean
- - name: filter
- in: query
+ When paginating, all other parameters provided to `ListRevisions` must
+ match the call that provided the page token.
+ - name: showDeleted
+ in: query
+ description: Whether to include deleted revisions in the results.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Whether to include deleted revisions in the results.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListRevisionsResponse'
+ /v1/instances/{instance}/databases/{database}/revisions/{revision}:
+ get:
+ tags:
+ - bytebase.v1.RevisionService
+ summary: GetRevision
+ description: |-
+ Retrieves a schema revision by name.
+ Permissions required: bb.revisions.get
+ operationId: bytebase.v1.RevisionService.GetRevision
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: revision
+ in: path
+ description: The revision id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Revision'
+ delete:
+ tags:
+ - bytebase.v1.RevisionService
+ summary: DeleteRevision
+ description: |-
+ Deletes a schema revision.
+ Permissions required: bb.revisions.delete
+ operationId: bytebase.v1.RevisionService.DeleteRevision
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: revision
+ in: path
+ description: The revision id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ /v1/instances/{instance}/databases/{database}/revisions:batchCreate:
+ post:
+ tags:
+ - bytebase.v1.RevisionService
+ summary: BatchCreateRevisions
+ description: |-
+ Creates multiple schema revisions in a single operation.
+ Permissions required: bb.revisions.create
+ operationId: bytebase.v1.RevisionService.BatchCreateRevisions
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ requests:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.CreateRevisionRequest'
+ title: requests
description: |-
- Filter the instance.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Supported filters:
- - name: the instance name, support "==" and ".matches()" operator.
- - resource_id: the instance id, support "==" and ".matches()" operator.
- - environment: the environment full name in "environments/{id}" format, support "==" operator.
- - state: the instance state, check State enum for values, support "==" operator.
- - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
- - host: the instance host, support "==" and ".matches()" operator.
- - port: the instance port, support "==" and ".matches()" operator.
- - project: the project full name in "projects/{id}" format, support "==" operator.
- - labels.{key}: the instance label, support "==" and "in" operators.
+ The request message specifying the revisions to create.
+ A maximum of 100 revisions can be created in a batch.
+ title: BatchCreateRevisionsRequest
+ required:
+ - requests
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchCreateRevisionsResponse'
+ /v1/instances/{instance}/databases/{database}/schema:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: GetDatabaseSchema
+ description: |-
+ Retrieves database schema as DDL statements.
+ Permissions required: bb.databases.getSchema
+ operationId: bytebase.v1.DatabaseService.GetDatabaseSchema
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DatabaseSchema'
+ /v1/instances/{instance}/databases/{database}/schemaString:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: GetSchemaString
+ description: |-
+ Generates schema DDL for a database object.
+ Permissions required: bb.databases.getSchema
+ operationId: bytebase.v1.DatabaseService.GetSchemaString
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: type
+ in: query
+ schema:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.GetSchemaStringRequest.ObjectType'
+ - name: schema
+ in: query
+ description: It's empty for DATABASE.
+ schema:
+ type: string
+ title: schema
+ description: It's empty for DATABASE.
+ - name: object
+ in: query
+ description: It's empty for DATABASE and SCHEMA.
+ schema:
+ type: string
+ title: object
+ description: It's empty for DATABASE and SCHEMA.
+ - name: metadata.name
+ in: query
+ description: |-
+ The database metadata name.
- For example:
- name == "sample instance"
- name.matches("sample")
- resource_id == "sample-instance"
- resource_id.matches("sample")
- state == "DELETED"
- environment == "environments/test"
- environment == "" (find instances which environment is not set)
- engine == "MYSQL"
- engine in ["MYSQL", "POSTGRES"]
- !(engine in ["MYSQL", "POSTGRES"])
- host == "127.0.0.1"
- host.matches("127.0")
- port == "54321"
- port.matches("543")
- labels.org_group == "infrastructure"
- labels.environment in ["prod", "production"]
- project == "projects/sample-project"
- You can combine filter conditions like:
- name.matches("sample") && environment == "environments/test"
- host == "127.0.0.1" && port == "54321"
- schema:
- type: string
- - name: orderBy
- in: query
- description: |-
- The order by of instances.
- Support title, environment. The default sorting order is ascending.
- For example:
- - order_by = "title"
- - order_by = "title desc"
- - order_by = "title desc, environment asc"
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListInstancesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - InstanceService
+ Format: instances/{instance}/databases/{database}/metadata
+ schema:
+ type: string
+ title: name
description: |-
- Creates a new database instance.
- Permissions required: bb.instances.create
- operationId: InstanceService_CreateInstance
- parameters:
- - name: instanceId
- in: query
- description: |-
- The ID to use for the instance, which will become the final component of
- the instance's resource name.
+ The database metadata name.
- This value should be 4-63 characters, and valid characters
- are /[a-z][0-9]-/.
- schema:
- type: string
- - name: validateOnly
- in: query
- description: Validate only also tests the data source connection.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Instance'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Instance'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}:
- get:
- tags:
- - InstanceService
+ Format: instances/{instance}/databases/{database}/metadata
+ - name: metadata.schemas.name
+ in: query
+ description: |-
+ The name is the schema name.
+ It is an empty string for databases without such concept such as MySQL.
+ schema:
+ type: string
+ title: name
description: |-
- Gets a database instance by name.
- Permissions required: bb.instances.get
- operationId: InstanceService_GetInstance
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Instance'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - InstanceService
+ The name is the schema name.
+ It is an empty string for databases without such concept such as MySQL.
+ - name: metadata.schemas.tables.name
+ in: query
+ description: The name is the name of a table.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a table.
+ - name: metadata.schemas.tables.columns.name
+ in: query
+ description: The name is the name of a column.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a column.
+ - name: metadata.schemas.tables.columns.position
+ in: query
+ description: The position is the position in columns.
+ schema:
+ type: integer
+ title: position
+ format: int32
+ description: The position is the position in columns.
+ - name: metadata.schemas.tables.columns.hasDefault
+ in: query
+ schema:
+ type: boolean
+ title: has_default
+ - name: metadata.schemas.tables.columns.default
+ in: query
+ description: The default value of column.
+ schema:
+ type: string
+ title: default
+ description: The default value of column.
+ - name: metadata.schemas.tables.columns.defaultOnNull
+ in: query
+ description: |-
+ Oracle specific metadata.
+ The default_on_null is the default on null of a column.
+ schema:
+ type: boolean
+ title: default_on_null
description: |-
- Deletes or soft-deletes a database instance.
- Permissions required: bb.instances.delete
- operationId: InstanceService_DeleteInstance
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: force
- in: query
- description: If set to true, any databases and sheets from this project will also be moved to default project, and all open issues will be closed.
- schema:
- type: boolean
- - name: purge
- in: query
- description: |-
- If set to true, permanently purge the soft-deleted instance and all related resources.
- This operation is irreversible. Following AIP-165, this should only be used for
- administrative cleanup of old soft-deleted instances.
- The instance must already be soft-deleted for this to work.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - InstanceService
+ Oracle specific metadata.
+ The default_on_null is the default on null of a column.
+ - name: metadata.schemas.tables.columns.onUpdate
+ in: query
+ description: |-
+ The on_update is the on update action of a column.
+ For MySQL like databases, it's only supported for TIMESTAMP columns with
+ CURRENT_TIMESTAMP as on update value.
+ schema:
+ type: string
+ title: on_update
description: |-
- Updates a database instance.
- Permissions required: bb.instances.update
- operationId: InstanceService_UpdateInstance
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the instance is not found, a new instance will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Instance'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Instance'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases:
- get:
- tags:
- - DatabaseService
+ The on_update is the on update action of a column.
+ For MySQL like databases, it's only supported for TIMESTAMP columns with
+ CURRENT_TIMESTAMP as on update value.
+ - name: metadata.schemas.tables.columns.nullable
+ in: query
+ description: The nullable is the nullable of a column.
+ schema:
+ type: boolean
+ title: nullable
+ description: The nullable is the nullable of a column.
+ - name: metadata.schemas.tables.columns.type
+ in: query
+ description: The type is the type of a column.
+ schema:
+ type: string
+ title: type
+ description: The type is the type of a column.
+ - name: metadata.schemas.tables.columns.characterSet
+ in: query
+ description: The character_set is the character_set of a column.
+ schema:
+ type: string
+ title: character_set
+ description: The character_set is the character_set of a column.
+ - name: metadata.schemas.tables.columns.collation
+ in: query
+ description: The collation is the collation of a column.
+ schema:
+ type: string
+ title: collation
+ description: The collation is the collation of a column.
+ - name: metadata.schemas.tables.columns.comment
+ in: query
+ description: The comment is the comment of a column.
+ schema:
+ type: string
+ title: comment
+ description: The comment is the comment of a column.
+ - name: metadata.schemas.tables.columns.generation.type
+ in: query
+ schema:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.GenerationMetadata.Type'
+ - name: metadata.schemas.tables.columns.generation.expression
+ in: query
+ schema:
+ type: string
+ title: expression
+ - name: metadata.schemas.tables.columns.isIdentity
+ in: query
+ schema:
+ type: boolean
+ title: is_identity
+ - name: metadata.schemas.tables.columns.identityGeneration
+ in: query
+ description: The identity_generation is for identity columns, PG only.
+ schema:
+ title: identity_generation
+ description: The identity_generation is for identity columns, PG only.
+ $ref: '#/components/schemas/bytebase.v1.ColumnMetadata.IdentityGeneration'
+ - name: metadata.schemas.tables.columns.identitySeed
+ in: query
+ description: The identity_seed is for identity columns, MSSQL only.
+ schema:
+ type:
+ - integer
+ - string
+ title: identity_seed
+ format: int64
+ description: The identity_seed is for identity columns, MSSQL only.
+ - name: metadata.schemas.tables.columns.identityIncrement
+ in: query
+ description: The identity_increment is for identity columns, MSSQL only.
+ schema:
+ type:
+ - integer
+ - string
+ title: identity_increment
+ format: int64
+ description: The identity_increment is for identity columns, MSSQL only.
+ - name: metadata.schemas.tables.columns.defaultConstraintName
+ in: query
+ description: |-
+ The default_constraint_name is the name of the default constraint, MSSQL only.
+ In MSSQL, default values are implemented as named constraints. When modifying or
+ dropping a column's default value, you must reference the constraint by name.
+ This field stores the actual constraint name from the database.
+
+ Example: A column definition like:
+ CREATE TABLE employees (
+ status NVARCHAR(20) DEFAULT 'active'
+ )
+
+ Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
+ or a user-defined name if specified:
+ ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status
+
+ To modify the default, you must first drop the existing constraint by name:
+ ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
+ ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status
+
+ This field is populated when syncing from the database. When empty (e.g., when parsing
+ from SQL files), the system cannot automatically drop the constraint.
+ schema:
+ type: string
+ title: default_constraint_name
description: |-
- Lists databases in a project, instance, or workspace.
- Permissions required: bb.projects.get (for project parent), bb.databases.list (for workspace parent), or bb.instances.get (for instance parent)
- operationId: DatabaseService_ListDatabases
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- The maximum number of databases to return. The service may return fewer
- than this value.
- If unspecified, at most 10 databases will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListDatabases` call.
- Provide this to retrieve the subsequent page.
+ The default_constraint_name is the name of the default constraint, MSSQL only.
+ In MSSQL, default values are implemented as named constraints. When modifying or
+ dropping a column's default value, you must reference the constraint by name.
+ This field stores the actual constraint name from the database.
- When paginating, all other parameters provided to `ListDatabases` must
- match the call that provided the page token.
- schema:
- type: string
- - name: filter
- in: query
- description: |-
- Filter is used to filter databases returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ Example: A column definition like:
+ CREATE TABLE employees (
+ status NVARCHAR(20) DEFAULT 'active'
+ )
- Supported filter:
- - environment: the environment full name in "environments/{id}" format, support "==" operator.
- - name: the database name, support ".matches()" operator.
- - project: the project full name in "projects/{id}" format, support "==" operator.
- - instance: the instance full name in "instances/{id}" format, support "==" operator.
- - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
- - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
- - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
- - table: filter by the database table, support "==" and ".matches()" operator.
- - labels.{key}: the database label, support "==" and "in" operators.
+ Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
+ or a user-defined name if specified:
+ ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status
- For example:
- environment == "environments/{environment resource id}"
- environment == "" (find databases which environment is not set)
- project == "projects/{project resource id}"
- instance == "instances/{instance resource id}"
- name.matches("database name")
- engine == "MYSQL"
- engine in ["MYSQL", "POSTGRES"]
- !(engine in ["MYSQL", "POSTGRES"])
- exclude_unassigned == true
- drifted == true
- table == "sample"
- table.matches("sam")
- labels.environment == "production"
- labels.region == "asia"
- labels.region in ["asia", "europe"]
-
- You can combine filter conditions like:
- environment == "environments/prod" && name.matches("employee")
- schema:
- type: string
- - name: showDeleted
- in: query
- description: Show deleted database if specified.
- schema:
- type: boolean
- - name: orderBy
- in: query
- description: |-
- The order by of databases.
- Support name, project, instance. The default sorting order is ascending.
- For example:
- - order_by = "name" - order by name ascending
- - order_by = "name desc"
- - order_by = "name desc, project asc"
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListDatabasesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}:
- get:
- tags:
- - DatabaseService
+ To modify the default, you must first drop the existing constraint by name:
+ ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
+ ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status
+
+ This field is populated when syncing from the database. When empty (e.g., when parsing
+ from SQL files), the system cannot automatically drop the constraint.
+ - name: metadata.schemas.tables.indexes.name
+ in: query
+ description: The name is the name of an index.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of an index.
+ - name: metadata.schemas.tables.indexes.expressions
+ in: query
+ description: |-
+ The expressions are the ordered columns or expressions of an index.
+ This could refer to a column or an expression.
+ schema:
+ type: array
+ items:
+ type: string
+ title: expressions
description: |-
- Retrieves a database by name.
- Permissions required: bb.databases.get
- operationId: DatabaseService_GetDatabase
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Database'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - DatabaseService
+ The expressions are the ordered columns or expressions of an index.
+ This could refer to a column or an expression.
+ - name: metadata.schemas.tables.indexes.keyLength
+ in: query
+ description: |-
+ The key_lengths are the ordered key lengths of an index.
+ If the key length is not specified, it's -1.
+ schema:
+ type: array
+ items:
+ type:
+ - integer
+ - string
+ format: int64
+ title: key_length
description: |-
- Updates database properties such as labels and project assignment.
- Permissions required: bb.databases.update
- operationId: DatabaseService_UpdateDatabase
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the database is not found, a new database will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Database'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Database'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/catalog:
- get:
- tags:
- - DatabaseCatalogService
+ The key_lengths are the ordered key lengths of an index.
+ If the key length is not specified, it's -1.
+ - name: metadata.schemas.tables.indexes.descending
+ in: query
+ description: The descending is the ordered descending of an index.
+ schema:
+ type: array
+ items:
+ type: boolean
+ title: descending
+ description: The descending is the ordered descending of an index.
+ - name: metadata.schemas.tables.indexes.type
+ in: query
+ description: The type is the type of an index.
+ schema:
+ type: string
+ title: type
+ description: The type is the type of an index.
+ - name: metadata.schemas.tables.indexes.unique
+ in: query
+ description: The unique is whether the index is unique.
+ schema:
+ type: boolean
+ title: unique
+ description: The unique is whether the index is unique.
+ - name: metadata.schemas.tables.indexes.primary
+ in: query
+ description: The primary is whether the index is a primary key index.
+ schema:
+ type: boolean
+ title: primary
+ description: The primary is whether the index is a primary key index.
+ - name: metadata.schemas.tables.indexes.visible
+ in: query
+ description: The visible is whether the index is visible.
+ schema:
+ type: boolean
+ title: visible
+ description: The visible is whether the index is visible.
+ - name: metadata.schemas.tables.indexes.comment
+ in: query
+ description: The comment is the comment of an index.
+ schema:
+ type: string
+ title: comment
+ description: The comment is the comment of an index.
+ - name: metadata.schemas.tables.indexes.definition
+ in: query
+ description: The definition of an index.
+ schema:
+ type: string
+ title: definition
+ description: The definition of an index.
+ - name: metadata.schemas.tables.indexes.parentIndexSchema
+ in: query
+ description: The schema name of the parent index.
+ schema:
+ type: string
+ title: parent_index_schema
+ description: The schema name of the parent index.
+ - name: metadata.schemas.tables.indexes.parentIndexName
+ in: query
+ description: The index name of the parent index.
+ schema:
+ type: string
+ title: parent_index_name
+ description: The index name of the parent index.
+ - name: metadata.schemas.tables.indexes.granularity
+ in: query
+ description: The number of granules in the block. It's a ClickHouse specific field.
+ schema:
+ type:
+ - integer
+ - string
+ title: granularity
+ format: int64
+ description: The number of granules in the block. It's a ClickHouse specific field.
+ - name: metadata.schemas.tables.indexes.isConstraint
+ in: query
+ description: |-
+ It's a PostgreSQL specific field.
+ The unique constraint and unique index are not the same thing in PostgreSQL.
+ schema:
+ type: boolean
+ title: is_constraint
description: |-
- Gets the catalog metadata for a database.
- Permissions required: bb.databaseCatalogs.get
- operationId: DatabaseCatalogService_GetDatabaseCatalog
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseCatalog'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - DatabaseCatalogService
+ It's a PostgreSQL specific field.
+ The unique constraint and unique index are not the same thing in PostgreSQL.
+ - name: metadata.schemas.tables.indexes.spatialConfig.method
+ in: query
+ description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
+ schema:
+ type: string
+ title: method
+ description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
+ - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.scheme
+ in: query
+ description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
+ schema:
+ type: string
+ title: scheme
+ description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
+ - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.gridLevels.level
+ in: query
+ description: Grid level number (1-4 for SQL Server)
+ schema:
+ type: integer
+ title: level
+ format: int32
+ description: Grid level number (1-4 for SQL Server)
+ - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.gridLevels.density
+ in: query
+ description: Grid density (LOW, MEDIUM, HIGH)
+ schema:
+ type: string
+ title: density
+ description: Grid density (LOW, MEDIUM, HIGH)
+ - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.cellsPerObject
+ in: query
+ description: Number of cells per object (1-8192 for SQL Server)
+ schema:
+ type: integer
+ title: cells_per_object
+ format: int32
+ description: Number of cells per object (1-8192 for SQL Server)
+ - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.xmin
+ in: query
+ description: Minimum X coordinate
+ schema:
+ type: number
+ title: xmin
+ format: double
+ description: Minimum X coordinate
+ - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.ymin
+ in: query
+ description: Minimum Y coordinate
+ schema:
+ type: number
+ title: ymin
+ format: double
+ description: Minimum Y coordinate
+ - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.xmax
+ in: query
+ description: Maximum X coordinate
+ schema:
+ type: number
+ title: xmax
+ format: double
+ description: Maximum X coordinate
+ - name: metadata.schemas.tables.indexes.spatialConfig.tessellation.boundingBox.ymax
+ in: query
+ description: Maximum Y coordinate
+ schema:
+ type: number
+ title: ymax
+ format: double
+ description: Maximum Y coordinate
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.fillfactor
+ in: query
+ description: Fill factor percentage (1-100)
+ schema:
+ type: integer
+ title: fillfactor
+ format: int32
+ description: Fill factor percentage (1-100)
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.buffering
+ in: query
+ description: Buffering mode for PostgreSQL (auto, on, off)
+ schema:
+ type: string
+ title: buffering
+ description: Buffering mode for PostgreSQL (auto, on, off)
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.tablespace
+ in: query
+ description: Tablespace configuration for Oracle
+ schema:
+ type: string
+ title: tablespace
+ description: Tablespace configuration for Oracle
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.workTablespace
+ in: query
+ schema:
+ type: string
+ title: work_tablespace
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.sdoLevel
+ in: query
+ schema:
+ type: integer
+ title: sdo_level
+ format: int32
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.commitInterval
+ in: query
+ schema:
+ type: integer
+ title: commit_interval
+ format: int32
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.padIndex
+ in: query
+ description: SQL Server specific parameters
+ schema:
+ type: boolean
+ title: pad_index
+ description: SQL Server specific parameters
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.sortInTempdb
+ in: query
+ description: ON, OFF
+ schema:
+ type: string
+ title: sort_in_tempdb
+ description: ON, OFF
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.dropExisting
+ in: query
+ schema:
+ type: boolean
+ title: drop_existing
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.online
+ in: query
+ schema:
+ type: boolean
+ title: online
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.allowRowLocks
+ in: query
+ schema:
+ type: boolean
+ title: allow_row_locks
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.allowPageLocks
+ in: query
+ schema:
+ type: boolean
+ title: allow_page_locks
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.maxdop
+ in: query
+ schema:
+ type: integer
+ title: maxdop
+ format: int32
+ - name: metadata.schemas.tables.indexes.spatialConfig.storage.dataCompression
+ in: query
+ description: NONE, ROW, PAGE
+ schema:
+ type: string
+ title: data_compression
+ description: NONE, ROW, PAGE
+ - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.dimensions
+ in: query
+ description: Number of dimensions (2-4, default 2)
+ schema:
+ type: integer
+ title: dimensions
+ format: int32
+ description: Number of dimensions (2-4, default 2)
+ - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.dataType
+ in: query
+ description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
+ schema:
+ type: string
+ title: data_type
+ description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
+ - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.srid
+ in: query
+ description: Spatial reference system identifier (SRID)
+ schema:
+ type: integer
+ title: srid
+ format: int32
+ description: Spatial reference system identifier (SRID)
+ - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.dimension
+ in: query
+ description: Dimension name/type (X, Y, Z, M, etc.)
+ schema:
+ type: string
+ title: dimension
+ description: Dimension name/type (X, Y, Z, M, etc.)
+ - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.minValue
+ in: query
+ description: Minimum value for this dimension
+ schema:
+ type: number
+ title: min_value
+ format: double
+ description: Minimum value for this dimension
+ - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.maxValue
+ in: query
+ description: Maximum value for this dimension
+ schema:
+ type: number
+ title: max_value
+ format: double
+ description: Maximum value for this dimension
+ - name: metadata.schemas.tables.indexes.spatialConfig.dimensional.constraints.tolerance
+ in: query
+ description: Tolerance for this dimension
+ schema:
+ type: number
+ title: tolerance
+ format: double
+ description: Tolerance for this dimension
+ - name: metadata.schemas.tables.indexes.opclassNames
+ in: query
+ description: |-
+ https://www.postgresql.org/docs/current/catalog-pg-opclass.html
+ Name of the operator class for each column. (PostgreSQL specific).
+ schema:
+ type: array
+ items:
+ type: string
+ title: opclass_names
description: |-
- Updates catalog metadata such as classifications and labels.
- Permissions required: bb.databaseCatalogs.update
- operationId: DatabaseCatalogService_UpdateDatabaseCatalog
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the database catalog is not found, a new database catalog will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseCatalog'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseCatalog'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/changelogs:
- get:
- tags:
- - DatabaseService
+ https://www.postgresql.org/docs/current/catalog-pg-opclass.html
+ Name of the operator class for each column. (PostgreSQL specific).
+ - name: metadata.schemas.tables.indexes.opclassDefaults
+ in: query
+ description: True if the operator class is the default. (PostgreSQL specific).
+ schema:
+ type: array
+ items:
+ type: boolean
+ title: opclass_defaults
+ description: True if the operator class is the default. (PostgreSQL specific).
+ - name: metadata.schemas.tables.engine
+ in: query
+ description: The engine is the engine of a table.
+ schema:
+ type: string
+ title: engine
+ description: The engine is the engine of a table.
+ - name: metadata.schemas.tables.collation
+ in: query
+ description: The collation is the collation of a table.
+ schema:
+ type: string
+ title: collation
+ description: The collation is the collation of a table.
+ - name: metadata.schemas.tables.charset
+ in: query
+ description: The character set of table.
+ schema:
+ type: string
+ title: charset
+ description: The character set of table.
+ - name: metadata.schemas.tables.rowCount
+ in: query
+ description: The row_count is the estimated number of rows of a table.
+ schema:
+ type:
+ - integer
+ - string
+ title: row_count
+ format: int64
+ description: The row_count is the estimated number of rows of a table.
+ - name: metadata.schemas.tables.dataSize
+ in: query
+ description: The data_size is the estimated data size of a table.
+ schema:
+ type:
+ - integer
+ - string
+ title: data_size
+ format: int64
+ description: The data_size is the estimated data size of a table.
+ - name: metadata.schemas.tables.indexSize
+ in: query
+ description: The index_size is the estimated index size of a table.
+ schema:
+ type:
+ - integer
+ - string
+ title: index_size
+ format: int64
+ description: The index_size is the estimated index size of a table.
+ - name: metadata.schemas.tables.dataFree
+ in: query
+ description: The data_free is the estimated free data size of a table.
+ schema:
+ type:
+ - integer
+ - string
+ title: data_free
+ format: int64
+ description: The data_free is the estimated free data size of a table.
+ - name: metadata.schemas.tables.createOptions
+ in: query
+ description: The create_options is the create option of a table.
+ schema:
+ type: string
+ title: create_options
+ description: The create_options is the create option of a table.
+ - name: metadata.schemas.tables.comment
+ in: query
+ description: The comment is the comment of a table.
+ schema:
+ type: string
+ title: comment
+ description: The comment is the comment of a table.
+ - name: metadata.schemas.tables.foreignKeys.name
+ in: query
+ description: The name is the name of a foreign key.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a foreign key.
+ - name: metadata.schemas.tables.foreignKeys.columns
+ in: query
+ description: The columns are the ordered referencing columns of a foreign key.
+ schema:
+ type: array
+ items:
+ type: string
+ title: columns
+ description: The columns are the ordered referencing columns of a foreign key.
+ - name: metadata.schemas.tables.foreignKeys.referencedSchema
+ in: query
+ description: |-
+ The referenced_schema is the referenced schema name of a foreign key.
+ It is an empty string for databases without such concept such as MySQL.
+ schema:
+ type: string
+ title: referenced_schema
description: |-
- Lists migration history for a database.
- Permissions required: bb.changelogs.list
- operationId: DatabaseService_ListChangelogs
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
+ The referenced_schema is the referenced schema name of a foreign key.
+ It is an empty string for databases without such concept such as MySQL.
+ - name: metadata.schemas.tables.foreignKeys.referencedTable
+ in: query
+ description: The referenced_table is the referenced table name of a foreign key.
+ schema:
+ type: string
+ title: referenced_table
+ description: The referenced_table is the referenced table name of a foreign key.
+ - name: metadata.schemas.tables.foreignKeys.referencedColumns
+ in: query
+ description: The referenced_columns are the ordered referenced columns of a foreign key.
+ schema:
+ type: array
+ items:
+ type: string
+ title: referenced_columns
+ description: The referenced_columns are the ordered referenced columns of a foreign key.
+ - name: metadata.schemas.tables.foreignKeys.onDelete
+ in: query
+ description: The on_delete is the on delete action of a foreign key.
+ schema:
+ type: string
+ title: on_delete
+ description: The on_delete is the on delete action of a foreign key.
+ - name: metadata.schemas.tables.foreignKeys.onUpdate
+ in: query
+ description: The on_update is the on update action of a foreign key.
+ schema:
+ type: string
+ title: on_update
+ description: The on_update is the on update action of a foreign key.
+ - name: metadata.schemas.tables.foreignKeys.matchType
+ in: query
+ description: |-
+ The match_type is the match type of a foreign key.
+ The match_type is the PostgreSQL specific field.
+ It's empty string for other databases.
+ schema:
+ type: string
+ title: match_type
+ description: |-
+ The match_type is the match type of a foreign key.
+ The match_type is the PostgreSQL specific field.
+ It's empty string for other databases.
+ - name: metadata.schemas.tables.partitions.name
+ in: query
+ description: The name is the name of a table partition.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a table partition.
+ - name: metadata.schemas.tables.partitions.type
+ in: query
+ description: The type of a table partition.
+ schema:
+ title: type
+ description: The type of a table partition.
+ $ref: '#/components/schemas/bytebase.v1.TablePartitionMetadata.Type'
+ - name: metadata.schemas.tables.partitions.expression
+ in: query
+ description: |-
+ The expression is the expression of a table partition.
+ For PostgreSQL, the expression is the text of {FOR VALUES
+ partition_bound_spec}, see
+ https://www.postgresql.org/docs/current/sql-createtable.html. For MySQL,
+ the expression is the `expr` or `column_list` of the following syntax.
+ PARTITION BY
+ { [LINEAR] HASH(expr)
+ | [LINEAR] KEY [ALGORITHM={1 | 2}] (column_list)
+ | RANGE{(expr) | COLUMNS(column_list)}
+ | LIST{(expr) | COLUMNS(column_list)} }.
+ schema:
+ type: string
+ title: expression
+ description: |-
+ The expression is the expression of a table partition.
+ For PostgreSQL, the expression is the text of {FOR VALUES
+ partition_bound_spec}, see
+ https://www.postgresql.org/docs/current/sql-createtable.html. For MySQL,
+ the expression is the `expr` or `column_list` of the following syntax.
+ PARTITION BY
+ { [LINEAR] HASH(expr)
+ | [LINEAR] KEY [ALGORITHM={1 | 2}] (column_list)
+ | RANGE{(expr) | COLUMNS(column_list)}
+ | LIST{(expr) | COLUMNS(column_list)} }.
+ - name: metadata.schemas.tables.partitions.value
+ in: query
+ description: |-
+ The value is the value of a table partition.
+ For MySQL, the value is for RANGE and LIST partition types,
+ - For a RANGE partition, it contains the value set in the partition's
+ VALUES LESS THAN clause, which can be either an integer or MAXVALUE.
+ - For a LIST partition, this column contains the values defined in the
+ partition's VALUES IN clause, which is a list of comma-separated integer
+ values.
+ - For others, it's an empty string.
+ schema:
+ type: string
+ title: value
+ description: |-
+ The value is the value of a table partition.
+ For MySQL, the value is for RANGE and LIST partition types,
+ - For a RANGE partition, it contains the value set in the partition's
+ VALUES LESS THAN clause, which can be either an integer or MAXVALUE.
+ - For a LIST partition, this column contains the values defined in the
+ partition's VALUES IN clause, which is a list of comma-separated integer
+ values.
+ - For others, it's an empty string.
+ - name: metadata.schemas.tables.partitions.useDefault
+ in: query
+ description: |-
+ The use_default is whether the users use the default partition, it stores
+ the different value for different database engines. For MySQL, it's [INT]
+ type, 0 means not use default partition, otherwise, it's equals to number
+ in syntax [SUB]PARTITION {number}.
+ schema:
+ type: string
+ title: use_default
+ description: |-
+ The use_default is whether the users use the default partition, it stores
+ the different value for different database engines. For MySQL, it's [INT]
+ type, 0 means not use default partition, otherwise, it's equals to number
+ in syntax [SUB]PARTITION {number}.
+ - name: metadata.schemas.tables.partitions.subpartitions.checkConstraints.name
+ in: query
+ description: The name is the name of a check constraint.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a check constraint.
+ - name: metadata.schemas.tables.partitions.subpartitions.checkConstraints.expression
+ in: query
+ description: The expression is the expression of a check constraint.
+ schema:
+ type: string
+ title: expression
+ description: The expression is the expression of a check constraint.
+ - name: metadata.schemas.tables.owner
+ in: query
+ description: The owner of the table.
+ schema:
+ type: string
+ title: owner
+ description: The owner of the table.
+ - name: metadata.schemas.tables.sortingKeys
+ in: query
+ description: |-
+ The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.
+ Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by
+ schema:
+ type: array
+ items:
+ type: string
+ title: sorting_keys
+ description: |-
+ The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.
+ Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by
+ - name: metadata.schemas.tables.triggers.name
+ in: query
+ description: The name is the name of the trigger.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of the trigger.
+ - name: metadata.schemas.tables.triggers.event
+ in: query
+ description: |-
+ The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
+ TRUNCATE.
+ schema:
+ type: string
+ title: event
+ description: |-
+ The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
+ TRUNCATE.
+ - name: metadata.schemas.tables.triggers.timing
+ in: query
+ description: The timing is the timing of the trigger, such as BEFORE, AFTER.
+ schema:
+ type: string
+ title: timing
+ description: The timing is the timing of the trigger, such as BEFORE, AFTER.
+ - name: metadata.schemas.tables.triggers.body
+ in: query
+ description: The body is the body of the trigger.
+ schema:
+ type: string
+ title: body
+ description: The body is the body of the trigger.
+ - name: metadata.schemas.tables.triggers.sqlMode
+ in: query
+ description: The SQL mode setting for the trigger.
+ schema:
+ type: string
+ title: sql_mode
+ description: The SQL mode setting for the trigger.
+ - name: metadata.schemas.tables.triggers.characterSetClient
+ in: query
+ description: The character set used by the client creating the trigger.
+ schema:
+ type: string
+ title: character_set_client
+ description: The character set used by the client creating the trigger.
+ - name: metadata.schemas.tables.triggers.collationConnection
+ in: query
+ description: The collation used for the connection when creating the trigger.
+ schema:
+ type: string
+ title: collation_connection
+ description: The collation used for the connection when creating the trigger.
+ - name: metadata.schemas.tables.triggers.comment
+ in: query
+ description: The comment describing the trigger.
+ schema:
+ type: string
+ title: comment
+ description: The comment describing the trigger.
+ - name: metadata.schemas.tables.triggers.skipDump
+ in: query
+ description: Whether to skip this trigger during schema dump operations.
+ schema:
+ type: boolean
+ title: skip_dump
+ description: Whether to skip this trigger during schema dump operations.
+ - name: metadata.schemas.tables.skipDump
+ in: query
+ description: Whether to skip this table during schema dump operations.
+ schema:
+ type: boolean
+ title: skip_dump
+ description: Whether to skip this table during schema dump operations.
+ - name: metadata.schemas.tables.shardingInfo
+ in: query
+ description: https://docs.pingcap.com/tidb/stable/information-schema-tables/
+ schema:
+ type: string
+ title: sharding_info
+ description: https://docs.pingcap.com/tidb/stable/information-schema-tables/
+ - name: metadata.schemas.tables.primaryKeyType
+ in: query
+ description: |-
+ https://docs.pingcap.com/tidb/stable/clustered-indexes/#clustered-indexes
+ CLUSTERED or NONCLUSTERED.
+ schema:
+ type: string
+ title: primary_key_type
+ description: |-
+ https://docs.pingcap.com/tidb/stable/clustered-indexes/#clustered-indexes
+ CLUSTERED or NONCLUSTERED.
+ - name: metadata.schemas.externalTables.name
+ in: query
+ description: The name is the name of a external table.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a external table.
+ - name: metadata.schemas.externalTables.externalServerName
+ in: query
+ description: The external_server_name is the name of the external server.
+ schema:
+ type: string
+ title: external_server_name
+ description: The external_server_name is the name of the external server.
+ - name: metadata.schemas.externalTables.externalDatabaseName
+ in: query
+ description: The external_database_name is the name of the external database.
+ schema:
+ type: string
+ title: external_database_name
+ description: The external_database_name is the name of the external database.
+ - name: metadata.schemas.views.name
+ in: query
+ description: The name is the name of a view.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a view.
+ - name: metadata.schemas.views.definition
+ in: query
+ description: The definition is the definition of a view.
+ schema:
+ type: string
+ title: definition
+ description: The definition is the definition of a view.
+ - name: metadata.schemas.views.comment
+ in: query
+ description: The comment is the comment of a view.
+ schema:
+ type: string
+ title: comment
+ description: The comment is the comment of a view.
+ - name: metadata.schemas.views.dependencyColumns.schema
+ in: query
+ description: The schema is the schema of a reference column.
+ schema:
+ type: string
+ title: schema
+ description: The schema is the schema of a reference column.
+ - name: metadata.schemas.views.dependencyColumns.table
+ in: query
+ description: The table is the table of a reference column.
+ schema:
+ type: string
+ title: table
+ description: The table is the table of a reference column.
+ - name: metadata.schemas.views.dependencyColumns.column
+ in: query
+ description: The column is the name of a reference column.
+ schema:
+ type: string
+ title: column
+ description: The column is the name of a reference column.
+ - name: metadata.schemas.views.skipDump
+ in: query
+ schema:
+ type: boolean
+ title: skip_dump
+ - name: metadata.schemas.functions.name
+ in: query
+ description: The name is the name of a function.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a function.
+ - name: metadata.schemas.functions.definition
+ in: query
+ description: The definition is the definition of a function.
+ schema:
+ type: string
+ title: definition
+ description: The definition is the definition of a function.
+ - name: metadata.schemas.functions.signature
+ in: query
+ description: |-
+ The signature is the name with the number and type of input arguments the
+ function takes.
+ schema:
+ type: string
+ title: signature
+ description: |-
+ The signature is the name with the number and type of input arguments the
+ function takes.
+ - name: metadata.schemas.functions.characterSetClient
+ in: query
+ description: MySQL specific metadata.
+ schema:
+ type: string
+ title: character_set_client
+ description: MySQL specific metadata.
+ - name: metadata.schemas.functions.collationConnection
+ in: query
+ schema:
+ type: string
+ title: collation_connection
+ - name: metadata.schemas.functions.databaseCollation
+ in: query
+ schema:
+ type: string
+ title: database_collation
+ - name: metadata.schemas.functions.sqlMode
+ in: query
+ schema:
+ type: string
+ title: sql_mode
+ - name: metadata.schemas.functions.comment
+ in: query
+ schema:
+ type: string
+ title: comment
+ - name: metadata.schemas.functions.dependencyTables.schema
+ in: query
+ description: The schema is the schema of a reference table.
+ schema:
+ type: string
+ title: schema
+ description: The schema is the schema of a reference table.
+ - name: metadata.schemas.functions.dependencyTables.table
+ in: query
+ description: The table is the name of a reference table.
+ schema:
+ type: string
+ title: table
+ description: The table is the name of a reference table.
+ - name: metadata.schemas.functions.skipDump
+ in: query
+ schema:
+ type: boolean
+ title: skip_dump
+ - name: metadata.schemas.procedures.name
+ in: query
+ description: The name is the name of a procedure.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a procedure.
+ - name: metadata.schemas.procedures.definition
+ in: query
+ description: The definition is the definition of a procedure.
+ schema:
+ type: string
+ title: definition
+ description: The definition is the definition of a procedure.
+ - name: metadata.schemas.procedures.signature
+ in: query
+ description: |-
+ The signature is the name with the number and type of input arguments the
+ procedure takes.
+ schema:
+ type: string
+ title: signature
+ description: |-
+ The signature is the name with the number and type of input arguments the
+ procedure takes.
+ - name: metadata.schemas.procedures.characterSetClient
+ in: query
+ description: MySQL specific metadata.
+ schema:
+ type: string
+ title: character_set_client
+ description: MySQL specific metadata.
+ - name: metadata.schemas.procedures.collationConnection
+ in: query
+ schema:
+ type: string
+ title: collation_connection
+ - name: metadata.schemas.procedures.databaseCollation
+ in: query
+ schema:
+ type: string
+ title: database_collation
+ - name: metadata.schemas.procedures.sqlMode
+ in: query
+ schema:
+ type: string
+ title: sql_mode
+ - name: metadata.schemas.procedures.comment
+ in: query
+ description: The comment is the comment of a procedure.
+ schema:
+ type: string
+ title: comment
+ description: The comment is the comment of a procedure.
+ - name: metadata.schemas.procedures.skipDump
+ in: query
+ schema:
+ type: boolean
+ title: skip_dump
+ - name: metadata.schemas.streams.name
+ in: query
+ description: The name is the name of a stream.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a stream.
+ - name: metadata.schemas.streams.tableName
+ in: query
+ description: The table_name is the name of the table/view that the stream is created on.
+ schema:
+ type: string
+ title: table_name
+ description: The table_name is the name of the table/view that the stream is created on.
+ - name: metadata.schemas.streams.owner
+ in: query
+ description: The owner of the stream.
+ schema:
+ type: string
+ title: owner
+ description: The owner of the stream.
+ - name: metadata.schemas.streams.comment
+ in: query
+ description: The comment of the stream.
+ schema:
+ type: string
+ title: comment
+ description: The comment of the stream.
+ - name: metadata.schemas.streams.type
+ in: query
+ description: The type of the stream.
+ schema:
+ title: type
+ description: The type of the stream.
+ $ref: '#/components/schemas/bytebase.v1.StreamMetadata.Type'
+ - name: metadata.schemas.streams.stale
+ in: query
+ description: Indicates whether the stream was last read before the `stale_after` time.
+ schema:
+ type: boolean
+ title: stale
+ description: Indicates whether the stream was last read before the `stale_after` time.
+ - name: metadata.schemas.streams.mode
+ in: query
+ description: The mode of the stream.
+ schema:
+ title: mode
+ description: The mode of the stream.
+ $ref: '#/components/schemas/bytebase.v1.StreamMetadata.Mode'
+ - name: metadata.schemas.streams.definition
+ in: query
+ description: The definition of the stream.
+ schema:
+ type: string
+ title: definition
+ description: The definition of the stream.
+ - name: metadata.schemas.tasks.name
+ in: query
+ description: The name is the name of a task.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a task.
+ - name: metadata.schemas.tasks.id
+ in: query
+ description: |-
+ The id is the snowflake-generated id of a task.
+ Example: 01ad32a0-1bb6-5e93-0000-000000000001
+ schema:
+ type: string
+ title: id
+ description: |-
+ The id is the snowflake-generated id of a task.
+ Example: 01ad32a0-1bb6-5e93-0000-000000000001
+ - name: metadata.schemas.tasks.owner
+ in: query
+ description: The owner of the task.
+ schema:
+ type: string
+ title: owner
+ description: The owner of the task.
+ - name: metadata.schemas.tasks.comment
+ in: query
+ description: The comment of the task.
+ schema:
+ type: string
+ title: comment
+ description: The comment of the task.
+ - name: metadata.schemas.tasks.warehouse
+ in: query
+ description: The warehouse of the task.
+ schema:
+ type: string
+ title: warehouse
+ description: The warehouse of the task.
+ - name: metadata.schemas.tasks.schedule
+ in: query
+ description: The schedule interval of the task.
+ schema:
+ type: string
+ title: schedule
+ description: The schedule interval of the task.
+ - name: metadata.schemas.tasks.predecessors
+ in: query
+ description: The predecessor tasks of the task.
+ schema:
+ type: array
+ items:
+ type: string
+ title: predecessors
+ description: The predecessor tasks of the task.
+ - name: metadata.schemas.tasks.state
+ in: query
+ description: The state of the task.
+ schema:
+ title: state
+ description: The state of the task.
+ $ref: '#/components/schemas/bytebase.v1.TaskMetadata.State'
+ - name: metadata.schemas.tasks.condition
+ in: query
+ description: The condition of the task.
+ schema:
+ type: string
+ title: condition
+ description: The condition of the task.
+ - name: metadata.schemas.tasks.definition
+ in: query
+ description: The definition of the task.
+ schema:
+ type: string
+ title: definition
+ description: The definition of the task.
+ - name: metadata.schemas.materializedViews.name
+ in: query
+ description: The name is the name of a materialized view.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a materialized view.
+ - name: metadata.schemas.materializedViews.definition
+ in: query
+ description: The definition is the definition of a materialized view.
+ schema:
+ type: string
+ title: definition
+ description: The definition is the definition of a materialized view.
+ - name: metadata.schemas.materializedViews.comment
+ in: query
+ description: The comment is the comment of a materialized view.
+ schema:
+ type: string
+ title: comment
+ description: The comment is the comment of a materialized view.
+ - name: metadata.schemas.materializedViews.skipDump
+ in: query
+ schema:
+ type: boolean
+ title: skip_dump
+ - name: metadata.schemas.packages.name
+ in: query
+ description: The name is the name of a package.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of a package.
+ - name: metadata.schemas.packages.definition
+ in: query
+ description: The definition is the definition of a package.
+ schema:
+ type: string
+ title: definition
+ description: The definition is the definition of a package.
+ - name: metadata.schemas.owner
+ in: query
+ description: The owner of the schema.
+ schema:
+ type: string
+ title: owner
+ description: The owner of the schema.
+ - name: metadata.schemas.sequences.name
+ in: query
+ description: The name of a sequence.
+ schema:
+ type: string
+ title: name
+ description: The name of a sequence.
+ - name: metadata.schemas.sequences.dataType
+ in: query
+ description: The data type of a sequence.
+ schema:
+ type: string
+ title: data_type
+ description: The data type of a sequence.
+ - name: metadata.schemas.sequences.start
+ in: query
+ description: The start value of a sequence.
+ schema:
+ type: string
+ title: start
+ description: The start value of a sequence.
+ - name: metadata.schemas.sequences.minValue
+ in: query
+ description: The minimum value of a sequence.
+ schema:
+ type: string
+ title: min_value
+ description: The minimum value of a sequence.
+ - name: metadata.schemas.sequences.maxValue
+ in: query
+ description: The maximum value of a sequence.
+ schema:
+ type: string
+ title: max_value
+ description: The maximum value of a sequence.
+ - name: metadata.schemas.sequences.increment
+ in: query
+ description: Increment value of a sequence.
+ schema:
+ type: string
+ title: increment
+ description: Increment value of a sequence.
+ - name: metadata.schemas.sequences.cycle
+ in: query
+ description: Cycle is whether the sequence cycles.
+ schema:
+ type: boolean
+ title: cycle
+ description: Cycle is whether the sequence cycles.
+ - name: metadata.schemas.sequences.cacheSize
+ in: query
+ description: Cache size of a sequence.
+ schema:
+ type: string
+ title: cache_size
+ description: Cache size of a sequence.
+ - name: metadata.schemas.sequences.lastValue
+ in: query
+ description: Last value of a sequence.
+ schema:
+ type: string
+ title: last_value
+ description: Last value of a sequence.
+ - name: metadata.schemas.sequences.ownerTable
+ in: query
+ description: The owner table of the sequence.
+ schema:
+ type: string
+ title: owner_table
+ description: The owner table of the sequence.
+ - name: metadata.schemas.sequences.ownerColumn
+ in: query
+ description: The owner column of the sequence.
+ schema:
+ type: string
+ title: owner_column
+ description: The owner column of the sequence.
+ - name: metadata.schemas.sequences.comment
+ in: query
+ description: The comment describing the sequence.
+ schema:
+ type: string
+ title: comment
+ description: The comment describing the sequence.
+ - name: metadata.schemas.sequences.skipDump
+ in: query
+ description: Whether to skip this sequence during schema dump operations.
+ schema:
+ type: boolean
+ title: skip_dump
+ description: Whether to skip this sequence during schema dump operations.
+ - name: metadata.schemas.events.name
+ in: query
+ description: The name of the event.
+ schema:
+ type: string
+ title: name
+ description: The name of the event.
+ - name: metadata.schemas.events.definition
+ in: query
+ description: The schedule of the event.
+ schema:
+ type: string
+ title: definition
+ description: The schedule of the event.
+ - name: metadata.schemas.events.timeZone
+ in: query
+ description: The time zone of the event.
+ schema:
+ type: string
+ title: time_zone
+ description: The time zone of the event.
+ - name: metadata.schemas.events.sqlMode
+ in: query
+ description: The SQL mode setting for the event.
+ schema:
+ type: string
+ title: sql_mode
+ description: The SQL mode setting for the event.
+ - name: metadata.schemas.events.characterSetClient
+ in: query
+ description: The character set used by the client creating the event.
+ schema:
+ type: string
+ title: character_set_client
+ description: The character set used by the client creating the event.
+ - name: metadata.schemas.events.collationConnection
+ in: query
+ description: The collation used for the connection when creating the event.
+ schema:
+ type: string
+ title: collation_connection
+ description: The collation used for the connection when creating the event.
+ - name: metadata.schemas.events.comment
+ in: query
+ description: The comment is the comment of an event.
+ schema:
+ type: string
+ title: comment
+ description: The comment is the comment of an event.
+ - name: metadata.schemas.enumTypes.name
+ in: query
+ description: The name of a type.
+ schema:
+ type: string
+ title: name
+ description: The name of a type.
+ - name: metadata.schemas.enumTypes.values
+ in: query
+ description: The enum values of a type.
+ schema:
+ type: array
+ items:
+ type: string
+ title: values
+ description: The enum values of a type.
+ - name: metadata.schemas.enumTypes.comment
+ in: query
+ description: The comment describing the enum type.
+ schema:
+ type: string
+ title: comment
+ description: The comment describing the enum type.
+ - name: metadata.schemas.enumTypes.skipDump
+ in: query
+ description: Whether to skip this enum type during schema dump operations.
+ schema:
+ type: boolean
+ title: skip_dump
+ description: Whether to skip this enum type during schema dump operations.
+ - name: metadata.schemas.skipDump
+ in: query
+ description: Whether to skip this schema during schema dump operations.
+ schema:
+ type: boolean
+ title: skip_dump
+ description: Whether to skip this schema during schema dump operations.
+ - name: metadata.schemas.comment
+ in: query
+ description: The comment is the comment of a schema.
+ schema:
+ type: string
+ title: comment
+ description: The comment is the comment of a schema.
+ - name: metadata.characterSet
+ in: query
+ description: The character_set is the character set of a database.
+ schema:
+ type: string
+ title: character_set
+ description: The character_set is the character set of a database.
+ - name: metadata.collation
+ in: query
+ description: The collation is the collation of a database.
+ schema:
+ type: string
+ title: collation
+ description: The collation is the collation of a database.
+ - name: metadata.extensions.name
+ in: query
+ description: The name is the name of an extension.
+ schema:
+ type: string
+ title: name
+ description: The name is the name of an extension.
+ - name: metadata.extensions.schema
+ in: query
+ description: |-
+ The schema is the extension that is installed to. But the extension usage
+ is not limited to the schema.
+ schema:
+ type: string
+ title: schema
+ description: |-
+ The schema is the extension that is installed to. But the extension usage
+ is not limited to the schema.
+ - name: metadata.extensions.version
+ in: query
+ description: The version is the version of an extension.
+ schema:
+ type: string
+ title: version
+ description: The version is the version of an extension.
+ - name: metadata.extensions.description
+ in: query
+ description: The description is the description of an extension.
+ schema:
+ type: string
+ title: description
+ description: The description is the description of an extension.
+ - name: metadata.owner
+ in: query
+ description: The owner of the database.
+ schema:
+ type: string
+ title: owner
+ description: The owner of the database.
+ - name: metadata.searchPath
+ in: query
+ description: The search_path is the search path of a PostgreSQL database.
+ schema:
+ type: string
+ title: search_path
+ description: The search_path is the search path of a PostgreSQL database.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.GetSchemaStringResponse'
+ /v1/instances/{instance}/databases/{database}/sdlSchema:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: GetDatabaseSDLSchema
+ description: |-
+ Retrieves database schema in SDL (Schema Definition Language) format.
+ Permissions required: bb.databases.getSchema
+ operationId: bytebase.v1.DatabaseService.GetDatabaseSDLSchema
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: format
+ in: query
+ description: The format of the SDL schema output.
+ schema:
+ title: format
+ description: The format of the SDL schema output.
+ $ref: '#/components/schemas/bytebase.v1.GetDatabaseSDLSchemaRequest.SDLFormat'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DatabaseSDLSchema'
+ /v1/instances/{instance}/databases/{database}:diffSchema:
+ post:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: DiffSchema
+ description: |-
+ Compares and generates migration statements between two schemas.
+ Permissions required: bb.databases.get
+ operationId: bytebase.v1.DatabaseService.DiffSchema
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DiffSchemaResponse'
+ /v1/instances/{instance}/databases/{database}:export:
+ post:
+ tags:
+ - bytebase.v1.SQLService
+ summary: Export
+ description: |-
+ Exports query results to a file format.
+ Permissions required: bb.databases.get
+ operationId: bytebase.v1.SQLService.Export
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ statement:
+ type: string
+ title: statement
+ description: The SQL statement to execute.
+ limit:
+ type: integer
+ title: limit
+ format: int32
+ description: The maximum number of rows to return.
+ format:
+ title: format
+ description: The export format.
+ $ref: '#/components/schemas/bytebase.v1.ExportFormat'
+ admin:
+ type: boolean
+ title: admin
description: |-
- The maximum number of changelogs to return. The service may return fewer
- than this value. If unspecified, at most 10 changelogs will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
+ The admin is used for workspace owner and DBA for exporting data from SQL
+ Editor Admin mode. The exported data is not masked.
+ password:
+ type: string
+ title: password
+ description: The zip password provide by users.
+ dataSourceId:
+ type: string
+ title: data_source_id
description: |-
- A page token, received from the previous call.
- Provide this to retrieve the subsequent page.
-
- When paginating, all other parameters provided must match
- the call that provided the page token.
- schema:
- type: string
- - name: view
- in: query
- schema:
- enum:
- - CHANGELOG_VIEW_UNSPECIFIED
- - CHANGELOG_VIEW_BASIC
- - CHANGELOG_VIEW_FULL
- type: string
- format: enum
- - name: filter
- in: query
+ The id of data source.
+ It is used for querying admin data source even if the instance has
+ read-only data sources. Or it can be used to query a specific read-only
+ data source.
+ schema:
+ type: string
+ title: schema
description: |-
- Filter is used to filter changelogs returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Supported filter:
- status: the changelog status, support "==" operation. check Changelog.Status for available values.
- type: the changelog type, support "in" and "==" operation. check Changelog.Type for available values.
-
- Example:
- status == "DONE"
- type in ["BASELINE", "MIGRATE"]
- status == "FAILED" && type == "SDL"
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListChangelogsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/changelogs/{changelog}:
- get:
- tags:
- - DatabaseService
- description: |-
- Retrieves a specific changelog entry.
- Permissions required: bb.changelogs.get
- operationId: DatabaseService_GetChangelog
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: changelog
- in: path
- description: The changelog id.
- required: true
- schema:
- type: string
- - name: view
- in: query
- schema:
- enum:
- - CHANGELOG_VIEW_UNSPECIFIED
- - CHANGELOG_VIEW_BASIC
- - CHANGELOG_VIEW_FULL
+ The default schema to search objects. Equals to the current schema in
+ Oracle and search path in Postgres.
+ nullable: true
+ title: ExportRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ExportResponse'
+ /v1/instances/{instance}/databases/{database}:query:
+ post:
+ tags:
+ - bytebase.v1.SQLService
+ summary: Query
+ description: |-
+ Executes a read-only SQL query against a database.
+ Permissions required: bb.databases.get
+ operationId: bytebase.v1.SQLService.Query
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ statement:
+ type: string
+ title: statement
+ description: The SQL statement to execute.
+ limit:
+ type: integer
+ title: limit
+ format: int32
+ description: The maximum number of rows to return.
+ dataSourceId:
+ type: string
+ title: data_source_id
+ description: |-
+ The id of data source.
+ It is used for querying admin data source even if the instance has
+ read-only data sources. Or it can be used to query a specific read-only
+ data source.
+ explain:
+ type: boolean
+ title: explain
+ description: Explain the statement.
+ schema:
+ type: string
+ title: schema
+ description: |-
+ The default schema to search objects. Equals to the current schema in
+ Oracle and search path in Postgres.
+ nullable: true
+ queryOption:
+ title: query_option
+ $ref: '#/components/schemas/bytebase.v1.QueryOption'
+ container:
+ type: string
+ title: container
+ description: |-
+ Container is the container name to execute the query against, used for
+ CosmosDB only.
+ nullable: true
+ title: QueryRequest
+ required:
+ - dataSourceId
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.QueryResponse'
+ /v1/instances/{instance}/databases/{database}:sync:
+ post:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: SyncDatabase
+ description: |-
+ Synchronizes database schema from the instance.
+ Permissions required: bb.databases.sync
+ operationId: bytebase.v1.DatabaseService.SyncDatabase
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SyncDatabaseResponse'
+ /v1/instances/{instance}/databases:batchGet:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: BatchGetDatabases
+ description: |-
+ Retrieves multiple databases by their names.
+ Permissions required: bb.databases.get
+ operationId: bytebase.v1.DatabaseService.BatchGetDatabases2
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: names
+ in: query
+ description: The list of database names to retrieve.
+ required: true
+ schema:
+ type: array
+ items:
+ type: string
+ title: names
+ description: The list of database names to retrieve.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchGetDatabasesResponse'
+ /v1/instances/{instance}/databases:batchSync:
+ post:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: BatchSyncDatabases
+ description: |-
+ Synchronizes multiple databases in a single batch operation.
+ Permissions required: bb.databases.sync
+ operationId: bytebase.v1.DatabaseService.BatchSyncDatabases
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ names:
+ type: array
+ items:
type: string
- format: enum
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Changelog'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/changelogs/{changelog}:diffSchema:
- post:
- tags:
- - DatabaseService
+ title: names
+ description: The list of database names to sync.
+ title: BatchSyncDatabasesRequest
+ required:
+ - names
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchSyncDatabasesResponse'
+ /v1/instances/{instance}/databases:batchUpdate:
+ post:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: BatchUpdateDatabases
+ description: |-
+ Updates multiple databases in a single batch operation.
+ Permissions required: bb.databases.update
+ operationId: bytebase.v1.DatabaseService.BatchUpdateDatabases
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ requests:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.UpdateDatabaseRequest'
+ title: requests
+ description: |-
+ The request message specifying the resources to update.
+ A maximum of 1000 databases can be modified in a batch.
+ title: BatchUpdateDatabasesRequest
+ required:
+ - requests
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchUpdateDatabasesResponse'
+ /v1/instances/{instance}/policies:
+ get:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: ListPolicies
+ description: |-
+ Lists policies at a specified resource level.
+ Permissions required: bb.policies.list
+ operationId: bytebase.v1.OrgPolicyService.ListPolicies4
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: policyType
+ in: query
+ description: Filter by specific policy type.
+ schema:
+ title: policy_type
+ description: Filter by specific policy type.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ - name: showDeleted
+ in: query
+ description: Show deleted policies if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted policies if specified.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListPoliciesResponse'
+ post:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: CreatePolicy
+ description: |-
+ Creates a new organizational policy.
+ Permissions required: bb.policies.create
+ operationId: bytebase.v1.OrgPolicyService.CreatePolicy4
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: type
+ in: query
+ description: The type of policy to create.
+ schema:
+ title: type
+ description: The type of policy to create.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ requestBody:
+ description: The policy to create.
+ content:
+ application/json:
+ schema:
+ title: policy
+ description: The policy to create.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ /v1/instances/{instance}/policies/{policy}:
+ get:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: GetPolicy
+ description: |-
+ Retrieves a policy by name.
+ Permissions required: bb.policies.get
+ operationId: bytebase.v1.OrgPolicyService.GetPolicy4
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ delete:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: DeletePolicy
+ description: |-
+ Deletes an organizational policy.
+ Permissions required: bb.policies.delete
+ operationId: bytebase.v1.OrgPolicyService.DeletePolicy4
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: UpdatePolicy
+ description: |-
+ Updates an existing organizational policy.
+ Permissions required: bb.policies.update
+ operationId: bytebase.v1.OrgPolicyService.UpdatePolicy4
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Compares and generates migration statements between two schemas.
- Permissions required: bb.databases.get
- operationId: DatabaseService_DiffSchema
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: changelog
- in: path
- description: The changelog id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DiffSchemaRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DiffSchemaResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/metadata:
- get:
- tags:
- - DatabaseService
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ content:
+ application/json:
+ schema:
+ title: policy
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ /v1/instances/{instance}/roles:
+ get:
+ tags:
+ - bytebase.v1.InstanceRoleService
+ summary: ListInstanceRoles
+ description: |-
+ Lists all database roles in an instance.
+ Permissions required: bb.instanceRoles.list
+ operationId: bytebase.v1.InstanceRoleService.ListInstanceRoles
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ Not used.
+ The maximum number of roles to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 roles will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Retrieves database metadata including tables, columns, and indexes.
- Permissions required: bb.databases.getSchema
- operationId: DatabaseService_GetDatabaseMetadata
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: filter
- in: query
- description: |-
- Filter is used to filter databases returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ Not used.
+ The maximum number of roles to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 roles will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ Not used.
+ A page token, received from a previous `ListInstanceRoles` call.
+ Provide this to retrieve the subsequent page.
- Supported filter:
- - schema: the schema name, support "==" operator.
- - table: the table name, support "==" and ".matches()" operator.
+ When paginating, all other parameters provided to `ListInstanceRoles` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
+ description: |-
+ Not used.
+ A page token, received from a previous `ListInstanceRoles` call.
+ Provide this to retrieve the subsequent page.
- For example:
- schema == "schema-a"
- table == "table-a"
- table.matches("table-a")
- schema == "schema-a" && table.matches("sample")
- The filter used to search table with wildcard "sample" in the schema "schemas/schema-a".
- The column masking level will only be returned when a table filter is used.
- schema:
- type: string
- - name: limit
- in: query
+ When paginating, all other parameters provided to `ListInstanceRoles` must match
+ the call that provided the page token.
+ - name: refresh
+ in: query
+ description: Refresh will refresh and return the latest data.
+ schema:
+ type: boolean
+ title: refresh
+ description: Refresh will refresh and return the latest data.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListInstanceRolesResponse'
+ /v1/instances/{instance}:addDataSource:
+ post:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: AddDataSource
+ description: |-
+ Adds a read-only data source to an instance.
+ Permissions required: bb.instances.update
+ operationId: bytebase.v1.InstanceService.AddDataSource
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ dataSource:
+ title: data_source
+ description: |-
+ Identified by data source ID.
+ Only READ_ONLY data source can be added.
+ $ref: '#/components/schemas/bytebase.v1.DataSource'
+ validateOnly:
+ type: boolean
+ title: validate_only
+ description: Validate only also tests the data source connection.
+ title: AddDataSourceRequest
+ required:
+ - dataSource
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ /v1/instances/{instance}:databases:
+ post:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: ListInstanceDatabase
+ description: |-
+ Lists all databases within an instance without creating them.
+ Permissions required: bb.instances.get
+ operationId: bytebase.v1.InstanceService.ListInstanceDatabase
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ instance:
+ title: instance
+ description: The target instance. We need to set this field if the target instance is not created yet.
+ nullable: true
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ title: ListInstanceDatabaseRequest
+ required:
+ - instance
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListInstanceDatabaseResponse'
+ /v1/instances/{instance}:removeDataSource:
+ post:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: RemoveDataSource
+ description: |-
+ Removes a read-only data source from an instance.
+ Permissions required: bb.instances.update
+ operationId: bytebase.v1.InstanceService.RemoveDataSource
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ dataSource:
+ title: data_source
+ description: |-
+ Identified by data source ID.
+ Only READ_ONLY data source can be removed.
+ $ref: '#/components/schemas/bytebase.v1.DataSource'
+ title: RemoveDataSourceRequest
+ required:
+ - dataSource
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ /v1/instances/{instance}:sync:
+ post:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: SyncInstance
+ description: |-
+ Syncs database schemas and metadata from an instance.
+ Permissions required: bb.instances.sync
+ operationId: bytebase.v1.InstanceService.SyncInstance
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ enableFullSync:
+ type: boolean
+ title: enable_full_sync
description: |-
- Limit the response size of returned table metadata per schema.
- For example, if the database has 3 schemas, and each schema has 100 tables,
- if limit is 20, then only 20 tables will be returned for each schema, total 60 tables.
- Default 0, means no limit.
- schema:
- type: integer
- format: int32
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseMetadata'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/policies:
- get:
- tags:
- - OrgPolicyService
+ When full sync is enabled, all databases in the instance will be synchronized. Otherwise, only
+ the instance metadata (such as the database list) and any newly discovered databases will be synced.
+ title: SyncInstanceRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SyncInstanceResponse'
+ /v1/instances/{instance}:undelete:
+ post:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: UndeleteInstance
+ description: |-
+ Restores a soft-deleted database instance.
+ Permissions required: bb.instances.undelete
+ operationId: bytebase.v1.InstanceService.UndeleteInstance
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ /v1/instances/{instance}:updateDataSource:
+ patch:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: UpdateDataSource
+ description: |-
+ Updates a data source configuration.
+ Permissions required: bb.instances.update
+ operationId: bytebase.v1.InstanceService.UpdateDataSource
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: validateOnly
+ in: query
+ description: Validate only also tests the data source connection.
+ schema:
+ type: boolean
+ title: validate_only
+ description: Validate only also tests the data source connection.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the data source is not found, a new data source will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Lists policies at a specified resource level.
- Permissions required: bb.policies.list
- operationId: OrgPolicyService_ListPolicies
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: policyType
- in: query
- description: Filter by specific policy type.
- schema:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- format: enum
- - name: showDeleted
- in: query
- description: Show deleted policies if specified.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListPoliciesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - OrgPolicyService
+ If set to true, and the data source is not found, a new data source will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: Identified by data source ID.
+ content:
+ application/json:
+ schema:
+ title: data_source
+ description: Identified by data source ID.
+ $ref: '#/components/schemas/bytebase.v1.DataSource'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ /v1/instances:batchSync:
+ post:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: BatchSyncInstances
+ description: |-
+ Syncs multiple instances in a single request.
+ Permissions required: bb.instances.sync
+ operationId: bytebase.v1.InstanceService.BatchSyncInstances
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchSyncInstancesRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchSyncInstancesResponse'
+ /v1/instances:batchUpdate:
+ post:
+ tags:
+ - bytebase.v1.InstanceService
+ summary: BatchUpdateInstances
+ description: |-
+ Updates multiple instances in a single request.
+ Permissions required: bb.instances.update
+ operationId: bytebase.v1.InstanceService.BatchUpdateInstances
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchUpdateInstancesRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchUpdateInstancesResponse'
+ /v1/policies:
+ get:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: ListPolicies
+ description: |-
+ Lists policies at a specified resource level.
+ Permissions required: bb.policies.list
+ operationId: bytebase.v1.OrgPolicyService.ListPolicies
+ parameters:
+ - name: parent
+ in: query
+ description: |-
+ The parent, which owns this collection of policies.
+ Format: {resource type}/{resource id}
+ required: true
+ schema:
+ type: string
+ title: parent
description: |-
- Creates a new organizational policy.
- Permissions required: bb.policies.create
- operationId: OrgPolicyService_CreatePolicy
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: type
- in: query
- description: The type of policy to create.
- schema:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- format: enum
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/policies/{policy}:
- get:
- tags:
- - OrgPolicyService
+ The parent, which owns this collection of policies.
+ Format: {resource type}/{resource id}
+ - name: policyType
+ in: query
+ description: Filter by specific policy type.
+ schema:
+ title: policy_type
+ description: Filter by specific policy type.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ - name: showDeleted
+ in: query
+ description: Show deleted policies if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted policies if specified.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListPoliciesResponse'
+ post:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: CreatePolicy
+ description: |-
+ Creates a new organizational policy.
+ Permissions required: bb.policies.create
+ operationId: bytebase.v1.OrgPolicyService.CreatePolicy
+ parameters:
+ - name: parent
+ in: query
+ description: |-
+ The parent resource where this instance will be created.
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ required: true
+ schema:
+ type: string
+ title: parent
description: |-
- Retrieves a policy by name.
- Permissions required: bb.policies.get
- operationId: OrgPolicyService_GetPolicy
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - OrgPolicyService
+ The parent resource where this instance will be created.
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ - name: type
+ in: query
+ description: The type of policy to create.
+ schema:
+ title: type
+ description: The type of policy to create.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ requestBody:
+ description: The policy to create.
+ content:
+ application/json:
+ schema:
+ title: policy
+ description: The policy to create.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ /v1/policies/{policy}:
+ get:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: GetPolicy
+ description: |-
+ Retrieves a policy by name.
+ Permissions required: bb.policies.get
+ operationId: bytebase.v1.OrgPolicyService.GetPolicy
+ parameters:
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ delete:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: DeletePolicy
+ description: |-
+ Deletes an organizational policy.
+ Permissions required: bb.policies.delete
+ operationId: bytebase.v1.OrgPolicyService.DeletePolicy
+ parameters:
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: UpdatePolicy
+ description: |-
+ Updates an existing organizational policy.
+ Permissions required: bb.policies.update
+ operationId: bytebase.v1.OrgPolicyService.UpdatePolicy
+ parameters:
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Deletes an organizational policy.
- Permissions required: bb.policies.delete
- operationId: OrgPolicyService_DeletePolicy
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - OrgPolicyService
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ content:
+ application/json:
+ schema:
+ title: policy
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ /v1/projects:
+ get:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: ListProjects
+ description: |-
+ Lists all projects in the workspace with optional filtering.
+ Permissions required: bb.projects.list
+ operationId: bytebase.v1.ProjectService.ListProjects
+ parameters:
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of projects to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 projects will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Updates an existing organizational policy.
- Permissions required: bb.policies.update
- operationId: OrgPolicyService_UpdatePolicy
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the policy is not found, a new policy will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/revisions:
- get:
- tags:
- - RevisionService
+ The maximum number of projects to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 projects will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListProjects` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListProjects` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Lists schema revisions for a database.
- Permissions required: bb.revisions.list
- operationId: RevisionService_ListRevisions
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- The maximum number of revisions to return. The service may return fewer
- than this value. If unspecified, at most 10 revisions will be returned. The
- maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListRevisions` call.
- Provide this to retrieve the subsequent page.
+ A page token, received from a previous `ListProjects` call.
+ Provide this to retrieve the subsequent page.
- When paginating, all other parameters provided to `ListRevisions` must
- match the call that provided the page token.
- schema:
- type: string
- - name: showDeleted
- in: query
- description: Whether to include deleted revisions in the results.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListRevisionsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/revisions/{revision}:
- get:
- tags:
- - RevisionService
+ When paginating, all other parameters provided to `ListProjects` must match
+ the call that provided the page token.
+ - name: showDeleted
+ in: query
+ description: Show deleted projects if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted projects if specified.
+ - name: filter
+ in: query
+ description: |-
+ Filter the project.
+ Check filter for SearchProjectsRequest for details.
+ Supports filtering by name, resource_id, state, and labels (e.g., labels.environment == "production").
+ schema:
+ type: string
+ title: filter
description: |-
- Retrieves a schema revision by name.
- Permissions required: bb.revisions.get
- operationId: RevisionService_GetRevision
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: revision
- in: path
- description: The revision id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Revision'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - RevisionService
+ Filter the project.
+ Check filter for SearchProjectsRequest for details.
+ Supports filtering by name, resource_id, state, and labels (e.g., labels.environment == "production").
+ - name: orderBy
+ in: query
+ description: |-
+ The order by of projects.
+ Support title. The default sorting order is ascending.
+ For example:
+ - order_by = "title"
+ - order_by = "title desc"
+ - order_by = "title asc"
+ schema:
+ type: string
+ title: order_by
description: |-
- Deletes a schema revision.
- Permissions required: bb.revisions.delete
- operationId: RevisionService_DeleteRevision
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: revision
- in: path
- description: The revision id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/revisions:batchCreate:
- post:
- tags:
- - RevisionService
+ The order by of projects.
+ Support title. The default sorting order is ascending.
+ For example:
+ - order_by = "title"
+ - order_by = "title desc"
+ - order_by = "title asc"
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListProjectsResponse'
+ post:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: CreateProject
+ description: |-
+ Creates a new project in the workspace.
+ Permissions required: bb.projects.create
+ operationId: bytebase.v1.ProjectService.CreateProject
+ parameters:
+ - name: projectId
+ in: query
+ description: |-
+ The ID to use for the project, which will become the final component of
+ the project's resource name.
+
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ schema:
+ type: string
+ title: project_id
description: |-
- Creates multiple schema revisions in a single operation.
- Permissions required: bb.revisions.create
- operationId: RevisionService_BatchCreateRevisions
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchCreateRevisionsRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchCreateRevisionsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/schema:
- get:
- tags:
- - DatabaseService
+ The ID to use for the project, which will become the final component of
+ the project's resource name.
+
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ requestBody:
+ description: The project to create.
+ content:
+ application/json:
+ schema:
+ title: project
+ description: The project to create.
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ /v1/projects/{project}:
+ get:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: GetProject
+ description: |-
+ GetProject retrieves a project by name.
+ Users with "bb.projects.get" permission on the workspace or the project owner can access this method.
+ Permissions required: bb.projects.get
+ operationId: bytebase.v1.ProjectService.GetProject
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ delete:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: DeleteProject
+ description: |-
+ Deletes (soft-delete or purge) a project.
+ Permissions required: bb.projects.delete
+ operationId: bytebase.v1.ProjectService.DeleteProject
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: force
+ in: query
+ description: |-
+ If set to true, any databases from this project will be moved to default project.
+ Sheets are not moved since BYTEBASE_ARTIFACT sheets belong to the issue and issue project.
+ Open issues will remain open but associated with the deleted project.
+ If set to false, the operation will fail if the project has databases or open issues.
+ schema:
+ type: boolean
+ title: force
description: |-
- Retrieves database schema as DDL statements.
- Permissions required: bb.databases.getSchema
- operationId: DatabaseService_GetDatabaseSchema
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseSchema'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/schemaString:
- get:
- tags:
- - DatabaseService
+ If set to true, any databases from this project will be moved to default project.
+ Sheets are not moved since BYTEBASE_ARTIFACT sheets belong to the issue and issue project.
+ Open issues will remain open but associated with the deleted project.
+ If set to false, the operation will fail if the project has databases or open issues.
+ - name: purge
+ in: query
+ description: |-
+ If set to true, permanently purge the soft-deleted project and all related resources.
+ This operation is irreversible. Following AIP-165, this should only be used for
+ administrative cleanup of old soft-deleted projects.
+ The project must already be soft-deleted for this to work.
+ schema:
+ type: boolean
+ title: purge
description: |-
- Generates schema DDL for a database object.
- Permissions required: bb.databases.getSchema
- operationId: DatabaseService_GetSchemaString
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: type
- in: query
- schema:
- enum:
- - OBJECT_TYPE_UNSPECIFIED
- - DATABASE
- - SCHEMA
- - TABLE
- - VIEW
- - MATERIALIZED_VIEW
- - FUNCTION
- - PROCEDURE
- - SEQUENCE
- type: string
- format: enum
- - name: schema
- in: query
- description: It's empty for DATABASE.
- schema:
- type: string
- - name: object
- in: query
- description: It's empty for DATABASE and SCHEMA.
- schema:
- type: string
- - name: metadata.name
- in: query
+ If set to true, permanently purge the soft-deleted project and all related resources.
+ This operation is irreversible. Following AIP-165, this should only be used for
+ administrative cleanup of old soft-deleted projects.
+ The project must already be soft-deleted for this to work.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: UpdateProject
+ description: |-
+ Updates an existing project's properties.
+ Permissions required: bb.projects.update
+ operationId: bytebase.v1.ProjectService.UpdateProject
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the project is not found, a new project will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the project is not found, a new project will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The project to update.
+
+ The project's `name` field is used to identify the project to update.
+ Format: projects/{project}
+ content:
+ application/json:
+ schema:
+ title: project
+ description: |-
+ The project to update.
+
+ The project's `name` field is used to identify the project to update.
+ Format: projects/{project}
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ /v1/projects/{project}/auditLogs:export:
+ post:
+ tags:
+ - bytebase.v1.AuditLogService
+ summary: ExportAuditLogs
+ description: |-
+ Exports audit logs in a specified format for external analysis.
+ Permissions required: bb.auditLogs.export
+ operationId: bytebase.v1.AuditLogService.ExportAuditLogs
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ filter:
+ type: string
+ title: filter
+ description: |-
+ The filter of the log. It should be a valid CEL expression.
+ Check the filter field in the SearchAuditLogsRequest message.
+ orderBy:
+ type: string
+ title: order_by
+ description: |-
+ The order by of the log.
+ Only support order by create_time. The default sorting order is ascending.
+ For example:
+ - order_by = "create_time asc"
+ - order_by = "create_time desc"
+ format:
+ title: format
+ description: The export format.
+ $ref: '#/components/schemas/bytebase.v1.ExportFormat'
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of logs to return.
+ The service may return fewer than this value.
+ If unspecified, at most 10 log entries will be returned.
+ The maximum value is 5000; values above 5000 will be coerced to 5000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ExportAuditLogs` call.
+ Provide this to retrieve the subsequent page.
+ title: ExportAuditLogsRequest
+ additionalProperties: false
+ description: Request message for exporting audit logs.
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ExportAuditLogsResponse'
+ /v1/projects/{project}/auditLogs:search:
+ post:
+ tags:
+ - bytebase.v1.AuditLogService
+ summary: SearchAuditLogs
+ description: |-
+ Searches audit logs with optional filtering and pagination.
+ Permissions required: bb.auditLogs.search
+ operationId: bytebase.v1.AuditLogService.SearchAuditLogs
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ filter:
+ type: string
+ title: filter
description: |-
- The database metadata name.
+ The filter of the log. It should be a valid CEL expression.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- Format: instances/{instance}/databases/{database}/metadata
- schema:
- type: string
- - name: metadata.characterSet
- in: query
- description: The character_set is the character set of a database.
- schema:
- type: string
- - name: metadata.collation
- in: query
- description: The collation is the collation of a database.
- schema:
- type: string
- - name: metadata.owner
- in: query
- description: The owner of the database.
- schema:
- type: string
- - name: metadata.searchPath
- in: query
- description: The search_path is the search path of a PostgreSQL database.
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/GetSchemaStringResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}/sdlSchema:
- get:
- tags:
- - DatabaseService
+ Supported filter:
+ - method: the API name, can be found in the docs, should start with "/bytebase.v1." prefix. For example "/bytebase.v1.UserService/CreateUser". Support "==" operator.
+ - severity: support "==" operator, check Severity enum in AuditLog message for values.
+ - user: the actor, should in "users/{email}" format, support "==" operator.
+ - create_time: support ">=" and "<=" operator.
+
+ For example:
+ - filter = "method == '/bytebase.v1.SQLService/Query'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/[email protected]'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
+ orderBy:
+ type: string
+ title: order_by
+ description: |-
+ The order by of the log.
+ Only support order by create_time. The default sorting order is ascending.
+ For example:
+ - order_by = "create_time asc"
+ - order_by = "create_time desc"
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of logs to return.
+ The service may return fewer than this value.
+ If unspecified, at most 10 log entries will be returned.
+ The maximum value is 5000; values above 5000 will be coerced to 5000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `SearchLogs` call.
+ Provide this to retrieve the subsequent page.
+ title: SearchAuditLogsRequest
+ additionalProperties: false
+ description: Request message for searching audit logs.
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchAuditLogsResponse'
+ /v1/projects/{project}/databaseGroups:
+ get:
+ tags:
+ - bytebase.v1.DatabaseGroupService
+ summary: ListDatabaseGroups
+ description: |-
+ Lists database groups in a project.
+ Permissions required: bb.databaseGroups.list
+ operationId: bytebase.v1.DatabaseGroupService.ListDatabaseGroups
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: view
+ in: query
+ description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
+ schema:
+ title: view
+ description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroupView'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListDatabaseGroupsResponse'
+ post:
+ tags:
+ - bytebase.v1.DatabaseGroupService
+ summary: CreateDatabaseGroup
+ description: |-
+ Creates a new database group.
+ Permissions required: bb.databaseGroups.create
+ operationId: bytebase.v1.DatabaseGroupService.CreateDatabaseGroup
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: databaseGroupId
+ in: query
+ description: |-
+ The ID to use for the database group, which will become the final component of
+ the database group's resource name.
+
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ schema:
+ type: string
+ title: database_group_id
description: |-
- Retrieves database schema in SDL (Schema Definition Language) format.
- Permissions required: bb.databases.getSchema
- operationId: DatabaseService_GetDatabaseSDLSchema
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- - name: format
- in: query
- description: The format of the SDL schema output.
- schema:
- enum:
- - SDL_FORMAT_UNSPECIFIED
- - SINGLE_FILE
- - MULTI_FILE
- type: string
- format: enum
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseSDLSchema'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}:diffSchema:
- post:
- tags:
- - DatabaseService
+ The ID to use for the database group, which will become the final component of
+ the database group's resource name.
+
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ - name: validateOnly
+ in: query
+ description: If set, validate the create request and preview the full database group response, but do not actually create it.
+ schema:
+ type: boolean
+ title: validate_only
+ description: If set, validate the create request and preview the full database group response, but do not actually create it.
+ requestBody:
+ description: The database group to create.
+ content:
+ application/json:
+ schema:
+ title: database_group
+ description: The database group to create.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
+ /v1/projects/{project}/databaseGroups/{databaseGroup}:
+ get:
+ tags:
+ - bytebase.v1.DatabaseGroupService
+ summary: GetDatabaseGroup
+ description: |-
+ Gets a database group by name.
+ Permissions required: bb.databaseGroups.get
+ operationId: bytebase.v1.DatabaseGroupService.GetDatabaseGroup
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: databaseGroup
+ in: path
+ description: The databaseGroup id.
+ required: true
+ schema:
+ type: string
+ - name: view
+ in: query
+ description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
+ schema:
+ title: view
+ description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroupView'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
+ delete:
+ tags:
+ - bytebase.v1.DatabaseGroupService
+ summary: DeleteDatabaseGroup
+ description: |-
+ Deletes a database group.
+ Permissions required: bb.databaseGroups.delete
+ operationId: bytebase.v1.DatabaseGroupService.DeleteDatabaseGroup
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: databaseGroup
+ in: path
+ description: The databaseGroup id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.DatabaseGroupService
+ summary: UpdateDatabaseGroup
+ description: |-
+ Updates a database group.
+ Permissions required: bb.databaseGroups.update
+ When allow_missing=true, also requires: bb.databaseGroups.create
+ operationId: bytebase.v1.DatabaseGroupService.UpdateDatabaseGroup
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: databaseGroup
+ in: path
+ description: The databaseGroup id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the database group is not found, a new database group will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Compares and generates migration statements between two schemas.
- Permissions required: bb.databases.get
- operationId: DatabaseService_DiffSchema
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DiffSchemaRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DiffSchemaResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}:export:
- post:
- tags:
- - SQLService
+ If set to true, and the database group is not found, a new database group will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The database group to update.
+
+ The database group's `name` field is used to identify the database group to update.
+ Format: projects/{project}/databaseGroups/{databaseGroup}
+ content:
+ application/json:
+ schema:
+ title: database_group
+ description: |-
+ The database group to update.
+
+ The database group's `name` field is used to identify the database group to update.
+ Format: projects/{project}/databaseGroups/{databaseGroup}
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
+ /v1/projects/{project}/databases:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: ListDatabases
+ description: |-
+ Lists databases in a project, instance, or workspace.
+ Permissions required: bb.projects.get (for project parent), bb.databases.list (for workspace parent), or bb.instances.get (for instance parent)
+ operationId: bytebase.v1.DatabaseService.ListDatabases
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of databases to return. The service may return fewer
+ than this value.
+ If unspecified, at most 10 databases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Exports query results to a file format.
- Permissions required: bb.databases.get
- operationId: SQLService_Export
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}:query:
- post:
- tags:
- - SQLService
+ The maximum number of databases to return. The service may return fewer
+ than this value.
+ If unspecified, at most 10 databases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListDatabases` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListDatabases` must
+ match the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Executes a read-only SQL query against a database.
- Permissions required: bb.databases.get
- operationId: SQLService_Query
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/QueryRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/QueryResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases/{database}:sync:
- post:
- tags:
- - DatabaseService
+ A page token, received from a previous `ListDatabases` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListDatabases` must
+ match the call that provided the page token.
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - name: the database name, support ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
+ - table: filter by the database table, support "==" and ".matches()" operator.
+ - labels.{key}: the database label, support "==" and "in" operators.
+
+ For example:
+ environment == "environments/{environment resource id}"
+ environment == "" (find databases which environment is not set)
+ project == "projects/{project resource id}"
+ instance == "instances/{instance resource id}"
+ name.matches("database name")
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ exclude_unassigned == true
+ drifted == true
+ table == "sample"
+ table.matches("sam")
+ labels.environment == "production"
+ labels.region == "asia"
+ labels.region in ["asia", "europe"]
+
+ You can combine filter conditions like:
+ environment == "environments/prod" && name.matches("employee")
+ schema:
+ type: string
+ title: filter
description: |-
- Synchronizes database schema from the instance.
- Permissions required: bb.databases.sync
- operationId: DatabaseService_SyncDatabase
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: database
- in: path
- description: The database id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SyncDatabaseRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SyncDatabaseResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases:batchGet:
- get:
- tags:
- - DatabaseService
+ Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - name: the database name, support ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
+ - table: filter by the database table, support "==" and ".matches()" operator.
+ - labels.{key}: the database label, support "==" and "in" operators.
+
+ For example:
+ environment == "environments/{environment resource id}"
+ environment == "" (find databases which environment is not set)
+ project == "projects/{project resource id}"
+ instance == "instances/{instance resource id}"
+ name.matches("database name")
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ exclude_unassigned == true
+ drifted == true
+ table == "sample"
+ table.matches("sam")
+ labels.environment == "production"
+ labels.region == "asia"
+ labels.region in ["asia", "europe"]
+
+ You can combine filter conditions like:
+ environment == "environments/prod" && name.matches("employee")
+ - name: showDeleted
+ in: query
+ description: Show deleted database if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted database if specified.
+ - name: orderBy
+ in: query
+ description: |-
+ The order by of databases.
+ Support name, project, instance. The default sorting order is ascending.
+ For example:
+ - order_by = "name" - order by name ascending
+ - order_by = "name desc"
+ - order_by = "name desc, project asc"
+ schema:
+ type: string
+ title: order_by
description: |-
- Retrieves multiple databases by their names.
- Permissions required: bb.databases.get
- operationId: DatabaseService_BatchGetDatabases
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: names
- in: query
- description: The list of database names to retrieve.
- schema:
- type: array
- items:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchGetDatabasesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases:batchSync:
- post:
- tags:
- - DatabaseService
+ The order by of databases.
+ Support name, project, instance. The default sorting order is ascending.
+ For example:
+ - order_by = "name" - order by name ascending
+ - order_by = "name desc"
+ - order_by = "name desc, project asc"
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListDatabasesResponse'
+ /v1/projects/{project}/databases:batchGet:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: BatchGetDatabases
+ description: |-
+ Retrieves multiple databases by their names.
+ Permissions required: bb.databases.get
+ operationId: bytebase.v1.DatabaseService.BatchGetDatabases
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: names
+ in: query
+ description: The list of database names to retrieve.
+ required: true
+ schema:
+ type: array
+ items:
+ type: string
+ title: names
+ description: The list of database names to retrieve.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchGetDatabasesResponse'
+ /v1/projects/{project}/issues:
+ get:
+ tags:
+ - bytebase.v1.IssueService
+ summary: ListIssues
+ description: |-
+ Lists issues in a project.
+ Permissions required: bb.issues.list
+ operationId: bytebase.v1.IssueService.ListIssues
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of issues to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 issues will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Synchronizes multiple databases in a single batch operation.
- Permissions required: bb.databases.sync
- operationId: DatabaseService_BatchSyncDatabases
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchSyncDatabasesRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchSyncDatabasesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/databases:batchUpdate:
- post:
- tags:
- - DatabaseService
+ The maximum number of issues to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 issues will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListIssues` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListIssues` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Updates multiple databases in a single batch operation.
- Permissions required: bb.databases.update
- operationId: DatabaseService_BatchUpdateDatabases
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchUpdateDatabasesRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchUpdateDatabasesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/policies:
- get:
- tags:
- - OrgPolicyService
+ A page token, received from a previous `ListIssues` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListIssues` must match
+ the call that provided the page token.
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter issues returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
+ - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
+ - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
+ - labels: the issue labels, support "==" and "in" operator.
+ - approval_status: issue approval status, support "==" operator.
+ - current_approver: the issue approver, should in "users/{email} format", support "==" operator.
+
+ For example:
+ creator == "users/[email protected]" && status in ["OPEN", "DONE"]
+ status == "CANCELED" && type == "DATABASE_CHANGE"
+ labels in ["label1", "label2"]
+ create_time >= "2025-01-02T15:04:05Z07:00"
+ schema:
+ type: string
+ title: filter
description: |-
- Lists policies at a specified resource level.
- Permissions required: bb.policies.list
- operationId: OrgPolicyService_ListPolicies
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: policyType
- in: query
- description: Filter by specific policy type.
- schema:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- format: enum
- - name: showDeleted
- in: query
- description: Show deleted policies if specified.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListPoliciesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - OrgPolicyService
+ Filter is used to filter issues returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
+ - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
+ - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
+ - labels: the issue labels, support "==" and "in" operator.
+ - approval_status: issue approval status, support "==" operator.
+ - current_approver: the issue approver, should in "users/{email} format", support "==" operator.
+
+ For example:
+ creator == "users/[email protected]" && status in ["OPEN", "DONE"]
+ status == "CANCELED" && type == "DATABASE_CHANGE"
+ labels in ["label1", "label2"]
+ create_time >= "2025-01-02T15:04:05Z07:00"
+ - name: query
+ in: query
+ description: Query is the query statement.
+ schema:
+ type: string
+ title: query
+ description: Query is the query statement.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListIssuesResponse'
+ post:
+ tags:
+ - bytebase.v1.IssueService
+ summary: CreateIssue
+ description: |-
+ Creates a new issue for database changes or tasks.
+ Permissions required: bb.issues.create
+ operationId: bytebase.v1.IssueService.CreateIssue
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: The issue to create.
+ content:
+ application/json:
+ schema:
+ title: issue
+ description: The issue to create.
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ /v1/projects/{project}/issues/{issue}:
+ get:
+ tags:
+ - bytebase.v1.IssueService
+ summary: GetIssue
+ description: |-
+ Retrieves an issue by name.
+ Permissions required: bb.issues.get
+ operationId: bytebase.v1.IssueService.GetIssue
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: issue
+ in: path
+ description: The issue id.
+ required: true
+ schema:
+ type: string
+ - name: force
+ in: query
+ description: If set to true, bypass cache and fetch the latest data.
+ schema:
+ type: boolean
+ title: force
+ description: If set to true, bypass cache and fetch the latest data.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ patch:
+ tags:
+ - bytebase.v1.IssueService
+ summary: UpdateIssue
+ description: |-
+ Updates an issue's properties such as title, description, or labels.
+ Permissions required: bb.issues.update
+ operationId: bytebase.v1.IssueService.UpdateIssue
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: issue
+ in: path
+ description: The issue id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the issue is not found, a new issue will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Creates a new organizational policy.
- Permissions required: bb.policies.create
- operationId: OrgPolicyService_CreatePolicy
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: type
- in: query
- description: The type of policy to create.
- schema:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- format: enum
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/policies/{policy}:
- get:
- tags:
- - OrgPolicyService
+ If set to true, and the issue is not found, a new issue will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The issue to update.
+
+ The issue's `name` field is used to identify the issue to update.
+ Format: projects/{project}/issues/{issue}
+ content:
+ application/json:
+ schema:
+ title: issue
+ description: |-
+ The issue to update.
+
+ The issue's `name` field is used to identify the issue to update.
+ Format: projects/{project}/issues/{issue}
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ /v1/projects/{project}/issues/{issue}/issueComments:
+ get:
+ tags:
+ - bytebase.v1.IssueService
+ summary: ListIssueComments
+ description: |-
+ Lists comments on an issue.
+ Permissions required: bb.issueComments.list
+ operationId: bytebase.v1.IssueService.ListIssueComments
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: issue
+ in: path
+ description: The issue id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of issue comments to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 issue comments will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Retrieves a policy by name.
- Permissions required: bb.policies.get
- operationId: OrgPolicyService_GetPolicy
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - OrgPolicyService
+ The maximum number of issue comments to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 issue comments will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListIssueComments` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListIssueComments` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Deletes an organizational policy.
- Permissions required: bb.policies.delete
- operationId: OrgPolicyService_DeletePolicy
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - OrgPolicyService
+ A page token, received from a previous `ListIssueComments` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListIssueComments` must match
+ the call that provided the page token.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListIssueCommentsResponse'
+ /v1/projects/{project}/issues/{issue}:approve:
+ post:
+ tags:
+ - bytebase.v1.IssueService
+ summary: ApproveIssue
+ description: |-
+ Approves an issue. Access determined by approval flow configuration - caller must be a designated approver for the current approval step.
+ Permissions required: None (determined by approval flow)
+ operationId: bytebase.v1.IssueService.ApproveIssue
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: issue
+ in: path
+ description: The issue id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ comment:
+ type: string
+ title: comment
+ description: The comment explaining the approval decision.
+ title: ApproveIssueRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ /v1/projects/{project}/issues/{issue}:comment:
+ post:
+ tags:
+ - bytebase.v1.IssueService
+ summary: CreateIssueComment
+ description: |-
+ Adds a comment to an issue.
+ Permissions required: bb.issueComments.create
+ operationId: bytebase.v1.IssueService.CreateIssueComment
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: issue
+ in: path
+ description: The issue id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: The comment to create.
+ content:
+ application/json:
+ schema:
+ title: issue_comment
+ description: The comment to create.
+ $ref: '#/components/schemas/bytebase.v1.IssueComment'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.IssueComment'
+ patch:
+ tags:
+ - bytebase.v1.IssueService
+ summary: UpdateIssueComment
+ description: |-
+ Updates an existing issue comment.
+ Permissions required: bb.issueComments.update
+ operationId: bytebase.v1.IssueService.UpdateIssueComment
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: issue
+ in: path
+ description: The issue id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the issue comment is not found, a new issue comment will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Updates an existing organizational policy.
- Permissions required: bb.policies.update
- operationId: OrgPolicyService_UpdatePolicy
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
+ If set to true, and the issue comment is not found, a new issue comment will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: The comment to update.
+ content:
+ application/json:
+ schema:
+ title: issue_comment
+ description: The comment to update.
+ $ref: '#/components/schemas/bytebase.v1.IssueComment'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.IssueComment'
+ /v1/projects/{project}/issues/{issue}:reject:
+ post:
+ tags:
+ - bytebase.v1.IssueService
+ summary: RejectIssue
+ description: |-
+ Rejects an issue. Access determined by approval flow configuration - caller must be a designated approver for the current approval step.
+ Permissions required: None (determined by approval flow)
+ operationId: bytebase.v1.IssueService.RejectIssue
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: issue
+ in: path
+ description: The issue id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ comment:
+ type: string
+ title: comment
+ description: The comment explaining the rejection decision.
+ title: RejectIssueRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ /v1/projects/{project}/issues/{issue}:request:
+ post:
+ tags:
+ - bytebase.v1.IssueService
+ summary: RequestIssue
+ description: |-
+ Requests changes on an issue. Access determined by approval flow configuration - caller must be a designated approver for the current approval step.
+ Permissions required: None (determined by approval flow)
+ operationId: bytebase.v1.IssueService.RequestIssue
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: issue
+ in: path
+ description: The issue id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ comment:
+ type: string
+ title: comment
+ description: The comment explaining the request.
+ title: RequestIssueRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ /v1/projects/{project}/issues:batchUpdateStatus:
+ post:
+ tags:
+ - bytebase.v1.IssueService
+ summary: BatchUpdateIssuesStatus
+ description: |-
+ Updates the status of multiple issues in a single operation.
+ Permissions required: bb.issues.update
+ operationId: bytebase.v1.IssueService.BatchUpdateIssuesStatus
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ issues:
+ type: array
+ items:
type: string
- format: field-mask
- - name: allowMissing
- in: query
+ title: issues
description: |-
- If set to true, and the policy is not found, a new policy will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}/roles:
- get:
- tags:
- - InstanceRoleService
- description: |-
- Lists all database roles in an instance.
- Permissions required: bb.instanceRoles.list
- operationId: InstanceRoleService_ListInstanceRoles
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
+ The list of issues to update.
+ Format: projects/{project}/issues/{issue}
+ status:
+ title: status
+ description: The new status.
+ $ref: '#/components/schemas/bytebase.v1.IssueStatus'
+ reason:
+ type: string
+ title: reason
+ description: The reason for the status change.
+ title: BatchUpdateIssuesStatusRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchUpdateIssuesStatusResponse'
+ /v1/projects/{project}/issues:search:
+ post:
+ tags:
+ - bytebase.v1.IssueService
+ summary: SearchIssues
+ description: |-
+ Search for issues that the caller has the bb.issues.get permission on and also satisfy the specified filter & query.
+ Permissions required: bb.issues.get
+ operationId: bytebase.v1.IssueService.SearchIssues
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Not used.
- The maximum number of roles to return. The service may return fewer than
+ The maximum number of issues to return. The service may return fewer than
this value.
- If unspecified, at most 10 roles will be returned.
+ If unspecified, at most 10 issues will be returned.
The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
+ pageToken:
+ type: string
+ title: page_token
description: |-
- Not used.
- A page token, received from a previous `ListInstanceRoles` call.
+ A page token, received from a previous `SearchIssues` call.
Provide this to retrieve the subsequent page.
- When paginating, all other parameters provided to `ListInstanceRoles` must match
+ When paginating, all other parameters provided to `SearchIssues` must match
the call that provided the page token.
- schema:
- type: string
- - name: refresh
- in: query
- description: Refresh will refresh and return the latest data.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListInstanceRolesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}:addDataSource:
- post:
- tags:
- - InstanceService
- description: |-
- Adds a read-only data source to an instance.
- Permissions required: bb.instances.update
- operationId: InstanceService_AddDataSource
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AddDataSourceRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Instance'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}:databases:
- post:
- tags:
- - InstanceService
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter issues returned in the list.
+ Check the filter field in the ListIssuesRequest message.
+ query:
+ type: string
+ title: query
+ description: Query is the query statement.
+ title: SearchIssuesRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchIssuesResponse'
+ /v1/projects/{project}/plans:
+ get:
+ tags:
+ - bytebase.v1.PlanService
+ summary: ListPlans
+ description: |-
+ Lists deployment plans in a project.
+ Permissions required: bb.plans.list
+ operationId: bytebase.v1.PlanService.ListPlans
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of plans to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 plans will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Lists all databases within an instance without creating them.
- Permissions required: bb.instances.get
- operationId: InstanceService_ListInstanceDatabase
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListInstanceDatabaseRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListInstanceDatabaseResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}:removeDataSource:
- post:
- tags:
- - InstanceService
+ The maximum number of plans to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 plans will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListPlans` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListPlans` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Removes a read-only data source from an instance.
- Permissions required: bb.instances.update
- operationId: InstanceService_RemoveDataSource
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RemoveDataSourceRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Instance'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}:sync:
- post:
- tags:
- - InstanceService
+ A page token, received from a previous `ListPlans` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListPlans` must match
+ the call that provided the page token.
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter plans returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
+ - create_time: the plan create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - has_rollout: whether the plan has rollout, support "==" operator, the value should be "true" or "false".
+ - has_issue: the plan has issue or not, support "==" operator, the value should be "true" or "false".
+ - title: the plan title, support "==" operator for exact match and ".matches()" operator for case-insensitive substring match.
+ - spec_type: the plan spec config type, support "==" operator, the value should be "create_database_config", "change_database_config", or "export_data_config".
+ - state: the plan state, support "==" operator, the value should be "ACTIVE" or "DELETED".
+
+ For example:
+ creator == "users/[email protected]" && create_time >= "2025-01-02T15:04:05Z07:00"
+ has_rollout == false && has_issue == true
+ title == "My Plan"
+ title.matches("database migration")
+ spec_type == "change_database_config"
+ state == "ACTIVE"
+ schema:
+ type: string
+ title: filter
description: |-
- Syncs database schemas and metadata from an instance.
- Permissions required: bb.instances.sync
- operationId: InstanceService_SyncInstance
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SyncInstanceRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SyncInstanceResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}:undelete:
- post:
- tags:
- - InstanceService
+ Filter is used to filter plans returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
+ - create_time: the plan create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - has_rollout: whether the plan has rollout, support "==" operator, the value should be "true" or "false".
+ - has_issue: the plan has issue or not, support "==" operator, the value should be "true" or "false".
+ - title: the plan title, support "==" operator for exact match and ".matches()" operator for case-insensitive substring match.
+ - spec_type: the plan spec config type, support "==" operator, the value should be "create_database_config", "change_database_config", or "export_data_config".
+ - state: the plan state, support "==" operator, the value should be "ACTIVE" or "DELETED".
+
+ For example:
+ creator == "users/[email protected]" && create_time >= "2025-01-02T15:04:05Z07:00"
+ has_rollout == false && has_issue == true
+ title == "My Plan"
+ title.matches("database migration")
+ spec_type == "change_database_config"
+ state == "ACTIVE"
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListPlansResponse'
+ post:
+ tags:
+ - bytebase.v1.PlanService
+ summary: CreatePlan
+ description: |-
+ Creates a new deployment plan.
+ Permissions required: bb.plans.create
+ operationId: bytebase.v1.PlanService.CreatePlan
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: The plan to create.
+ content:
+ application/json:
+ schema:
+ title: plan
+ description: The plan to create.
+ $ref: '#/components/schemas/bytebase.v1.Plan'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Plan'
+ /v1/projects/{project}/plans/{plan}:
+ get:
+ tags:
+ - bytebase.v1.PlanService
+ summary: GetPlan
+ description: |-
+ Retrieves a deployment plan by name.
+ Permissions required: bb.plans.get
+ operationId: bytebase.v1.PlanService.GetPlan
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Plan'
+ patch:
+ tags:
+ - bytebase.v1.PlanService
+ summary: UpdatePlan
+ description: |-
+ UpdatePlan updates the plan.
+ The plan creator and the user with bb.plans.update permission on the project can update the plan.
+ Permissions required: bb.plans.update (or creator)
+ operationId: bytebase.v1.PlanService.UpdatePlan
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the plan is not found, a new plan will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Restores a soft-deleted database instance.
- Permissions required: bb.instances.undelete
- operationId: InstanceService_UndeleteInstance
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
+ If set to true, and the plan is not found, a new plan will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The plan to update.
+
+ The plan's `name` field is used to identify the plan to update.
+ Format: projects/{project}/plans/{plan}
+ content:
+ application/json:
+ schema:
+ title: plan
+ description: |-
+ The plan to update.
+
+ The plan's `name` field is used to identify the plan to update.
+ Format: projects/{project}/plans/{plan}
+ $ref: '#/components/schemas/bytebase.v1.Plan'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Plan'
+ /v1/projects/{project}/plans/{plan}/planCheckRun:
+ get:
+ tags:
+ - bytebase.v1.PlanService
+ summary: GetPlanCheckRun
+ description: |-
+ Gets the plan check run for a deployment plan.
+ Permissions required: bb.planCheckRuns.get
+ operationId: bytebase.v1.PlanService.GetPlanCheckRun
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.PlanCheckRun'
+ /v1/projects/{project}/plans/{plan}/planCheckRun:cancel:
+ post:
+ tags:
+ - bytebase.v1.PlanService
+ summary: CancelPlanCheckRun
+ description: |-
+ Cancels the plan check run for a deployment plan.
+ Permissions required: bb.planCheckRuns.run
+ operationId: bytebase.v1.PlanService.CancelPlanCheckRun
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.CancelPlanCheckRunResponse'
+ /v1/projects/{project}/plans/{plan}/rollout:
+ get:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: GetRollout
+ description: |-
+ Retrieves a rollout by its plan name.
+ Permissions required: bb.rollouts.get
+ operationId: bytebase.v1.RolloutService.GetRollout
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Rollout'
+ post:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: CreateRollout
+ description: |-
+ Creates a new rollout for a plan.
+ Permissions required: bb.rollouts.create
+ operationId: bytebase.v1.RolloutService.CreateRollout
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ target:
+ type: string
+ title: target
+ description: |-
+ Create the rollout only for the specified target.
+ Format: environments/{environment}
+ If unspecified, all stages are created.
+ If set to "", no stages are created.
+ nullable: true
+ title: CreateRolloutRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Rollout'
+ /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/tasks:batchRun:
+ post:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: BatchRunTasks
+ description: |-
+ Executes multiple tasks in a rollout stage.
+ Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)
+ operationId: bytebase.v1.RolloutService.BatchRunTasks
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ - name: rollout
+ in: path
+ description: The rollout id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ tasks:
+ type: array
+ items:
type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UndeleteInstanceRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Instance'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances/{instance}:updateDataSource:
- patch:
- tags:
- - InstanceService
- description: |-
- Updates a data source configuration.
- Permissions required: bb.instances.update
- operationId: InstanceService_UpdateDataSource
- parameters:
- - name: instance
- in: path
- description: The instance id.
- required: true
- schema:
+ title: tasks
+ description: |-
+ The tasks to run.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
+ runTime:
+ title: run_time
+ description: The task run should run after run_time.
+ nullable: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ title: BatchRunTasksRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchRunTasksResponse'
+ /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/tasks:batchSkip:
+ post:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: BatchSkipTasks
+ description: |-
+ Skips multiple tasks in a rollout stage.
+ Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)
+ operationId: bytebase.v1.RolloutService.BatchSkipTasks
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ - name: rollout
+ in: path
+ description: The rollout id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ tasks:
+ type: array
+ items:
type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
+ title: tasks
+ description: |-
+ The tasks to skip.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
+ reason:
+ type: string
+ title: reason
+ maxLength: 1000
+ description: The reason for skipping the tasks.
+ title: BatchSkipTasksRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchSkipTasksResponse'
+ /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/taskRuns:
+ get:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: ListTaskRuns
+ description: |-
+ Lists task run executions for a task.
+ Permissions required: bb.taskRuns.list
+ operationId: bytebase.v1.RolloutService.ListTaskRuns
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ - name: rollout
+ in: path
+ description: The rollout id.
+ required: true
+ schema:
+ type: string
+ - name: '*'
+ in: path
+ description: The * id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListTaskRunsResponse'
+ /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/taskRuns:batchCancel:
+ post:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: BatchCancelTaskRuns
+ description: |-
+ Cancels multiple running task executions.
+ Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)
+ operationId: bytebase.v1.RolloutService.BatchCancelTaskRuns
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ - name: rollout
+ in: path
+ description: The rollout id.
+ required: true
+ schema:
+ type: string
+ - name: '*'
+ in: path
+ description: The * id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ taskRuns:
+ type: array
+ items:
type: string
- format: field-mask
- - name: validateOnly
- in: query
- description: Validate only also tests the data source connection.
- schema:
- type: boolean
- - name: allowMissing
- in: query
+ title: task_runs
description: |-
- If set to true, and the data source is not found, a new data source will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DataSource'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Instance'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances:batchSync:
- post:
- tags:
- - InstanceService
- description: |-
- Syncs multiple instances in a single request.
- Permissions required: bb.instances.sync
- operationId: InstanceService_BatchSyncInstances
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchSyncInstancesRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchSyncInstancesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/instances:batchUpdate:
- post:
- tags:
- - InstanceService
- description: |-
- Updates multiple instances in a single request.
- Permissions required: bb.instances.update
- operationId: InstanceService_BatchUpdateInstances
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchUpdateInstancesRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchUpdateInstancesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/policies:
- get:
- tags:
- - OrgPolicyService
- description: |-
- Lists policies at a specified resource level.
- Permissions required: bb.policies.list
- operationId: OrgPolicyService_ListPolicies
- parameters:
- - name: parent
- in: query
+ The taskRuns to cancel.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
+ title: BatchCancelTaskRunsRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchCancelTaskRunsResponse'
+ /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/{*}/*:
+ get:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: GetTaskRun
+ description: |-
+ Retrieves a task run by name.
+ Permissions required: bb.taskRuns.list
+ operationId: bytebase.v1.RolloutService.GetTaskRun
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ - name: rollout
+ in: path
+ description: The rollout id.
+ required: true
+ schema:
+ type: string
+ - name: '*'
+ in: path
+ description: The * id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.TaskRun'
+ /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/{*}/*/log:
+ get:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: GetTaskRunLog
+ description: |-
+ Retrieves execution logs for a task run.
+ Permissions required: bb.taskRuns.list
+ operationId: bytebase.v1.RolloutService.GetTaskRunLog
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ - name: rollout
+ in: path
+ description: The rollout id.
+ required: true
+ schema:
+ type: string
+ - name: '*'
+ in: path
+ description: The * id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLog'
+ /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/{*}/*/session:
+ get:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: GetTaskRunSession
+ description: |-
+ Retrieves database session information for a running task.
+ Permissions required: bb.taskRuns.list
+ operationId: bytebase.v1.RolloutService.GetTaskRunSession
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ - name: rollout
+ in: path
+ description: The rollout id.
+ required: true
+ schema:
+ type: string
+ - name: '*'
+ in: path
+ description: The * id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.TaskRunSession'
+ /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/{*}/*:previewRollback:
+ post:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: PreviewTaskRunRollback
+ description: |-
+ Generates rollback SQL for a completed task run.
+ Permissions required: bb.taskRuns.list
+ operationId: bytebase.v1.RolloutService.PreviewTaskRunRollback
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ - name: rollout
+ in: path
+ description: The rollout id.
+ required: true
+ schema:
+ type: string
+ - name: '*'
+ in: path
+ description: The * id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.PreviewTaskRunRollbackResponse'
+ /v1/projects/{project}/plans/{plan}:runPlanChecks:
+ post:
+ tags:
+ - bytebase.v1.PlanService
+ summary: RunPlanChecks
+ description: |-
+ Executes validation checks on a deployment plan.
+ Permissions required: bb.planCheckRuns.run
+ operationId: bytebase.v1.PlanService.RunPlanChecks
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: plan
+ in: path
+ description: The plan id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ specId:
+ type: string
+ title: spec_id
description: |-
- The parent, which owns this collection of policies.
- Format: {resource type}/{resource id}
- schema:
- type: string
- - name: policyType
- in: query
- description: Filter by specific policy type.
- schema:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- format: enum
- - name: showDeleted
- in: query
- description: Show deleted policies if specified.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListPoliciesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - OrgPolicyService
+ The UUID of the specific spec to run plan checks for.
+ This should match the spec.id field in Plan.Spec.
+ If not set, all specs in the plan will be used.
+ nullable: true
+ title: RunPlanChecksRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.RunPlanChecksResponse'
+ /v1/projects/{project}/policies:
+ get:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: ListPolicies
+ description: |-
+ Lists policies at a specified resource level.
+ Permissions required: bb.policies.list
+ operationId: bytebase.v1.OrgPolicyService.ListPolicies2
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: policyType
+ in: query
+ description: Filter by specific policy type.
+ schema:
+ title: policy_type
+ description: Filter by specific policy type.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ - name: showDeleted
+ in: query
+ description: Show deleted policies if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted policies if specified.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListPoliciesResponse'
+ post:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: CreatePolicy
+ description: |-
+ Creates a new organizational policy.
+ Permissions required: bb.policies.create
+ operationId: bytebase.v1.OrgPolicyService.CreatePolicy2
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: type
+ in: query
+ description: The type of policy to create.
+ schema:
+ title: type
+ description: The type of policy to create.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ requestBody:
+ description: The policy to create.
+ content:
+ application/json:
+ schema:
+ title: policy
+ description: The policy to create.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ /v1/projects/{project}/policies/{policy}:
+ get:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: GetPolicy
+ description: |-
+ Retrieves a policy by name.
+ Permissions required: bb.policies.get
+ operationId: bytebase.v1.OrgPolicyService.GetPolicy2
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ delete:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: DeletePolicy
+ description: |-
+ Deletes an organizational policy.
+ Permissions required: bb.policies.delete
+ operationId: bytebase.v1.OrgPolicyService.DeletePolicy2
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.OrgPolicyService
+ summary: UpdatePolicy
+ description: |-
+ Updates an existing organizational policy.
+ Permissions required: bb.policies.update
+ operationId: bytebase.v1.OrgPolicyService.UpdatePolicy2
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: policy
+ in: path
+ description: The policy id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Creates a new organizational policy.
- Permissions required: bb.policies.create
- operationId: OrgPolicyService_CreatePolicy
- parameters:
- - name: parent
- in: query
- description: |-
- The parent resource where this instance will be created.
- Workspace resource name: "".
- Environment resource name: environments/environment-id.
- Instance resource name: instances/instance-id.
- Database resource name: instances/instance-id/databases/database-name.
- schema:
- type: string
- - name: type
- in: query
- description: The type of policy to create.
- schema:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- format: enum
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/policies/{policy}:
- get:
- tags:
- - OrgPolicyService
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ content:
+ application/json:
+ schema:
+ title: policy
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ /v1/projects/{project}/releases:
+ get:
+ tags:
+ - bytebase.v1.ReleaseService
+ summary: ListReleases
+ description: |-
+ Lists releases in a project.
+ Permissions required: bb.releases.list
+ operationId: bytebase.v1.ReleaseService.ListReleases
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of releases to return. The service may return fewer than this value.
+ If unspecified, at most 10 releases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Retrieves a policy by name.
- Permissions required: bb.policies.get
- operationId: OrgPolicyService_GetPolicy
- parameters:
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - OrgPolicyService
+ The maximum number of releases to return. The service may return fewer than this value.
+ If unspecified, at most 10 releases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListReleases` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListReleases` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Deletes an organizational policy.
- Permissions required: bb.policies.delete
- operationId: OrgPolicyService_DeletePolicy
- parameters:
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - OrgPolicyService
+ A page token, received from a previous `ListReleases` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListReleases` must match
+ the call that provided the page token.
+ - name: showDeleted
+ in: query
+ description: Show deleted releases if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted releases if specified.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListReleasesResponse'
+ post:
+ tags:
+ - bytebase.v1.ReleaseService
+ summary: CreateRelease
+ description: |-
+ Creates a new release with SQL files.
+ Permissions required: bb.releases.create
+ operationId: bytebase.v1.ReleaseService.CreateRelease
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: The release to create.
+ content:
+ application/json:
+ schema:
+ title: release
+ description: The release to create.
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ /v1/projects/{project}/releases/{release}:
+ get:
+ tags:
+ - bytebase.v1.ReleaseService
+ summary: GetRelease
+ description: |-
+ Retrieves a release by name.
+ Permissions required: bb.releases.get
+ operationId: bytebase.v1.ReleaseService.GetRelease
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: release
+ in: path
+ description: The release id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ delete:
+ tags:
+ - bytebase.v1.ReleaseService
+ summary: DeleteRelease
+ description: |-
+ Deletes a release.
+ Permissions required: bb.releases.delete
+ operationId: bytebase.v1.ReleaseService.DeleteRelease
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: release
+ in: path
+ description: The release id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.ReleaseService
+ summary: UpdateRelease
+ description: |-
+ Updates an existing release.
+ Permissions required: bb.releases.update
+ When allow_missing=true, also requires: bb.releases.create
+ operationId: bytebase.v1.ReleaseService.UpdateRelease
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: release
+ in: path
+ description: The release id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the release is not found, a new release will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Updates an existing organizational policy.
- Permissions required: bb.policies.update
- operationId: OrgPolicyService_UpdatePolicy
- parameters:
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
+ If set to true, and the release is not found, a new release will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: The release to update.
+ content:
+ application/json:
+ schema:
+ title: release
+ description: The release to update.
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ /v1/projects/{project}/releases/{release}:undelete:
+ post:
+ tags:
+ - bytebase.v1.ReleaseService
+ summary: UndeleteRelease
+ description: |-
+ Restores a deleted release.
+ Permissions required: bb.releases.undelete
+ operationId: bytebase.v1.ReleaseService.UndeleteRelease
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: release
+ in: path
+ description: The release id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ /v1/projects/{project}/releases:check:
+ post:
+ tags:
+ - bytebase.v1.ReleaseService
+ summary: CheckRelease
+ description: |-
+ Validates a release by dry-running checks on target databases.
+ Permissions required: bb.releases.check
+ operationId: bytebase.v1.ReleaseService.CheckRelease
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ release:
+ title: release
+ description: The release to check.
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ targets:
+ type: array
+ items:
type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the policy is not found, a new policy will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects:
- get:
- tags:
- - ProjectService
- description: |-
- Lists all projects in the workspace with optional filtering.
- Permissions required: bb.projects.list
- operationId: ProjectService_ListProjects
- parameters:
- - name: pageSize
- in: query
+ title: targets
description: |-
- The maximum number of projects to return. The service may return fewer than
- this value.
- If unspecified, at most 10 projects will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
+ The targets to dry-run the release.
+ Can be database or databaseGroup.
+ Format:
+ projects/{project}/databaseGroups/{databaseGroup}
+ instances/{instance}/databases/{database}
+ customRules:
+ type: string
+ title: custom_rules
description: |-
- A page token, received from a previous `ListProjects` call.
- Provide this to retrieve the subsequent page.
+ Custom linting rules in natural language for AI-powered validation.
+ Each rule should be a clear statement describing the desired schema constraint.
+ Example: "All tables must have a primary key"
+ Example: "VARCHAR columns should specify a maximum length"
+ title: CheckReleaseRequest
+ required:
+ - release
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.CheckReleaseResponse'
+ /v1/projects/{project}/releases:search:
+ get:
+ tags:
+ - bytebase.v1.ReleaseService
+ summary: SearchReleases
+ description: |-
+ Searches releases by digest or other criteria.
+ Permissions required: bb.releases.get
+ operationId: bytebase.v1.ReleaseService.SearchReleases
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of releases to return. The service may return fewer than this value.
+ If unspecified, at most 10 releases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of releases to return. The service may return fewer than this value.
+ If unspecified, at most 10 releases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListReleases` call.
+ Provide this to retrieve the subsequent page.
- When paginating, all other parameters provided to `ListProjects` must match
- the call that provided the page token.
- schema:
- type: string
- - name: showDeleted
- in: query
- description: Show deleted projects if specified.
- schema:
- type: boolean
- - name: filter
- in: query
- description: |-
- Filter the project.
- Check filter for SearchProjectsRequest for details.
- Supports filtering by name, resource_id, state, and labels (e.g., labels.environment == "production").
- schema:
- type: string
- - name: orderBy
- in: query
- description: |-
- The order by of projects.
- Support title. The default sorting order is ascending.
- For example:
- - order_by = "title"
- - order_by = "title desc"
- - order_by = "title asc"
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListProjectsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - ProjectService
+ When paginating, all other parameters provided to `ListReleases` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Creates a new project in the workspace.
- Permissions required: bb.projects.create
- operationId: ProjectService_CreateProject
- parameters:
- - name: projectId
- in: query
- description: |-
- The ID to use for the project, which will become the final component of
- the project's resource name.
+ A page token, received from a previous `ListReleases` call.
+ Provide this to retrieve the subsequent page.
- This value should be 4-63 characters, and valid characters
- are /[a-z][0-9]-/.
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Project'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Project'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}:
- get:
- tags:
- - ProjectService
+ When paginating, all other parameters provided to `ListReleases` must match
+ the call that provided the page token.
+ - name: digest
+ in: query
+ description: Search by the digest of the release.
+ schema:
+ type: string
+ title: digest
+ description: Search by the digest of the release.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchReleasesResponse'
+ /v1/projects/{project}/rollouts:
+ get:
+ tags:
+ - bytebase.v1.RolloutService
+ summary: ListRollouts
+ description: |-
+ Lists rollouts in a project.
+ Permissions required: bb.rollouts.list
+ operationId: bytebase.v1.RolloutService.ListRollouts
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of rollouts to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 rollouts will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- GetProject retrieves a project by name.
- Users with "bb.projects.get" permission on the workspace or the project owner can access this method.
- Permissions required: bb.projects.get
- operationId: ProjectService_GetProject
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Project'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - ProjectService
+ The maximum number of rollouts to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 rollouts will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListRollouts` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListRollouts` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Deletes (soft-delete or purge) a project.
- Permissions required: bb.projects.delete
- operationId: ProjectService_DeleteProject
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: force
- in: query
+ A page token, received from a previous `ListRollouts` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListRollouts` must match
+ the call that provided the page token.
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter rollouts returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - update_time: rollout update time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - task_type: the task type, support "in" operator, check the Task.Type enum for the values.
+
+ For example:
+ update_time >= "2025-01-02T15:04:05Z07:00"
+ task_type in ["DATABASE_MIGRATE", "DATABASE_EXPORT"]
+ schema:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter rollouts returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - update_time: rollout update time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - task_type: the task type, support "in" operator, check the Task.Type enum for the values.
+
+ For example:
+ update_time >= "2025-01-02T15:04:05Z07:00"
+ task_type in ["DATABASE_MIGRATE", "DATABASE_EXPORT"]
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListRolloutsResponse'
+ /v1/projects/{project}/rollouts/{rollout}/stages/{stage}:export:
+ post:
+ tags:
+ - bytebase.v1.SQLService
+ summary: Export
+ description: |-
+ Exports query results to a file format.
+ Permissions required: bb.databases.get
+ operationId: bytebase.v1.SQLService.Export3
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: rollout
+ in: path
+ description: The rollout id.
+ required: true
+ schema:
+ type: string
+ - name: stage
+ in: path
+ description: The stage id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ statement:
+ type: string
+ title: statement
+ description: The SQL statement to execute.
+ limit:
+ type: integer
+ title: limit
+ format: int32
+ description: The maximum number of rows to return.
+ format:
+ title: format
+ description: The export format.
+ $ref: '#/components/schemas/bytebase.v1.ExportFormat'
+ admin:
+ type: boolean
+ title: admin
description: |-
- If set to true, any databases from this project will be moved to default project.
- Sheets are not moved since BYTEBASE_ARTIFACT sheets belong to the issue and issue project.
- Open issues will remain open but associated with the deleted project.
- If set to false, the operation will fail if the project has databases or open issues.
- schema:
- type: boolean
- - name: purge
- in: query
+ The admin is used for workspace owner and DBA for exporting data from SQL
+ Editor Admin mode. The exported data is not masked.
+ password:
+ type: string
+ title: password
+ description: The zip password provide by users.
+ dataSourceId:
+ type: string
+ title: data_source_id
description: |-
- If set to true, permanently purge the soft-deleted project and all related resources.
- This operation is irreversible. Following AIP-165, this should only be used for
- administrative cleanup of old soft-deleted projects.
- The project must already be soft-deleted for this to work.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - ProjectService
- description: |-
- Updates an existing project's properties.
- Permissions required: bb.projects.update
- operationId: ProjectService_UpdateProject
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
+ The id of data source.
+ It is used for querying admin data source even if the instance has
+ read-only data sources. Or it can be used to query a specific read-only
+ data source.
+ schema:
+ type: string
+ title: schema
+ description: |-
+ The default schema to search objects. Equals to the current schema in
+ Oracle and search path in Postgres.
+ nullable: true
+ title: ExportRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ExportResponse'
+ /v1/projects/{project}/rollouts/{rollout}:export:
+ post:
+ tags:
+ - bytebase.v1.SQLService
+ summary: Export
+ description: |-
+ Exports query results to a file format.
+ Permissions required: bb.databases.get
+ operationId: bytebase.v1.SQLService.Export2
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: rollout
+ in: path
+ description: The rollout id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ statement:
+ type: string
+ title: statement
+ description: The SQL statement to execute.
+ limit:
+ type: integer
+ title: limit
+ format: int32
+ description: The maximum number of rows to return.
+ format:
+ title: format
+ description: The export format.
+ $ref: '#/components/schemas/bytebase.v1.ExportFormat'
+ admin:
+ type: boolean
+ title: admin
description: |-
- If set to true, and the project is not found, a new project will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Project'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Project'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/auditLogs:export:
- post:
- tags:
- - AuditLogService
+ The admin is used for workspace owner and DBA for exporting data from SQL
+ Editor Admin mode. The exported data is not masked.
+ password:
+ type: string
+ title: password
+ description: The zip password provide by users.
+ dataSourceId:
+ type: string
+ title: data_source_id
+ description: |-
+ The id of data source.
+ It is used for querying admin data source even if the instance has
+ read-only data sources. Or it can be used to query a specific read-only
+ data source.
+ schema:
+ type: string
+ title: schema
+ description: |-
+ The default schema to search objects. Equals to the current schema in
+ Oracle and search path in Postgres.
+ nullable: true
+ title: ExportRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ExportResponse'
+ /v1/projects/{project}/sheets:
+ post:
+ tags:
+ - bytebase.v1.SheetService
+ summary: CreateSheet
+ description: |-
+ Creates a new SQL sheet.
+ Permissions required: bb.sheets.create
+ operationId: bytebase.v1.SheetService.CreateSheet
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: The sheet to create.
+ content:
+ application/json:
+ schema:
+ title: sheet
+ description: The sheet to create.
+ $ref: '#/components/schemas/bytebase.v1.Sheet'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Sheet'
+ /v1/projects/{project}/sheets/{sheet}:
+ get:
+ tags:
+ - bytebase.v1.SheetService
+ summary: GetSheet
+ description: |-
+ Retrieves a SQL sheet by name.
+ Permissions required: bb.sheets.get
+ operationId: bytebase.v1.SheetService.GetSheet
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: sheet
+ in: path
+ description: The sheet id.
+ required: true
+ schema:
+ type: string
+ - name: raw
+ in: query
+ description: By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content.
+ schema:
+ type: boolean
+ title: raw
+ description: By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Sheet'
+ /v1/projects/{project}/sheets:batchCreate:
+ post:
+ tags:
+ - bytebase.v1.SheetService
+ summary: BatchCreateSheets
+ description: |-
+ Creates multiple SQL sheets in a single operation.
+ Permissions required: bb.sheets.create
+ operationId: bytebase.v1.SheetService.BatchCreateSheets
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ requests:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.CreateSheetRequest'
+ title: requests
+ title: BatchCreateSheetsRequest
+ required:
+ - requests
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchCreateSheetsResponse'
+ /v1/projects/{project}/webhooks/{webhook}:removeWebhook:
+ post:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: RemoveWebhook
+ description: |-
+ Removes a webhook from a project.
+ Permissions required: bb.projects.update
+ operationId: bytebase.v1.ProjectService.RemoveWebhook
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: webhook
+ in: path
+ description: The webhook id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ webhook:
+ title: webhook
+ description: The webhook to remove. Identified by its url.
+ $ref: '#/components/schemas/bytebase.v1.Webhook'
+ title: RemoveWebhookRequest
+ required:
+ - webhook
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ /v1/projects/{project}/webhooks/{webhook}:updateWebhook:
+ patch:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: UpdateWebhook
+ description: |-
+ Updates an existing webhook configuration.
+ Permissions required: bb.projects.update
+ operationId: bytebase.v1.ProjectService.UpdateWebhook
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: webhook
+ in: path
+ description: The webhook id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the webhook is not found, a new webhook will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Exports audit logs in a specified format for external analysis.
- Permissions required: bb.auditLogs.export
- operationId: AuditLogService_ExportAuditLogs
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportAuditLogsRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportAuditLogsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/auditLogs:search:
- post:
- tags:
- - AuditLogService
+ If set to true, and the webhook is not found, a new webhook will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: The webhook to modify.
+ content:
+ application/json:
+ schema:
+ title: webhook
+ description: The webhook to modify.
+ $ref: '#/components/schemas/bytebase.v1.Webhook'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ /v1/projects/{project}:addWebhook:
+ post:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: AddWebhook
+ description: |-
+ Adds a webhook to a project for notifications.
+ Permissions required: bb.projects.update
+ operationId: bytebase.v1.ProjectService.AddWebhook
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ webhook:
+ title: webhook
+ description: The webhook to add.
+ $ref: '#/components/schemas/bytebase.v1.Webhook'
+ title: AddWebhookRequest
+ required:
+ - webhook
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ /v1/projects/{project}:getIamPolicy:
+ get:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: GetIamPolicy
+ description: |-
+ Retrieves the IAM policy for a project.
+ Permissions required: bb.projects.getIamPolicy
+ operationId: bytebase.v1.ProjectService.GetIamPolicy
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.IamPolicy'
+ /v1/projects/{project}:setIamPolicy:
+ post:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: SetIamPolicy
+ description: |-
+ Sets the IAM policy for a project.
+ Permissions required: bb.projects.setIamPolicy
+ operationId: bytebase.v1.ProjectService.SetIamPolicy
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ policy:
+ title: policy
+ $ref: '#/components/schemas/bytebase.v1.IamPolicy'
+ etag:
+ type: string
+ title: etag
+ description: The current etag of the policy.
+ title: SetIamPolicyRequest
+ required:
+ - policy
+ additionalProperties: false
+ description: Request message for setting an IAM policy.
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.IamPolicy'
+ /v1/projects/{project}:testWebhook:
+ post:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: TestWebhook
+ description: |-
+ Tests a webhook by sending a test notification.
+ Permissions required: bb.projects.update
+ operationId: bytebase.v1.ProjectService.TestWebhook
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ webhook:
+ title: webhook
+ description: The webhook to test. Identified by its url.
+ $ref: '#/components/schemas/bytebase.v1.Webhook'
+ title: TestWebhookRequest
+ required:
+ - webhook
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.TestWebhookResponse'
+ /v1/projects/{project}:undelete:
+ post:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: UndeleteProject
+ description: |-
+ Restores a soft-deleted project.
+ Permissions required: bb.projects.undelete
+ operationId: bytebase.v1.ProjectService.UndeleteProject
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ /v1/projects:batchDelete:
+ post:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: BatchDeleteProjects
+ description: |-
+ Deletes multiple projects in a single operation.
+ Permissions required: bb.projects.delete
+ operationId: bytebase.v1.ProjectService.BatchDeleteProjects
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchDeleteProjectsRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ /v1/projects:batchGet:
+ get:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: BatchGetProjects
+ description: |-
+ BatchGetProjects retrieves multiple projects by their names.
+ Permissions required: bb.projects.get
+ operationId: bytebase.v1.ProjectService.BatchGetProjects
+ parameters:
+ - name: names
+ in: query
+ description: |-
+ The names of projects to retrieve.
+ Format: projects/{project}
+ required: true
+ schema:
+ type: array
+ items:
+ type: string
+ title: names
description: |-
- Searches audit logs with optional filtering and pagination.
- Permissions required: bb.auditLogs.search
- operationId: AuditLogService_SearchAuditLogs
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchAuditLogsRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchAuditLogsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/databaseGroups:
- get:
- tags:
- - DatabaseGroupService
+ The names of projects to retrieve.
+ Format: projects/{project}
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchGetProjectsResponse'
+ /v1/projects:search:
+ post:
+ tags:
+ - bytebase.v1.ProjectService
+ summary: SearchProjects
+ description: |-
+ Searches for projects with advanced filtering capabilities.
+ Permissions required: bb.projects.get (or project-level bb.projects.get for specific projects)
+ operationId: bytebase.v1.ProjectService.SearchProjects
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchProjectsRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchProjectsResponse'
+ /v1/queryHistories:search:
+ post:
+ tags:
+ - bytebase.v1.SQLService
+ summary: SearchQueryHistories
+ description: |-
+ SearchQueryHistories searches query histories for the caller.
+ Permissions required: None (only returns caller's own query histories)
+ operationId: bytebase.v1.SQLService.SearchQueryHistories
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchQueryHistoriesRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchQueryHistoriesResponse'
+ /v1/reviewConfigs:
+ get:
+ tags:
+ - bytebase.v1.ReviewConfigService
+ summary: ListReviewConfigs
+ description: |-
+ Lists all SQL review configurations.
+ Permissions required: bb.reviewConfigs.list
+ operationId: bytebase.v1.ReviewConfigService.ListReviewConfigs
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListReviewConfigsResponse'
+ post:
+ tags:
+ - bytebase.v1.ReviewConfigService
+ summary: CreateReviewConfig
+ description: |-
+ Creates a new SQL review configuration.
+ Permissions required: bb.reviewConfigs.create
+ operationId: bytebase.v1.ReviewConfigService.CreateReviewConfig
+ requestBody:
+ description: The SQL review config to create.
+ content:
+ application/json:
+ schema:
+ title: review_config
+ description: The SQL review config to create.
+ $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
+ /v1/reviewConfigs/{reviewConfig}:
+ get:
+ tags:
+ - bytebase.v1.ReviewConfigService
+ summary: GetReviewConfig
+ description: |-
+ Retrieves a SQL review configuration by name.
+ Permissions required: bb.reviewConfigs.get
+ operationId: bytebase.v1.ReviewConfigService.GetReviewConfig
+ parameters:
+ - name: reviewConfig
+ in: path
+ description: The reviewConfig id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
+ delete:
+ tags:
+ - bytebase.v1.ReviewConfigService
+ summary: DeleteReviewConfig
+ description: |-
+ Deletes a SQL review configuration.
+ Permissions required: bb.reviewConfigs.delete
+ operationId: bytebase.v1.ReviewConfigService.DeleteReviewConfig
+ parameters:
+ - name: reviewConfig
+ in: path
+ description: The reviewConfig id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.ReviewConfigService
+ summary: UpdateReviewConfig
+ description: |-
+ Updates a SQL review configuration.
+ Permissions required: bb.reviewConfigs.update
+ When allow_missing=true, also requires: bb.reviewConfigs.create
+ operationId: bytebase.v1.ReviewConfigService.UpdateReviewConfig
+ parameters:
+ - name: reviewConfig
+ in: path
+ description: The reviewConfig id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the config is not found, a new config will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Lists database groups in a project.
- Permissions required: bb.databaseGroups.list
- operationId: DatabaseGroupService_ListDatabaseGroups
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: view
- in: query
- description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
- schema:
- enum:
- - DATABASE_GROUP_VIEW_UNSPECIFIED
- - DATABASE_GROUP_VIEW_BASIC
- - DATABASE_GROUP_VIEW_FULL
- type: string
- format: enum
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListDatabaseGroupsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - DatabaseGroupService
+ If set to true, and the config is not found, a new config will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The SQL review config to update.
+
+ The name field is used to identify the SQL review config to update.
+ content:
+ application/json:
+ schema:
+ title: review_config
+ description: |-
+ The SQL review config to update.
+
+ The name field is used to identify the SQL review config to update.
+ $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
+ /v1/roles:
+ get:
+ tags:
+ - bytebase.v1.RoleService
+ summary: ListRoles
+ description: |-
+ Lists roles in the workspace.
+ Permissions required: bb.roles.list
+ operationId: bytebase.v1.RoleService.ListRoles
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListRolesResponse'
+ post:
+ tags:
+ - bytebase.v1.RoleService
+ summary: CreateRole
+ description: |-
+ Creates a new custom role.
+ Permissions required: bb.roles.create
+ operationId: bytebase.v1.RoleService.CreateRole
+ parameters:
+ - name: roleId
+ in: query
+ description: |-
+ The ID to use for the role, which will become the final component
+ of the role's resource name.
+
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][A-Z][0-9]/.
+ required: true
+ schema:
+ type: string
+ title: role_id
description: |-
- Creates a new database group.
- Permissions required: bb.databaseGroups.create
- operationId: DatabaseGroupService_CreateDatabaseGroup
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: databaseGroupId
- in: query
- description: |-
- The ID to use for the database group, which will become the final component of
- the database group's resource name.
+ The ID to use for the role, which will become the final component
+ of the role's resource name.
- This value should be 4-63 characters, and valid characters
- are /[a-z][0-9]-/.
- schema:
- type: string
- - name: validateOnly
- in: query
- description: If set, validate the create request and preview the full database group response, but do not actually create it.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseGroup'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseGroup'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/databaseGroups/{databaseGroup}:
- get:
- tags:
- - DatabaseGroupService
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][A-Z][0-9]/.
+ requestBody:
+ description: The role to create.
+ content:
+ application/json:
+ schema:
+ title: role
+ description: The role to create.
+ $ref: '#/components/schemas/bytebase.v1.Role'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Role'
+ /v1/roles/{role}:
+ get:
+ tags:
+ - bytebase.v1.RoleService
+ summary: GetRole
+ description: |-
+ Retrieves a role by name.
+ Permissions required: bb.roles.get
+ operationId: bytebase.v1.RoleService.GetRole
+ parameters:
+ - name: role
+ in: path
+ description: The role id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Role'
+ delete:
+ tags:
+ - bytebase.v1.RoleService
+ summary: DeleteRole
+ description: |-
+ Deletes a custom role.
+ Permissions required: bb.roles.delete
+ operationId: bytebase.v1.RoleService.DeleteRole
+ parameters:
+ - name: role
+ in: path
+ description: The role id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.RoleService
+ summary: UpdateRole
+ description: |-
+ Updates a role's properties.
+ Permissions required: bb.roles.update
+ When allow_missing=true, also requires: bb.roles.create
+ operationId: bytebase.v1.RoleService.UpdateRole
+ parameters:
+ - name: role
+ in: path
+ description: The role id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the role is not found, a new role will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Gets a database group by name.
- Permissions required: bb.databaseGroups.get
- operationId: DatabaseGroupService_GetDatabaseGroup
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: databaseGroup
- in: path
- description: The databaseGroup id.
- required: true
- schema:
- type: string
- - name: view
- in: query
- description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
- schema:
- enum:
- - DATABASE_GROUP_VIEW_UNSPECIFIED
- - DATABASE_GROUP_VIEW_BASIC
- - DATABASE_GROUP_VIEW_FULL
- type: string
- format: enum
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseGroup'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - DatabaseGroupService
+ If set to true, and the role is not found, a new role will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: The role to update.
+ content:
+ application/json:
+ schema:
+ title: role
+ description: The role to update.
+ $ref: '#/components/schemas/bytebase.v1.Role'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Role'
+ /v1/schemaDesign:diffMetadata:
+ post:
+ tags:
+ - bytebase.v1.SQLService
+ summary: DiffMetadata
+ description: |-
+ Computes schema differences between two database metadata.
+ Permissions required: None
+ operationId: bytebase.v1.SQLService.DiffMetadata
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DiffMetadataRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DiffMetadataResponse'
+ /v1/settings:
+ get:
+ tags:
+ - bytebase.v1.SettingService
+ summary: ListSettings
+ description: |-
+ Lists all workspace settings.
+ Permissions required: bb.settings.list
+ operationId: bytebase.v1.SettingService.ListSettings
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListSettingsResponse'
+ /v1/settings/{setting}:
+ get:
+ tags:
+ - bytebase.v1.SettingService
+ summary: GetSetting
+ description: |-
+ Retrieves a workspace setting by name.
+ Permissions required: bb.settings.get
+ operationId: bytebase.v1.SettingService.GetSetting
+ parameters:
+ - name: setting
+ in: path
+ description: The setting id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Setting'
+ patch:
+ tags:
+ - bytebase.v1.SettingService
+ summary: UpdateSetting
+ description: |-
+ Updates a workspace setting.
+ Permissions required: bb.settings.set
+ operationId: bytebase.v1.SettingService.UpdateSetting
+ parameters:
+ - name: setting
+ in: path
+ description: The setting id.
+ required: true
+ schema:
+ type: string
+ - name: validateOnly
+ in: query
+ description: |-
+ validate_only is a flag to indicate whether to validate the setting value,
+ server would not persist the setting value if it is true.
+ schema:
+ type: boolean
+ title: validate_only
description: |-
- Deletes a database group.
- Permissions required: bb.databaseGroups.delete
- operationId: DatabaseGroupService_DeleteDatabaseGroup
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: databaseGroup
- in: path
- description: The databaseGroup id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - DatabaseGroupService
+ validate_only is a flag to indicate whether to validate the setting value,
+ server would not persist the setting value if it is true.
+ - name: allowMissing
+ in: query
+ schema:
+ type: boolean
+ title: allow_missing
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ requestBody:
+ description: The setting to update.
+ content:
+ application/json:
+ schema:
+ title: setting
+ description: The setting to update.
+ $ref: '#/components/schemas/bytebase.v1.Setting'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Setting'
+ /v1/sql/aiCompletion:
+ post:
+ tags:
+ - bytebase.v1.SQLService
+ summary: AICompletion
+ description: |-
+ Provides AI-powered SQL completion and generation.
+ Permissions required: None (authenticated users only, requires AI to be enabled)
+ operationId: bytebase.v1.SQLService.AICompletion
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.AICompletionRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.AICompletionResponse'
+ /v1/subscription:
+ get:
+ tags:
+ - bytebase.v1.SubscriptionService
+ summary: GetSubscription
+ description: |-
+ GetSubscription returns the current subscription.
+ If there is no license, we will return a free plan subscription without expiration time.
+ If there is expired license, we will return a free plan subscription with the expiration time of the expired license.
+ Permissions required: None
+ operationId: bytebase.v1.SubscriptionService.GetSubscription
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Subscription'
+ patch:
+ tags:
+ - bytebase.v1.SubscriptionService
+ summary: UpdateSubscription
+ description: |-
+ Updates the enterprise license subscription.
+ Permissions required: bb.settings.set
+ operationId: bytebase.v1.SubscriptionService.UpdateSubscription
+ parameters:
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the subscription is not found, a new subscription will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Updates a database group.
- Permissions required: bb.databaseGroups.update
- When allow_missing=true, also requires: bb.databaseGroups.create
- operationId: DatabaseGroupService_UpdateDatabaseGroup
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: databaseGroup
- in: path
- description: The databaseGroup id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the database group is not found, a new database group will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseGroup'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DatabaseGroup'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/databases:
- get:
- tags:
- - DatabaseService
+ If set to true, and the subscription is not found, a new subscription will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: string
+ title: license
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Subscription'
+ /v1/users:
+ get:
+ tags:
+ - bytebase.v1.UserService
+ summary: ListUsers
+ description: |-
+ List all users.
+ Any authenticated user can list users.
+ Permissions required: bb.users.list
+ operationId: bytebase.v1.UserService.ListUsers
+ parameters:
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of users to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 users will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Lists databases in a project, instance, or workspace.
- Permissions required: bb.projects.get (for project parent), bb.databases.list (for workspace parent), or bb.instances.get (for instance parent)
- operationId: DatabaseService_ListDatabases
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- The maximum number of databases to return. The service may return fewer
- than this value.
- If unspecified, at most 10 databases will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListDatabases` call.
- Provide this to retrieve the subsequent page.
+ The maximum number of users to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 users will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListUsers` call.
+ Provide this to retrieve the subsequent page.
- When paginating, all other parameters provided to `ListDatabases` must
- match the call that provided the page token.
- schema:
- type: string
- - name: filter
- in: query
- description: |-
- Filter is used to filter databases returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ When paginating, all other parameters provided to `ListUsers` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListUsers` call.
+ Provide this to retrieve the subsequent page.
- Supported filter:
- - environment: the environment full name in "environments/{id}" format, support "==" operator.
- - name: the database name, support ".matches()" operator.
- - project: the project full name in "projects/{id}" format, support "==" operator.
- - instance: the instance full name in "instances/{id}" format, support "==" operator.
- - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
- - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
- - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
- - table: filter by the database table, support "==" and ".matches()" operator.
- - labels.{key}: the database label, support "==" and "in" operators.
+ When paginating, all other parameters provided to `ListUsers` must match
+ the call that provided the page token.
+ - name: showDeleted
+ in: query
+ description: Show deleted users if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted users if specified.
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter users returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- For example:
- environment == "environments/{environment resource id}"
- environment == "" (find databases which environment is not set)
- project == "projects/{project resource id}"
- instance == "instances/{instance resource id}"
- name.matches("database name")
- engine == "MYSQL"
- engine in ["MYSQL", "POSTGRES"]
- !(engine in ["MYSQL", "POSTGRES"])
- exclude_unassigned == true
- drifted == true
- table == "sample"
- table.matches("sam")
- labels.environment == "production"
- labels.region == "asia"
- labels.region in ["asia", "europe"]
-
- You can combine filter conditions like:
- environment == "environments/prod" && name.matches("employee")
- schema:
- type: string
- - name: showDeleted
- in: query
- description: Show deleted database if specified.
- schema:
- type: boolean
- - name: orderBy
- in: query
- description: |-
- The order by of databases.
- Support name, project, instance. The default sorting order is ascending.
- For example:
- - order_by = "name" - order by name ascending
- - order_by = "name desc"
- - order_by = "name desc, project asc"
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListDatabasesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/databases:batchGet:
- get:
- tags:
- - DatabaseService
+ Supported filter:
+ - name: the user name, support "==" and ".matches()" operator.
+ - email: the user email, support "==" and ".matches()" operator.
+ - user_type: the type, check UserType enum for values, support "==", "in [xx]", "!(in [xx])" operator.
+ - state: check State enum for values, support "==" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+
+ For example:
+ name == "ed"
+ name.matches("ed")
+ email == "[email protected]"
+ email.matches("ed")
+ user_type == "SERVICE_ACCOUNT"
+ user_type in ["SERVICE_ACCOUNT", "USER"]
+ !(user_type in ["SERVICE_ACCOUNT", "USER"])
+ state == "DELETED"
+ project == "projects/sample-project"
+ You can combine filter conditions like:
+ name.matches("ed") && project == "projects/sample-project"
+ (name == "ed" || email == "[email protected]") && project == "projects/sample-project"
+ schema:
+ type: string
+ title: filter
description: |-
- Retrieves multiple databases by their names.
- Permissions required: bb.databases.get
- operationId: DatabaseService_BatchGetDatabases
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: names
- in: query
- description: The list of database names to retrieve.
- schema:
- type: array
- items:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchGetDatabasesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/issues:
- get:
- tags:
- - IssueService
+ Filter is used to filter users returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - name: the user name, support "==" and ".matches()" operator.
+ - email: the user email, support "==" and ".matches()" operator.
+ - user_type: the type, check UserType enum for values, support "==", "in [xx]", "!(in [xx])" operator.
+ - state: check State enum for values, support "==" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+
+ For example:
+ name == "ed"
+ name.matches("ed")
+ email == "[email protected]"
+ email.matches("ed")
+ user_type == "SERVICE_ACCOUNT"
+ user_type in ["SERVICE_ACCOUNT", "USER"]
+ !(user_type in ["SERVICE_ACCOUNT", "USER"])
+ state == "DELETED"
+ project == "projects/sample-project"
+ You can combine filter conditions like:
+ name.matches("ed") && project == "projects/sample-project"
+ (name == "ed" || email == "[email protected]") && project == "projects/sample-project"
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListUsersResponse'
+ post:
+ tags:
+ - bytebase.v1.UserService
+ summary: CreateUser
+ description: |-
+ Creates a user. When Disallow Signup is enabled, requires bb.users.create permission; otherwise any user can sign up.
+ Permissions required: bb.users.create (only when Disallow Signup is enabled)
+ operationId: bytebase.v1.UserService.CreateUser
+ requestBody:
+ description: The user to create.
+ content:
+ application/json:
+ schema:
+ title: user
+ description: The user to create.
+ $ref: '#/components/schemas/bytebase.v1.User'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.User'
+ /v1/users/me:
+ get:
+ tags:
+ - bytebase.v1.UserService
+ summary: GetCurrentUser
+ description: |-
+ Get the current authenticated user.
+ Permissions required: None
+ operationId: bytebase.v1.UserService.GetCurrentUser
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.User'
+ /v1/users/{user}:
+ get:
+ tags:
+ - bytebase.v1.UserService
+ summary: GetUser
+ description: |-
+ Get the user.
+ Any authenticated user can get the user.
+ Permissions required: bb.users.get
+ operationId: bytebase.v1.UserService.GetUser
+ parameters:
+ - name: user
+ in: path
+ description: The user id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.User'
+ delete:
+ tags:
+ - bytebase.v1.UserService
+ summary: DeleteUser
+ description: |-
+ Deletes a user. Requires bb.users.delete permission with additional validation: the last remaining workspace admin cannot be deleted.
+ Permissions required: bb.users.delete
+ operationId: bytebase.v1.UserService.DeleteUser
+ parameters:
+ - name: user
+ in: path
+ description: The user id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.UserService
+ summary: UpdateUser
+ description: |-
+ Updates a user. Users can update their own profile, or users with bb.users.update permission can update any user.
+ Note: Email updates are not supported through this API. Use UpdateEmail instead.
+ Permissions required: bb.users.update (or self)
+ operationId: bytebase.v1.UserService.UpdateUser
+ parameters:
+ - name: user
+ in: path
+ description: The user id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: otpCode
+ in: query
+ description: The otp_code is used to verify the user's identity by MFA.
+ schema:
+ type: string
+ title: otp_code
+ description: The otp_code is used to verify the user's identity by MFA.
+ - name: regenerateTempMfaSecret
+ in: query
+ description: |-
+ The regenerate_temp_mfa_secret flag means to regenerate temporary MFA secret for user.
+ This is used for MFA setup. The temporary MFA secret and recovery codes will be returned in the response.
+ schema:
+ type: boolean
+ title: regenerate_temp_mfa_secret
description: |-
- Lists issues in a project.
- Permissions required: bb.issues.list
- operationId: IssueService_ListIssues
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- The maximum number of issues to return. The service may return fewer than
- this value.
- If unspecified, at most 10 issues will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListIssues` call.
- Provide this to retrieve the subsequent page.
+ The regenerate_temp_mfa_secret flag means to regenerate temporary MFA secret for user.
+ This is used for MFA setup. The temporary MFA secret and recovery codes will be returned in the response.
+ - name: regenerateRecoveryCodes
+ in: query
+ description: The regenerate_recovery_codes flag means to regenerate recovery codes for user.
+ schema:
+ type: boolean
+ title: regenerate_recovery_codes
+ description: The regenerate_recovery_codes flag means to regenerate recovery codes for user.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the user is not found, a new user will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the user is not found, a new user will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The user to update.
- When paginating, all other parameters provided to `ListIssues` must match
- the call that provided the page token.
- schema:
- type: string
- - name: filter
- in: query
- description: |-
- Filter is used to filter issues returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ The user's `name` field is used to identify the user to update.
+ Format: users/{email}
+ content:
+ application/json:
+ schema:
+ title: user
+ description: |-
+ The user to update.
- Supported filters:
- - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
- - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
- - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
- - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
- - labels: the issue labels, support "==" and "in" operator.
- - approval_status: issue approval status, support "==" operator.
- - current_approver: the issue approver, should in "users/{email} format", support "==" operator.
-
- For example:
- creator == "users/[email protected]" && status in ["OPEN", "DONE"]
- status == "CANCELED" && type == "DATABASE_CHANGE"
- labels in ["label1", "label2"]
- create_time >= "2025-01-02T15:04:05Z07:00"
- schema:
- type: string
- - name: query
- in: query
- description: Query is the query statement.
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListIssuesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - IssueService
- description: |-
- Creates a new issue for database changes or tasks.
- Permissions required: bb.issues.create
- operationId: IssueService_CreateIssue
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Issue'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Issue'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/issues/{issue}:
- get:
- tags:
- - IssueService
- description: |-
- Retrieves an issue by name.
- Permissions required: bb.issues.get
- operationId: IssueService_GetIssue
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: issue
- in: path
- description: The issue id.
- required: true
- schema:
- type: string
- - name: force
- in: query
- description: If set to true, bypass cache and fetch the latest data.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Issue'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - IssueService
- description: |-
- Updates an issue's properties such as title, description, or labels.
- Permissions required: bb.issues.update
- operationId: IssueService_UpdateIssue
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: issue
- in: path
- description: The issue id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the issue is not found, a new issue will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Issue'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Issue'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/issues/{issue}/issueComments:
- get:
- tags:
- - IssueService
+ The user's `name` field is used to identify the user to update.
+ Format: users/{email}
+ $ref: '#/components/schemas/bytebase.v1.User'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.User'
+ /v1/users/{user}:undelete:
+ post:
+ tags:
+ - bytebase.v1.UserService
+ summary: UndeleteUser
+ description: |-
+ Restores a deleted user.
+ Permissions required: bb.users.undelete
+ operationId: bytebase.v1.UserService.UndeleteUser
+ parameters:
+ - name: user
+ in: path
+ description: The user id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.User'
+ /v1/users/{user}:updateEmail:
+ post:
+ tags:
+ - bytebase.v1.UserService
+ summary: UpdateEmail
+ description: |-
+ Updates a user's email address.
+ Permissions required: bb.users.updateEmail
+ operationId: bytebase.v1.UserService.UpdateEmail
+ parameters:
+ - name: user
+ in: path
+ description: The user id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ email:
+ type: string
+ title: email
+ description: The new email address.
+ title: UpdateEmailRequest
+ required:
+ - email
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.User'
+ /v1/users:batchGet:
+ get:
+ tags:
+ - bytebase.v1.UserService
+ summary: BatchGetUsers
+ description: |-
+ Get the users in batch.
+ Any authenticated user can batch get users.
+ Permissions required: bb.users.get
+ operationId: bytebase.v1.UserService.BatchGetUsers
+ parameters:
+ - name: names
+ in: query
+ description: |-
+ The user names to retrieve.
+ Format: users/{email}
+ required: true
+ schema:
+ type: array
+ items:
+ type: string
+ title: names
description: |-
- Lists comments on an issue.
- Permissions required: bb.issueComments.list
- operationId: IssueService_ListIssueComments
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: issue
- in: path
- description: The issue id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- The maximum number of issue comments to return. The service may return fewer than
- this value.
- If unspecified, at most 10 issue comments will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListIssueComments` call.
- Provide this to retrieve the subsequent page.
+ The user names to retrieve.
+ Format: users/{email}
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchGetUsersResponse'
+ /v1/worksheets:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: CreateWorksheet
+ description: |-
+ Creates a personal worksheet used in SQL Editor. Any authenticated user can create their own worksheets.
+ Permissions required: None (authenticated users only)
+ operationId: bytebase.v1.WorksheetService.CreateWorksheet
+ requestBody:
+ description: The worksheet to create.
+ content:
+ application/json:
+ schema:
+ title: worksheet
+ description: The worksheet to create.
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ /v1/worksheets/organizer:batchUpdate:
+ patch:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: BatchUpdateWorksheetOrganizer
+ description: |-
+ Batch update the organizers of worksheets.
+ The access is the same as UpdateWorksheet method.
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: bytebase.v1.WorksheetService.BatchUpdateWorksheetOrganizer
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchUpdateWorksheetOrganizerRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchUpdateWorksheetOrganizerResponse'
+ /v1/worksheets/{worksheet}:
+ get:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: GetWorksheet
+ description: |-
+ Get a worksheet by name.
+ The users can access this method if,
+ - they are the creator of the worksheet;
+ - they have bb.worksheets.get permission on the workspace;
+ - the sheet is shared with them with PROJECT_READ and PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: bytebase.v1.WorksheetService.GetWorksheet
+ parameters:
+ - name: worksheet
+ in: path
+ description: The worksheet id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ delete:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: DeleteWorksheet
+ description: |-
+ Delete a worksheet.
+ The access is the same as UpdateWorksheet method.
+ Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets)
+ operationId: bytebase.v1.WorksheetService.DeleteWorksheet
+ parameters:
+ - name: worksheet
+ in: path
+ description: The worksheet id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: UpdateWorksheet
+ description: |-
+ Update a worksheet.
+ The users can access this method if,
+ - they are the creator of the worksheet;
+ - they have bb.worksheets.manage permission on the workspace;
+ - the sheet is shared with them with PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
+ Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets)
+ operationId: bytebase.v1.WorksheetService.UpdateWorksheet
+ parameters:
+ - name: worksheet
+ in: path
+ description: The worksheet id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ requestBody:
+ description: |-
+ The worksheet to update.
- When paginating, all other parameters provided to `ListIssueComments` must match
- the call that provided the page token.
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListIssueCommentsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/issues/{issue}:approve:
- post:
- tags:
- - IssueService
- description: |-
- Approves an issue. Access determined by approval flow configuration - caller must be a designated approver for the current approval step.
- Permissions required: None (determined by approval flow)
- operationId: IssueService_ApproveIssue
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: issue
- in: path
- description: The issue id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ApproveIssueRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Issue'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/issues/{issue}:comment:
- post:
- tags:
- - IssueService
- description: |-
- Adds a comment to an issue.
- Permissions required: bb.issueComments.create
- operationId: IssueService_CreateIssueComment
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: issue
- in: path
- description: The issue id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IssueComment'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IssueComment'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - IssueService
- description: |-
- Updates an existing issue comment.
- Permissions required: bb.issueComments.update
- operationId: IssueService_UpdateIssueComment
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: issue
- in: path
- description: The issue id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the issue comment is not found, a new issue comment will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IssueComment'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IssueComment'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/issues/{issue}:reject:
- post:
- tags:
- - IssueService
- description: |-
- Rejects an issue. Access determined by approval flow configuration - caller must be a designated approver for the current approval step.
- Permissions required: None (determined by approval flow)
- operationId: IssueService_RejectIssue
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: issue
- in: path
- description: The issue id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RejectIssueRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Issue'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/issues/{issue}:request:
- post:
- tags:
- - IssueService
- description: |-
- Requests changes on an issue. Access determined by approval flow configuration - caller must be a designated approver for the current approval step.
- Permissions required: None (determined by approval flow)
- operationId: IssueService_RequestIssue
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: issue
- in: path
- description: The issue id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RequestIssueRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Issue'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/issues:batchUpdateStatus:
- post:
- tags:
- - IssueService
+ The worksheet's `name` field is used to identify the worksheet to update.
+ Format: worksheets/{worksheet}
+ content:
+ application/json:
+ schema:
+ title: worksheet
+ description: |-
+ The worksheet to update.
+
+ The worksheet's `name` field is used to identify the worksheet to update.
+ Format: worksheets/{worksheet}
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ /v1/worksheets/{worksheet}/organizer:
+ patch:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: UpdateWorksheetOrganizer
+ description: |-
+ Update the organizer of a worksheet.
+ The access is the same as UpdateWorksheet method.
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: bytebase.v1.WorksheetService.UpdateWorksheetOrganizer
+ parameters:
+ - name: worksheet
+ in: path
+ description: The worksheet id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask.paths
+ in: query
+ description: The set of field mask paths.
+ schema:
+ type: array
+ items:
+ type: string
+ title: paths
+ description: The set of field mask paths.
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the worksheet organizer is not found, a new worksheet organizer will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
description: |-
- Updates the status of multiple issues in a single operation.
- Permissions required: bb.issues.update
- operationId: IssueService_BatchUpdateIssuesStatus
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchUpdateIssuesStatusRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchUpdateIssuesStatusResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/issues:search:
- post:
- tags:
- - IssueService
+ If set to true, and the worksheet organizer is not found, a new worksheet organizer will be created.
+ In this situation, `update_mask` is ignored.
+ requestBody:
+ description: |-
+ The organizer to update.
+
+ The organizer's `worksheet` field is used to identify the worksheet.
+ Format: worksheets/{worksheet}
+ content:
+ application/json:
+ schema:
+ title: organizer
+ description: |-
+ The organizer to update.
+
+ The organizer's `worksheet` field is used to identify the worksheet.
+ Format: worksheets/{worksheet}
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ /v1/worksheets:search:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: SearchWorksheets
+ description: |-
+ Search for worksheets.
+ This is used for finding my worksheets or worksheets shared by other people.
+ The sheet accessibility is the same as GetWorksheet().
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: bytebase.v1.WorksheetService.SearchWorksheets
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchWorksheetsRequest'
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchWorksheetsResponse'
+ /v1/workspaces/{workspace}/databases:
+ get:
+ tags:
+ - bytebase.v1.DatabaseService
+ summary: ListDatabases
+ description: |-
+ Lists databases in a project, instance, or workspace.
+ Permissions required: bb.projects.get (for project parent), bb.databases.list (for workspace parent), or bb.instances.get (for instance parent)
+ operationId: bytebase.v1.DatabaseService.ListDatabases3
+ parameters:
+ - name: workspace
+ in: path
+ description: The workspace id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of databases to return. The service may return fewer
+ than this value.
+ If unspecified, at most 10 databases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
description: |-
- Search for issues that the caller has the bb.issues.get permission on and also satisfy the specified filter & query.
- Permissions required: bb.issues.get
- operationId: IssueService_SearchIssues
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchIssuesRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchIssuesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans:
- get:
- tags:
- - PlanService
+ The maximum number of databases to return. The service may return fewer
+ than this value.
+ If unspecified, at most 10 databases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListDatabases` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListDatabases` must
+ match the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
description: |-
- Lists deployment plans in a project.
- Permissions required: bb.plans.list
- operationId: PlanService_ListPlans
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- The maximum number of plans to return. The service may return fewer than
- this value.
- If unspecified, at most 10 plans will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListPlans` call.
- Provide this to retrieve the subsequent page.
+ A page token, received from a previous `ListDatabases` call.
+ Provide this to retrieve the subsequent page.
- When paginating, all other parameters provided to `ListPlans` must match
- the call that provided the page token.
- schema:
- type: string
- - name: filter
- in: query
- description: |-
- Filter is used to filter plans returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ When paginating, all other parameters provided to `ListDatabases` must
+ match the call that provided the page token.
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- Supported filters:
- - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
- - create_time: the plan create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
- - has_rollout: whether the plan has rollout, support "==" operator, the value should be "true" or "false".
- - has_issue: the plan has issue or not, support "==" operator, the value should be "true" or "false".
- - title: the plan title, support "==" operator for exact match and ".matches()" operator for case-insensitive substring match.
- - spec_type: the plan spec config type, support "==" operator, the value should be "create_database_config", "change_database_config", or "export_data_config".
- - state: the plan state, support "==" operator, the value should be "ACTIVE" or "DELETED".
+ Supported filter:
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - name: the database name, support ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
+ - table: filter by the database table, support "==" and ".matches()" operator.
+ - labels.{key}: the database label, support "==" and "in" operators.
- For example:
- creator == "users/[email protected]" && create_time >= "2025-01-02T15:04:05Z07:00"
- has_rollout == false && has_issue == true
- title == "My Plan"
- title.matches("database migration")
- spec_type == "change_database_config"
- state == "ACTIVE"
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListPlansResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - PlanService
- description: |-
- Creates a new deployment plan.
- Permissions required: bb.plans.create
- operationId: PlanService_CreatePlan
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Plan'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Plan'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}:
- get:
- tags:
- - PlanService
- description: |-
- Retrieves a deployment plan by name.
- Permissions required: bb.plans.get
- operationId: PlanService_GetPlan
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Plan'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - PlanService
- description: |-
- UpdatePlan updates the plan.
- The plan creator and the user with bb.plans.update permission on the project can update the plan.
- Permissions required: bb.plans.update (or creator)
- operationId: PlanService_UpdatePlan
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the plan is not found, a new plan will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Plan'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Plan'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/planCheckRun:
- get:
- tags:
- - PlanService
- description: |-
- Gets the plan check run for a deployment plan.
- Permissions required: bb.planCheckRuns.get
- operationId: PlanService_GetPlanCheckRun
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PlanCheckRun'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/planCheckRun:cancel:
- post:
- tags:
- - PlanService
- description: |-
- Cancels the plan check run for a deployment plan.
- Permissions required: bb.planCheckRuns.run
- operationId: PlanService_CancelPlanCheckRun
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CancelPlanCheckRunRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CancelPlanCheckRunResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/rollout:
- get:
- tags:
- - RolloutService
- description: |-
- Retrieves a rollout by its plan name.
- Permissions required: bb.rollouts.get
- operationId: RolloutService_GetRollout
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Rollout'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - RolloutService
- description: |-
- Creates a new rollout for a plan.
- Permissions required: bb.rollouts.create
- operationId: RolloutService_CreateRollout
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CreateRolloutRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Rollout'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/tasks:batchRun:
- post:
- tags:
- - RolloutService
- description: |-
- Executes multiple tasks in a rollout stage.
- Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)
- operationId: RolloutService_BatchRunTasks
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- - name: rollout
- in: path
- description: The rollout id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchRunTasksRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchRunTasksResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/tasks:batchSkip:
- post:
- tags:
- - RolloutService
- description: |-
- Skips multiple tasks in a rollout stage.
- Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)
- operationId: RolloutService_BatchSkipTasks
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- - name: rollout
- in: path
- description: The rollout id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchSkipTasksRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchSkipTasksResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/taskRuns:
- get:
- tags:
- - RolloutService
- description: |-
- Lists task run executions for a task.
- Permissions required: bb.taskRuns.list
- operationId: RolloutService_ListTaskRuns
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- - name: rollout
- in: path
- description: The rollout id.
- required: true
- schema:
- type: string
- - name: '*'
- in: path
- description: The * id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListTaskRunsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/taskRuns:batchCancel:
- post:
- tags:
- - RolloutService
- description: |-
- Cancels multiple running task executions.
- Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)
- operationId: RolloutService_BatchCancelTaskRuns
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- - name: rollout
- in: path
- description: The rollout id.
- required: true
- schema:
- type: string
- - name: '*'
- in: path
- description: The * id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchCancelTaskRunsRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchCancelTaskRunsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/{*}/*:
- get:
- tags:
- - RolloutService
- description: |-
- Retrieves a task run by name.
- Permissions required: bb.taskRuns.list
- operationId: RolloutService_GetTaskRun
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- - name: rollout
- in: path
- description: The rollout id.
- required: true
- schema:
- type: string
- - name: '*'
- in: path
- description: The * id.
- required: true
- schema:
- type: string
- - name: '*'
- in: path
- description: The * id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TaskRun'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/{*}/*/log:
- get:
- tags:
- - RolloutService
- description: |-
- Retrieves execution logs for a task run.
- Permissions required: bb.taskRuns.list
- operationId: RolloutService_GetTaskRunLog
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- - name: rollout
- in: path
- description: The rollout id.
- required: true
- schema:
- type: string
- - name: '*'
- in: path
- description: The * id.
- required: true
- schema:
- type: string
- - name: '*'
- in: path
- description: The * id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TaskRunLog'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/{*}/*/session:
- get:
- tags:
- - RolloutService
- description: |-
- Retrieves database session information for a running task.
- Permissions required: bb.taskRuns.list
- operationId: RolloutService_GetTaskRunSession
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- - name: rollout
- in: path
- description: The rollout id.
- required: true
- schema:
- type: string
- - name: '*'
- in: path
- description: The * id.
- required: true
- schema:
- type: string
- - name: '*'
- in: path
- description: The * id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TaskRunSession'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}/rollout/{rollout}/*/{*}/*/{*}/*:previewRollback:
- post:
- tags:
- - RolloutService
- description: |-
- Generates rollback SQL for a completed task run.
- Permissions required: bb.taskRuns.list
- operationId: RolloutService_PreviewTaskRunRollback
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- - name: rollout
- in: path
- description: The rollout id.
- required: true
- schema:
- type: string
- - name: '*'
- in: path
- description: The * id.
- required: true
- schema:
- type: string
- - name: '*'
- in: path
- description: The * id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PreviewTaskRunRollbackRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PreviewTaskRunRollbackResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/plans/{plan}:runPlanChecks:
- post:
- tags:
- - PlanService
- description: |-
- Executes validation checks on a deployment plan.
- Permissions required: bb.planCheckRuns.run
- operationId: PlanService_RunPlanChecks
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: plan
- in: path
- description: The plan id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RunPlanChecksRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RunPlanChecksResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/policies:
- get:
- tags:
- - OrgPolicyService
- description: |-
- Lists policies at a specified resource level.
- Permissions required: bb.policies.list
- operationId: OrgPolicyService_ListPolicies
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: policyType
- in: query
- description: Filter by specific policy type.
- schema:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- format: enum
- - name: showDeleted
- in: query
- description: Show deleted policies if specified.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListPoliciesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - OrgPolicyService
- description: |-
- Creates a new organizational policy.
- Permissions required: bb.policies.create
- operationId: OrgPolicyService_CreatePolicy
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: type
- in: query
- description: The type of policy to create.
- schema:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- format: enum
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/policies/{policy}:
- get:
- tags:
- - OrgPolicyService
- description: |-
- Retrieves a policy by name.
- Permissions required: bb.policies.get
- operationId: OrgPolicyService_GetPolicy
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - OrgPolicyService
- description: |-
- Deletes an organizational policy.
- Permissions required: bb.policies.delete
- operationId: OrgPolicyService_DeletePolicy
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - OrgPolicyService
- description: |-
- Updates an existing organizational policy.
- Permissions required: bb.policies.update
- operationId: OrgPolicyService_UpdatePolicy
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: policy
- in: path
- description: The policy id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the policy is not found, a new policy will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Policy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/releases:
- get:
- tags:
- - ReleaseService
- description: |-
- Lists releases in a project.
- Permissions required: bb.releases.list
- operationId: ReleaseService_ListReleases
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- The maximum number of releases to return. The service may return fewer than this value.
- If unspecified, at most 10 releases will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListReleases` call.
- Provide this to retrieve the subsequent page.
+ For example:
+ environment == "environments/{environment resource id}"
+ environment == "" (find databases which environment is not set)
+ project == "projects/{project resource id}"
+ instance == "instances/{instance resource id}"
+ name.matches("database name")
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ exclude_unassigned == true
+ drifted == true
+ table == "sample"
+ table.matches("sam")
+ labels.environment == "production"
+ labels.region == "asia"
+ labels.region in ["asia", "europe"]
- When paginating, all other parameters provided to `ListReleases` must match
- the call that provided the page token.
- schema:
- type: string
- - name: showDeleted
- in: query
- description: Show deleted releases if specified.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListReleasesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - ReleaseService
- description: |-
- Creates a new release with SQL files.
- Permissions required: bb.releases.create
- operationId: ReleaseService_CreateRelease
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Release'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Release'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/releases/{release}:
- get:
- tags:
- - ReleaseService
- description: |-
- Retrieves a release by name.
- Permissions required: bb.releases.get
- operationId: ReleaseService_GetRelease
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: release
- in: path
- description: The release id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Release'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - ReleaseService
+ You can combine filter conditions like:
+ environment == "environments/prod" && name.matches("employee")
+ schema:
+ type: string
+ title: filter
description: |-
- Deletes a release.
- Permissions required: bb.releases.delete
- operationId: ReleaseService_DeleteRelease
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: release
- in: path
- description: The release id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - ReleaseService
+ Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - name: the database name, support ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
+ - table: filter by the database table, support "==" and ".matches()" operator.
+ - labels.{key}: the database label, support "==" and "in" operators.
+
+ For example:
+ environment == "environments/{environment resource id}"
+ environment == "" (find databases which environment is not set)
+ project == "projects/{project resource id}"
+ instance == "instances/{instance resource id}"
+ name.matches("database name")
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ exclude_unassigned == true
+ drifted == true
+ table == "sample"
+ table.matches("sam")
+ labels.environment == "production"
+ labels.region == "asia"
+ labels.region in ["asia", "europe"]
+
+ You can combine filter conditions like:
+ environment == "environments/prod" && name.matches("employee")
+ - name: showDeleted
+ in: query
+ description: Show deleted database if specified.
+ schema:
+ type: boolean
+ title: show_deleted
+ description: Show deleted database if specified.
+ - name: orderBy
+ in: query
+ description: |-
+ The order by of databases.
+ Support name, project, instance. The default sorting order is ascending.
+ For example:
+ - order_by = "name" - order by name ascending
+ - order_by = "name desc"
+ - order_by = "name desc, project asc"
+ schema:
+ type: string
+ title: order_by
description: |-
- Updates an existing release.
- Permissions required: bb.releases.update
- When allow_missing=true, also requires: bb.releases.create
- operationId: ReleaseService_UpdateRelease
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: release
- in: path
- description: The release id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to be updated.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the release is not found, a new release will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Release'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Release'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/releases/{release}:undelete:
- post:
- tags:
- - ReleaseService
+ The order by of databases.
+ Support name, project, instance. The default sorting order is ascending.
+ For example:
+ - order_by = "name" - order by name ascending
+ - order_by = "name desc"
+ - order_by = "name desc, project asc"
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListDatabasesResponse'
+ /v1/workspaces/{workspace}:getIamPolicy:
+ get:
+ tags:
+ - bytebase.v1.WorkspaceService
+ summary: GetIamPolicy
+ description: |-
+ Retrieves IAM policy for the workspace.
+ Permissions required: bb.workspaces.getIamPolicy
+ operationId: bytebase.v1.WorkspaceService.GetIamPolicy
+ parameters:
+ - name: workspace
+ in: path
+ description: The workspace id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.IamPolicy'
+ /v1/workspaces/{workspace}:setIamPolicy:
+ post:
+ tags:
+ - bytebase.v1.WorkspaceService
+ summary: SetIamPolicy
+ description: |-
+ Sets IAM policy for the workspace.
+ Permissions required: bb.workspaces.setIamPolicy
+ operationId: bytebase.v1.WorkspaceService.SetIamPolicy
+ parameters:
+ - name: workspace
+ in: path
+ description: The workspace id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ policy:
+ title: policy
+ $ref: '#/components/schemas/bytebase.v1.IamPolicy'
+ etag:
+ type: string
+ title: etag
+ description: The current etag of the policy.
+ title: SetIamPolicyRequest
+ required:
+ - policy
+ additionalProperties: false
+ description: Request message for setting an IAM policy.
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.IamPolicy'
+ /v1:adminExecute:
+ get:
+ tags:
+ - bytebase.v1.SQLService
+ summary: AdminExecute
+ description: |-
+ Executes SQL with admin privileges via streaming connection.
+ Permissions required: bb.sql.admin
+ operationId: bytebase.v1.SQLService.AdminExecute
+ parameters:
+ - name: name
+ in: query
+ description: |-
+ The name is the instance name to execute the query against.
+ Format: instances/{instance}/databases/{databaseName}
+ required: true
+ schema:
+ type: string
+ title: name
description: |-
- Restores a deleted release.
- Permissions required: bb.releases.undelete
- operationId: ReleaseService_UndeleteRelease
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: release
- in: path
- description: The release id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Release'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/releases:check:
- post:
- tags:
- - ReleaseService
+ The name is the instance name to execute the query against.
+ Format: instances/{instance}/databases/{databaseName}
+ - name: statement
+ in: query
+ description: The SQL statement to execute.
+ schema:
+ type: string
+ title: statement
+ description: The SQL statement to execute.
+ - name: limit
+ in: query
+ description: The maximum number of rows to return.
+ schema:
+ type: integer
+ title: limit
+ format: int32
+ description: The maximum number of rows to return.
+ - name: schema
+ in: query
+ description: |-
+ The default schema to execute the statement. Equals to the current schema
+ in Oracle and search path in Postgres.
+ schema:
+ type: string
+ title: schema
description: |-
- Validates a release by dry-running checks on target databases.
- Permissions required: bb.releases.check
- operationId: ReleaseService_CheckRelease
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CheckReleaseRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CheckReleaseResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/releases:search:
- get:
- tags:
- - ReleaseService
+ The default schema to execute the statement. Equals to the current schema
+ in Oracle and search path in Postgres.
+ - name: container
+ in: query
+ description: |-
+ Container is the container name to execute the query against, used for
+ CosmosDB only.
+ schema:
+ type: string
+ title: container
description: |-
- Searches releases by digest or other criteria.
- Permissions required: bb.releases.get
- operationId: ReleaseService_SearchReleases
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- The maximum number of releases to return. The service may return fewer than this value.
- If unspecified, at most 10 releases will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListReleases` call.
- Provide this to retrieve the subsequent page.
+ Container is the container name to execute the query against, used for
+ CosmosDB only.
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.AdminExecuteResponse'
+components:
+ schemas:
+ bytebase.v1.AICompletionRequest:
+ type: object
+ properties:
+ messages:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.AICompletionRequest.Message'
+ title: messages
+ title: AICompletionRequest
+ additionalProperties: false
+ bytebase.v1.AICompletionRequest.Message:
+ type: object
+ properties:
+ role:
+ type: string
+ title: role
+ content:
+ type: string
+ title: content
+ title: Message
+ additionalProperties: false
+ bytebase.v1.AICompletionResponse:
+ type: object
+ properties:
+ candidates:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.AICompletionResponse.Candidate'
+ title: candidates
+ description: |-
+ candidates is used for results with multiple choices and candidates. Used
+ for OpenAI and Gemini.
+ title: AICompletionResponse
+ additionalProperties: false
+ bytebase.v1.AICompletionResponse.Candidate:
+ type: object
+ properties:
+ content:
+ title: content
+ $ref: '#/components/schemas/bytebase.v1.AICompletionResponse.Candidate.Content'
+ title: Candidate
+ additionalProperties: false
+ bytebase.v1.AICompletionResponse.Candidate.Content:
+ type: object
+ properties:
+ parts:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.AICompletionResponse.Candidate.Content.Part'
+ title: parts
+ description: parts is used for a result content with multiple parts.
+ title: Content
+ additionalProperties: false
+ bytebase.v1.AICompletionResponse.Candidate.Content.Part:
+ type: object
+ properties:
+ text:
+ type: string
+ title: text
+ title: Part
+ additionalProperties: false
+ bytebase.v1.AISetting:
+ type: object
+ properties:
+ enabled:
+ type: boolean
+ title: enabled
+ provider:
+ title: provider
+ $ref: '#/components/schemas/bytebase.v1.AISetting.Provider'
+ endpoint:
+ type: string
+ title: endpoint
+ apiKey:
+ type: string
+ title: api_key
+ model:
+ type: string
+ title: model
+ version:
+ type: string
+ title: version
+ title: AISetting
+ additionalProperties: false
+ bytebase.v1.AISetting.Provider:
+ type: string
+ title: Provider
+ enum:
+ - PROVIDER_UNSPECIFIED
+ - OPEN_AI
+ - CLAUDE
+ - GEMINI
+ - AZURE_OPENAI
+ bytebase.v1.Activity:
+ type: object
+ title: Activity
+ additionalProperties: false
+ description: Activity types for webhook notifications.
+ bytebase.v1.Activity.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - ISSUE_CREATED
+ - ISSUE_APPROVAL_REQUESTED
+ - ISSUE_SENT_BACK
+ - PIPELINE_FAILED
+ - PIPELINE_COMPLETED
+ description: Activity type enumeration.
+ bytebase.v1.ActuatorInfo:
+ type: object
+ properties:
+ version:
+ type: string
+ title: version
+ description: The Bytebase server version.
+ readOnly: true
+ gitCommit:
+ type: string
+ title: git_commit
+ description: The git commit hash of the build.
+ readOnly: true
+ readonly:
+ type: boolean
+ title: readonly
+ description: Whether the Bytebase instance is running in read-only mode.
+ readOnly: true
+ saas:
+ type: boolean
+ title: saas
+ description: Whether the Bytebase instance is running in SaaS mode where some features cannot be edited by users.
+ readOnly: true
+ demo:
+ type: boolean
+ title: demo
+ description: Whether the Bytebase instance is running in demo mode.
+ readOnly: true
+ host:
+ type: string
+ title: host
+ description: The host address of the Bytebase instance.
+ readOnly: true
+ port:
+ type: string
+ title: port
+ description: The port number of the Bytebase instance.
+ readOnly: true
+ externalUrl:
+ type: string
+ title: external_url
+ description: The external URL where users or webhook callbacks access Bytebase.
+ readOnly: true
+ needAdminSetup:
+ type: boolean
+ title: need_admin_setup
+ description: Whether the Bytebase instance requires initial admin setup.
+ readOnly: true
+ disallowSignup:
+ type: boolean
+ title: disallow_signup
+ description: Whether self-service user signup is disabled.
+ readOnly: true
+ lastActiveTime:
+ title: last_active_time
+ description: The last time any API call was made, refreshed on each request.
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ require2fa:
+ type: boolean
+ title: require_2fa
+ description: Whether two-factor authentication is required for all users.
+ readOnly: true
+ workspaceId:
+ type: string
+ title: workspace_id
+ description: The unique identifier for the workspace.
+ readOnly: true
+ debug:
+ type: boolean
+ title: debug
+ description: Whether debug mode is enabled.
+ unlicensedFeatures:
+ type: array
+ items:
+ type: string
+ readOnly: true
+ title: unlicensed_features
+ description: List of features that are not licensed.
+ readOnly: true
+ disallowPasswordSignin:
+ type: boolean
+ title: disallow_password_signin
+ description: Whether password-based signin is disabled (except for workspace admins).
+ readOnly: true
+ passwordRestriction:
+ title: password_restriction
+ description: Password complexity and restriction requirements.
+ readOnly: true
+ $ref: '#/components/schemas/bytebase.v1.WorkspaceProfileSetting.PasswordRestriction'
+ docker:
+ type: boolean
+ title: docker
+ description: Whether the Bytebase instance is running in Docker.
+ readOnly: true
+ userStats:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ActuatorInfo.StatUser'
+ title: user_stats
+ description: Statistics about users in the system.
+ readOnly: true
+ activatedInstanceCount:
+ type: integer
+ title: activated_instance_count
+ format: int32
+ description: The number of activated database instances.
+ readOnly: true
+ totalInstanceCount:
+ type: integer
+ title: total_instance_count
+ format: int32
+ description: The total number of database instances.
+ readOnly: true
+ enableSample:
+ type: boolean
+ title: enable_sample
+ description: Whether sample data setup is enabled.
+ readOnly: true
+ externalUrlFromFlag:
+ type: boolean
+ title: external_url_from_flag
+ description: Whether the external URL is set via command-line flag (and thus cannot be changed via UI).
+ readOnly: true
+ title: ActuatorInfo
+ additionalProperties: false
+ description: |-
+ System information and configuration for the Bytebase instance.
+ Actuator concept is similar to the Spring Boot Actuator.
+ bytebase.v1.ActuatorInfo.StatUser:
+ type: object
+ properties:
+ userType:
+ title: user_type
+ description: The type of user.
+ $ref: '#/components/schemas/bytebase.v1.UserType'
+ state:
+ title: state
+ description: The state of the user.
+ $ref: '#/components/schemas/bytebase.v1.State'
+ count:
+ type: integer
+ title: count
+ format: int32
+ description: The count of users matching this type and state.
+ title: StatUser
+ additionalProperties: false
+ description: User statistics by type and state.
+ bytebase.v1.AddDataSourceRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the instance to add a data source to.
+ Format: instances/{instance}
+ dataSource:
+ title: data_source
+ description: |-
+ Identified by data source ID.
+ Only READ_ONLY data source can be added.
+ $ref: '#/components/schemas/bytebase.v1.DataSource'
+ validateOnly:
+ type: boolean
+ title: validate_only
+ description: Validate only also tests the data source connection.
+ title: AddDataSourceRequest
+ required:
+ - name
+ - dataSource
+ additionalProperties: false
+ bytebase.v1.AddWebhookRequest:
+ type: object
+ properties:
+ project:
+ type: string
+ title: project
+ description: |-
+ The name of the project to add the webhook to.
+ Format: projects/{project}
+ webhook:
+ title: webhook
+ description: The webhook to add.
+ $ref: '#/components/schemas/bytebase.v1.Webhook'
+ title: AddWebhookRequest
+ required:
+ - project
+ - webhook
+ additionalProperties: false
+ bytebase.v1.AdminExecuteRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name is the instance name to execute the query against.
+ Format: instances/{instance}/databases/{databaseName}
+ statement:
+ type: string
+ title: statement
+ description: The SQL statement to execute.
+ limit:
+ type: integer
+ title: limit
+ format: int32
+ description: The maximum number of rows to return.
+ schema:
+ type: string
+ title: schema
+ description: |-
+ The default schema to execute the statement. Equals to the current schema
+ in Oracle and search path in Postgres.
+ nullable: true
+ container:
+ type: string
+ title: container
+ description: |-
+ Container is the container name to execute the query against, used for
+ CosmosDB only.
+ nullable: true
+ title: AdminExecuteRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.AdminExecuteResponse:
+ type: object
+ properties:
+ results:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.QueryResult'
+ title: results
+ description: The query results.
+ title: AdminExecuteResponse
+ additionalProperties: false
+ bytebase.v1.Advice:
+ type: object
+ properties:
+ status:
+ title: status
+ description: The advice level.
+ $ref: '#/components/schemas/bytebase.v1.Advice.Level'
+ code:
+ type: integer
+ title: code
+ format: int32
+ description: The advice code.
+ title:
+ type: string
+ title: title
+ description: The advice title.
+ content:
+ type: string
+ title: content
+ description: The advice content.
+ startPosition:
+ title: start_position
+ description: |-
+ The start_position is inclusive and the end_position is exclusive.
+ TODO: use range instead
+ $ref: '#/components/schemas/bytebase.v1.Position'
+ endPosition:
+ title: end_position
+ $ref: '#/components/schemas/bytebase.v1.Position'
+ ruleType:
+ title: rule_type
+ description: The type of linting rule that generated this advice.
+ $ref: '#/components/schemas/bytebase.v1.Advice.RuleType'
+ title: Advice
+ additionalProperties: false
+ bytebase.v1.Advice.Level:
+ type: string
+ title: Level
+ enum:
+ - ADVICE_LEVEL_UNSPECIFIED
+ - SUCCESS
+ - WARNING
+ - ERROR
+ description: Level represents the severity level of the advice.
+ bytebase.v1.Advice.RuleType:
+ type: string
+ title: RuleType
+ enum:
+ - RULE_TYPE_UNSPECIFIED
+ - PARSER_BASED
+ - AI_POWERED
+ description: RuleType indicates the source of the linting rule.
+ bytebase.v1.Algorithm:
+ type: object
+ oneOf:
+ - properties:
+ fullMask:
+ title: full_mask
+ $ref: '#/components/schemas/bytebase.v1.Algorithm.FullMask'
+ title: full_mask
+ required:
+ - fullMask
+ - properties:
+ innerOuterMask:
+ title: inner_outer_mask
+ $ref: '#/components/schemas/bytebase.v1.Algorithm.InnerOuterMask'
+ title: inner_outer_mask
+ required:
+ - innerOuterMask
+ - properties:
+ md5Mask:
+ title: md5_mask
+ $ref: '#/components/schemas/bytebase.v1.Algorithm.MD5Mask'
+ title: md5_mask
+ required:
+ - md5Mask
+ - properties:
+ rangeMask:
+ title: range_mask
+ $ref: '#/components/schemas/bytebase.v1.Algorithm.RangeMask'
+ title: range_mask
+ required:
+ - rangeMask
+ title: Algorithm
+ additionalProperties: false
+ bytebase.v1.Algorithm.FullMask:
+ type: object
+ properties:
+ substitution:
+ type: string
+ title: substitution
+ description: |-
+ substitution is the string used to replace the original value, the
+ max length of the string is 16 bytes.
+ title: FullMask
+ additionalProperties: false
+ bytebase.v1.Algorithm.InnerOuterMask:
+ type: object
+ properties:
+ prefixLen:
+ type: integer
+ title: prefix_len
+ format: int32
+ suffixLen:
+ type: integer
+ title: suffix_len
+ format: int32
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.Algorithm.InnerOuterMask.MaskType'
+ substitution:
+ type: string
+ title: substitution
+ title: InnerOuterMask
+ additionalProperties: false
+ bytebase.v1.Algorithm.InnerOuterMask.MaskType:
+ type: string
+ title: MaskType
+ enum:
+ - MASK_TYPE_UNSPECIFIED
+ - INNER
+ - OUTER
+ bytebase.v1.Algorithm.MD5Mask:
+ type: object
+ properties:
+ salt:
+ type: string
+ title: salt
+ description: salt is the salt value to generate a different hash that with the word alone.
+ title: MD5Mask
+ additionalProperties: false
+ bytebase.v1.Algorithm.RangeMask:
+ type: object
+ properties:
+ slices:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Algorithm.RangeMask.Slice'
+ title: slices
+ description: |-
+ We store it as a repeated field to face the fact that the original value may have multiple parts should be masked.
+ But frontend can be started with a single rule easily.
+ title: RangeMask
+ additionalProperties: false
+ bytebase.v1.Algorithm.RangeMask.Slice:
+ type: object
+ properties:
+ start:
+ type: integer
+ title: start
+ format: int32
+ description: |-
+ start is the start character index (0-based) of the original value, should be less than end.
+ Uses character indices (not byte offsets) for display-oriented masking.
+ Example: For "你好world", character index 2 refers to 'w' (the 3rd character).
+ end:
+ type: integer
+ title: end
+ format: int32
+ description: |-
+ end is the end character index (exclusive) of the original value.
+ Uses character indices (not byte offsets) for display-oriented masking.
+ substitution:
+ type: string
+ title: substitution
+ description: substitution is the string used to replace the OriginalValue[start:end).
+ title: Slice
+ additionalProperties: false
+ bytebase.v1.Announcement:
+ type: object
+ properties:
+ level:
+ title: level
+ description: The alert level of announcement
+ $ref: '#/components/schemas/bytebase.v1.Announcement.AlertLevel'
+ text:
+ type: string
+ title: text
+ description: The text of announcement
+ link:
+ type: string
+ title: link
+ description: The optional link, user can follow the link to check extra details
+ title: Announcement
+ additionalProperties: false
+ bytebase.v1.Announcement.AlertLevel:
+ type: string
+ title: AlertLevel
+ enum:
+ - ALERT_LEVEL_UNSPECIFIED
+ - INFO
+ - WARNING
+ - CRITICAL
+ description: 'We support three levels of AlertLevel: INFO, WARNING, and ERROR.'
+ bytebase.v1.AppIMSetting:
+ type: object
+ properties:
+ settings:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.AppIMSetting.IMSetting'
+ title: settings
+ title: AppIMSetting
+ additionalProperties: false
+ bytebase.v1.AppIMSetting.DingTalk:
+ type: object
+ properties:
+ clientId:
+ type: string
+ title: client_id
+ writeOnly: true
+ clientSecret:
+ type: string
+ title: client_secret
+ writeOnly: true
+ robotCode:
+ type: string
+ title: robot_code
+ writeOnly: true
+ title: DingTalk
+ additionalProperties: false
+ bytebase.v1.AppIMSetting.Feishu:
+ type: object
+ properties:
+ appId:
+ type: string
+ title: app_id
+ writeOnly: true
+ appSecret:
+ type: string
+ title: app_secret
+ writeOnly: true
+ title: Feishu
+ additionalProperties: false
+ bytebase.v1.AppIMSetting.IMSetting:
+ type: object
+ allOf:
+ - properties:
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.WebhookType'
+ - oneOf:
+ - properties:
+ dingtalk:
+ title: dingtalk
+ $ref: '#/components/schemas/bytebase.v1.AppIMSetting.DingTalk'
+ title: dingtalk
+ required:
+ - dingtalk
+ - properties:
+ feishu:
+ title: feishu
+ $ref: '#/components/schemas/bytebase.v1.AppIMSetting.Feishu'
+ title: feishu
+ required:
+ - feishu
+ - properties:
+ lark:
+ title: lark
+ $ref: '#/components/schemas/bytebase.v1.AppIMSetting.Lark'
+ title: lark
+ required:
+ - lark
+ - properties:
+ slack:
+ title: slack
+ $ref: '#/components/schemas/bytebase.v1.AppIMSetting.Slack'
+ title: slack
+ required:
+ - slack
+ - properties:
+ teams:
+ title: teams
+ $ref: '#/components/schemas/bytebase.v1.AppIMSetting.Teams'
+ title: teams
+ required:
+ - teams
+ - properties:
+ wecom:
+ title: wecom
+ $ref: '#/components/schemas/bytebase.v1.AppIMSetting.Wecom'
+ title: wecom
+ required:
+ - wecom
+ title: IMSetting
+ additionalProperties: false
+ bytebase.v1.AppIMSetting.Lark:
+ type: object
+ properties:
+ appId:
+ type: string
+ title: app_id
+ writeOnly: true
+ appSecret:
+ type: string
+ title: app_secret
+ writeOnly: true
+ title: Lark
+ additionalProperties: false
+ bytebase.v1.AppIMSetting.Slack:
+ type: object
+ properties:
+ token:
+ type: string
+ title: token
+ writeOnly: true
+ title: Slack
+ additionalProperties: false
+ bytebase.v1.AppIMSetting.Teams:
+ type: object
+ properties:
+ tenantId:
+ type: string
+ title: tenant_id
+ description: Azure AD tenant ID (Directory ID).
+ writeOnly: true
+ clientId:
+ type: string
+ title: client_id
+ description: Azure AD application (client) ID.
+ writeOnly: true
+ clientSecret:
+ type: string
+ title: client_secret
+ description: Azure AD client secret.
+ writeOnly: true
+ title: Teams
+ additionalProperties: false
+ bytebase.v1.AppIMSetting.Wecom:
+ type: object
+ properties:
+ corpId:
+ type: string
+ title: corp_id
+ writeOnly: true
+ agentId:
+ type: string
+ title: agent_id
+ writeOnly: true
+ secret:
+ type: string
+ title: secret
+ writeOnly: true
+ title: Wecom
+ additionalProperties: false
+ bytebase.v1.ApprovalFlow:
+ type: object
+ properties:
+ roles:
+ type: array
+ items:
+ type: string
+ title: roles
+ description: The roles required for approval in order.
+ title: ApprovalFlow
+ additionalProperties: false
+ bytebase.v1.ApprovalTemplate:
+ type: object
+ properties:
+ flow:
+ title: flow
+ description: The approval flow definition.
+ $ref: '#/components/schemas/bytebase.v1.ApprovalFlow'
+ title:
+ type: string
+ title: title
+ description: The title of the approval template.
+ description:
+ type: string
+ title: description
+ description: The description of the approval template.
+ title: ApprovalTemplate
+ additionalProperties: false
+ bytebase.v1.ApproveIssueRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the issue to add an approver.
+ Format: projects/{project}/issues/{issue}
+ comment:
+ type: string
+ title: comment
+ description: The comment explaining the approval decision.
+ title: ApproveIssueRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.AuditData:
+ type: object
+ properties:
+ policyDelta:
+ title: policy_delta
+ description: Changes to IAM policies.
+ $ref: '#/components/schemas/bytebase.v1.PolicyDelta'
+ title: AuditData
+ additionalProperties: false
+ description: Additional audit data specific to certain operations.
+ bytebase.v1.AuditLog:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the log.
+ Formats:
+ - projects/{project}/auditLogs/{uid}
+ - workspaces/{workspace}/auditLogs/{uid}
+ readOnly: true
+ createTime:
+ title: create_time
+ description: The timestamp when the audit log was created.
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ user:
+ type: string
+ title: user
+ description: |-
+ The user who performed the action.
+ Format: users/{email}
+ method:
+ type: string
+ title: method
+ description: |-
+ The method or action being audited.
+ For example: /bytebase.v1.SQLService/Query or bb.project.repository.push
+ severity:
+ title: severity
+ description: The severity level of this audit log entry.
+ $ref: '#/components/schemas/bytebase.v1.AuditLog.Severity'
+ resource:
+ type: string
+ title: resource
+ description: The resource associated with this audit log.
+ request:
+ type: string
+ title: request
+ description: The request payload in JSON format.
+ response:
+ type: string
+ title: response
+ description: |-
+ The response payload in JSON format.
+ Some fields may be omitted if they are too large or contain sensitive information.
+ status:
+ title: status
+ description: The status of the operation.
+ $ref: '#/components/schemas/google.rpc.Status'
+ latency:
+ title: latency
+ description: The duration of the operation.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ serviceData:
+ title: service_data
+ description: Service-specific metadata about the request, response, and activities.
+ $ref: '#/components/schemas/google.protobuf.Any'
+ requestMetadata:
+ title: request_metadata
+ description: Metadata about the request context.
+ $ref: '#/components/schemas/bytebase.v1.RequestMetadata'
+ title: AuditLog
+ additionalProperties: false
+ description: Audit log entry recording system activity or API call.
+ bytebase.v1.AuditLog.Severity:
+ type: string
+ title: Severity
+ enum:
+ - SEVERITY_UNSPECIFIED
+ - DEBUG
+ - INFO
+ - NOTICE
+ - WARNING
+ - ERROR
+ - CRITICAL
+ - ALERT
+ - EMERGENCY
+ description: Severity level for audit log entries.
+ bytebase.v1.AuthMethod:
+ type: string
+ title: AuthMethod
+ enum:
+ - AUTH_METHOD_UNSPECIFIED
+ - IAM
+ - CUSTOM
+ description: Authorization method for RPC calls.
+ bytebase.v1.BatchCancelTaskRunsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The task name for the taskRuns.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
+ Use `projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/-` to cancel task runs under the same stage.
+ taskRuns:
+ type: array
+ items:
+ type: string
+ title: task_runs
+ description: |-
+ The taskRuns to cancel.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
+ title: BatchCancelTaskRunsRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.BatchCancelTaskRunsResponse:
+ type: object
+ title: BatchCancelTaskRunsResponse
+ additionalProperties: false
+ bytebase.v1.BatchCreateRevisionsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource shared by all revisions being created.
+ Format: instances/{instance}/databases/{database}
+ requests:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.CreateRevisionRequest'
+ title: requests
+ description: |-
+ The request message specifying the revisions to create.
+ A maximum of 100 revisions can be created in a batch.
+ title: BatchCreateRevisionsRequest
+ required:
+ - parent
+ - requests
+ additionalProperties: false
+ bytebase.v1.BatchCreateRevisionsResponse:
+ type: object
+ properties:
+ revisions:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Revision'
+ title: revisions
+ description: The created revisions.
+ title: BatchCreateRevisionsResponse
+ additionalProperties: false
+ bytebase.v1.BatchCreateSheetsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource where all sheets will be created.
+ Format: projects/{project}
+ requests:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.CreateSheetRequest'
+ title: requests
+ title: BatchCreateSheetsRequest
+ required:
+ - parent
+ - requests
+ additionalProperties: false
+ bytebase.v1.BatchCreateSheetsResponse:
+ type: object
+ properties:
+ sheets:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Sheet'
+ title: sheets
+ title: BatchCreateSheetsResponse
+ additionalProperties: false
+ bytebase.v1.BatchDeleteProjectsRequest:
+ type: object
+ properties:
+ names:
+ type: array
+ items:
+ type: string
+ title: names
+ description: |-
+ The names of the projects to delete.
+ Format: projects/{project}
+ force:
+ type: boolean
+ title: force
+ description: |-
+ If set to true, any databases from this project will be moved to default project.
+ Sheets are not moved since BYTEBASE_ARTIFACT sheets belong to the issue and issue project.
+ Open issues will remain open but associated with the deleted project.
+ If set to false, the operation will fail if the project has databases or open issues.
+ title: BatchDeleteProjectsRequest
+ required:
+ - names
+ additionalProperties: false
+ bytebase.v1.BatchDeparseRequest:
+ type: object
+ properties:
+ expressions:
+ type: array
+ items:
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ title: expressions
+ description: The CEL expression ASTs to deparse.
+ title: BatchDeparseRequest
+ additionalProperties: false
+ description: Request message for batch deparsing CEL expressions.
+ bytebase.v1.BatchDeparseResponse:
+ type: object
+ properties:
+ expressions:
+ type: array
+ items:
+ type: string
+ title: expressions
+ description: The deparsed CEL expressions as strings.
+ title: BatchDeparseResponse
+ additionalProperties: false
+ description: Response message for batch deparsing CEL expressions.
+ bytebase.v1.BatchGetDatabasesRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource shared by all databases being retrieved.
+ - projects/{project}: batch get databases in a project;
+ - instances/{instances}: batch get databases in a instance;
+ Use "-" as wildcard to batch get databases across parent.
+ names:
+ type: array
+ items:
+ type: string
+ title: names
+ description: The list of database names to retrieve.
+ title: BatchGetDatabasesRequest
+ required:
+ - parent
+ - names
+ additionalProperties: false
+ bytebase.v1.BatchGetDatabasesResponse:
+ type: object
+ properties:
+ databases:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Database'
+ title: databases
+ description: The databases from the specified request.
+ title: BatchGetDatabasesResponse
+ additionalProperties: false
+ bytebase.v1.BatchGetGroupsRequest:
+ type: object
+ properties:
+ names:
+ type: array
+ items:
+ type: string
+ title: names
+ description: |-
+ The group names to retrieve.
+ Format: groups/{email}
+ title: BatchGetGroupsRequest
+ required:
+ - names
+ additionalProperties: false
+ description: Request message for batch getting groups.
+ bytebase.v1.BatchGetGroupsResponse:
+ type: object
+ properties:
+ groups:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Group'
+ title: groups
+ description: The groups from the specified request.
+ title: BatchGetGroupsResponse
+ additionalProperties: false
+ description: Response message for batch getting groups.
+ bytebase.v1.BatchGetProjectsRequest:
+ type: object
+ properties:
+ names:
+ type: array
+ items:
+ type: string
+ title: names
+ description: |-
+ The names of projects to retrieve.
+ Format: projects/{project}
+ title: BatchGetProjectsRequest
+ required:
+ - names
+ additionalProperties: false
+ bytebase.v1.BatchGetProjectsResponse:
+ type: object
+ properties:
+ projects:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ title: projects
+ description: The projects from the specified request.
+ title: BatchGetProjectsResponse
+ additionalProperties: false
+ bytebase.v1.BatchGetUsersRequest:
+ type: object
+ properties:
+ names:
+ type: array
+ items:
+ type: string
+ title: names
+ description: |-
+ The user names to retrieve.
+ Format: users/{email}
+ title: BatchGetUsersRequest
+ required:
+ - names
+ additionalProperties: false
+ bytebase.v1.BatchGetUsersResponse:
+ type: object
+ properties:
+ users:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.User'
+ title: users
+ description: The users from the specified request.
+ title: BatchGetUsersResponse
+ additionalProperties: false
+ bytebase.v1.BatchParseRequest:
+ type: object
+ properties:
+ expressions:
+ type: array
+ items:
+ type: string
+ title: expressions
+ description: The CEL expression strings to parse.
+ title: BatchParseRequest
+ additionalProperties: false
+ description: Request message for batch parsing CEL expressions.
+ bytebase.v1.BatchParseResponse:
+ type: object
+ properties:
+ expressions:
+ type: array
+ items:
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ title: expressions
+ description: The parsed CEL expressions as AST.
+ title: BatchParseResponse
+ additionalProperties: false
+ description: Response message for batch parsing CEL expressions.
+ bytebase.v1.BatchRunTasksRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The stage name for the tasks.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}
+ tasks:
+ type: array
+ items:
+ type: string
+ title: tasks
+ description: |-
+ The tasks to run.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
+ runTime:
+ title: run_time
+ description: The task run should run after run_time.
+ nullable: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ title: BatchRunTasksRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.BatchRunTasksResponse:
+ type: object
+ title: BatchRunTasksResponse
+ additionalProperties: false
+ bytebase.v1.BatchSkipTasksRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The stage name for the tasks.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}
+ tasks:
+ type: array
+ items:
+ type: string
+ title: tasks
+ description: |-
+ The tasks to skip.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
+ reason:
+ type: string
+ title: reason
+ maxLength: 1000
+ description: The reason for skipping the tasks.
+ title: BatchSkipTasksRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.BatchSkipTasksResponse:
+ type: object
+ title: BatchSkipTasksResponse
+ additionalProperties: false
+ bytebase.v1.BatchSyncDatabasesRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource shared by all databases being updated.
+ Format: instances/{instance}
+ If the operation spans parents, a dash (-) may be accepted as a wildcard.
+ names:
+ type: array
+ items:
+ type: string
+ title: names
+ description: The list of database names to sync.
+ title: BatchSyncDatabasesRequest
+ required:
+ - names
+ additionalProperties: false
+ bytebase.v1.BatchSyncDatabasesResponse:
+ type: object
+ title: BatchSyncDatabasesResponse
+ additionalProperties: false
+ bytebase.v1.BatchSyncInstancesRequest:
+ type: object
+ properties:
+ requests:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.SyncInstanceRequest'
+ title: requests
+ description: |-
+ The request message specifying the instances to sync.
+ A maximum of 1000 instances can be synced in a batch.
+ title: BatchSyncInstancesRequest
+ required:
+ - requests
+ additionalProperties: false
+ bytebase.v1.BatchSyncInstancesResponse:
+ type: object
+ title: BatchSyncInstancesResponse
+ additionalProperties: false
+ bytebase.v1.BatchUpdateDatabasesRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource shared by all databases being updated.
+ Format: instances/{instance}
+ If the operation spans parents, a dash (-) may be accepted as a wildcard.
+ We only support updating the project of databases for now.
+ requests:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.UpdateDatabaseRequest'
+ title: requests
+ description: |-
+ The request message specifying the resources to update.
+ A maximum of 1000 databases can be modified in a batch.
+ title: BatchUpdateDatabasesRequest
+ required:
+ - requests
+ additionalProperties: false
+ bytebase.v1.BatchUpdateDatabasesResponse:
+ type: object
+ properties:
+ databases:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Database'
+ title: databases
+ description: Databases updated.
+ title: BatchUpdateDatabasesResponse
+ additionalProperties: false
+ bytebase.v1.BatchUpdateInstancesRequest:
+ type: object
+ properties:
+ requests:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.UpdateInstanceRequest'
+ title: requests
+ description: The request message specifying the resources to update.
+ title: BatchUpdateInstancesRequest
+ required:
+ - requests
+ additionalProperties: false
+ bytebase.v1.BatchUpdateInstancesResponse:
+ type: object
+ properties:
+ instances:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ title: instances
+ title: BatchUpdateInstancesResponse
+ additionalProperties: false
+ bytebase.v1.BatchUpdateIssuesStatusRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource shared by all issues being updated.
+ Format: projects/{project}
+ If the operation spans parents, a dash (-) may be accepted as a wildcard.
+ We only support updating the status of databases for now.
+ issues:
+ type: array
+ items:
+ type: string
+ title: issues
+ description: |-
+ The list of issues to update.
+ Format: projects/{project}/issues/{issue}
+ status:
+ title: status
+ description: The new status.
+ $ref: '#/components/schemas/bytebase.v1.IssueStatus'
+ reason:
+ type: string
+ title: reason
+ description: The reason for the status change.
+ title: BatchUpdateIssuesStatusRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.BatchUpdateIssuesStatusResponse:
+ type: object
+ title: BatchUpdateIssuesStatusResponse
+ additionalProperties: false
+ bytebase.v1.BatchUpdateWorksheetOrganizerRequest:
+ type: object
+ properties:
+ requests:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.UpdateWorksheetOrganizerRequest'
+ title: requests
+ title: BatchUpdateWorksheetOrganizerRequest
+ required:
+ - requests
+ additionalProperties: false
+ bytebase.v1.BatchUpdateWorksheetOrganizerResponse:
+ type: object
+ properties:
+ worksheetOrganizers:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ title: worksheet_organizers
+ title: BatchUpdateWorksheetOrganizerResponse
+ additionalProperties: false
+ bytebase.v1.Binding:
+ type: object
+ properties:
+ role:
+ type: string
+ title: role
+ description: |-
+ The role that is assigned to the members.
+ Format: roles/{role}
+ members:
+ type: array
+ items:
+ type: string
+ title: members
+ description: |-
+ Specifies the principals requesting access for a Bytebase resource.
+ For users, the member should be: user:{email}
+ For groups, the member should be: group:{email}
+ condition:
+ title: condition
+ description: |-
+ The condition that is associated with this binding, only used in the project IAM policy.
+ If the condition evaluates to true, then this binding applies to the current request.
+ If the condition evaluates to false, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- When paginating, all other parameters provided to `ListReleases` must match
- the call that provided the page token.
- schema:
- type: string
- - name: digest
- in: query
- description: Search by the digest of the release.
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchReleasesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/rollouts:
- get:
- tags:
- - RolloutService
- description: |-
- Lists rollouts in a project.
- Permissions required: bb.rollouts.list
- operationId: RolloutService_ListRollouts
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- The maximum number of rollouts to return. The service may return fewer than
- this value.
- If unspecified, at most 10 rollouts will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListRollouts` call.
- Provide this to retrieve the subsequent page.
+ Support variables:
+ resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" role, support "==" operator.
+ resource.schema_name: the schema name, used by the "roles/sqlEditorUser" role, support "==" operator.
+ resource.table_name: the table name, used by the "roles/sqlEditorUser" role, support "==" operator.
+ request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
- When paginating, all other parameters provided to `ListRollouts` must match
- the call that provided the page token.
- schema:
- type: string
- - name: filter
- in: query
- description: |-
- Filter is used to filter rollouts returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ For example:
+ resource.database == "instances/local-pg/databases/postgres" && resource.schema_name in ["public","another_schema"]
+ resource.database == "instances/local-pg/databases/bytebase" && resource.schema_name == "public" && resource.table_name in ["audit_log"]
+ request.time < timestamp("2025-04-26T11:24:48.655Z")
+ $ref: '#/components/schemas/google.type.Expr'
+ parsedExpr:
+ title: parsed_expr
+ description: The parsed expression of the condition.
+ readOnly: true
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ title: Binding
+ additionalProperties: false
+ description: Binding associates members with a role and optional conditions.
+ bytebase.v1.BindingDelta:
+ type: object
+ properties:
+ action:
+ title: action
+ description: The action that was performed on a Binding.
+ $ref: '#/components/schemas/bytebase.v1.BindingDelta.Action'
+ role:
+ type: string
+ title: role
+ description: |-
+ Role that is assigned to `members`.
+ For example, `roles/projectOwner`.
+ member:
+ type: string
+ title: member
+ description: Follows the same format of Binding.members.
+ condition:
+ title: condition
+ description: The condition that is associated with this binding.
+ $ref: '#/components/schemas/google.type.Expr'
+ title: BindingDelta
+ additionalProperties: false
+ description: A single change to a binding.
+ bytebase.v1.BindingDelta.Action:
+ type: string
+ title: Action
+ enum:
+ - ACTION_UNSPECIFIED
+ - ADD
+ - REMOVE
+ description: Type of action performed on a binding.
+ bytebase.v1.BoundingBox:
+ type: object
+ properties:
+ xmin:
+ type: number
+ title: xmin
+ format: double
+ description: Minimum X coordinate
+ ymin:
+ type: number
+ title: ymin
+ format: double
+ description: Minimum Y coordinate
+ xmax:
+ type: number
+ title: xmax
+ format: double
+ description: Maximum X coordinate
+ ymax:
+ type: number
+ title: ymax
+ format: double
+ description: Maximum Y coordinate
+ title: BoundingBox
+ additionalProperties: false
+ description: BoundingBox defines the spatial bounds for GEOMETRY spatial indexes.
+ bytebase.v1.CancelPlanCheckRunRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the plan check run to cancel.
+ Format: projects/{project}/plans/{plan}/planCheckRun
+ title: CancelPlanCheckRunRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.CancelPlanCheckRunResponse:
+ type: object
+ title: CancelPlanCheckRunResponse
+ additionalProperties: false
+ bytebase.v1.Changelog:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: instances/{instance}/databases/{database}/changelogs/{changelog}'
+ createTime:
+ title: create_time
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ status:
+ title: status
+ $ref: '#/components/schemas/bytebase.v1.Changelog.Status'
+ statement:
+ type: string
+ title: statement
+ description: The statement is used for preview purpose.
+ statementSize:
+ type:
+ - integer
+ - string
+ title: statement_size
+ format: int64
+ statementSheet:
+ type: string
+ title: statement_sheet
+ description: |-
+ The name of the sheet resource.
+ Format: projects/{project}/sheets/{sheet}
+ schema:
+ type: string
+ title: schema
+ schemaSize:
+ type:
+ - integer
+ - string
+ title: schema_size
+ format: int64
+ prevSchema:
+ type: string
+ title: prev_schema
+ prevSchemaSize:
+ type:
+ - integer
+ - string
+ title: prev_schema_size
+ format: int64
+ taskRun:
+ type: string
+ title: task_run
+ description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
+ version:
+ type: string
+ title: version
+ description: Could be empty
+ revision:
+ type: string
+ title: revision
+ description: |-
+ Could be empty
+ Or present but not found if deleted
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.Changelog.Type'
+ title: Changelog
+ additionalProperties: false
+ bytebase.v1.Changelog.Status:
+ type: string
+ title: Status
+ enum:
+ - STATUS_UNSPECIFIED
+ - PENDING
+ - DONE
+ - FAILED
+ bytebase.v1.Changelog.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - BASELINE
+ - MIGRATE
+ - SDL
+ bytebase.v1.ChangelogView:
+ type: string
+ title: ChangelogView
+ enum:
+ - CHANGELOG_VIEW_UNSPECIFIED
+ - CHANGELOG_VIEW_BASIC
+ - CHANGELOG_VIEW_FULL
+ bytebase.v1.CheckConstraintMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a check constraint.
+ expression:
+ type: string
+ title: expression
+ description: The expression is the expression of a check constraint.
+ title: CheckConstraintMetadata
+ additionalProperties: false
+ description: CheckConstraintMetadata is the metadata for check constraints.
+ bytebase.v1.CheckReleaseRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: 'Format: projects/{project}'
+ release:
+ title: release
+ description: The release to check.
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ targets:
+ type: array
+ items:
+ type: string
+ title: targets
+ description: |-
+ The targets to dry-run the release.
+ Can be database or databaseGroup.
+ Format:
+ projects/{project}/databaseGroups/{databaseGroup}
+ instances/{instance}/databases/{database}
+ customRules:
+ type: string
+ title: custom_rules
+ description: |-
+ Custom linting rules in natural language for AI-powered validation.
+ Each rule should be a clear statement describing the desired schema constraint.
+ Example: "All tables must have a primary key"
+ Example: "VARCHAR columns should specify a maximum length"
+ title: CheckReleaseRequest
+ required:
+ - parent
+ - release
+ additionalProperties: false
+ bytebase.v1.CheckReleaseResponse:
+ type: object
+ properties:
+ results:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.CheckReleaseResponse.CheckResult'
+ title: results
+ description: The check results for each file and target combination.
+ affectedRows:
+ type:
+ - integer
+ - string
+ title: affected_rows
+ format: int64
+ description: The total affected rows across all checks.
+ riskLevel:
+ title: risk_level
+ description: The aggregated risk level of the check.
+ $ref: '#/components/schemas/bytebase.v1.RiskLevel'
+ title: CheckReleaseResponse
+ additionalProperties: false
+ bytebase.v1.CheckReleaseResponse.CheckResult:
+ type: object
+ properties:
+ file:
+ type: string
+ title: file
+ description: The file path that is being checked.
+ target:
+ type: string
+ title: target
+ description: |-
+ The target that the check is performed on.
+ Should be a database. Format: instances/{instance}/databases/{database}
+ advices:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Advice'
+ title: advices
+ description: The list of advice for the file and the target.
+ affectedRows:
+ type:
+ - integer
+ - string
+ title: affected_rows
+ format: int64
+ description: The count of affected rows of the statement on the target.
+ riskLevel:
+ title: risk_level
+ description: The risk level of the statement on the target.
+ $ref: '#/components/schemas/bytebase.v1.RiskLevel'
+ title: CheckResult
+ additionalProperties: false
+ description: Check result for a single release file on a target database.
+ bytebase.v1.ColumnCatalog:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The column name.
+ semanticType:
+ type: string
+ title: semantic_type
+ description: The semantic type describing the data purpose.
+ labels:
+ type: object
+ title: labels
+ additionalProperties:
+ type: string
+ title: value
+ description: User-defined labels for this column.
+ classification:
+ type: string
+ title: classification
+ description: The data classification level for this column.
+ objectSchema:
+ title: object_schema
+ description: Object schema for complex column types like JSON.
+ nullable: true
+ $ref: '#/components/schemas/bytebase.v1.ObjectSchema'
+ title: ColumnCatalog
+ additionalProperties: false
+ description: Column metadata within a table.
+ bytebase.v1.ColumnCatalog.LabelsEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: string
+ title: value
+ title: LabelsEntry
+ additionalProperties: false
+ bytebase.v1.ColumnMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a column.
+ position:
+ type: integer
+ title: position
+ format: int32
+ description: The position is the position in columns.
+ hasDefault:
+ type: boolean
+ title: has_default
+ default:
+ type: string
+ title: default
+ description: The default value of column.
+ defaultOnNull:
+ type: boolean
+ title: default_on_null
+ description: |-
+ Oracle specific metadata.
+ The default_on_null is the default on null of a column.
+ onUpdate:
+ type: string
+ title: on_update
+ description: |-
+ The on_update is the on update action of a column.
+ For MySQL like databases, it's only supported for TIMESTAMP columns with
+ CURRENT_TIMESTAMP as on update value.
+ nullable:
+ type: boolean
+ title: nullable
+ description: The nullable is the nullable of a column.
+ type:
+ type: string
+ title: type
+ description: The type is the type of a column.
+ characterSet:
+ type: string
+ title: character_set
+ description: The character_set is the character_set of a column.
+ collation:
+ type: string
+ title: collation
+ description: The collation is the collation of a column.
+ comment:
+ type: string
+ title: comment
+ description: The comment is the comment of a column.
+ generation:
+ title: generation
+ description: The generation is the generation of a column.
+ $ref: '#/components/schemas/bytebase.v1.GenerationMetadata'
+ isIdentity:
+ type: boolean
+ title: is_identity
+ identityGeneration:
+ title: identity_generation
+ description: The identity_generation is for identity columns, PG only.
+ $ref: '#/components/schemas/bytebase.v1.ColumnMetadata.IdentityGeneration'
+ identitySeed:
+ type:
+ - integer
+ - string
+ title: identity_seed
+ format: int64
+ description: The identity_seed is for identity columns, MSSQL only.
+ identityIncrement:
+ type:
+ - integer
+ - string
+ title: identity_increment
+ format: int64
+ description: The identity_increment is for identity columns, MSSQL only.
+ defaultConstraintName:
+ type: string
+ title: default_constraint_name
+ description: |-
+ The default_constraint_name is the name of the default constraint, MSSQL only.
+ In MSSQL, default values are implemented as named constraints. When modifying or
+ dropping a column's default value, you must reference the constraint by name.
+ This field stores the actual constraint name from the database.
- Supported filters:
- - update_time: rollout update time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
- - task_type: the task type, support "in" operator, check the Task.Type enum for the values.
+ Example: A column definition like:
+ CREATE TABLE employees (
+ status NVARCHAR(20) DEFAULT 'active'
+ )
- For example:
- update_time >= "2025-01-02T15:04:05Z07:00"
- task_type in ["DATABASE_MIGRATE", "DATABASE_EXPORT"]
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListRolloutsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/rollouts/{rollout}/stages/{stage}:export:
- post:
- tags:
- - SQLService
- description: |-
- Exports query results to a file format.
- Permissions required: bb.databases.get
- operationId: SQLService_Export
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: rollout
- in: path
- description: The rollout id.
- required: true
- schema:
- type: string
- - name: stage
- in: path
- description: The stage id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/rollouts/{rollout}:export:
- post:
- tags:
- - SQLService
- description: |-
- Exports query results to a file format.
- Permissions required: bb.databases.get
- operationId: SQLService_Export
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: rollout
- in: path
- description: The rollout id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/sheets:
- post:
- tags:
- - SheetService
- description: |-
- Creates a new SQL sheet.
- Permissions required: bb.sheets.create
- operationId: SheetService_CreateSheet
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Sheet'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Sheet'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/sheets/{sheet}:
- get:
- tags:
- - SheetService
- description: |-
- Retrieves a SQL sheet by name.
- Permissions required: bb.sheets.get
- operationId: SheetService_GetSheet
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: sheet
- in: path
- description: The sheet id.
- required: true
- schema:
- type: string
- - name: raw
- in: query
- description: By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content.
- schema:
- type: boolean
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Sheet'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/sheets:batchCreate:
- post:
- tags:
- - SheetService
- description: |-
- Creates multiple SQL sheets in a single operation.
- Permissions required: bb.sheets.create
- operationId: SheetService_BatchCreateSheets
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchCreateSheetsRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchCreateSheetsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/webhooks/{webhook}:removeWebhook:
- post:
- tags:
- - ProjectService
- description: |-
- Removes a webhook from a project.
- Permissions required: bb.projects.update
- operationId: ProjectService_RemoveWebhook
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: webhook
- in: path
- description: The webhook id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RemoveWebhookRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Project'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}/webhooks/{webhook}:updateWebhook:
- patch:
- tags:
- - ProjectService
- description: |-
- Updates an existing webhook configuration.
- Permissions required: bb.projects.update
- operationId: ProjectService_UpdateWebhook
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- - name: webhook
- in: path
- description: The webhook id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the webhook is not found, a new webhook will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Webhook'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Project'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}:addWebhook:
- post:
- tags:
- - ProjectService
- description: |-
- Adds a webhook to a project for notifications.
- Permissions required: bb.projects.update
- operationId: ProjectService_AddWebhook
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AddWebhookRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Project'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}:getIamPolicy:
- get:
- tags:
- - ProjectService
- description: |-
- Retrieves the IAM policy for a project.
- Permissions required: bb.projects.getIamPolicy
- operationId: ProjectService_GetIamPolicy
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IamPolicy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}:setIamPolicy:
- post:
- tags:
- - ProjectService
- description: |-
- Sets the IAM policy for a project.
- Permissions required: bb.projects.setIamPolicy
- operationId: ProjectService_SetIamPolicy
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SetIamPolicyRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IamPolicy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}:testWebhook:
- post:
- tags:
- - ProjectService
- description: |-
- Tests a webhook by sending a test notification.
- Permissions required: bb.projects.update
- operationId: ProjectService_TestWebhook
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TestWebhookRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TestWebhookResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects/{project}:undelete:
- post:
- tags:
- - ProjectService
- description: |-
- Restores a soft-deleted project.
- Permissions required: bb.projects.undelete
- operationId: ProjectService_UndeleteProject
- parameters:
- - name: project
- in: path
- description: The project id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UndeleteProjectRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Project'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects:batchDelete:
- post:
- tags:
- - ProjectService
- description: |-
- Deletes multiple projects in a single operation.
- Permissions required: bb.projects.delete
- operationId: ProjectService_BatchDeleteProjects
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchDeleteProjectsRequest'
- required: true
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects:batchGet:
- get:
- tags:
- - ProjectService
- description: |-
- BatchGetProjects retrieves multiple projects by their names.
- Permissions required: bb.projects.get
- operationId: ProjectService_BatchGetProjects
- parameters:
- - name: names
- in: query
- description: |-
- The names of projects to retrieve.
- Format: projects/{project}
- schema:
- type: array
- items:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchGetProjectsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/projects:search:
- post:
- tags:
- - ProjectService
- description: |-
- Searches for projects with advanced filtering capabilities.
- Permissions required: bb.projects.get (or project-level bb.projects.get for specific projects)
- operationId: ProjectService_SearchProjects
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchProjectsRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchProjectsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/queryHistories:search:
- post:
- tags:
- - SQLService
- description: |-
- SearchQueryHistories searches query histories for the caller.
- Permissions required: None (only returns caller's own query histories)
- operationId: SQLService_SearchQueryHistories
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchQueryHistoriesRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchQueryHistoriesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/reviewConfigs:
- get:
- tags:
- - ReviewConfigService
- description: |-
- Lists all SQL review configurations.
- Permissions required: bb.reviewConfigs.list
- operationId: ReviewConfigService_ListReviewConfigs
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListReviewConfigsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - ReviewConfigService
- description: |-
- Creates a new SQL review configuration.
- Permissions required: bb.reviewConfigs.create
- operationId: ReviewConfigService_CreateReviewConfig
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ReviewConfig'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ReviewConfig'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/reviewConfigs/{reviewConfig}:
- get:
- tags:
- - ReviewConfigService
- description: |-
- Retrieves a SQL review configuration by name.
- Permissions required: bb.reviewConfigs.get
- operationId: ReviewConfigService_GetReviewConfig
- parameters:
- - name: reviewConfig
- in: path
- description: The reviewConfig id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ReviewConfig'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - ReviewConfigService
- description: |-
- Deletes a SQL review configuration.
- Permissions required: bb.reviewConfigs.delete
- operationId: ReviewConfigService_DeleteReviewConfig
- parameters:
- - name: reviewConfig
- in: path
- description: The reviewConfig id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - ReviewConfigService
- description: |-
- Updates a SQL review configuration.
- Permissions required: bb.reviewConfigs.update
- When allow_missing=true, also requires: bb.reviewConfigs.create
- operationId: ReviewConfigService_UpdateReviewConfig
- parameters:
- - name: reviewConfig
- in: path
- description: The reviewConfig id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the config is not found, a new config will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ReviewConfig'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ReviewConfig'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/roles:
- get:
- tags:
- - RoleService
- description: |-
- Lists roles in the workspace.
- Permissions required: bb.roles.list
- operationId: RoleService_ListRoles
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListRolesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - RoleService
- description: |-
- Creates a new custom role.
- Permissions required: bb.roles.create
- operationId: RoleService_CreateRole
- parameters:
- - name: roleId
- in: query
- description: |-
- The ID to use for the role, which will become the final component
- of the role's resource name.
+ Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
+ or a user-defined name if specified:
+ ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status
- This value should be 4-63 characters, and valid characters
- are /[a-z][A-Z][0-9]/.
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Role'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Role'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/roles/{role}:
- get:
- tags:
- - RoleService
- description: |-
- Retrieves a role by name.
- Permissions required: bb.roles.get
- operationId: RoleService_GetRole
- parameters:
- - name: role
- in: path
- description: The role id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Role'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - RoleService
- description: |-
- Deletes a custom role.
- Permissions required: bb.roles.delete
- operationId: RoleService_DeleteRole
- parameters:
- - name: role
- in: path
- description: The role id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - RoleService
- description: |-
- Updates a role's properties.
- Permissions required: bb.roles.update
- When allow_missing=true, also requires: bb.roles.create
- operationId: RoleService_UpdateRole
- parameters:
- - name: role
- in: path
- description: The role id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the role is not found, a new role will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Role'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Role'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/schemaDesign:diffMetadata:
- post:
- tags:
- - SQLService
- description: |-
- Computes schema differences between two database metadata.
- Permissions required: None
- operationId: SQLService_DiffMetadata
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DiffMetadataRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/DiffMetadataResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/settings:
- get:
- tags:
- - SettingService
- description: |-
- Lists all workspace settings.
- Permissions required: bb.settings.list
- operationId: SettingService_ListSettings
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListSettingsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/settings/{setting}:
- get:
- tags:
- - SettingService
- description: |-
- Retrieves a workspace setting by name.
- Permissions required: bb.settings.get
- operationId: SettingService_GetSetting
- parameters:
- - name: setting
- in: path
- description: The setting id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Setting'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - SettingService
- description: |-
- Updates a workspace setting.
- Permissions required: bb.settings.set
- operationId: SettingService_UpdateSetting
- parameters:
- - name: setting
- in: path
- description: The setting id.
- required: true
- schema:
- type: string
- - name: validateOnly
- in: query
- description: |-
- validate_only is a flag to indicate whether to validate the setting value,
- server would not persist the setting value if it is true.
- schema:
- type: boolean
- - name: allowMissing
- in: query
- schema:
- type: boolean
- - name: updateMask
- in: query
- schema:
- type: string
- format: field-mask
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Setting'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Setting'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/sql/aiCompletion:
- post:
- tags:
- - SQLService
- description: |-
- Provides AI-powered SQL completion and generation.
- Permissions required: None (authenticated users only, requires AI to be enabled)
- operationId: SQLService_AICompletion
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AICompletionRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AICompletionResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/subscription:
- get:
- tags:
- - SubscriptionService
- description: |-
- GetSubscription returns the current subscription.
- If there is no license, we will return a free plan subscription without expiration time.
- If there is expired license, we will return a free plan subscription with the expiration time of the expired license.
- Permissions required: None
- operationId: SubscriptionService_GetSubscription
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Subscription'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - SubscriptionService
- description: |-
- Updates the enterprise license subscription.
- Permissions required: bb.settings.set
- operationId: SubscriptionService_UpdateSubscription
- parameters:
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the subscription is not found, a new subscription will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- type: string
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Subscription'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/users:
- get:
- tags:
- - UserService
- description: |-
- List all users.
- Any authenticated user can list users.
- Permissions required: bb.users.list
- operationId: UserService_ListUsers
- parameters:
- - name: pageSize
- in: query
- description: |-
- The maximum number of users to return. The service may return fewer than
- this value.
- If unspecified, at most 10 users will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListUsers` call.
- Provide this to retrieve the subsequent page.
+ To modify the default, you must first drop the existing constraint by name:
+ ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
+ ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status
- When paginating, all other parameters provided to `ListUsers` must match
- the call that provided the page token.
- schema:
- type: string
- - name: showDeleted
- in: query
- description: Show deleted users if specified.
- schema:
- type: boolean
- - name: filter
- in: query
- description: |-
- Filter is used to filter users returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ This field is populated when syncing from the database. When empty (e.g., when parsing
+ from SQL files), the system cannot automatically drop the constraint.
+ title: ColumnMetadata
+ additionalProperties: false
+ description: ColumnMetadata is the metadata for columns.
+ bytebase.v1.ColumnMetadata.IdentityGeneration:
+ type: string
+ title: IdentityGeneration
+ enum:
+ - IDENTITY_GENERATION_UNSPECIFIED
+ - ALWAYS
+ - BY_DEFAULT
+ bytebase.v1.CreateDatabaseGroupRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource where this database group will be created.
+ Format: projects/{project}
+ databaseGroup:
+ title: database_group
+ description: The database group to create.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
+ databaseGroupId:
+ type: string
+ title: database_group_id
+ description: |-
+ The ID to use for the database group, which will become the final component of
+ the database group's resource name.
- Supported filter:
- - name: the user name, support "==" and ".matches()" operator.
- - email: the user email, support "==" and ".matches()" operator.
- - user_type: the type, check UserType enum for values, support "==", "in [xx]", "!(in [xx])" operator.
- - state: check State enum for values, support "==" operator.
- - project: the project full name in "projects/{id}" format, support "==" operator.
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ validateOnly:
+ type: boolean
+ title: validate_only
+ description: If set, validate the create request and preview the full database group response, but do not actually create it.
+ title: CreateDatabaseGroupRequest
+ required:
+ - parent
+ - databaseGroup
+ additionalProperties: false
+ description: Request message for creating a database group.
+ bytebase.v1.CreateGroupRequest:
+ type: object
+ properties:
+ group:
+ title: group
+ description: The group to create.
+ $ref: '#/components/schemas/bytebase.v1.Group'
+ groupEmail:
+ type: string
+ title: group_email
+ description: |-
+ The email to use for the group, which will become the final component
+ of the group's resource name.
+ title: CreateGroupRequest
+ required:
+ - group
+ - groupEmail
+ additionalProperties: false
+ description: Request message for creating a group.
+ bytebase.v1.CreateIdentityProviderRequest:
+ type: object
+ properties:
+ identityProvider:
+ title: identity_provider
+ description: The identity provider to create.
+ $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
+ identityProviderId:
+ type: string
+ title: identity_provider_id
+ description: |-
+ The ID to use for the identity provider, which will become the final component of
+ the identity provider's resource name.
- For example:
- name == "ed"
- name.matches("ed")
- email == "[email protected]"
- email.matches("ed")
- user_type == "SERVICE_ACCOUNT"
- user_type in ["SERVICE_ACCOUNT", "USER"]
- !(user_type in ["SERVICE_ACCOUNT", "USER"])
- state == "DELETED"
- project == "projects/sample-project"
- You can combine filter conditions like:
- name.matches("ed") && project == "projects/sample-project"
- (name == "ed" || email == "[email protected]") && project == "projects/sample-project"
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListUsersResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- post:
- tags:
- - UserService
- description: |-
- Creates a user. When Disallow Signup is enabled, requires bb.users.create permission; otherwise any user can sign up.
- Permissions required: bb.users.create (only when Disallow Signup is enabled)
- operationId: UserService_CreateUser
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/users/me:
- get:
- tags:
- - UserService
- description: |-
- Get the current authenticated user.
- Permissions required: None
- operationId: UserService_GetCurrentUser
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/users/{user}:
- get:
- tags:
- - UserService
- description: |-
- Get the user.
- Any authenticated user can get the user.
- Permissions required: bb.users.get
- operationId: UserService_GetUser
- parameters:
- - name: user
- in: path
- description: The user id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - UserService
- description: |-
- Deletes a user. Requires bb.users.delete permission with additional validation: the last remaining workspace admin cannot be deleted.
- Permissions required: bb.users.delete
- operationId: UserService_DeleteUser
- parameters:
- - name: user
- in: path
- description: The user id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - UserService
- description: |-
- Updates a user. Users can update their own profile, or users with bb.users.update permission can update any user.
- Note: Email updates are not supported through this API. Use UpdateEmail instead.
- Permissions required: bb.users.update (or self)
- operationId: UserService_UpdateUser
- parameters:
- - name: user
- in: path
- description: The user id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: The list of fields to update.
- schema:
- type: string
- format: field-mask
- - name: otpCode
- in: query
- description: The otp_code is used to verify the user's identity by MFA.
- schema:
- type: string
- - name: regenerateTempMfaSecret
- in: query
- description: |-
- The regenerate_temp_mfa_secret flag means to regenerate temporary MFA secret for user.
- This is used for MFA setup. The temporary MFA secret and recovery codes will be returned in the response.
- schema:
- type: boolean
- - name: regenerateRecoveryCodes
- in: query
- description: The regenerate_recovery_codes flag means to regenerate recovery codes for user.
- schema:
- type: boolean
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the user is not found, a new user will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/users/{user}:undelete:
- post:
- tags:
- - UserService
- description: |-
- Restores a deleted user.
- Permissions required: bb.users.undelete
- operationId: UserService_UndeleteUser
- parameters:
- - name: user
- in: path
- description: The user id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UndeleteUserRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/users/{user}:updateEmail:
- post:
- tags:
- - UserService
- description: |-
- Updates a user's email address.
- Permissions required: bb.users.updateEmail
- operationId: UserService_UpdateEmail
- parameters:
- - name: user
- in: path
- description: The user id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UpdateEmailRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/users:batchGet:
- get:
- tags:
- - UserService
- description: |-
- Get the users in batch.
- Any authenticated user can batch get users.
- Permissions required: bb.users.get
- operationId: UserService_BatchGetUsers
- parameters:
- - name: names
- in: query
- description: |-
- The user names to retrieve.
- Format: users/{email}
- schema:
- type: array
- items:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchGetUsersResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/worksheets:
- post:
- tags:
- - WorksheetService
- description: |-
- Creates a personal worksheet used in SQL Editor. Any authenticated user can create their own worksheets.
- Permissions required: None (authenticated users only)
- operationId: WorksheetService_CreateWorksheet
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Worksheet'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Worksheet'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/worksheets/organizer:batchUpdate:
- patch:
- tags:
- - WorksheetService
- description: |-
- Batch update the organizers of worksheets.
- The access is the same as UpdateWorksheet method.
- Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
- operationId: WorksheetService_BatchUpdateWorksheetOrganizer
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchUpdateWorksheetOrganizerRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BatchUpdateWorksheetOrganizerResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/worksheets/{worksheet}:
- get:
- tags:
- - WorksheetService
- description: |-
- Get a worksheet by name.
- The users can access this method if,
- - they are the creator of the worksheet;
- - they have bb.worksheets.get permission on the workspace;
- - the sheet is shared with them with PROJECT_READ and PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
- Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
- operationId: WorksheetService_GetWorksheet
- parameters:
- - name: worksheet
- in: path
- description: The worksheet id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Worksheet'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- delete:
- tags:
- - WorksheetService
- description: |-
- Delete a worksheet.
- The access is the same as UpdateWorksheet method.
- Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets)
- operationId: WorksheetService_DeleteWorksheet
- parameters:
- - name: worksheet
- in: path
- description: The worksheet id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content: {}
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- patch:
- tags:
- - WorksheetService
- description: |-
- Update a worksheet.
- The users can access this method if,
- - they are the creator of the worksheet;
- - they have bb.worksheets.manage permission on the workspace;
- - the sheet is shared with them with PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
- Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets)
- operationId: WorksheetService_UpdateWorksheet
- parameters:
- - name: worksheet
- in: path
- description: The worksheet id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: |-
- The list of fields to be updated.
- Fields are specified relative to the worksheet.
- (e.g., `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`)
- Only support update the following fields for now:
- - `title`
- - `statement`
- - `starred`
- - `visibility`
- schema:
- type: string
- format: field-mask
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Worksheet'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Worksheet'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/worksheets/{worksheet}/organizer:
- patch:
- tags:
- - WorksheetService
- description: |-
- Update the organizer of a worksheet.
- The access is the same as UpdateWorksheet method.
- Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
- operationId: WorksheetService_UpdateWorksheetOrganizer
- parameters:
- - name: worksheet
- in: path
- description: The worksheet id.
- required: true
- schema:
- type: string
- - name: updateMask
- in: query
- description: |-
- The list of fields to be updated.
- Fields are specified relative to the worksheet organizer.
- Only support update the following fields for now:
- - `starred`
- schema:
- type: string
- format: field-mask
- - name: allowMissing
- in: query
- description: |-
- If set to true, and the worksheet organizer is not found, a new worksheet organizer will be created.
- In this situation, `update_mask` is ignored.
- schema:
- type: boolean
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/WorksheetOrganizer'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/WorksheetOrganizer'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/worksheets:search:
- post:
- tags:
- - WorksheetService
- description: |-
- Search for worksheets.
- This is used for finding my worksheets or worksheets shared by other people.
- The sheet accessibility is the same as GetWorksheet().
- Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
- operationId: WorksheetService_SearchWorksheets
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchWorksheetsRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SearchWorksheetsResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/workspaces/{workspace}/databases:
- get:
- tags:
- - DatabaseService
- description: |-
- Lists databases in a project, instance, or workspace.
- Permissions required: bb.projects.get (for project parent), bb.databases.list (for workspace parent), or bb.instances.get (for instance parent)
- operationId: DatabaseService_ListDatabases
- parameters:
- - name: workspace
- in: path
- description: The workspace id.
- required: true
- schema:
- type: string
- - name: pageSize
- in: query
- description: |-
- The maximum number of databases to return. The service may return fewer
- than this value.
- If unspecified, at most 10 databases will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- schema:
- type: integer
- format: int32
- - name: pageToken
- in: query
- description: |-
- A page token, received from a previous `ListDatabases` call.
- Provide this to retrieve the subsequent page.
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ validateOnly:
+ type: boolean
+ title: validate_only
+ description: If set to true, the request will be validated without actually creating the identity provider.
+ title: CreateIdentityProviderRequest
+ required:
+ - identityProvider
+ additionalProperties: false
+ bytebase.v1.CreateInstanceRequest:
+ type: object
+ properties:
+ instance:
+ title: instance
+ description: The instance to create.
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ instanceId:
+ type: string
+ title: instance_id
+ description: |-
+ The ID to use for the instance, which will become the final component of
+ the instance's resource name.
- When paginating, all other parameters provided to `ListDatabases` must
- match the call that provided the page token.
- schema:
- type: string
- - name: filter
- in: query
- description: |-
- Filter is used to filter databases returned in the list.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ validateOnly:
+ type: boolean
+ title: validate_only
+ description: Validate only also tests the data source connection.
+ title: CreateInstanceRequest
+ required:
+ - instance
+ additionalProperties: false
+ bytebase.v1.CreateIssueCommentRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The issue name
+ Format: projects/{project}/issues/{issue}
+ issueComment:
+ title: issue_comment
+ description: The comment to create.
+ $ref: '#/components/schemas/bytebase.v1.IssueComment'
+ title: CreateIssueCommentRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.CreateIssueRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent, which owns this collection of issues.
+ Format: projects/{project}
+ issue:
+ title: issue
+ description: The issue to create.
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ title: CreateIssueRequest
+ required:
+ - parent
+ - issue
+ additionalProperties: false
+ bytebase.v1.CreatePlanRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent project where this plan will be created.
+ Format: projects/{project}
+ plan:
+ title: plan
+ description: The plan to create.
+ $ref: '#/components/schemas/bytebase.v1.Plan'
+ title: CreatePlanRequest
+ required:
+ - parent
+ - plan
+ additionalProperties: false
+ bytebase.v1.CreatePolicyRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource where this instance will be created.
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ policy:
+ title: policy
+ description: The policy to create.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ type:
+ title: type
+ description: The type of policy to create.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ title: CreatePolicyRequest
+ required:
+ - parent
+ - policy
+ additionalProperties: false
+ bytebase.v1.CreateProjectRequest:
+ type: object
+ properties:
+ project:
+ title: project
+ description: The project to create.
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ projectId:
+ type: string
+ title: project_id
+ description: |-
+ The ID to use for the project, which will become the final component of
+ the project's resource name.
- Supported filter:
- - environment: the environment full name in "environments/{id}" format, support "==" operator.
- - name: the database name, support ".matches()" operator.
- - project: the project full name in "projects/{id}" format, support "==" operator.
- - instance: the instance full name in "instances/{id}" format, support "==" operator.
- - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
- - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
- - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
- - table: filter by the database table, support "==" and ".matches()" operator.
- - labels.{key}: the database label, support "==" and "in" operators.
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ title: CreateProjectRequest
+ required:
+ - project
+ additionalProperties: false
+ bytebase.v1.CreateReleaseRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: 'Format: projects/{project}'
+ release:
+ title: release
+ description: The release to create.
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ title: CreateReleaseRequest
+ required:
+ - parent
+ - release
+ additionalProperties: false
+ bytebase.v1.CreateReviewConfigRequest:
+ type: object
+ properties:
+ reviewConfig:
+ title: review_config
+ description: The SQL review config to create.
+ $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
+ title: CreateReviewConfigRequest
+ required:
+ - reviewConfig
+ additionalProperties: false
+ bytebase.v1.CreateRevisionRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: 'Format: instances/{instance}/databases/{database}'
+ revision:
+ title: revision
+ description: The revision to create.
+ $ref: '#/components/schemas/bytebase.v1.Revision'
+ title: CreateRevisionRequest
+ required:
+ - parent
+ - revision
+ additionalProperties: false
+ bytebase.v1.CreateRoleRequest:
+ type: object
+ properties:
+ role:
+ title: role
+ description: The role to create.
+ $ref: '#/components/schemas/bytebase.v1.Role'
+ roleId:
+ type: string
+ title: role_id
+ description: |-
+ The ID to use for the role, which will become the final component
+ of the role's resource name.
- For example:
- environment == "environments/{environment resource id}"
- environment == "" (find databases which environment is not set)
- project == "projects/{project resource id}"
- instance == "instances/{instance resource id}"
- name.matches("database name")
- engine == "MYSQL"
- engine in ["MYSQL", "POSTGRES"]
- !(engine in ["MYSQL", "POSTGRES"])
- exclude_unassigned == true
- drifted == true
- table == "sample"
- table.matches("sam")
- labels.environment == "production"
- labels.region == "asia"
- labels.region in ["asia", "europe"]
-
- You can combine filter conditions like:
- environment == "environments/prod" && name.matches("employee")
- schema:
- type: string
- - name: showDeleted
- in: query
- description: Show deleted database if specified.
- schema:
- type: boolean
- - name: orderBy
- in: query
- description: |-
- The order by of databases.
- Support name, project, instance. The default sorting order is ascending.
- For example:
- - order_by = "name" - order by name ascending
- - order_by = "name desc"
- - order_by = "name desc, project asc"
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListDatabasesResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/workspaces/{workspace}:getIamPolicy:
- get:
- tags:
- - WorkspaceService
- description: |-
- Retrieves IAM policy for the workspace.
- Permissions required: bb.workspaces.getIamPolicy
- operationId: WorkspaceService_GetIamPolicy
- parameters:
- - name: workspace
- in: path
- description: The workspace id.
- required: true
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IamPolicy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1/workspaces/{workspace}:setIamPolicy:
- post:
- tags:
- - WorkspaceService
- description: |-
- Sets IAM policy for the workspace.
- Permissions required: bb.workspaces.setIamPolicy
- operationId: WorkspaceService_SetIamPolicy
- parameters:
- - name: workspace
- in: path
- description: The workspace id.
- required: true
- schema:
- type: string
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SetIamPolicyRequest'
- required: true
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/IamPolicy'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
- /v1:adminExecute:
- get:
- tags:
- - SQLService
- description: |-
- Executes SQL with admin privileges via streaming connection.
- Permissions required: bb.sql.admin
- operationId: SQLService_AdminExecute
- parameters:
- - name: name
- in: query
- description: |-
- The name is the instance name to execute the query against.
- Format: instances/{instance}/databases/{databaseName}
- schema:
- type: string
- - name: statement
- in: query
- description: The SQL statement to execute.
- schema:
- type: string
- - name: limit
- in: query
- description: The maximum number of rows to return.
- schema:
- type: integer
- format: int32
- - name: schema
- in: query
- description: |-
- The default schema to execute the statement. Equals to the current schema
- in Oracle and search path in Postgres.
- schema:
- type: string
- - name: container
- in: query
- description: |-
- Container is the container name to execute the query against, used for
- CosmosDB only.
- schema:
- type: string
- responses:
- "200":
- description: OK
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/AdminExecuteResponse'
- default:
- description: Default error response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Status'
-components:
- schemas:
- AICompletionRequest:
- type: object
- properties:
- messages:
- type: array
- items:
- $ref: '#/components/schemas/AICompletionRequest_Message'
- AICompletionRequest_Message:
- type: object
- properties:
- role:
- type: string
- content:
- type: string
- AICompletionResponse:
- type: object
- properties:
- candidates:
- type: array
- items:
- $ref: '#/components/schemas/AICompletionResponse_Candidate'
- description: |-
- candidates is used for results with multiple choices and candidates. Used
- for OpenAI and Gemini.
- AICompletionResponse_Candidate:
- type: object
- properties:
- content:
- $ref: '#/components/schemas/Candidate_Content'
- AISetting:
- type: object
- properties:
- enabled:
- type: boolean
- provider:
- enum:
- - PROVIDER_UNSPECIFIED
- - OPEN_AI
- - CLAUDE
- - GEMINI
- - AZURE_OPENAI
- type: string
- format: enum
- endpoint:
- type: string
- apiKey:
- type: string
- model:
- type: string
- version:
- type: string
- ActuatorInfo:
- type: object
- properties:
- version:
- readOnly: true
- type: string
- description: The Bytebase server version.
- gitCommit:
- readOnly: true
- type: string
- description: The git commit hash of the build.
- readonly:
- readOnly: true
- type: boolean
- description: Whether the Bytebase instance is running in read-only mode.
- saas:
- readOnly: true
- type: boolean
- description: Whether the Bytebase instance is running in SaaS mode where some features cannot be edited by users.
- demo:
- readOnly: true
- type: boolean
- description: Whether the Bytebase instance is running in demo mode.
- host:
- readOnly: true
- type: string
- description: The host address of the Bytebase instance.
- port:
- readOnly: true
- type: string
- description: The port number of the Bytebase instance.
- externalUrl:
- readOnly: true
- type: string
- description: The external URL where users or webhook callbacks access Bytebase.
- needAdminSetup:
- readOnly: true
- type: boolean
- description: Whether the Bytebase instance requires initial admin setup.
- disallowSignup:
- readOnly: true
- type: boolean
- description: Whether self-service user signup is disabled.
- lastActiveTime:
- readOnly: true
- type: string
- description: The last time any API call was made, refreshed on each request.
- format: date-time
- require2fa:
- readOnly: true
- type: boolean
- description: Whether two-factor authentication is required for all users.
- workspaceId:
- readOnly: true
- type: string
- description: The unique identifier for the workspace.
- debug:
- type: boolean
- description: Whether debug mode is enabled.
- unlicensedFeatures:
- readOnly: true
- type: array
- items:
- type: string
- description: List of features that are not licensed.
- disallowPasswordSignin:
- readOnly: true
- type: boolean
- description: Whether password-based signin is disabled (except for workspace admins).
- passwordRestriction:
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/WorkspaceProfileSetting_PasswordRestriction'
- description: Password complexity and restriction requirements.
- docker:
- readOnly: true
- type: boolean
- description: Whether the Bytebase instance is running in Docker.
- userStats:
- readOnly: true
- type: array
- items:
- $ref: '#/components/schemas/ActuatorInfo_StatUser'
- description: Statistics about users in the system.
- activatedInstanceCount:
- readOnly: true
- type: integer
- description: The number of activated database instances.
- format: int32
- totalInstanceCount:
- readOnly: true
- type: integer
- description: The total number of database instances.
- format: int32
- enableSample:
- readOnly: true
- type: boolean
- description: Whether sample data setup is enabled.
- externalUrlFromFlag:
- readOnly: true
- type: boolean
- description: Whether the external URL is set via command-line flag (and thus cannot be changed via UI).
- description: |-
- System information and configuration for the Bytebase instance.
- Actuator concept is similar to the Spring Boot Actuator.
- ActuatorInfo_StatUser:
- type: object
- properties:
- userType:
- enum:
- - USER_TYPE_UNSPECIFIED
- - USER
- - SYSTEM_BOT
- - SERVICE_ACCOUNT
- - WORKLOAD_IDENTITY
- type: string
- description: The type of user.
- format: enum
- state:
- enum:
- - STATE_UNSPECIFIED
- - ACTIVE
- - DELETED
- type: string
- description: The state of the user.
- format: enum
- count:
- type: integer
- description: The count of users matching this type and state.
- format: int32
- description: User statistics by type and state.
- AddDataSourceRequest:
- required:
- - name
- - dataSource
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the instance to add a data source to.
- Format: instances/{instance}
- dataSource:
- allOf:
- - $ref: '#/components/schemas/DataSource'
- description: |-
- Identified by data source ID.
- Only READ_ONLY data source can be added.
- validateOnly:
- type: boolean
- description: Validate only also tests the data source connection.
- AddWebhookRequest:
- required:
- - project
- - webhook
- type: object
- properties:
- project:
- type: string
- description: |-
- The name of the project to add the webhook to.
- Format: projects/{project}
- webhook:
- allOf:
- - $ref: '#/components/schemas/Webhook'
- description: The webhook to add.
- AdminExecuteResponse:
- type: object
- properties:
- results:
- type: array
- items:
- $ref: '#/components/schemas/QueryResult'
- description: The query results.
- Advice:
- type: object
- properties:
- status:
- enum:
- - ADVICE_LEVEL_UNSPECIFIED
- - SUCCESS
- - WARNING
- - ERROR
- type: string
- description: The advice level.
- format: enum
- code:
- type: integer
- description: The advice code.
- format: int32
- title:
- type: string
- description: The advice title.
- content:
- type: string
- description: The advice content.
- startPosition:
- allOf:
- - $ref: '#/components/schemas/Position'
- description: |-
- The start_position is inclusive and the end_position is exclusive.
- TODO: use range instead
- endPosition:
- $ref: '#/components/schemas/Position'
- ruleType:
- enum:
- - RULE_TYPE_UNSPECIFIED
- - PARSER_BASED
- - AI_POWERED
- type: string
- description: The type of linting rule that generated this advice.
- format: enum
- Algorithm:
- type: object
- properties:
- fullMask:
- $ref: '#/components/schemas/Algorithm_FullMask'
- rangeMask:
- $ref: '#/components/schemas/Algorithm_RangeMask'
- md5Mask:
- $ref: '#/components/schemas/Algorithm_MD5Mask'
- innerOuterMask:
- $ref: '#/components/schemas/Algorithm_InnerOuterMask'
- Algorithm_FullMask:
- type: object
- properties:
- substitution:
- type: string
- description: |-
- substitution is the string used to replace the original value, the
- max length of the string is 16 bytes.
- Algorithm_InnerOuterMask:
- type: object
- properties:
- prefixLen:
- type: integer
- format: int32
- suffixLen:
- type: integer
- format: int32
- type:
- enum:
- - MASK_TYPE_UNSPECIFIED
- - INNER
- - OUTER
- type: string
- format: enum
- substitution:
- type: string
- Algorithm_MD5Mask:
- type: object
- properties:
- salt:
- type: string
- description: salt is the salt value to generate a different hash that with the word alone.
- Algorithm_RangeMask:
- type: object
- properties:
- slices:
- type: array
- items:
- $ref: '#/components/schemas/RangeMask_Slice'
- description: |-
- We store it as a repeated field to face the fact that the original value may have multiple parts should be masked.
- But frontend can be started with a single rule easily.
- Announcement:
- type: object
- properties:
- level:
- enum:
- - ALERT_LEVEL_UNSPECIFIED
- - INFO
- - WARNING
- - CRITICAL
- type: string
- description: The alert level of announcement
- format: enum
- text:
- type: string
- description: The text of announcement
- link:
- type: string
- description: The optional link, user can follow the link to check extra details
- AppIMSetting:
- type: object
- properties:
- settings:
- type: array
- items:
- $ref: '#/components/schemas/AppIMSetting_IMSetting'
- AppIMSetting_DingTalk:
- type: object
- properties:
- clientId:
- writeOnly: true
- type: string
- clientSecret:
- writeOnly: true
- type: string
- robotCode:
- writeOnly: true
- type: string
- AppIMSetting_Feishu:
- type: object
- properties:
- appId:
- writeOnly: true
- type: string
- appSecret:
- writeOnly: true
- type: string
- AppIMSetting_IMSetting:
- type: object
- properties:
- type:
- enum:
- - WEBHOOK_TYPE_UNSPECIFIED
- - SLACK
- - DISCORD
- - TEAMS
- - DINGTALK
- - FEISHU
- - WECOM
- - LARK
- type: string
- format: enum
- slack:
- $ref: '#/components/schemas/AppIMSetting_Slack'
- feishu:
- $ref: '#/components/schemas/AppIMSetting_Feishu'
- wecom:
- $ref: '#/components/schemas/AppIMSetting_Wecom'
- lark:
- $ref: '#/components/schemas/AppIMSetting_Lark'
- dingtalk:
- $ref: '#/components/schemas/AppIMSetting_DingTalk'
- teams:
- $ref: '#/components/schemas/AppIMSetting_Teams'
- AppIMSetting_Lark:
- type: object
- properties:
- appId:
- writeOnly: true
- type: string
- appSecret:
- writeOnly: true
- type: string
- AppIMSetting_Slack:
- type: object
- properties:
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][A-Z][0-9]/.
+ title: CreateRoleRequest
+ required:
+ - role
+ - roleId
+ additionalProperties: false
+ bytebase.v1.CreateRolloutRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent plan for which this rollout will be created.
+ Format: projects/{project}/plans/{plan}
+ target:
+ type: string
+ title: target
+ description: |-
+ Create the rollout only for the specified target.
+ Format: environments/{environment}
+ If unspecified, all stages are created.
+ If set to "", no stages are created.
+ nullable: true
+ title: CreateRolloutRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.CreateSheetRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource where this sheet will be created.
+ Format: projects/{project}
+ sheet:
+ title: sheet
+ description: The sheet to create.
+ $ref: '#/components/schemas/bytebase.v1.Sheet'
+ title: CreateSheetRequest
+ required:
+ - parent
+ - sheet
+ additionalProperties: false
+ bytebase.v1.CreateUserRequest:
+ type: object
+ properties:
+ user:
+ title: user
+ description: The user to create.
+ $ref: '#/components/schemas/bytebase.v1.User'
+ title: CreateUserRequest
+ required:
+ - user
+ additionalProperties: false
+ bytebase.v1.CreateWorksheetRequest:
+ type: object
+ properties:
+ worksheet:
+ title: worksheet
+ description: The worksheet to create.
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ title: CreateWorksheetRequest
+ required:
+ - worksheet
+ additionalProperties: false
+ bytebase.v1.DataClassificationSetting:
+ type: object
+ properties:
+ configs:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DataClassificationSetting.DataClassificationConfig'
+ title: configs
+ title: DataClassificationSetting
+ additionalProperties: false
+ bytebase.v1.DataClassificationSetting.DataClassificationConfig:
+ type: object
+ properties:
+ id:
+ type: string
+ title: id
+ description: id is the uuid for classification. Each project can chose one classification config.
+ title:
+ type: string
+ title: title
+ levels:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DataClassificationSetting.DataClassificationConfig.Level'
+ title: levels
+ description: |-
+ levels is user defined level list for classification.
+ The order for the level decides its priority.
+ classification:
+ type: object
+ title: classification
+ additionalProperties:
+ title: value
+ $ref: '#/components/schemas/bytebase.v1.DataClassificationSetting.DataClassificationConfig.DataClassification'
+ description: |-
+ classification is the id - DataClassification map.
+ The id should in [0-9]+-[0-9]+-[0-9]+ format.
+ title: DataClassificationConfig
+ additionalProperties: false
+ bytebase.v1.DataClassificationSetting.DataClassificationConfig.ClassificationEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ title: value
+ $ref: '#/components/schemas/bytebase.v1.DataClassificationSetting.DataClassificationConfig.DataClassification'
+ title: ClassificationEntry
+ additionalProperties: false
+ bytebase.v1.DataClassificationSetting.DataClassificationConfig.DataClassification:
+ type: object
+ properties:
+ id:
+ type: string
+ title: id
+ description: id is the classification id in [0-9]+-[0-9]+-[0-9]+ format.
+ title:
+ type: string
+ title: title
+ description:
+ type: string
+ title: description
+ levelId:
+ type: string
+ title: level_id
+ nullable: true
+ title: DataClassification
+ additionalProperties: false
+ bytebase.v1.DataClassificationSetting.DataClassificationConfig.Level:
+ type: object
+ properties:
+ id:
+ type: string
+ title: id
+ title:
+ type: string
+ title: title
+ description:
+ type: string
+ title: description
+ title: Level
+ additionalProperties: false
+ bytebase.v1.DataSource:
+ type: object
+ allOf:
+ - properties:
+ id:
+ type: string
+ title: id
+ description: The unique identifier for this data source.
+ type:
+ title: type
+ description: The type of data source (ADMIN or READ_ONLY).
+ $ref: '#/components/schemas/bytebase.v1.DataSourceType'
+ username:
+ type: string
+ title: username
+ description: The username for database authentication.
+ password:
+ type: string
+ title: password
+ description: The password for database authentication.
+ writeOnly: true
+ useSsl:
+ type: boolean
+ title: use_ssl
+ description: Use SSL to connect to the data source. By default, we use system default SSL configuration.
+ sslCa:
+ type: string
+ title: ssl_ca
+ description: The SSL certificate authority certificate.
+ writeOnly: true
+ sslCert:
+ type: string
+ title: ssl_cert
+ description: The SSL client certificate.
+ writeOnly: true
+ sslKey:
+ type: string
+ title: ssl_key
+ description: The SSL client private key.
+ writeOnly: true
+ verifyTlsCertificate:
+ type: boolean
+ title: verify_tls_certificate
+ description: |-
+ verify_tls_certificate enables TLS certificate verification for SSL connections.
+ Default is false (no verification) for backward compatibility.
+ Set to true for secure connections (recommended for production).
+ Only set to false for development or when certificates cannot be properly
+ validated (e.g., self-signed certs, VPN environments).
+ host:
+ type: string
+ title: host
+ description: The hostname or IP address of the database server.
+ port:
+ type: string
+ title: port
+ description: The port number of the database server.
+ database:
+ type: string
+ title: database
+ description: The name of the database to connect to.
+ srv:
+ type: boolean
+ title: srv
+ description: |-
+ srv, authentication_database and replica_set are used for MongoDB.
+ srv is a boolean flag that indicates whether the host is a DNS SRV record.
+ authenticationDatabase:
+ type: string
+ title: authentication_database
+ description: authentication_database is the database name to authenticate against, which stores the user credentials.
+ replicaSet:
+ type: string
+ title: replica_set
+ description: replica_set is used for MongoDB replica set.
+ sid:
+ type: string
+ title: sid
+ description: sid and service_name are used for Oracle.
+ serviceName:
+ type: string
+ title: service_name
+ sshHost:
+ type: string
+ title: ssh_host
+ description: |-
+ Connection over SSH.
+ The hostname of the SSH server agent.
+ Required.
+ sshPort:
+ type: string
+ title: ssh_port
+ description: |-
+ The port of the SSH server agent. It's 22 typically.
+ Required.
+ sshUser:
+ type: string
+ title: ssh_user
+ description: |-
+ The user to login the server.
+ Required.
+ sshPassword:
+ type: string
+ title: ssh_password
+ description: The password to login the server. If it's empty string, no password is required.
+ writeOnly: true
+ sshPrivateKey:
+ type: string
+ title: ssh_private_key
+ description: The private key to login the server. If it's empty string, we will use the system default private key from os.Getenv("SSH_AUTH_SOCK").
+ writeOnly: true
+ authenticationPrivateKey:
+ type: string
+ title: authentication_private_key
+ description: |-
+ PKCS#8 private key in PEM format. If it's empty string, no private key is required.
+ Used for authentication when connecting to the data source.
+ writeOnly: true
+ authenticationPrivateKeyPassphrase:
+ type: string
+ title: authentication_private_key_passphrase
+ description: Passphrase for the encrypted PKCS#8 private key. Only used when the private key is encrypted.
+ writeOnly: true
+ externalSecret:
+ title: external_secret
+ $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret'
+ authenticationType:
+ title: authentication_type
+ $ref: '#/components/schemas/bytebase.v1.DataSource.AuthenticationType'
+ saslConfig:
+ title: sasl_config
+ $ref: '#/components/schemas/bytebase.v1.SASLConfig'
+ additionalAddresses:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DataSource.Address'
+ title: additional_addresses
+ description: (OPTIONAL) additional_addresses is used for MongoDB replica set.
+ directConnection:
+ type: boolean
+ title: direct_connection
+ description: direct_connection is used for MongoDB to dispatch all the operations to the node specified in the connection string.
+ region:
+ type: string
+ title: region
+ description: region is the location of where the DB is, works for AWS RDS. For example, us-east-1.
+ warehouseId:
+ type: string
+ title: warehouse_id
+ description: warehouse_id is used by Databricks.
+ masterName:
+ type: string
+ title: master_name
+ description: master_name is the master name used by connecting redis-master via redis sentinel.
+ masterUsername:
+ type: string
+ title: master_username
+ description: master_username and master_password are master credentials used by redis sentinel mode.
+ masterPassword:
+ type: string
+ title: master_password
+ redisType:
+ title: redis_type
+ $ref: '#/components/schemas/bytebase.v1.DataSource.RedisType'
+ cluster:
+ type: string
+ title: cluster
+ description: Cluster is the cluster name for the data source. Used by CockroachDB.
+ extraConnectionParameters:
+ type: object
+ title: extra_connection_parameters
+ additionalProperties:
+ type: string
+ title: value
+ description: |-
+ Extra connection parameters for the database connection.
+ For PostgreSQL HA, this can be used to set target_session_attrs=read-write
+ - oneOf:
+ - properties:
+ awsCredential:
+ title: aws_credential
+ $ref: '#/components/schemas/bytebase.v1.DataSource.AWSCredential'
+ title: aws_credential
+ required:
+ - awsCredential
+ - properties:
+ azureCredential:
+ title: azure_credential
+ $ref: '#/components/schemas/bytebase.v1.DataSource.AzureCredential'
+ title: azure_credential
+ required:
+ - azureCredential
+ - properties:
+ gcpCredential:
+ title: gcp_credential
+ $ref: '#/components/schemas/bytebase.v1.DataSource.GCPCredential'
+ title: gcp_credential
+ required:
+ - gcpCredential
+ title: DataSource
+ additionalProperties: false
+ bytebase.v1.DataSource.AWSCredential:
+ type: object
+ properties:
+ accessKeyId:
+ type: string
+ title: access_key_id
+ writeOnly: true
+ secretAccessKey:
+ type: string
+ title: secret_access_key
+ writeOnly: true
+ sessionToken:
+ type: string
+ title: session_token
+ writeOnly: true
+ roleArn:
+ type: string
+ title: role_arn
+ description: |-
+ ARN of IAM role to assume for cross-account access.
+ See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
+ writeOnly: true
+ externalId:
+ type: string
+ title: external_id
+ description: |-
+ Optional external ID for additional security when assuming role.
+ See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
+ writeOnly: true
+ title: AWSCredential
+ additionalProperties: false
+ bytebase.v1.DataSource.Address:
+ type: object
+ properties:
+ host:
+ type: string
+ title: host
+ port:
+ type: string
+ title: port
+ title: Address
+ additionalProperties: false
+ bytebase.v1.DataSource.AuthenticationType:
+ type: string
+ title: AuthenticationType
+ enum:
+ - AUTHENTICATION_UNSPECIFIED
+ - PASSWORD
+ - GOOGLE_CLOUD_SQL_IAM
+ - AWS_RDS_IAM
+ - AZURE_IAM
+ bytebase.v1.DataSource.AzureCredential:
+ type: object
+ properties:
+ tenantId:
+ type: string
+ title: tenant_id
+ clientId:
+ type: string
+ title: client_id
+ clientSecret:
+ type: string
+ title: client_secret
+ writeOnly: true
+ title: AzureCredential
+ additionalProperties: false
+ bytebase.v1.DataSource.ExtraConnectionParametersEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: string
+ title: value
+ title: ExtraConnectionParametersEntry
+ additionalProperties: false
+ bytebase.v1.DataSource.GCPCredential:
+ type: object
+ properties:
+ content:
+ type: string
+ title: content
+ writeOnly: true
+ title: GCPCredential
+ additionalProperties: false
+ bytebase.v1.DataSource.RedisType:
+ type: string
+ title: RedisType
+ enum:
+ - REDIS_TYPE_UNSPECIFIED
+ - STANDALONE
+ - SENTINEL
+ - CLUSTER
+ bytebase.v1.DataSourceExternalSecret:
+ type: object
+ allOf:
+ - properties:
+ secretType:
+ title: secret_type
+ description: The type of external secret store.
+ $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret.SecretType'
+ url:
+ type: string
+ title: url
+ description: The URL of the external secret store.
+ authType:
+ title: auth_type
+ description: The authentication method for accessing the secret store.
+ $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret.AuthType'
+ engineName:
+ type: string
+ title: engine_name
+ description: engine name is the name for secret engine.
+ secretName:
+ type: string
+ title: secret_name
+ description: the secret name in the engine to store the password.
+ passwordKeyName:
+ type: string
+ title: password_key_name
+ description: the key name for the password.
+ skipVaultTlsVerification:
+ type: boolean
+ title: skip_vault_tls_verification
+ description: |-
+ TLS configuration for connecting to Vault server.
+ These fields are separate from the database TLS configuration in DataSource.
+ skip_vault_tls_verification disables TLS certificate verification for Vault connections.
+ Default is false (verification enabled) for security.
+ Only set to true for development or when certificates cannot be properly validated.
+ vaultSslCa:
+ type: string
+ title: vault_ssl_ca
+ description: CA certificate for Vault server verification.
+ writeOnly: true
+ vaultSslCert:
+ type: string
+ title: vault_ssl_cert
+ description: Client certificate for mutual TLS authentication with Vault.
+ writeOnly: true
+ vaultSslKey:
+ type: string
+ title: vault_ssl_key
+ description: Client private key for mutual TLS authentication with Vault.
+ writeOnly: true
+ - oneOf:
+ - properties:
+ appRole:
+ title: app_role
+ description: AppRole authentication configuration.
+ $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption'
+ title: app_role
+ required:
+ - appRole
+ - properties:
token:
- writeOnly: true
- type: string
- AppIMSetting_Teams:
- type: object
- properties:
- tenantId:
- writeOnly: true
- type: string
- description: Azure AD tenant ID (Directory ID).
- clientId:
- writeOnly: true
- type: string
- description: Azure AD application (client) ID.
- clientSecret:
- writeOnly: true
- type: string
- description: Azure AD client secret.
- AppIMSetting_Wecom:
- type: object
- properties:
- corpId:
- writeOnly: true
- type: string
- agentId:
- writeOnly: true
- type: string
- secret:
- writeOnly: true
- type: string
- ApprovalFlow:
- type: object
- properties:
- roles:
- type: array
- items:
- type: string
- description: The roles required for approval in order.
- ApprovalTemplate:
- type: object
- properties:
- flow:
- allOf:
- - $ref: '#/components/schemas/ApprovalFlow'
- description: The approval flow definition.
- title:
- type: string
- description: The title of the approval template.
- description:
- type: string
- description: The description of the approval template.
- ApproveIssueRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the issue to add an approver.
- Format: projects/{project}/issues/{issue}
- comment:
- type: string
- description: The comment explaining the approval decision.
- AuditLog:
- type: object
- properties:
- name:
- readOnly: true
- type: string
- description: |-
- The name of the log.
- Formats:
- - projects/{project}/auditLogs/{uid}
- - workspaces/{workspace}/auditLogs/{uid}
- createTime:
- readOnly: true
- type: string
- description: The timestamp when the audit log was created.
- format: date-time
- user:
- type: string
- description: |-
- The user who performed the action.
- Format: users/{email}
- method:
- type: string
- description: |-
- The method or action being audited.
- For example: /bytebase.v1.SQLService/Query or bb.project.repository.push
- severity:
- enum:
- - SEVERITY_UNSPECIFIED
- - DEBUG
- - INFO
- - NOTICE
- - WARNING
- - ERROR
- - CRITICAL
- - ALERT
- - EMERGENCY
- type: string
- description: The severity level of this audit log entry.
- format: enum
- resource:
- type: string
- description: The resource associated with this audit log.
- request:
- type: string
- description: The request payload in JSON format.
- response:
- type: string
- description: |-
- The response payload in JSON format.
- Some fields may be omitted if they are too large or contain sensitive information.
- status:
- allOf:
- - $ref: '#/components/schemas/Status'
- description: The status of the operation.
- latency:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: The duration of the operation.
- serviceData:
- allOf:
- - $ref: '#/components/schemas/GoogleProtobufAny'
- description: Service-specific metadata about the request, response, and activities.
- requestMetadata:
- allOf:
- - $ref: '#/components/schemas/RequestMetadata'
- description: Metadata about the request context.
- description: Audit log entry recording system activity or API call.
- BatchCancelTaskRunsRequest:
- required:
- - parent
- type: object
- properties:
- parent:
- type: string
- description: |-
- The task name for the taskRuns.
- Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
- Use `projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/-` to cancel task runs under the same stage.
- taskRuns:
- type: array
- items:
- type: string
- description: |-
- The taskRuns to cancel.
- Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
- BatchCancelTaskRunsResponse:
- type: object
- properties: {}
- BatchCreateRevisionsRequest:
- required:
- - parent
- - requests
- type: object
- properties:
- parent:
- type: string
- description: |-
- The parent resource shared by all revisions being created.
- Format: instances/{instance}/databases/{database}
- requests:
- type: array
- items:
- $ref: '#/components/schemas/CreateRevisionRequest'
- description: |-
- The request message specifying the revisions to create.
- A maximum of 100 revisions can be created in a batch.
- BatchCreateRevisionsResponse:
- type: object
- properties:
- revisions:
- type: array
- items:
- $ref: '#/components/schemas/Revision'
- description: The created revisions.
- BatchCreateSheetsRequest:
- required:
- - parent
- - requests
- type: object
- properties:
- parent:
- type: string
- description: |-
- The parent resource where all sheets will be created.
- Format: projects/{project}
- requests:
- type: array
- items:
- $ref: '#/components/schemas/CreateSheetRequest'
- BatchCreateSheetsResponse:
- type: object
- properties:
- sheets:
- type: array
- items:
- $ref: '#/components/schemas/Sheet'
- BatchDeleteProjectsRequest:
- required:
- - names
- type: object
- properties:
- names:
- type: array
- items:
- type: string
- description: |-
- The names of the projects to delete.
- Format: projects/{project}
- force:
- type: boolean
- description: |-
- If set to true, any databases from this project will be moved to default project.
- Sheets are not moved since BYTEBASE_ARTIFACT sheets belong to the issue and issue project.
- Open issues will remain open but associated with the deleted project.
- If set to false, the operation will fail if the project has databases or open issues.
- BatchDeparseRequest:
- type: object
- properties:
- expressions:
- type: array
- items:
- $ref: '#/components/schemas/Expr'
- description: The CEL expression ASTs to deparse.
- description: Request message for batch deparsing CEL expressions.
- BatchDeparseResponse:
- type: object
- properties:
- expressions:
- type: array
- items:
- type: string
- description: The deparsed CEL expressions as strings.
- description: Response message for batch deparsing CEL expressions.
- BatchGetDatabasesResponse:
- type: object
- properties:
- databases:
- type: array
- items:
- $ref: '#/components/schemas/Database'
- description: The databases from the specified request.
- BatchGetGroupsResponse:
- type: object
- properties:
- groups:
- type: array
- items:
- $ref: '#/components/schemas/Group'
- description: The groups from the specified request.
- description: Response message for batch getting groups.
- BatchGetProjectsResponse:
- type: object
- properties:
- projects:
- type: array
- items:
- $ref: '#/components/schemas/Project'
- description: The projects from the specified request.
- BatchGetUsersResponse:
- type: object
- properties:
- users:
- type: array
- items:
- $ref: '#/components/schemas/User'
- description: The users from the specified request.
- BatchParseRequest:
- type: object
- properties:
- expressions:
- type: array
- items:
- type: string
- description: The CEL expression strings to parse.
- description: Request message for batch parsing CEL expressions.
- BatchParseResponse:
- type: object
- properties:
- expressions:
- type: array
- items:
- $ref: '#/components/schemas/Expr'
- description: The parsed CEL expressions as AST.
- description: Response message for batch parsing CEL expressions.
- BatchRunTasksRequest:
- required:
- - parent
- type: object
- properties:
- parent:
- type: string
- description: |-
- The stage name for the tasks.
- Format: projects/{project}/plans/{plan}/rollout/stages/{stage}
- tasks:
- type: array
- items:
- type: string
- description: |-
- The tasks to run.
- Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
- runTime:
- type: string
- description: The task run should run after run_time.
- format: date-time
- BatchRunTasksResponse:
- type: object
- properties: {}
- BatchSkipTasksRequest:
- required:
- - parent
- type: object
- properties:
- parent:
- type: string
- description: |-
- The stage name for the tasks.
- Format: projects/{project}/plans/{plan}/rollout/stages/{stage}
- tasks:
- type: array
- items:
- type: string
- description: |-
- The tasks to skip.
- Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
- reason:
- type: string
- description: The reason for skipping the tasks.
- BatchSkipTasksResponse:
- type: object
- properties: {}
- BatchSyncDatabasesRequest:
- required:
- - names
- type: object
- properties:
- parent:
- type: string
- description: |-
- The parent resource shared by all databases being updated.
- Format: instances/{instance}
- If the operation spans parents, a dash (-) may be accepted as a wildcard.
- names:
- type: array
- items:
- type: string
- description: The list of database names to sync.
- BatchSyncDatabasesResponse:
- type: object
- properties: {}
- BatchSyncInstancesRequest:
- required:
- - requests
- type: object
- properties:
- requests:
- type: array
- items:
- $ref: '#/components/schemas/SyncInstanceRequest'
- description: |-
- The request message specifying the instances to sync.
- A maximum of 1000 instances can be synced in a batch.
- BatchSyncInstancesResponse:
- type: object
- properties: {}
- BatchUpdateDatabasesRequest:
- required:
- - requests
- type: object
- properties:
- parent:
- type: string
- description: |-
- The parent resource shared by all databases being updated.
- Format: instances/{instance}
- If the operation spans parents, a dash (-) may be accepted as a wildcard.
- We only support updating the project of databases for now.
- requests:
- type: array
- items:
- $ref: '#/components/schemas/UpdateDatabaseRequest'
- description: |-
- The request message specifying the resources to update.
- A maximum of 1000 databases can be modified in a batch.
- BatchUpdateDatabasesResponse:
- type: object
- properties:
- databases:
- type: array
- items:
- $ref: '#/components/schemas/Database'
- description: Databases updated.
- BatchUpdateInstancesRequest:
- required:
- - requests
- type: object
- properties:
- requests:
- type: array
- items:
- $ref: '#/components/schemas/UpdateInstanceRequest'
- description: The request message specifying the resources to update.
- BatchUpdateInstancesResponse:
- type: object
- properties:
- instances:
- type: array
- items:
- $ref: '#/components/schemas/Instance'
- BatchUpdateIssuesStatusRequest:
- required:
- - parent
- type: object
- properties:
- parent:
- type: string
- description: |-
- The parent resource shared by all issues being updated.
- Format: projects/{project}
- If the operation spans parents, a dash (-) may be accepted as a wildcard.
- We only support updating the status of databases for now.
- issues:
- type: array
- items:
- type: string
- description: |-
- The list of issues to update.
- Format: projects/{project}/issues/{issue}
- status:
- enum:
- - ISSUE_STATUS_UNSPECIFIED
- - OPEN
- - DONE
- - CANCELED
- type: string
- description: The new status.
- format: enum
- reason:
- type: string
- description: The reason for the status change.
- BatchUpdateIssuesStatusResponse:
- type: object
- properties: {}
- BatchUpdateWorksheetOrganizerRequest:
- required:
- - requests
- type: object
- properties:
- requests:
- type: array
- items:
- $ref: '#/components/schemas/UpdateWorksheetOrganizerRequest'
- BatchUpdateWorksheetOrganizerResponse:
- type: object
- properties:
- worksheetOrganizers:
- type: array
- items:
- $ref: '#/components/schemas/WorksheetOrganizer'
- Binding:
- type: object
- properties:
- role:
- type: string
- description: |-
- The role that is assigned to the members.
- Format: roles/{role}
- members:
- type: array
- items:
- type: string
- description: |-
- Specifies the principals requesting access for a Bytebase resource.
- For users, the member should be: user:{email}
- For groups, the member should be: group:{email}
- condition:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- The condition that is associated with this binding, only used in the project IAM policy.
- If the condition evaluates to true, then this binding applies to the current request.
- If the condition evaluates to false, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Support variables:
- resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" role, support "==" operator.
- resource.schema_name: the schema name, used by the "roles/sqlEditorUser" role, support "==" operator.
- resource.table_name: the table name, used by the "roles/sqlEditorUser" role, support "==" operator.
- request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
-
- For example:
- resource.database == "instances/local-pg/databases/postgres" && resource.schema_name in ["public","another_schema"]
- resource.database == "instances/local-pg/databases/bytebase" && resource.schema_name == "public" && resource.table_name in ["audit_log"]
- request.time < timestamp("2025-04-26T11:24:48.655Z")
- parsedExpr:
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: The parsed expression of the condition.
- description: Binding associates members with a role and optional conditions.
- BoundingBox:
- type: object
- properties:
- xmin:
- type: number
- description: Minimum X coordinate
- format: double
- ymin:
- type: number
- description: Minimum Y coordinate
- format: double
- xmax:
- type: number
- description: Maximum X coordinate
- format: double
- ymax:
- type: number
- description: Maximum Y coordinate
- format: double
- description: BoundingBox defines the spatial bounds for GEOMETRY spatial indexes.
- CancelPlanCheckRunRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the plan check run to cancel.
- Format: projects/{project}/plans/{plan}/planCheckRun
- CancelPlanCheckRunResponse:
- type: object
- properties: {}
- Candidate_Content:
- type: object
- properties:
- parts:
- type: array
- items:
- $ref: '#/components/schemas/Content_Part'
- description: parts is used for a result content with multiple parts.
- Changelog:
- type: object
- properties:
- name:
- type: string
- description: 'Format: instances/{instance}/databases/{database}/changelogs/{changelog}'
- createTime:
- type: string
- format: date-time
- status:
- enum:
- - STATUS_UNSPECIFIED
- - PENDING
- - DONE
- - FAILED
- type: string
- format: enum
- statement:
- type: string
- description: The statement is used for preview purpose.
- statementSize:
- type: string
- statementSheet:
- type: string
- description: |-
- The name of the sheet resource.
- Format: projects/{project}/sheets/{sheet}
+ type: string
+ title: token
+ description: Token for direct authentication.
+ writeOnly: true
+ title: token
+ required:
+ - token
+ title: DataSourceExternalSecret
+ additionalProperties: false
+ bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption:
+ type: object
+ properties:
+ roleId:
+ type: string
+ title: role_id
+ description: The role ID for Vault AppRole authentication.
+ writeOnly: true
+ secretId:
+ type: string
+ title: secret_id
+ description: the secret id for the role without ttl.
+ writeOnly: true
+ type:
+ title: type
+ description: The type of secret for AppRole authentication.
+ $ref: '#/components/schemas/bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType'
+ mountPath:
+ type: string
+ title: mount_path
+ description: The path where the approle auth method is mounted.
+ title: AppRoleAuthOption
+ additionalProperties: false
+ bytebase.v1.DataSourceExternalSecret.AppRoleAuthOption.SecretType:
+ type: string
+ title: SecretType
+ enum:
+ - SECRET_TYPE_UNSPECIFIED
+ - PLAIN
+ - ENVIRONMENT
+ bytebase.v1.DataSourceExternalSecret.AuthType:
+ type: string
+ title: AuthType
+ enum:
+ - AUTH_TYPE_UNSPECIFIED
+ - TOKEN
+ - VAULT_APP_ROLE
+ bytebase.v1.DataSourceExternalSecret.SecretType:
+ type: string
+ title: SecretType
+ enum:
+ - SECRET_TYPE_UNSPECIFIED
+ - VAULT_KV_V2
+ - AWS_SECRETS_MANAGER
+ - GCP_SECRET_MANAGER
+ - AZURE_KEY_VAULT
+ bytebase.v1.DataSourceQueryPolicy:
+ type: object
+ properties:
+ adminDataSourceRestriction:
+ title: admin_data_source_restriction
+ description: Restriction for admin data source queries.
+ $ref: '#/components/schemas/bytebase.v1.DataSourceQueryPolicy.Restriction'
+ disallowDdl:
+ type: boolean
+ title: disallow_ddl
+ description: Disallow running DDL statements in the SQL editor.
+ disallowDml:
+ type: boolean
+ title: disallow_dml
+ description: Disallow running DML statements in the SQL editor.
+ title: DataSourceQueryPolicy
+ additionalProperties: false
+ description: Policy for controlling which data sources can be queried in the SQL editor.
+ bytebase.v1.DataSourceQueryPolicy.Restriction:
+ type: string
+ title: Restriction
+ enum:
+ - RESTRICTION_UNSPECIFIED
+ - FALLBACK
+ - DISALLOW
+ description: Restriction level for admin data source access.
+ bytebase.v1.DataSourceType:
+ type: string
+ title: DataSourceType
+ enum:
+ - DATA_SOURCE_UNSPECIFIED
+ - ADMIN
+ - READ_ONLY
+ bytebase.v1.Database:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database.
+ Format: instances/{instance}/databases/{database}
+ {database} is the database name in the instance.
+ state:
+ title: state
+ description: The existence of a database.
+ readOnly: true
+ $ref: '#/components/schemas/bytebase.v1.State'
+ successfulSyncTime:
+ title: successful_sync_time
+ description: The latest synchronization time.
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ project:
+ type: string
+ title: project
+ description: |-
+ The project for a database.
+ Format: projects/{project}
+ schemaVersion:
+ type: string
+ title: schema_version
+ description: The version of database schema.
+ readOnly: true
+ environment:
+ type: string
+ title: environment
+ description: |-
+ (OPTIONAL) The environment resource.
+ Format: environments/prod where prod is the environment resource ID.
+ nullable: true
+ effectiveEnvironment:
+ type: string
+ title: effective_environment
+ description: |-
+ The effective environment based on environment tag above and environment
+ tag on the instance. Inheritance follows
+ https://cloud.google.com/resource-manager/docs/tags/tags-overview.
+ nullable: true
+ readOnly: true
+ labels:
+ type: object
+ title: labels
+ additionalProperties:
+ type: string
+ title: value
+ description: Labels will be used for deployment and policy control.
+ instanceResource:
+ title: instance_resource
+ description: The instance resource.
+ readOnly: true
+ $ref: '#/components/schemas/bytebase.v1.InstanceResource'
+ backupAvailable:
+ type: boolean
+ title: backup_available
+ description: The database is available for DML prior backup.
+ readOnly: true
+ drifted:
+ type: boolean
+ title: drifted
+ description: The schema is drifted from the source of truth.
+ readOnly: true
+ title: Database
+ additionalProperties: false
+ bytebase.v1.Database.LabelsEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: string
+ title: value
+ title: LabelsEntry
+ additionalProperties: false
+ bytebase.v1.DatabaseCatalog:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database catalog.
+ Format: instances/{instance}/databases/{database}/catalog
+ schemas:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.SchemaCatalog'
+ title: schemas
+ description: The schemas in the database.
+ title: DatabaseCatalog
+ additionalProperties: false
+ description: Catalog metadata for a database including schemas, tables, and columns.
+ bytebase.v1.DatabaseChangeMode:
+ type: string
+ title: DatabaseChangeMode
+ enum:
+ - DATABASE_CHANGE_MODE_UNSPECIFIED
+ - PIPELINE
+ - EDITOR
+ bytebase.v1.DatabaseChangeType:
+ type: string
+ title: DatabaseChangeType
+ enum:
+ - DATABASE_CHANGE_TYPE_UNSPECIFIED
+ - MIGRATE
+ - SDL
+ description: DatabaseChangeType is the database change type.
+ bytebase.v1.DatabaseGroup:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database group.
+ Format: projects/{project}/databaseGroups/{databaseGroup}
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The short name used in actual databases specified by users.
+ databaseExpr:
+ title: database_expr
+ description: |-
+ The condition that is associated with this database group.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Support variables:
+ resource.environment_id: the environment resource id. Support "==", "!=", "in [XX]", "!(in [xx])" operations.
+ resource.instance_id: the instance resource id. Support "==", "!=", "in [XX]", "!(in [xx])", "contains", "matches", "startsWith", "endsWith" operations.
+ resource.database_name: the database name. Support "==", "!=", "in [XX]", "!(in [xx])", "contains", "matches", "startsWith", "endsWith" operations.
+ resource.database_labels: the database labels. Support map access operations.
+ All variables should join with "&&" condition.
+
+ For example:
+ resource.environment_id == "test" && resource.database_name.startsWith("sample_")
+ resource.database_labels["tenant"] == "tenant1"
+ $ref: '#/components/schemas/google.type.Expr'
+ matchedDatabases:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroup.Database'
+ title: matched_databases
+ description: The list of databases that match the database group condition.
+ readOnly: true
+ title: DatabaseGroup
+ required:
+ - title
+ additionalProperties: false
+ description: A group of databases matched by expressions.
+ bytebase.v1.DatabaseGroup.Database:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The resource name of the database.
+ Format: instances/{instance}/databases/{database}
+ title: Database
+ additionalProperties: false
+ description: A database within a database group.
+ bytebase.v1.DatabaseGroupView:
+ type: string
+ title: DatabaseGroupView
+ enum:
+ - DATABASE_GROUP_VIEW_UNSPECIFIED
+ - DATABASE_GROUP_VIEW_BASIC
+ - DATABASE_GROUP_VIEW_FULL
+ description: View options for database group responses.
+ bytebase.v1.DatabaseMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The database metadata name.
+
+ Format: instances/{instance}/databases/{database}/metadata
+ schemas:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.SchemaMetadata'
+ title: schemas
+ description: The schemas is the list of schemas in a database.
+ characterSet:
+ type: string
+ title: character_set
+ description: The character_set is the character set of a database.
+ collation:
+ type: string
+ title: collation
+ description: The collation is the collation of a database.
+ extensions:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ExtensionMetadata'
+ title: extensions
+ description: The extensions is the list of extensions in a database.
+ owner:
+ type: string
+ title: owner
+ description: The owner of the database.
+ searchPath:
+ type: string
+ title: search_path
+ description: The search_path is the search path of a PostgreSQL database.
+ title: DatabaseMetadata
+ additionalProperties: false
+ description: DatabaseMetadata is the metadata for databases.
+ bytebase.v1.DatabaseSDLSchema:
+ type: object
+ properties:
+ schema:
+ type: string
+ title: schema
+ format: byte
+ description: |-
+ The SDL schema content.
+ - For SINGLE_FILE format: contains the complete SDL schema as a text string.
+ - For MULTI_FILE format: contains the ZIP archive as binary data.
+ contentType:
+ type: string
+ title: content_type
+ description: |-
+ The MIME type of the schema content.
+ Indicates how the client should interpret the schema field.
+ Examples:
+ - "text/plain; charset=utf-8" for SINGLE_FILE format
+ - "application/zip" for MULTI_FILE format
+ readOnly: true
+ title: DatabaseSDLSchema
+ additionalProperties: false
+ description: DatabaseSDLSchema contains the schema in SDL format.
+ bytebase.v1.DatabaseSchema:
+ type: object
+ properties:
+ schema:
+ type: string
+ title: schema
+ description: The schema dump from database.
+ title: DatabaseSchema
+ additionalProperties: false
+ description: DatabaseSchema is the metadata for databases.
+ bytebase.v1.DeleteCacheRequest:
+ type: object
+ title: DeleteCacheRequest
+ additionalProperties: false
+ description: Request message for deleting cache.
+ bytebase.v1.DeleteDatabaseGroupRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database group to delete.
+ Format: projects/{project}/databaseGroups/{databaseGroup}
+ title: DeleteDatabaseGroupRequest
+ required:
+ - name
+ additionalProperties: false
+ description: Request message for deleting a database group.
+ bytebase.v1.DeleteGroupRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the group to delete.
+ Format: groups/{email}
+ title: DeleteGroupRequest
+ required:
+ - name
+ additionalProperties: false
+ description: Request message for deleting a group.
+ bytebase.v1.DeleteIdentityProviderRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the identity provider to delete.
+ Format: idps/{identity_provider}
+ title: DeleteIdentityProviderRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DeleteInstanceRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the instance to delete.
+ Format: instances/{instance}
+ force:
+ type: boolean
+ title: force
+ description: If set to true, any databases and sheets from this project will also be moved to default project, and all open issues will be closed.
+ purge:
+ type: boolean
+ title: purge
+ description: |-
+ If set to true, permanently purge the soft-deleted instance and all related resources.
+ This operation is irreversible. Following AIP-165, this should only be used for
+ administrative cleanup of old soft-deleted instances.
+ The instance must already be soft-deleted for this to work.
+ title: DeleteInstanceRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DeletePolicyRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ title: DeletePolicyRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DeleteProjectRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the project to delete.
+ Format: projects/{project}
+ force:
+ type: boolean
+ title: force
+ description: |-
+ If set to true, any databases from this project will be moved to default project.
+ Sheets are not moved since BYTEBASE_ARTIFACT sheets belong to the issue and issue project.
+ Open issues will remain open but associated with the deleted project.
+ If set to false, the operation will fail if the project has databases or open issues.
+ purge:
+ type: boolean
+ title: purge
+ description: |-
+ If set to true, permanently purge the soft-deleted project and all related resources.
+ This operation is irreversible. Following AIP-165, this should only be used for
+ administrative cleanup of old soft-deleted projects.
+ The project must already be soft-deleted for this to work.
+ title: DeleteProjectRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DeleteReleaseRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the release to delete.
+ Format: projects/{project}/releases/{release}
+ title: DeleteReleaseRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DeleteReviewConfigRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the SQL review config to delete.
+ Format: reviewConfigs/{reviewConfig}
+ title: DeleteReviewConfigRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DeleteRevisionRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the revision to delete.
+ Format: instances/{instance}/databases/{database}/revisions/{revision}
+ title: DeleteRevisionRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DeleteRoleRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the role to delete.
+ Format: roles/{role}
+ title: DeleteRoleRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DeleteUserRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the user to delete.
+ Format: users/{email}
+ title: DeleteUserRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DeleteWorksheetRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the worksheet to delete.
+ Format: worksheets/{worksheet}
+ title: DeleteWorksheetRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DependencyColumn:
+ type: object
+ properties:
+ schema:
+ type: string
+ title: schema
+ description: The schema is the schema of a reference column.
+ table:
+ type: string
+ title: table
+ description: The table is the table of a reference column.
+ column:
+ type: string
+ title: column
+ description: The column is the name of a reference column.
+ title: DependencyColumn
+ additionalProperties: false
+ description: DependencyColumn is the metadata for dependency columns.
+ bytebase.v1.DependencyTable:
+ type: object
+ properties:
+ schema:
+ type: string
+ title: schema
+ description: The schema is the schema of a reference table.
+ table:
+ type: string
+ title: table
+ description: The table is the name of a reference table.
+ title: DependencyTable
+ additionalProperties: false
+ bytebase.v1.DiffMetadataRequest:
+ type: object
+ properties:
+ sourceMetadata:
+ title: source_metadata
+ description: The metadata of the source schema.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseMetadata'
+ targetMetadata:
+ title: target_metadata
+ description: The metadata of the target schema.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseMetadata'
+ engine:
+ title: engine
+ description: The database engine of the schema.
+ $ref: '#/components/schemas/bytebase.v1.Engine'
+ title: DiffMetadataRequest
+ required:
+ - sourceMetadata
+ - targetMetadata
+ additionalProperties: false
+ bytebase.v1.DiffMetadataResponse:
+ type: object
+ properties:
+ diff:
+ type: string
+ title: diff
+ description: The diff of the metadata.
+ title: DiffMetadataResponse
+ additionalProperties: false
+ bytebase.v1.DiffSchemaRequest:
+ type: object
+ allOf:
+ - properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database or changelog.
+ Format:
+ database: instances/{instance}/databases/{database}
+ changelog: instances/{instance}/databases/{database}/changelogs/{changelog}
+ - oneOf:
+ - properties:
+ changelog:
+ type: string
+ title: changelog
+ description: |-
+ The resource name of the changelog
+ Format:
+ instances/{instance}/databases/{database}/changelogs/{changelog}
+ title: changelog
+ required:
+ - changelog
+ - properties:
schema:
- type: string
- schemaSize:
- type: string
- prevSchema:
- type: string
- prevSchemaSize:
- type: string
- taskRun:
- type: string
- description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
- version:
- type: string
- description: Could be empty
- revision:
- type: string
- description: |-
- Could be empty
- Or present but not found if deleted
- type:
- enum:
- - TYPE_UNSPECIFIED
- - BASELINE
- - MIGRATE
- - SDL
- type: string
- format: enum
- CheckConstraintMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a check constraint.
- expression:
- type: string
- description: The expression is the expression of a check constraint.
- description: CheckConstraintMetadata is the metadata for check constraints.
- CheckReleaseRequest:
- required:
- - parent
- - release
- type: object
- properties:
- parent:
- type: string
- description: 'Format: projects/{project}'
- release:
- allOf:
- - $ref: '#/components/schemas/Release'
- description: The release to check.
- targets:
- type: array
- items:
- type: string
- description: |-
- The targets to dry-run the release.
- Can be database or databaseGroup.
- Format:
- projects/{project}/databaseGroups/{databaseGroup}
- instances/{instance}/databases/{database}
- customRules:
- type: string
- description: |-
- Custom linting rules in natural language for AI-powered validation.
- Each rule should be a clear statement describing the desired schema constraint.
- Example: "All tables must have a primary key"
- Example: "VARCHAR columns should specify a maximum length"
- CheckReleaseResponse:
- type: object
- properties:
- results:
- type: array
- items:
- $ref: '#/components/schemas/CheckReleaseResponse_CheckResult'
- description: The check results for each file and target combination.
- affectedRows:
- type: string
- description: The total affected rows across all checks.
- riskLevel:
- enum:
- - RISK_LEVEL_UNSPECIFIED
- - LOW
- - MODERATE
- - HIGH
- type: string
- description: The aggregated risk level of the check.
- format: enum
- CheckReleaseResponse_CheckResult:
- type: object
- properties:
- file:
- type: string
- description: The file path that is being checked.
- target:
- type: string
- description: |-
- The target that the check is performed on.
- Should be a database. Format: instances/{instance}/databases/{database}
- advices:
- type: array
- items:
- $ref: '#/components/schemas/Advice'
- description: The list of advice for the file and the target.
- affectedRows:
- type: string
- description: The count of affected rows of the statement on the target.
- riskLevel:
- enum:
- - RISK_LEVEL_UNSPECIFIED
- - LOW
- - MODERATE
- - HIGH
- type: string
- description: The risk level of the statement on the target.
- format: enum
- description: Check result for a single release file on a target database.
- ColumnCatalog:
- type: object
- properties:
- name:
- type: string
- description: The column name.
- semanticType:
- type: string
- description: The semantic type describing the data purpose.
- labels:
- type: object
- additionalProperties:
- type: string
- description: User-defined labels for this column.
- classification:
- type: string
- description: The data classification level for this column.
- objectSchema:
- allOf:
- - $ref: '#/components/schemas/ObjectSchema'
- description: Object schema for complex column types like JSON.
- description: Column metadata within a table.
- ColumnMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a column.
- position:
- type: integer
- description: The position is the position in columns.
- format: int32
- hasDefault:
- type: boolean
- default:
- type: string
- description: The default value of column.
- defaultOnNull:
- type: boolean
- description: |-
- Oracle specific metadata.
- The default_on_null is the default on null of a column.
- onUpdate:
- type: string
- description: |-
- The on_update is the on update action of a column.
- For MySQL like databases, it's only supported for TIMESTAMP columns with
- CURRENT_TIMESTAMP as on update value.
- nullable:
- type: boolean
- description: The nullable is the nullable of a column.
- type:
- type: string
- description: The type is the type of a column.
- characterSet:
- type: string
- description: The character_set is the character_set of a column.
- collation:
- type: string
- description: The collation is the collation of a column.
- comment:
- type: string
- description: The comment is the comment of a column.
- generation:
- allOf:
- - $ref: '#/components/schemas/GenerationMetadata'
- description: The generation is the generation of a column.
- isIdentity:
- type: boolean
- identityGeneration:
- enum:
- - IDENTITY_GENERATION_UNSPECIFIED
- - ALWAYS
- - BY_DEFAULT
- type: string
- description: The identity_generation is for identity columns, PG only.
- format: enum
- identitySeed:
- type: string
- description: The identity_seed is for identity columns, MSSQL only.
- identityIncrement:
- type: string
- description: The identity_increment is for identity columns, MSSQL only.
- defaultConstraintName:
- type: string
- description: |-
- The default_constraint_name is the name of the default constraint, MSSQL only.
- In MSSQL, default values are implemented as named constraints. When modifying or
- dropping a column's default value, you must reference the constraint by name.
- This field stores the actual constraint name from the database.
-
- Example: A column definition like:
- CREATE TABLE employees (
- status NVARCHAR(20) DEFAULT 'active'
- )
-
- Will create a constraint with an auto-generated name like 'DF__employees__statu__3B75D760'
- or a user-defined name if specified:
- ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'active' FOR status
-
- To modify the default, you must first drop the existing constraint by name:
- ALTER TABLE employees DROP CONSTRAINT DF__employees__statu__3B75D760
- ALTER TABLE employees ADD CONSTRAINT DF_employees_status DEFAULT 'inactive' FOR status
-
- This field is populated when syncing from the database. When empty (e.g., when parsing
- from SQL files), the system cannot automatically drop the constraint.
- description: ColumnMetadata is the metadata for columns.
- CommandExecute_CommandResponse:
- type: object
- properties:
- logTime:
- type: string
- description: When the response was logged.
- format: date-time
- error:
- type: string
- description: Error message if command execution failed.
- affectedRows:
- type: string
- description: Total affected rows.
- allAffectedRows:
- type: array
- items:
- type: string
- description: |-
- `all_affected_rows` is the affected rows of each command.
- `all_affected_rows` may be unavailable if the database driver doesn't support it. Caller should fallback to `affected_rows` in that case.
- description: Command execution response.
- Constant:
- type: object
- properties:
- nullValue:
- enum:
- - NULL_VALUE
- type: string
- description: null value.
- format: enum
- boolValue:
- type: boolean
- description: boolean value.
- int64Value:
- type: string
- description: int64 value.
- uint64Value:
- type: string
- description: uint64 value.
- doubleValue:
- type: number
- description: double value.
- format: double
- stringValue:
- type: string
- description: string value.
- bytesValue:
- type: string
- description: bytes value.
- format: bytes
- durationValue:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: |-
- protobuf.Duration value.
+ type: string
+ title: schema
+ description: The target schema.
+ title: schema
+ required:
+ - schema
+ title: DiffSchemaRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.DiffSchemaResponse:
+ type: object
+ properties:
+ diff:
+ type: string
+ title: diff
+ title: DiffSchemaResponse
+ additionalProperties: false
+ bytebase.v1.DimensionConstraint:
+ type: object
+ properties:
+ dimension:
+ type: string
+ title: dimension
+ description: Dimension name/type (X, Y, Z, M, etc.)
+ minValue:
+ type: number
+ title: min_value
+ format: double
+ description: Minimum value for this dimension
+ maxValue:
+ type: number
+ title: max_value
+ format: double
+ description: Maximum value for this dimension
+ tolerance:
+ type: number
+ title: tolerance
+ format: double
+ description: Tolerance for this dimension
+ title: DimensionConstraint
+ additionalProperties: false
+ description: DimensionConstraint defines constraints for a spatial dimension.
+ bytebase.v1.DimensionalConfig:
+ type: object
+ properties:
+ dimensions:
+ type: integer
+ title: dimensions
+ format: int32
+ description: Number of dimensions (2-4, default 2)
+ dataType:
+ type: string
+ title: data_type
+ description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
+ srid:
+ type: integer
+ title: srid
+ format: int32
+ description: Spatial reference system identifier (SRID)
+ constraints:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DimensionConstraint'
+ title: constraints
+ description: Coordinate system constraints
+ title: DimensionalConfig
+ additionalProperties: false
+ description: DimensionalConfig defines dimensional and constraint parameters for spatial indexes.
+ bytebase.v1.Engine:
+ type: string
+ title: Engine
+ enum:
+ - ENGINE_UNSPECIFIED
+ - CLICKHOUSE
+ - MYSQL
+ - POSTGRES
+ - SNOWFLAKE
+ - SQLITE
+ - TIDB
+ - MONGODB
+ - REDIS
+ - ORACLE
+ - SPANNER
+ - MSSQL
+ - REDSHIFT
+ - MARIADB
+ - OCEANBASE
+ - STARROCKS
+ - DORIS
+ - HIVE
+ - ELASTICSEARCH
+ - BIGQUERY
+ - DYNAMODB
+ - DATABRICKS
+ - COCKROACHDB
+ - COSMOSDB
+ - TRINO
+ - CASSANDRA
+ description: Database engine type.
+ bytebase.v1.EnumTypeMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name of a type.
+ values:
+ type: array
+ items:
+ type: string
+ title: values
+ description: The enum values of a type.
+ comment:
+ type: string
+ title: comment
+ description: The comment describing the enum type.
+ skipDump:
+ type: boolean
+ title: skip_dump
+ description: Whether to skip this enum type during schema dump operations.
+ title: EnumTypeMetadata
+ additionalProperties: false
+ bytebase.v1.EnvironmentSetting:
+ type: object
+ properties:
+ environments:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.EnvironmentSetting.Environment'
+ title: environments
+ title: EnvironmentSetting
+ additionalProperties: false
+ bytebase.v1.EnvironmentSetting.Environment:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The resource name of the environment.
+ Format: environments/{environment}.
+ Output only.
+ readOnly: true
+ id:
+ type: string
+ title: id
+ description: |-
+ The resource id of the environment.
+ This value should be 4-63 characters, and valid characters
+ are /[a-z][0-9]-/.
+ title:
+ type: string
+ title: title
+ description: The display name of the environment.
+ tags:
+ type: object
+ title: tags
+ additionalProperties:
+ type: string
+ title: value
+ color:
+ type: string
+ title: color
+ title: Environment
+ additionalProperties: false
+ bytebase.v1.EnvironmentSetting.Environment.TagsEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: string
+ title: value
+ title: TagsEntry
+ additionalProperties: false
+ bytebase.v1.EventMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name of the event.
+ definition:
+ type: string
+ title: definition
+ description: The schedule of the event.
+ timeZone:
+ type: string
+ title: time_zone
+ description: The time zone of the event.
+ sqlMode:
+ type: string
+ title: sql_mode
+ description: The SQL mode setting for the event.
+ characterSetClient:
+ type: string
+ title: character_set_client
+ description: The character set used by the client creating the event.
+ collationConnection:
+ type: string
+ title: collation_connection
+ description: The collation used for the connection when creating the event.
+ comment:
+ type: string
+ title: comment
+ description: The comment is the comment of an event.
+ title: EventMetadata
+ additionalProperties: false
+ bytebase.v1.ExchangeTokenRequest:
+ type: object
+ properties:
+ token:
+ type: string
+ title: token
+ description: External OIDC token (JWT) from CI/CD platform.
+ email:
+ type: string
+ title: email
+ description: |-
+ Workload Identity email for identifying which identity to authenticate as.
+ Format: {name}@workload.bytebase.com
+ title: ExchangeTokenRequest
+ additionalProperties: false
+ bytebase.v1.ExchangeTokenResponse:
+ type: object
+ properties:
+ accessToken:
+ type: string
+ title: access_token
+ description: Bytebase access token.
+ title: ExchangeTokenResponse
+ additionalProperties: false
+ bytebase.v1.ExportAuditLogsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ filter:
+ type: string
+ title: filter
+ description: |-
+ The filter of the log. It should be a valid CEL expression.
+ Check the filter field in the SearchAuditLogsRequest message.
+ orderBy:
+ type: string
+ title: order_by
+ description: |-
+ The order by of the log.
+ Only support order by create_time. The default sorting order is ascending.
+ For example:
+ - order_by = "create_time asc"
+ - order_by = "create_time desc"
+ format:
+ title: format
+ description: The export format.
+ $ref: '#/components/schemas/bytebase.v1.ExportFormat'
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of logs to return.
+ The service may return fewer than this value.
+ If unspecified, at most 10 log entries will be returned.
+ The maximum value is 5000; values above 5000 will be coerced to 5000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ExportAuditLogs` call.
+ Provide this to retrieve the subsequent page.
+ title: ExportAuditLogsRequest
+ required:
+ - parent
+ additionalProperties: false
+ description: Request message for exporting audit logs.
+ bytebase.v1.ExportAuditLogsResponse:
+ type: object
+ properties:
+ content:
+ type: string
+ title: content
+ format: byte
+ description: The exported audit log content in the requested format.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token to retrieve next page of log entities.
+ Pass this value in the page_token field in the subsequent call
+ to retrieve the next page of log entities.
+ title: ExportAuditLogsResponse
+ additionalProperties: false
+ description: Response message for exporting audit logs.
+ bytebase.v1.ExportFormat:
+ type: string
+ title: ExportFormat
+ enum:
+ - FORMAT_UNSPECIFIED
+ - CSV
+ - JSON
+ - SQL
+ - XLSX
+ description: Data export format.
+ bytebase.v1.ExportRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name is the resource name to execute the export against.
+ Format: instances/{instance}/databases/{database}
+ Format: instances/{instance}
+ Format: projects/{project}/rollouts/{rollout}
+ Format: projects/{project}/rollouts/{rollout}/stages/{stage}
+ statement:
+ type: string
+ title: statement
+ description: The SQL statement to execute.
+ limit:
+ type: integer
+ title: limit
+ format: int32
+ description: The maximum number of rows to return.
+ format:
+ title: format
+ description: The export format.
+ $ref: '#/components/schemas/bytebase.v1.ExportFormat'
+ admin:
+ type: boolean
+ title: admin
+ description: |-
+ The admin is used for workspace owner and DBA for exporting data from SQL
+ Editor Admin mode. The exported data is not masked.
+ password:
+ type: string
+ title: password
+ description: The zip password provide by users.
+ dataSourceId:
+ type: string
+ title: data_source_id
+ description: |-
+ The id of data source.
+ It is used for querying admin data source even if the instance has
+ read-only data sources. Or it can be used to query a specific read-only
+ data source.
+ schema:
+ type: string
+ title: schema
+ description: |-
+ The default schema to search objects. Equals to the current schema in
+ Oracle and search path in Postgres.
+ nullable: true
+ title: ExportRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.ExportResponse:
+ type: object
+ properties:
+ content:
+ type: string
+ title: content
+ format: byte
+ description: The export file content.
+ title: ExportResponse
+ additionalProperties: false
+ bytebase.v1.ExtensionMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of an extension.
+ schema:
+ type: string
+ title: schema
+ description: |-
+ The schema is the extension that is installed to. But the extension usage
+ is not limited to the schema.
+ version:
+ type: string
+ title: version
+ description: The version is the version of an extension.
+ description:
+ type: string
+ title: description
+ description: The description is the description of an extension.
+ title: ExtensionMetadata
+ additionalProperties: false
+ description: ExtensionMetadata is the metadata for extensions.
+ bytebase.v1.ExternalTableMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a external table.
+ externalServerName:
+ type: string
+ title: external_server_name
+ description: The external_server_name is the name of the external server.
+ externalDatabaseName:
+ type: string
+ title: external_database_name
+ description: The external_database_name is the name of the external database.
+ columns:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ColumnMetadata'
+ title: columns
+ description: The columns is the ordered list of columns in a foreign table.
+ title: ExternalTableMetadata
+ additionalProperties: false
+ bytebase.v1.FieldMapping:
+ type: object
+ properties:
+ identifier:
+ type: string
+ title: identifier
+ description: Identifier is the field name of the unique identifier in 3rd-party idp user info. Required.
+ displayName:
+ type: string
+ title: display_name
+ description: DisplayName is the field name of display name in 3rd-party idp user info. Optional.
+ phone:
+ type: string
+ title: phone
+ description: Phone is the field name of primary phone in 3rd-party idp user info. Optional.
+ groups:
+ type: string
+ title: groups
+ description: |-
+ Groups is the field name of groups in 3rd-party idp user info. Optional.
+ Mainly used for OIDC: https://developer.okta.com/docs/guides/customize-tokens-groups-claim/main/
+ title: FieldMapping
+ additionalProperties: false
+ description: |-
+ FieldMapping saves the field names from user info API of identity provider.
+ As we save all raw json string of user info response data into `principal.idp_user_info`,
+ we can extract the relevant data based with `FieldMapping`.
+ bytebase.v1.ForeignKeyMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a foreign key.
+ columns:
+ type: array
+ items:
+ type: string
+ title: columns
+ description: The columns are the ordered referencing columns of a foreign key.
+ referencedSchema:
+ type: string
+ title: referenced_schema
+ description: |-
+ The referenced_schema is the referenced schema name of a foreign key.
+ It is an empty string for databases without such concept such as MySQL.
+ referencedTable:
+ type: string
+ title: referenced_table
+ description: The referenced_table is the referenced table name of a foreign key.
+ referencedColumns:
+ type: array
+ items:
+ type: string
+ title: referenced_columns
+ description: The referenced_columns are the ordered referenced columns of a foreign key.
+ onDelete:
+ type: string
+ title: on_delete
+ description: The on_delete is the on delete action of a foreign key.
+ onUpdate:
+ type: string
+ title: on_update
+ description: The on_update is the on update action of a foreign key.
+ matchType:
+ type: string
+ title: match_type
+ description: |-
+ The match_type is the match type of a foreign key.
+ The match_type is the PostgreSQL specific field.
+ It's empty string for other databases.
+ title: ForeignKeyMetadata
+ additionalProperties: false
+ description: ForeignKeyMetadata is the metadata for foreign keys.
+ bytebase.v1.FunctionMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a function.
+ definition:
+ type: string
+ title: definition
+ description: The definition is the definition of a function.
+ signature:
+ type: string
+ title: signature
+ description: |-
+ The signature is the name with the number and type of input arguments the
+ function takes.
+ characterSetClient:
+ type: string
+ title: character_set_client
+ description: MySQL specific metadata.
+ collationConnection:
+ type: string
+ title: collation_connection
+ databaseCollation:
+ type: string
+ title: database_collation
+ sqlMode:
+ type: string
+ title: sql_mode
+ comment:
+ type: string
+ title: comment
+ dependencyTables:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DependencyTable'
+ title: dependency_tables
+ description: |-
+ The dependency_tables is the list of dependency tables of a function.
+ For PostgreSQL, it's the list of tables that the function depends on the return type definition.
+ skipDump:
+ type: boolean
+ title: skip_dump
+ title: FunctionMetadata
+ additionalProperties: false
+ description: FunctionMetadata is the metadata for functions.
+ bytebase.v1.GenerationMetadata:
+ type: object
+ properties:
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.GenerationMetadata.Type'
+ expression:
+ type: string
+ title: expression
+ title: GenerationMetadata
+ additionalProperties: false
+ bytebase.v1.GenerationMetadata.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - VIRTUAL
+ - STORED
+ bytebase.v1.GetActuatorInfoRequest:
+ type: object
+ title: GetActuatorInfoRequest
+ additionalProperties: false
+ description: Request message for getting actuator information.
+ bytebase.v1.GetChangelogRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the changelog to retrieve.
+ Format: instances/{instance}/databases/{database}/changelogs/{changelog}
+ view:
+ title: view
+ $ref: '#/components/schemas/bytebase.v1.ChangelogView'
+ title: GetChangelogRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetDatabaseCatalogRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database catalog to retrieve.
+ Format: instances/{instance}/databases/{database}/catalog
+ title: GetDatabaseCatalogRequest
+ required:
+ - name
+ additionalProperties: false
+ description: Request message for getting a database catalog.
+ bytebase.v1.GetDatabaseGroupRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database group to retrieve.
+ Format: projects/{project}/databaseGroups/{databaseGroup}
+ view:
+ title: view
+ description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroupView'
+ title: GetDatabaseGroupRequest
+ required:
+ - name
+ additionalProperties: false
+ description: Request message for getting a database group.
+ bytebase.v1.GetDatabaseMetadataRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database to retrieve metadata.
+ Format: instances/{instance}/databases/{database}/metadata
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- Deprecated: duration is no longer considered a builtin cel type.
- timestampValue:
- type: string
- description: |-
- protobuf.Timestamp value.
+ Supported filter:
+ - schema: the schema name, support "==" operator.
+ - table: the table name, support "==" and ".matches()" operator.
- Deprecated: timestamp is no longer considered a builtin cel type.
- format: date-time
- description: |-
- Represents a primitive literal.
+ For example:
+ schema == "schema-a"
+ table == "table-a"
+ table.matches("table-a")
+ schema == "schema-a" && table.matches("sample")
+ The filter used to search table with wildcard "sample" in the schema "schemas/schema-a".
+ The column masking level will only be returned when a table filter is used.
+ limit:
+ type: integer
+ title: limit
+ format: int32
+ description: |-
+ Limit the response size of returned table metadata per schema.
+ For example, if the database has 3 schemas, and each schema has 100 tables,
+ if limit is 20, then only 20 tables will be returned for each schema, total 60 tables.
+ Default 0, means no limit.
+ title: GetDatabaseMetadataRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetDatabaseRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database to retrieve.
+ Format: instances/{instance}/databases/{database}
+ title: GetDatabaseRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetDatabaseSDLSchemaRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database to retrieve SDL schema.
+ Format: instances/{instance}/databases/{database}/sdlSchema
+ format:
+ title: format
+ description: The format of the SDL schema output.
+ $ref: '#/components/schemas/bytebase.v1.GetDatabaseSDLSchemaRequest.SDLFormat'
+ title: GetDatabaseSDLSchemaRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetDatabaseSDLSchemaRequest.SDLFormat:
+ type: string
+ title: SDLFormat
+ enum:
+ - SDL_FORMAT_UNSPECIFIED
+ - SINGLE_FILE
+ - MULTI_FILE
+ description: SDLFormat specifies the output format for SDL schema.
+ bytebase.v1.GetDatabaseSchemaRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database to retrieve schema.
+ Format: instances/{instance}/databases/{database}/schema
+ title: GetDatabaseSchemaRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetGroupRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the group to retrieve.
+ Format: groups/{email}
+ title: GetGroupRequest
+ required:
+ - name
+ additionalProperties: false
+ description: Request message for getting a group.
+ bytebase.v1.GetIamPolicyRequest:
+ type: object
+ properties:
+ resource:
+ type: string
+ title: resource
+ description: |-
+ The name of the resource to get the IAM policy.
+ Format: projects/{project}
+ Format: workspaces/{workspace}
+ title: GetIamPolicyRequest
+ required:
+ - resource
+ additionalProperties: false
+ description: Request message for getting an IAM policy.
+ bytebase.v1.GetIdentityProviderRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the identity provider to retrieve.
+ Format: idps/{idp}
+ title: GetIdentityProviderRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetInstanceRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the instance to retrieve.
+ Format: instances/{instance}
+ title: GetInstanceRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetIssueRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the issue to retrieve.
+ Format: projects/{project}/issues/{issue}
+ force:
+ type: boolean
+ title: force
+ description: If set to true, bypass cache and fetch the latest data.
+ title: GetIssueRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetPlanCheckRunRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the plan check run to retrieve.
+ Format: projects/{project}/plans/{plan}/planCheckRun
+ title: GetPlanCheckRunRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetPlanRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the plan to retrieve.
+ Format: projects/{project}/plans/{plan}
+ title: GetPlanRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetPolicyRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the policy to retrieve.
+ Format: {resource type}/{resource id}/policies/{policy type}
+ title: GetPolicyRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetProjectRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the project to retrieve.
+ Format: projects/{project}
+ title: GetProjectRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetReleaseRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: projects/{project}/releases/{release}'
+ title: GetReleaseRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetResourcePackageRequest:
+ type: object
+ title: GetResourcePackageRequest
+ additionalProperties: false
+ description: Request message for getting branding resources.
+ bytebase.v1.GetReviewConfigRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the SQL review config to retrieve.
+ Format: reviewConfigs/{reviewConfig}
+ title: GetReviewConfigRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetRevisionRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the revision.
+ Format: instances/{instance}/databases/{database}/revisions/{revision}
+ title: GetRevisionRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetRoleRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the role to retrieve.
+ Format: roles/{role}
+ title: GetRoleRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetRolloutRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the rollout to retrieve.
+ This is the rollout resource name, which is the plan name plus /rollout suffix.
+ Format: projects/{project}/plans/{plan}/rollout
+ title: GetRolloutRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetSchemaStringRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database.
+ Format: instances/{instance}/databases/{database}
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.GetSchemaStringRequest.ObjectType'
+ schema:
+ type: string
+ title: schema
+ description: It's empty for DATABASE.
+ object:
+ type: string
+ title: object
+ description: It's empty for DATABASE and SCHEMA.
+ metadata:
+ title: metadata
+ description: |-
+ If use the metadata to generate the schema string, the type is OBJECT_TYPE_UNSPECIFIED.
+ Also the schema and object are empty.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseMetadata'
+ title: GetSchemaStringRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetSchemaStringRequest.ObjectType:
+ type: string
+ title: ObjectType
+ enum:
+ - OBJECT_TYPE_UNSPECIFIED
+ - DATABASE
+ - SCHEMA
+ - TABLE
+ - VIEW
+ - MATERIALIZED_VIEW
+ - FUNCTION
+ - PROCEDURE
+ - SEQUENCE
+ bytebase.v1.GetSchemaStringResponse:
+ type: object
+ properties:
+ schemaString:
+ type: string
+ title: schema_string
+ title: GetSchemaStringResponse
+ additionalProperties: false
+ bytebase.v1.GetSettingRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The resource name of the setting.
+ title: GetSettingRequest
+ required:
+ - name
+ additionalProperties: false
+ description: The request message for getting a setting.
+ bytebase.v1.GetSettingResponse:
+ type: object
+ properties:
+ setting:
+ title: setting
+ $ref: '#/components/schemas/bytebase.v1.Setting'
+ title: GetSettingResponse
+ additionalProperties: false
+ description: The response message for getting a setting.
+ bytebase.v1.GetSheetRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the sheet to retrieve.
+ Format: projects/{project}/sheets/{sheet}
+ raw:
+ type: boolean
+ title: raw
+ description: By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content.
+ title: GetSheetRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetSubscriptionRequest:
+ type: object
+ title: GetSubscriptionRequest
+ additionalProperties: false
+ bytebase.v1.GetTaskRunLogRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
+ title: GetTaskRunLogRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.GetTaskRunRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
+ title: GetTaskRunRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetTaskRunSessionRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
+ title: GetTaskRunSessionRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.GetUserRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the user to retrieve.
+ Format: users/{email}
+ title: GetUserRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GetWorksheetRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the worksheet to retrieve.
+ Format: worksheets/{worksheet}
+ title: GetWorksheetRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.GrantRequest:
+ type: object
+ properties:
+ role:
+ type: string
+ title: role
+ description: |-
+ The requested role.
+ Format: roles/EXPORTER.
+ user:
+ type: string
+ title: user
+ description: |-
+ The user to be granted.
+ Format: users/{email}.
+ condition:
+ title: condition
+ description: The condition for the role. Same as the condition in IAM Binding message.
+ $ref: '#/components/schemas/google.type.Expr'
+ expiration:
+ title: expiration
+ description: The duration for which the grant is valid.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ title: GrantRequest
+ additionalProperties: false
+ bytebase.v1.GridLevel:
+ type: object
+ properties:
+ level:
+ type: integer
+ title: level
+ format: int32
+ description: Grid level number (1-4 for SQL Server)
+ density:
+ type: string
+ title: density
+ description: Grid density (LOW, MEDIUM, HIGH)
+ title: GridLevel
+ additionalProperties: false
+ description: GridLevel defines a tessellation grid level with its density.
+ bytebase.v1.Group:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the group to retrieve.
+ Format: groups/{group}, the group should be email or uuid.
+ readOnly: true
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The display title of the group.
+ description:
+ type: string
+ title: description
+ maxLength: 1000
+ description: The description of the group.
+ members:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.GroupMember'
+ title: members
+ description: The members of the group.
+ source:
+ type: string
+ title: source
+ description: The source system where the group originated (e.g., Entra ID for SCIM sync).
+ email:
+ type: string
+ title: email
+ description: The unique email for the group.
+ title: Group
+ additionalProperties: false
+ description: A group of users within the workspace.
+ bytebase.v1.GroupMember:
+ type: object
+ properties:
+ member:
+ type: string
+ title: member
+ description: |-
+ Member is the principal who belong to this group.
- Named 'Constant' here for backwards compatibility.
+ Format: users/[email protected]
+ role:
+ title: role
+ description: The member's role in the group.
+ $ref: '#/components/schemas/bytebase.v1.GroupMember.Role'
+ title: GroupMember
+ additionalProperties: false
+ description: A member of a group with a role.
+ bytebase.v1.GroupMember.Role:
+ type: string
+ title: Role
+ enum:
+ - ROLE_UNSPECIFIED
+ - OWNER
+ - MEMBER
+ description: The role of a group member.
+ bytebase.v1.IamPolicy:
+ type: object
+ properties:
+ bindings:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Binding'
+ title: bindings
+ description: |-
+ Collection of binding.
+ A binding binds one or more project members to a single project role.
+ etag:
+ type: string
+ title: etag
+ description: |-
+ The current etag of the policy.
+ If an etag is provided and does not match the current etag of the policy,
+ the call will be blocked and an ABORTED error will be returned.
+ title: IamPolicy
+ additionalProperties: false
+ description: IAM policy that binds members to roles.
+ bytebase.v1.IdentityProvider:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the identity provider.
+ Format: idps/{idp}
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The display title of the identity provider.
+ domain:
+ type: string
+ title: domain
+ description: The domain for email matching when using this identity provider.
+ type:
+ title: type
+ description: The type of identity provider protocol.
+ $ref: '#/components/schemas/bytebase.v1.IdentityProviderType'
+ config:
+ title: config
+ description: The configuration details for the identity provider.
+ $ref: '#/components/schemas/bytebase.v1.IdentityProviderConfig'
+ title: IdentityProvider
+ additionalProperties: false
+ bytebase.v1.IdentityProviderConfig:
+ type: object
+ oneOf:
+ - properties:
+ ldapConfig:
+ title: ldap_config
+ description: LDAP protocol configuration.
+ $ref: '#/components/schemas/bytebase.v1.LDAPIdentityProviderConfig'
+ title: ldap_config
+ required:
+ - ldapConfig
+ - properties:
+ oauth2Config:
+ title: oauth2_config
+ description: OAuth2 protocol configuration.
+ $ref: '#/components/schemas/bytebase.v1.OAuth2IdentityProviderConfig'
+ title: oauth2_config
+ required:
+ - oauth2Config
+ - properties:
+ oidcConfig:
+ title: oidc_config
+ description: OIDC protocol configuration.
+ $ref: '#/components/schemas/bytebase.v1.OIDCIdentityProviderConfig'
+ title: oidc_config
+ required:
+ - oidcConfig
+ title: IdentityProviderConfig
+ additionalProperties: false
+ bytebase.v1.IdentityProviderContext:
+ type: object
+ oneOf:
+ - properties:
+ oauth2Context:
+ title: oauth2_context
+ description: OAuth2 authentication context.
+ $ref: '#/components/schemas/bytebase.v1.OAuth2IdentityProviderContext'
+ title: oauth2_context
+ required:
+ - oauth2Context
+ - properties:
+ oidcContext:
+ title: oidc_context
+ description: OpenID Connect authentication context.
+ $ref: '#/components/schemas/bytebase.v1.OIDCIdentityProviderContext'
+ title: oidc_context
+ required:
+ - oidcContext
+ title: IdentityProviderContext
+ additionalProperties: false
+ description: Context for identity provider authentication.
+ bytebase.v1.IdentityProviderType:
+ type: string
+ title: IdentityProviderType
+ enum:
+ - IDENTITY_PROVIDER_TYPE_UNSPECIFIED
+ - OAUTH2
+ - OIDC
+ - LDAP
+ bytebase.v1.IndexMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of an index.
+ expressions:
+ type: array
+ items:
+ type: string
+ title: expressions
+ description: |-
+ The expressions are the ordered columns or expressions of an index.
+ This could refer to a column or an expression.
+ keyLength:
+ type: array
+ items:
+ type:
+ - integer
+ - string
+ format: int64
+ title: key_length
+ description: |-
+ The key_lengths are the ordered key lengths of an index.
+ If the key length is not specified, it's -1.
+ descending:
+ type: array
+ items:
+ type: boolean
+ title: descending
+ description: The descending is the ordered descending of an index.
+ type:
+ type: string
+ title: type
+ description: The type is the type of an index.
+ unique:
+ type: boolean
+ title: unique
+ description: The unique is whether the index is unique.
+ primary:
+ type: boolean
+ title: primary
+ description: The primary is whether the index is a primary key index.
+ visible:
+ type: boolean
+ title: visible
+ description: The visible is whether the index is visible.
+ comment:
+ type: string
+ title: comment
+ description: The comment is the comment of an index.
+ definition:
+ type: string
+ title: definition
+ description: The definition of an index.
+ parentIndexSchema:
+ type: string
+ title: parent_index_schema
+ description: The schema name of the parent index.
+ parentIndexName:
+ type: string
+ title: parent_index_name
+ description: The index name of the parent index.
+ granularity:
+ type:
+ - integer
+ - string
+ title: granularity
+ format: int64
+ description: The number of granules in the block. It's a ClickHouse specific field.
+ isConstraint:
+ type: boolean
+ title: is_constraint
+ description: |-
+ It's a PostgreSQL specific field.
+ The unique constraint and unique index are not the same thing in PostgreSQL.
+ spatialConfig:
+ title: spatial_config
+ description: Spatial index configuration for spatial databases like SQL Server, PostgreSQL with PostGIS, etc.
+ $ref: '#/components/schemas/bytebase.v1.SpatialIndexConfig'
+ opclassNames:
+ type: array
+ items:
+ type: string
+ title: opclass_names
+ description: |-
+ https://www.postgresql.org/docs/current/catalog-pg-opclass.html
+ Name of the operator class for each column. (PostgreSQL specific).
+ opclassDefaults:
+ type: array
+ items:
+ type: boolean
+ title: opclass_defaults
+ description: True if the operator class is the default. (PostgreSQL specific).
+ title: IndexMetadata
+ additionalProperties: false
+ description: IndexMetadata is the metadata for indexes.
+ bytebase.v1.Instance:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the instance.
+ Format: instances/{instance}
+ state:
+ title: state
+ description: The lifecycle state of the instance.
+ $ref: '#/components/schemas/bytebase.v1.State'
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The display title of the instance.
+ engine:
+ title: engine
+ description: The database engine type.
+ $ref: '#/components/schemas/bytebase.v1.Engine'
+ engineVersion:
+ type: string
+ title: engine_version
+ description: The version of the database engine.
+ readOnly: true
+ externalLink:
+ type: string
+ title: external_link
+ description: External URL to the database instance console.
+ dataSources:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DataSource'
+ title: data_sources
+ description: Data source configurations for connecting to the instance.
+ environment:
+ type: string
+ title: environment
+ description: |-
+ (OPTIONAL) The environment resource.
+ Format: environments/prod where prod is the environment resource ID.
+ nullable: true
+ activation:
+ type: boolean
+ title: activation
+ description: Whether the instance is activated for use.
+ roles:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.InstanceRole'
+ title: roles
+ description: Database roles available in this instance.
+ readOnly: true
+ syncInterval:
+ title: sync_interval
+ description: How often the instance is synced.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ syncDatabases:
+ type: array
+ items:
+ type: string
+ title: sync_databases
+ description: |-
+ Enable sync for following databases.
+ Default empty, means sync all schemas & databases.
+ lastSyncTime:
+ title: last_sync_time
+ description: The last time the instance was synced.
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ labels:
+ type: object
+ title: labels
+ additionalProperties:
+ type: string
+ title: value
+ description: |-
+ Labels are key-value pairs that can be attached to the instance.
+ For example, { "org_group": "infrastructure", "environment": "production" }
+ title: Instance
+ additionalProperties: false
+ bytebase.v1.Instance.LabelsEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: string
+ title: value
+ title: LabelsEntry
+ additionalProperties: false
+ bytebase.v1.InstanceResource:
+ type: object
+ properties:
+ title:
+ type: string
+ title: title
+ description: The display title of the instance.
+ engine:
+ title: engine
+ description: The database engine type.
+ $ref: '#/components/schemas/bytebase.v1.Engine'
+ engineVersion:
+ type: string
+ title: engine_version
+ description: The version of the database engine.
+ readOnly: true
+ dataSources:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DataSource'
+ title: data_sources
+ description: Data source configurations for the instance.
+ activation:
+ type: boolean
+ title: activation
+ description: Whether the instance is activated.
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the instance.
+ Format: instances/{instance}
+ environment:
+ type: string
+ title: environment
+ description: |-
+ The environment resource.
+ Format: environments/prod where prod is the environment resource ID.
+ nullable: true
+ title: InstanceResource
+ additionalProperties: false
+ bytebase.v1.InstanceRole:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the role.
+ Format: instances/{instance}/roles/{role}
+ The role name is the unique name for the role.
+ roleName:
+ type: string
+ title: role_name
+ description: The role name. It's unique within the instance.
+ password:
+ type: string
+ title: password
+ description: The role password.
+ nullable: true
+ writeOnly: true
+ connectionLimit:
+ type: integer
+ title: connection_limit
+ format: int32
+ description: The connection count limit for this role.
+ nullable: true
+ validUntil:
+ type: string
+ title: valid_until
+ description: The expiration for the role's password.
+ nullable: true
+ attribute:
+ type: string
+ title: attribute
+ description: |-
+ The role attribute.
+ For PostgreSQL, it contains super_user, no_inherit, create_role, create_db, can_login, replication, and bypass_rls. Docs: https://www.postgresql.org/docs/current/role-attributes.html
+ For MySQL, it's the global privileges as GRANT statements, which means it only contains "GRANT ... ON *.* TO ...". Docs: https://dev.mysql.com/doc/refman/8.0/en/grant.html
+ nullable: true
+ title: InstanceRole
+ additionalProperties: false
+ description: InstanceRole is the API message for instance role.
+ bytebase.v1.Issue:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the issue.
+ Format: projects/{project}/issues/{issue}
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The title of the issue.
+ description:
+ type: string
+ title: description
+ maxLength: 10000
+ description: The description of the issue.
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.Issue.Type'
+ status:
+ title: status
+ description: The status of the issue.
+ $ref: '#/components/schemas/bytebase.v1.IssueStatus'
+ approvers:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Issue.Approver'
+ title: approvers
+ approvalTemplate:
+ title: approval_template
+ description: The approval template for the issue.
+ $ref: '#/components/schemas/bytebase.v1.ApprovalTemplate'
+ creator:
+ type: string
+ title: creator
+ description: 'Format: users/[email protected]'
+ readOnly: true
+ createTime:
+ title: create_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ updateTime:
+ title: update_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ plan:
+ type: string
+ title: plan
+ description: |-
+ The plan associated with the issue.
+ Can be empty.
+ Format: projects/{project}/plans/{plan}
+ grantRequest:
+ title: grant_request
+ description: Used if the issue type is GRANT_REQUEST.
+ $ref: '#/components/schemas/bytebase.v1.GrantRequest'
+ riskLevel:
+ title: risk_level
+ description: The risk level of the issue.
+ $ref: '#/components/schemas/bytebase.v1.RiskLevel'
+ labels:
+ type: array
+ items:
+ type: string
+ title: labels
+ description: Labels attached to the issue for categorization and filtering.
+ approvalStatus:
+ title: approval_status
+ readOnly: true
+ $ref: '#/components/schemas/bytebase.v1.Issue.ApprovalStatus'
+ approvalStatusError:
+ type: string
+ title: approval_status_error
+ description: Only populated when approval_status == ERROR
+ readOnly: true
+ title: Issue
+ additionalProperties: false
+ bytebase.v1.Issue.ApprovalStatus:
+ type: string
+ title: ApprovalStatus
+ enum:
+ - APPROVAL_STATUS_UNSPECIFIED
+ - CHECKING
+ - PENDING
+ - APPROVED
+ - REJECTED
+ - SKIPPED
+ - ERROR
+ description: The overall approval status for the issue.
+ bytebase.v1.Issue.Approver:
+ type: object
+ properties:
+ status:
+ title: status
+ description: The new status.
+ $ref: '#/components/schemas/bytebase.v1.Issue.Approver.Status'
+ principal:
+ type: string
+ title: principal
+ description: 'Format: users/[email protected]'
+ title: Approver
+ additionalProperties: false
+ description: Approvers and their approval status for the issue.
+ bytebase.v1.Issue.Approver.Status:
+ type: string
+ title: Status
+ enum:
+ - STATUS_UNSPECIFIED
+ - PENDING
+ - APPROVED
+ - REJECTED
+ description: The approval status of an approver.
+ bytebase.v1.Issue.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - DATABASE_CHANGE
+ - GRANT_REQUEST
+ - DATABASE_EXPORT
+ description: The type of issue.
+ bytebase.v1.IssueComment:
+ type: object
+ allOf:
+ - properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: projects/{project}/issues/{issue}/issueComments/{issueComment-uid}'
+ comment:
+ type: string
+ title: comment
+ maxLength: 65536
+ description: The text content of the comment.
+ payload:
+ type: string
+ title: payload
+ description: 'TODO: use struct message instead.'
+ createTime:
+ title: create_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ updateTime:
+ title: update_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ creator:
+ type: string
+ title: creator
+ description: 'Format: users/{email}'
+ readOnly: true
+ - oneOf:
+ - properties:
+ approval:
+ title: approval
+ description: Approval event.
+ $ref: '#/components/schemas/bytebase.v1.IssueComment.Approval'
+ title: approval
+ required:
+ - approval
+ - properties:
+ issueUpdate:
+ title: issue_update
+ description: Issue update event.
+ $ref: '#/components/schemas/bytebase.v1.IssueComment.IssueUpdate'
+ title: issue_update
+ required:
+ - issueUpdate
+ - properties:
+ planSpecUpdate:
+ title: plan_spec_update
+ description: Plan spec update event.
+ $ref: '#/components/schemas/bytebase.v1.IssueComment.PlanSpecUpdate'
+ title: plan_spec_update
+ required:
+ - planSpecUpdate
+ title: IssueComment
+ additionalProperties: false
+ description: A comment on an issue.
+ bytebase.v1.IssueComment.Approval:
+ type: object
+ properties:
+ status:
+ title: status
+ description: The approval status.
+ $ref: '#/components/schemas/bytebase.v1.IssueComment.Approval.Status'
+ title: Approval
+ additionalProperties: false
+ description: Approval event information.
+ bytebase.v1.IssueComment.Approval.Status:
+ type: string
+ title: Status
+ enum:
+ - STATUS_UNSPECIFIED
+ - PENDING
+ - APPROVED
+ - REJECTED
+ description: Approval status values.
+ bytebase.v1.IssueComment.IssueUpdate:
+ type: object
+ properties:
+ fromTitle:
+ type: string
+ title: from_title
+ nullable: true
+ toTitle:
+ type: string
+ title: to_title
+ nullable: true
+ fromDescription:
+ type: string
+ title: from_description
+ nullable: true
+ toDescription:
+ type: string
+ title: to_description
+ nullable: true
+ fromStatus:
+ title: from_status
+ nullable: true
+ $ref: '#/components/schemas/bytebase.v1.IssueStatus'
+ toStatus:
+ title: to_status
+ nullable: true
+ $ref: '#/components/schemas/bytebase.v1.IssueStatus'
+ fromLabels:
+ type: array
+ items:
+ type: string
+ title: from_labels
+ toLabels:
+ type: array
+ items:
+ type: string
+ title: to_labels
+ title: IssueUpdate
+ additionalProperties: false
+ description: Issue update event information.
+ bytebase.v1.IssueComment.PlanSpecUpdate:
+ type: object
+ properties:
+ spec:
+ type: string
+ title: spec
+ description: |-
+ The spec that was updated.
+ Format: projects/{project}/plans/{plan}/specs/{spec}
+ fromSheet:
+ type: string
+ title: from_sheet
+ description: |-
+ The previous sheet.
+ Format: projects/{project}/sheets/{sheet}
+ nullable: true
+ toSheet:
+ type: string
+ title: to_sheet
+ description: |-
+ The new sheet.
+ Format: projects/{project}/sheets/{sheet}
+ nullable: true
+ title: PlanSpecUpdate
+ additionalProperties: false
+ description: Plan spec update event information (tracks sheet changes to plan specs).
+ bytebase.v1.IssueStatus:
+ type: string
+ title: IssueStatus
+ enum:
+ - ISSUE_STATUS_UNSPECIFIED
+ - OPEN
+ - DONE
+ - CANCELED
+ description: The status of an issue.
+ bytebase.v1.KerberosConfig:
+ type: object
+ properties:
+ primary:
+ type: string
+ title: primary
+ description: The primary component of the Kerberos principal.
+ instance:
+ type: string
+ title: instance
+ description: The instance component of the Kerberos principal.
+ realm:
+ type: string
+ title: realm
+ description: The Kerberos realm.
+ keytab:
+ type: string
+ title: keytab
+ format: byte
+ description: The keytab file contents for authentication.
+ kdcHost:
+ type: string
+ title: kdc_host
+ description: The hostname of the Key Distribution Center (KDC).
+ kdcPort:
+ type: string
+ title: kdc_port
+ description: The port of the Key Distribution Center (KDC).
+ kdcTransportProtocol:
+ type: string
+ title: kdc_transport_protocol
+ description: The transport protocol for KDC communication (tcp or udp).
+ title: KerberosConfig
+ additionalProperties: false
+ bytebase.v1.LDAPIdentityProviderConfig:
+ type: object
+ properties:
+ host:
+ type: string
+ title: host
+ description: |-
+ Host is the hostname or IP address of the LDAP server, e.g.,
+ "ldap.example.com".
+ port:
+ type: integer
+ title: port
+ format: int32
+ description: |-
+ Port is the port number of the LDAP server, e.g., 389. When not set, the
+ default port of the corresponding security protocol will be used, i.e. 389
+ for StartTLS and 636 for LDAPS.
+ skipTlsVerify:
+ type: boolean
+ title: skip_tls_verify
+ description: SkipTLSVerify controls whether to skip TLS certificate verification.
+ bindDn:
+ type: string
+ title: bind_dn
+ description: |-
+ BindDN is the DN of the user to bind as a service account to perform
+ search requests.
+ bindPassword:
+ type: string
+ title: bind_password
+ description: BindPassword is the password of the user to bind as a service account.
+ baseDn:
+ type: string
+ title: base_dn
+ description: BaseDN is the base DN to search for users, e.g., "ou=users,dc=example,dc=com".
+ userFilter:
+ type: string
+ title: user_filter
+ description: UserFilter is the filter to search for users, e.g., "(uid=%s)".
+ securityProtocol:
+ title: security_protocol
+ description: |-
+ SecurityProtocol is the security protocol to be used for establishing
+ connections with the LDAP server.
+ $ref: '#/components/schemas/bytebase.v1.LDAPIdentityProviderConfig.SecurityProtocol'
+ fieldMapping:
+ title: field_mapping
+ description: |-
+ FieldMapping is the mapping of the user attributes returned by the LDAP
+ server.
+ $ref: '#/components/schemas/bytebase.v1.FieldMapping'
+ title: LDAPIdentityProviderConfig
+ additionalProperties: false
+ description: LDAPIdentityProviderConfig is the structure for LDAP identity provider config.
+ bytebase.v1.LDAPIdentityProviderConfig.SecurityProtocol:
+ type: string
+ title: SecurityProtocol
+ enum:
+ - SECURITY_PROTOCOL_UNSPECIFIED
+ - START_TLS
+ - LDAPS
+ bytebase.v1.Label:
+ type: object
+ properties:
+ value:
+ type: string
+ title: value
+ description: The label value/name.
+ color:
+ type: string
+ title: color
+ description: The color code for the label (e.g., hex color).
+ group:
+ type: string
+ title: group
+ description: The group this label belongs to.
+ title: Label
+ additionalProperties: false
+ description: A label for categorizing and organizing issues.
+ bytebase.v1.ListChangelogsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent of the changelogs.
+ Format: instances/{instance}/databases/{database}
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of changelogs to return. The service may return fewer
+ than this value. If unspecified, at most 10 changelogs will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from the previous call.
+ Provide this to retrieve the subsequent page.
- This is similar as the primitives supported in the well-known type
- `google.protobuf.Value`, but richer so it can represent CEL's full range of
- primitives.
+ When paginating, all other parameters provided must match
+ the call that provided the page token.
+ view:
+ title: view
+ $ref: '#/components/schemas/bytebase.v1.ChangelogView'
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter changelogs returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- Lists and structs are not included as constants as these aggregate types may
- contain [Expr][google.api.expr.v1alpha1.Expr] elements which require
- evaluation and are thus not constant.
+ Supported filter:
+ status: the changelog status, support "==" operation. check Changelog.Status for available values.
+ type: the changelog type, support "in" and "==" operation. check Changelog.Type for available values.
- Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`,
- `true`, `null`.
- Content_Part:
- type: object
- properties:
- text:
- type: string
- CreateRevisionRequest:
- required:
- - parent
- - revision
- type: object
- properties:
- parent:
- type: string
- description: 'Format: instances/{instance}/databases/{database}'
- revision:
- allOf:
- - $ref: '#/components/schemas/Revision'
- description: The revision to create.
- CreateRolloutRequest:
- required:
- - parent
- type: object
- properties:
- parent:
- type: string
- description: |-
- The parent plan for which this rollout will be created.
- Format: projects/{project}/plans/{plan}
- target:
- type: string
- description: |-
- Create the rollout only for the specified target.
- Format: environments/{environment}
- If unspecified, all stages are created.
- If set to "", no stages are created.
- CreateSheetRequest:
- required:
- - parent
- - sheet
- type: object
- properties:
- parent:
- type: string
- description: |-
- The parent resource where this sheet will be created.
- Format: projects/{project}
- sheet:
- allOf:
- - $ref: '#/components/schemas/Sheet'
- description: The sheet to create.
- CreateStruct_Entry:
- type: object
- properties:
- id:
- type: string
- description: |-
- Required. An id assigned to this node by the parser which is unique
- in a given expression tree. This is used to associate type
- information and other attributes to the node.
+ Example:
+ status == "DONE"
+ type in ["BASELINE", "MIGRATE"]
+ status == "FAILED" && type == "SDL"
+ title: ListChangelogsRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListChangelogsResponse:
+ type: object
+ properties:
+ changelogs:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Changelog'
+ title: changelogs
+ description: The list of changelogs.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListChangelogsResponse
+ additionalProperties: false
+ bytebase.v1.ListDatabaseGroupsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource whose database groups are to be listed.
+ Format: projects/{project}
+ view:
+ title: view
+ description: The view to return. Defaults to DATABASE_GROUP_VIEW_BASIC.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroupView'
+ title: ListDatabaseGroupsRequest
+ required:
+ - parent
+ additionalProperties: false
+ description: Request message for listing database groups.
+ bytebase.v1.ListDatabaseGroupsResponse:
+ type: object
+ properties:
+ databaseGroups:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
+ title: database_groups
+ description: The database groups from the specified request.
+ title: ListDatabaseGroupsResponse
+ additionalProperties: false
+ description: Response message for listing database groups.
+ bytebase.v1.ListDatabasesRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ - projects/{project}: list databases in a project, require "bb.projects.get" permission.
+ - workspaces/-: list databases in the workspace, require "bb.databases.list" permission.
+ - instances/{instances}: list databases in a instance, require "bb.instances.get" permission
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of databases to return. The service may return fewer
+ than this value.
+ If unspecified, at most 10 databases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListDatabases` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListDatabases` must
+ match the call that provided the page token.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - name: the database name, support ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
+ - table: filter by the database table, support "==" and ".matches()" operator.
+ - labels.{key}: the database label, support "==" and "in" operators.
+
+ For example:
+ environment == "environments/{environment resource id}"
+ environment == "" (find databases which environment is not set)
+ project == "projects/{project resource id}"
+ instance == "instances/{instance resource id}"
+ name.matches("database name")
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ exclude_unassigned == true
+ drifted == true
+ table == "sample"
+ table.matches("sam")
+ labels.environment == "production"
+ labels.region == "asia"
+ labels.region in ["asia", "europe"]
+
+ You can combine filter conditions like:
+ environment == "environments/prod" && name.matches("employee")
+ showDeleted:
+ type: boolean
+ title: show_deleted
+ description: Show deleted database if specified.
+ orderBy:
+ type: string
+ title: order_by
+ description: |-
+ The order by of databases.
+ Support name, project, instance. The default sorting order is ascending.
+ For example:
+ - order_by = "name" - order by name ascending
+ - order_by = "name desc"
+ - order_by = "name desc, project asc"
+ title: ListDatabasesRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListDatabasesResponse:
+ type: object
+ properties:
+ databases:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Database'
+ title: databases
+ description: The databases from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListDatabasesResponse
+ additionalProperties: false
+ bytebase.v1.ListGroupsRequest:
+ type: object
+ properties:
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of groups to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 groups will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListGroups` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListGroups` must match
+ the call that provided the page token.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter groups returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - title: the group title, support "==" and ".matches()" operator.
+ - email: the group email, support "==" and ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+
+ For example:
+ title == "dba"
+ email == "[email protected]"
+ title.matches("dba")
+ email.matches("dba")
+ project == "projects/sample-project"
+ You can combine filter conditions like:
+ title.matches("dba") || email.matches("dba")
+ title: ListGroupsRequest
+ additionalProperties: false
+ description: Request message for listing groups.
+ bytebase.v1.ListGroupsResponse:
+ type: object
+ properties:
+ groups:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Group'
+ title: groups
+ description: The groups from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListGroupsResponse
+ additionalProperties: false
+ description: Response message for listing groups.
+ bytebase.v1.ListIdentityProvidersRequest:
+ type: object
+ title: ListIdentityProvidersRequest
+ additionalProperties: false
+ bytebase.v1.ListIdentityProvidersResponse:
+ type: object
+ properties:
+ identityProviders:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
+ title: identity_providers
+ description: The identity providers from the specified request.
+ title: ListIdentityProvidersResponse
+ additionalProperties: false
+ bytebase.v1.ListInstanceDatabaseRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the instance.
+ Format: instances/{instance}
+ instance:
+ title: instance
+ description: The target instance. We need to set this field if the target instance is not created yet.
+ nullable: true
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ title: ListInstanceDatabaseRequest
+ required:
+ - name
+ - instance
+ additionalProperties: false
+ bytebase.v1.ListInstanceDatabaseResponse:
+ type: object
+ properties:
+ databases:
+ type: array
+ items:
+ type: string
+ title: databases
+ description: All database name list in the instance.
+ title: ListInstanceDatabaseResponse
+ additionalProperties: false
+ bytebase.v1.ListInstanceRolesRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent, which owns this collection of roles.
+ Format: instances/{instance}
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ Not used.
+ The maximum number of roles to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 roles will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ Not used.
+ A page token, received from a previous `ListInstanceRoles` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListInstanceRoles` must match
+ the call that provided the page token.
+ refresh:
+ type: boolean
+ title: refresh
+ description: Refresh will refresh and return the latest data.
+ title: ListInstanceRolesRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListInstanceRolesResponse:
+ type: object
+ properties:
+ roles:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.InstanceRole'
+ title: roles
+ description: The roles from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListInstanceRolesResponse
+ additionalProperties: false
+ bytebase.v1.ListInstancesRequest:
+ type: object
+ properties:
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of instances to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 instances will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListInstances` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListInstances` must match
+ the call that provided the page token.
+ showDeleted:
+ type: boolean
+ title: show_deleted
+ description: Show deleted instances if specified.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter the instance.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - name: the instance name, support "==" and ".matches()" operator.
+ - resource_id: the instance id, support "==" and ".matches()" operator.
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - state: the instance state, check State enum for values, support "==" operator.
+ - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - host: the instance host, support "==" and ".matches()" operator.
+ - port: the instance port, support "==" and ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - labels.{key}: the instance label, support "==" and "in" operators.
+
+ For example:
+ name == "sample instance"
+ name.matches("sample")
+ resource_id == "sample-instance"
+ resource_id.matches("sample")
+ state == "DELETED"
+ environment == "environments/test"
+ environment == "" (find instances which environment is not set)
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ host == "127.0.0.1"
+ host.matches("127.0")
+ port == "54321"
+ port.matches("543")
+ labels.org_group == "infrastructure"
+ labels.environment in ["prod", "production"]
+ project == "projects/sample-project"
+ You can combine filter conditions like:
+ name.matches("sample") && environment == "environments/test"
+ host == "127.0.0.1" && port == "54321"
+ orderBy:
+ type: string
+ title: order_by
+ description: |-
+ The order by of instances.
+ Support title, environment. The default sorting order is ascending.
+ For example:
+ - order_by = "title"
+ - order_by = "title desc"
+ - order_by = "title desc, environment asc"
+ title: ListInstancesRequest
+ additionalProperties: false
+ bytebase.v1.ListInstancesResponse:
+ type: object
+ properties:
+ instances:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ title: instances
+ description: The instances from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListInstancesResponse
+ additionalProperties: false
+ bytebase.v1.ListIssueCommentsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: 'Format: projects/{projects}/issues/{issue}'
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of issue comments to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 issue comments will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListIssueComments` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListIssueComments` must match
+ the call that provided the page token.
+ title: ListIssueCommentsRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListIssueCommentsResponse:
+ type: object
+ properties:
+ issueComments:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.IssueComment'
+ title: issue_comments
+ description: The issue comments from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListIssueCommentsResponse
+ additionalProperties: false
+ bytebase.v1.ListIssuesRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent, which owns this collection of issues.
+ Format: projects/{project}
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of issues to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 issues will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListIssues` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListIssues` must match
+ the call that provided the page token.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter issues returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
+ - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
+ - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
+ - labels: the issue labels, support "==" and "in" operator.
+ - approval_status: issue approval status, support "==" operator.
+ - current_approver: the issue approver, should in "users/{email} format", support "==" operator.
+
+ For example:
+ creator == "users/[email protected]" && status in ["OPEN", "DONE"]
+ status == "CANCELED" && type == "DATABASE_CHANGE"
+ labels in ["label1", "label2"]
+ create_time >= "2025-01-02T15:04:05Z07:00"
+ query:
+ type: string
+ title: query
+ description: Query is the query statement.
+ title: ListIssuesRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListIssuesResponse:
+ type: object
+ properties:
+ issues:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ title: issues
+ description: The issues from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListIssuesResponse
+ additionalProperties: false
+ bytebase.v1.ListPlansRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent, which owns this collection of plans.
+ Format: projects/{project}
+ Use "projects/-" to list all plans from all projects.
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of plans to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 plans will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListPlans` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListPlans` must match
+ the call that provided the page token.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter plans returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
+ - create_time: the plan create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - has_rollout: whether the plan has rollout, support "==" operator, the value should be "true" or "false".
+ - has_issue: the plan has issue or not, support "==" operator, the value should be "true" or "false".
+ - title: the plan title, support "==" operator for exact match and ".matches()" operator for case-insensitive substring match.
+ - spec_type: the plan spec config type, support "==" operator, the value should be "create_database_config", "change_database_config", or "export_data_config".
+ - state: the plan state, support "==" operator, the value should be "ACTIVE" or "DELETED".
+
+ For example:
+ creator == "users/[email protected]" && create_time >= "2025-01-02T15:04:05Z07:00"
+ has_rollout == false && has_issue == true
+ title == "My Plan"
+ title.matches("database migration")
+ spec_type == "change_database_config"
+ state == "ACTIVE"
+ title: ListPlansRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListPlansResponse:
+ type: object
+ properties:
+ plans:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Plan'
+ title: plans
+ description: The plans from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListPlansResponse
+ additionalProperties: false
+ bytebase.v1.ListPoliciesRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent, which owns this collection of policies.
+ Format: {resource type}/{resource id}
+ policyType:
+ title: policy_type
+ description: Filter by specific policy type.
+ nullable: true
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ showDeleted:
+ type: boolean
+ title: show_deleted
+ description: Show deleted policies if specified.
+ title: ListPoliciesRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListPoliciesResponse:
+ type: object
+ properties:
+ policies:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ title: policies
+ description: The policies from the specified request.
+ title: ListPoliciesResponse
+ additionalProperties: false
+ bytebase.v1.ListProjectsRequest:
+ type: object
+ properties:
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of projects to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 projects will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListProjects` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListProjects` must match
+ the call that provided the page token.
+ showDeleted:
+ type: boolean
+ title: show_deleted
+ description: Show deleted projects if specified.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter the project.
+ Check filter for SearchProjectsRequest for details.
+ Supports filtering by name, resource_id, state, and labels (e.g., labels.environment == "production").
+ orderBy:
+ type: string
+ title: order_by
+ description: |-
+ The order by of projects.
+ Support title. The default sorting order is ascending.
+ For example:
+ - order_by = "title"
+ - order_by = "title desc"
+ - order_by = "title asc"
+ title: ListProjectsRequest
+ additionalProperties: false
+ bytebase.v1.ListProjectsResponse:
+ type: object
+ properties:
+ projects:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ title: projects
+ description: The projects from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListProjectsResponse
+ additionalProperties: false
+ bytebase.v1.ListReleasesRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: 'Format: projects/{project}'
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of releases to return. The service may return fewer than this value.
+ If unspecified, at most 10 releases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListReleases` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListReleases` must match
+ the call that provided the page token.
+ showDeleted:
+ type: boolean
+ title: show_deleted
+ description: Show deleted releases if specified.
+ title: ListReleasesRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListReleasesResponse:
+ type: object
+ properties:
+ releases:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ title: releases
+ description: The releases from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListReleasesResponse
+ additionalProperties: false
+ bytebase.v1.ListReviewConfigsRequest:
+ type: object
+ title: ListReviewConfigsRequest
+ additionalProperties: false
+ bytebase.v1.ListReviewConfigsResponse:
+ type: object
+ properties:
+ reviewConfigs:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
+ title: review_configs
+ description: The SQL review configs from the specified request.
+ title: ListReviewConfigsResponse
+ additionalProperties: false
+ bytebase.v1.ListRevisionsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent of the revisions.
+ Format: instances/{instance}/databases/{database}
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of revisions to return. The service may return fewer
+ than this value. If unspecified, at most 10 revisions will be returned. The
+ maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListRevisions` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListRevisions` must
+ match the call that provided the page token.
+ showDeleted:
+ type: boolean
+ title: show_deleted
+ description: Whether to include deleted revisions in the results.
+ title: ListRevisionsRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListRevisionsResponse:
+ type: object
+ properties:
+ revisions:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Revision'
+ title: revisions
+ description: The revisions from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListRevisionsResponse
+ additionalProperties: false
+ bytebase.v1.ListRolesRequest:
+ type: object
+ title: ListRolesRequest
+ additionalProperties: false
+ bytebase.v1.ListRolesResponse:
+ type: object
+ properties:
+ roles:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Role'
+ title: roles
+ description: The roles from the specified request.
+ title: ListRolesResponse
+ additionalProperties: false
+ bytebase.v1.ListRolloutsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent, which owns this collection of rollouts.
+ Format: projects/{project}
+ Use "projects/-" to list all rollouts from all projects.
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of rollouts to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 rollouts will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListRollouts` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListRollouts` must match
+ the call that provided the page token.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter rollouts returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - update_time: rollout update time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - task_type: the task type, support "in" operator, check the Task.Type enum for the values.
+
+ For example:
+ update_time >= "2025-01-02T15:04:05Z07:00"
+ task_type in ["DATABASE_MIGRATE", "DATABASE_EXPORT"]
+ title: ListRolloutsRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListRolloutsResponse:
+ type: object
+ properties:
+ rollouts:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Rollout'
+ title: rollouts
+ description: The rollouts from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListRolloutsResponse
+ additionalProperties: false
+ bytebase.v1.ListSettingsRequest:
+ type: object
+ title: ListSettingsRequest
+ additionalProperties: false
+ bytebase.v1.ListSettingsResponse:
+ type: object
+ properties:
+ settings:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Setting'
+ title: settings
+ description: The settings from the specified request.
+ title: ListSettingsResponse
+ additionalProperties: false
+ bytebase.v1.ListTaskRunsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent, which owns this collection of taskRuns.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
+ Use "projects/{project}/plans/{plan}/rollout/stages/-/tasks/-" to list all taskRuns from a rollout.
+ title: ListTaskRunsRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListTaskRunsResponse:
+ type: object
+ properties:
+ taskRuns:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TaskRun'
+ title: task_runs
+ description: The taskRuns from the specified request.
+ title: ListTaskRunsResponse
+ additionalProperties: false
+ bytebase.v1.ListUsersRequest:
+ type: object
+ properties:
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of users to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 users will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListUsers` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListUsers` must match
+ the call that provided the page token.
+ showDeleted:
+ type: boolean
+ title: show_deleted
+ description: Show deleted users if specified.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter users returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - name: the user name, support "==" and ".matches()" operator.
+ - email: the user email, support "==" and ".matches()" operator.
+ - user_type: the type, check UserType enum for values, support "==", "in [xx]", "!(in [xx])" operator.
+ - state: check State enum for values, support "==" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+
+ For example:
+ name == "ed"
+ name.matches("ed")
+ email == "[email protected]"
+ email.matches("ed")
+ user_type == "SERVICE_ACCOUNT"
+ user_type in ["SERVICE_ACCOUNT", "USER"]
+ !(user_type in ["SERVICE_ACCOUNT", "USER"])
+ state == "DELETED"
+ project == "projects/sample-project"
+ You can combine filter conditions like:
+ name.matches("ed") && project == "projects/sample-project"
+ (name == "ed" || email == "[email protected]") && project == "projects/sample-project"
+ title: ListUsersRequest
+ additionalProperties: false
+ bytebase.v1.ListUsersResponse:
+ type: object
+ properties:
+ users:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.User'
+ title: users
+ description: The users from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListUsersResponse
+ additionalProperties: false
+ bytebase.v1.LoginRequest:
+ type: object
+ properties:
+ email:
+ type: string
+ title: email
+ description: User's email address.
+ password:
+ type: string
+ title: password
+ description: User's password for authentication.
+ web:
+ type: boolean
+ title: web
+ description: |-
+ If true, sets access token and refresh token as HTTP-only cookies instead of
+ returning the token in the response body. Use for browser-based clients.
+ idpName:
+ type: string
+ title: idp_name
+ description: |-
+ The name of the identity provider.
+ Format: idps/{idp}
+ idpContext:
+ title: idp_context
+ description: The idp_context is used to get the user information from identity provider.
+ $ref: '#/components/schemas/bytebase.v1.IdentityProviderContext'
+ otpCode:
+ type: string
+ title: otp_code
+ description: The otp_code is used to verify the user's identity by MFA.
+ nullable: true
+ recoveryCode:
+ type: string
+ title: recovery_code
+ description: The recovery_code is used to recovery the user's identity with MFA.
+ nullable: true
+ mfaTempToken:
+ type: string
+ title: mfa_temp_token
+ description: The mfa_temp_token is used to verify the user's identity by MFA.
+ nullable: true
+ title: LoginRequest
+ additionalProperties: false
+ bytebase.v1.LoginResponse:
+ type: object
+ properties:
+ token:
+ type: string
+ title: token
+ description: |-
+ Access token for authenticated requests.
+ Only returned when web=false. For web=true, the token is set as an HTTP-only cookie.
+ mfaTempToken:
+ type: string
+ title: mfa_temp_token
+ description: Temporary token for MFA verification.
+ nullable: true
+ requireResetPassword:
+ type: boolean
+ title: require_reset_password
+ description: Whether user must reset password before continuing.
+ user:
+ title: user
+ description: The user from the successful login.
+ $ref: '#/components/schemas/bytebase.v1.User'
+ title: LoginResponse
+ additionalProperties: false
+ bytebase.v1.LogoutRequest:
+ type: object
+ title: LogoutRequest
+ additionalProperties: false
+ description: Request to logout current user session.
+ bytebase.v1.MaskingExemptionPolicy:
+ type: object
+ properties:
+ exemptions:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.MaskingExemptionPolicy.Exemption'
+ title: exemptions
+ title: MaskingExemptionPolicy
+ additionalProperties: false
+ description: MaskingExemptionPolicy is the allowlist of users who can access sensitive data.
+ bytebase.v1.MaskingExemptionPolicy.Exemption:
+ type: object
+ properties:
+ members:
+ type: array
+ items:
+ type: string
+ title: members
+ description: |-
+ Specifies the principals who are exempt from masking.
+ For users, the member should be: user:{email}
+ For groups, the member should be: group:{email}
+ condition:
+ title: condition
+ description: |-
+ The condition that is associated with this exception policy instance.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ If the condition is empty, means the user can access all databases without expiration.
+
+ Support variables:
+ resource.instance_id: the instance resource id. Only support "==" operation.
+ resource.database_name: the database name. Only support "==" operation.
+ resource.schema_name: the schema name. Only support "==" operation.
+ resource.table_name: the table name. Only support "==" operation.
+ resource.column_name: the column name. Only support "==" operation.
+ request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`
+ All variables should join with "&&" condition.
+
+ For example:
+ resource.instance_id == "local" && resource.database_name == "employee" && request.time < timestamp("2025-04-30T11:10:39.000Z")
+ resource.instance_id == "local" && resource.database_name == "employee"
+ $ref: '#/components/schemas/google.type.Expr'
+ title: Exemption
+ additionalProperties: false
+ bytebase.v1.MaskingReason:
+ type: object
+ properties:
+ semanticTypeId:
+ type: string
+ title: semantic_type_id
+ description: The semantic type that triggered masking (e.g., "SSN", "email", "phone").
+ semanticTypeTitle:
+ type: string
+ title: semantic_type_title
+ description: Human-readable semantic type title.
+ maskingRuleId:
+ type: string
+ title: masking_rule_id
+ description: The masking rule ID that matched (if applicable).
+ algorithm:
+ type: string
+ title: algorithm
+ description: The masking algorithm used.
+ context:
+ type: string
+ title: context
+ description: 'Additional context (e.g., "Matched global rule: PII Protection").'
+ classificationLevel:
+ type: string
+ title: classification_level
+ description: Whether masking was due to classification level.
+ semanticTypeIcon:
+ type: string
+ title: semantic_type_icon
+ description: Icon associated with the semantic type (if any).
+ title: MaskingReason
+ additionalProperties: false
+ bytebase.v1.MaskingRulePolicy:
+ type: object
+ properties:
+ rules:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.MaskingRulePolicy.MaskingRule'
+ title: rules
+ description: The list of masking rules.
+ title: MaskingRulePolicy
+ additionalProperties: false
+ description: Policy for configuring data masking rules.
+ bytebase.v1.MaskingRulePolicy.MaskingRule:
+ type: object
+ properties:
+ id:
+ type: string
+ title: id
+ description: A unique identifier for the rule in UUID format.
+ condition:
+ title: condition
+ description: |-
+ The condition for the masking rule.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Support variables:
+ resource.environment_id: the environment resource id.
+ resource.project_id: the project resource id.
+ resource.instance_id: the instance resource id.
+ resource.database_name: the database name.
+ resource.table_name: the table name.
+ resource.column_name: the column name.
+ resource.classification_level: the classification level.
+
+ Each variable support following operations:
+ ==: the value equals the target.
+ !=: the value not equals the target.
+ in: the value matches one of the targets.
+ !(in): the value not matches any of the targets.
+
+ For example:
+ resource.environment_id == "test" && resource.project_id == "sample-project"
+ resource.instance_id == "sample-instance" && resource.database_name == "employee" && resource.table_name in ["table1", "table2"]
+ resource.environment_id != "test" || !(resource.project_id in ["poject1", "prject2"])
+ resource.instance_id == "sample-instance" && (resource.database_name == "db1" || resource.database_name == "db2")
+ $ref: '#/components/schemas/google.type.Expr'
+ semanticType:
+ type: string
+ title: semantic_type
+ description: The semantic type of data to mask (e.g., "SSN", "EMAIL").
+ title: MaskingRule
+ additionalProperties: false
+ description: A rule that defines when and how to mask data.
+ bytebase.v1.MaterializedViewMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a materialized view.
+ definition:
+ type: string
+ title: definition
+ description: The definition is the definition of a materialized view.
+ comment:
+ type: string
+ title: comment
+ description: The comment is the comment of a materialized view.
+ dependencyColumns:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DependencyColumn'
+ title: dependency_columns
+ description: |-
+ The dependency_columns is the list of dependency columns of a materialized
+ view.
+ triggers:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TriggerMetadata'
+ title: triggers
+ description: The columns is the ordered list of columns in a table.
+ indexes:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.IndexMetadata'
+ title: indexes
+ description: The indexes is the list of indexes in a table.
+ skipDump:
+ type: boolean
+ title: skip_dump
+ title: MaterializedViewMetadata
+ additionalProperties: false
+ description: MaterializedViewMetadata is the metadata for materialized views.
+ bytebase.v1.OAuth2AuthStyle:
+ type: string
+ title: OAuth2AuthStyle
+ enum:
+ - OAUTH2_AUTH_STYLE_UNSPECIFIED
+ - IN_PARAMS
+ - IN_HEADER
+ bytebase.v1.OAuth2IdentityProviderConfig:
+ type: object
+ properties:
+ authUrl:
+ type: string
+ title: auth_url
+ description: The authorization endpoint URL for OAuth2 flow.
+ tokenUrl:
+ type: string
+ title: token_url
+ description: The token endpoint URL for exchanging authorization code.
+ userInfoUrl:
+ type: string
+ title: user_info_url
+ description: The user information endpoint URL.
+ clientId:
+ type: string
+ title: client_id
+ description: The OAuth2 client identifier.
+ clientSecret:
+ type: string
+ title: client_secret
+ description: The OAuth2 client secret for authentication.
+ scopes:
+ type: array
+ items:
+ type: string
+ title: scopes
+ description: The list of OAuth2 scopes to request.
+ fieldMapping:
+ title: field_mapping
+ description: Mapping configuration for user attributes from OAuth2 response.
+ $ref: '#/components/schemas/bytebase.v1.FieldMapping'
+ skipTlsVerify:
+ type: boolean
+ title: skip_tls_verify
+ description: Whether to skip TLS certificate verification.
+ authStyle:
+ title: auth_style
+ description: The authentication style for client credentials.
+ $ref: '#/components/schemas/bytebase.v1.OAuth2AuthStyle'
+ title: OAuth2IdentityProviderConfig
+ additionalProperties: false
+ description: OAuth2IdentityProviderConfig is the structure for OAuth2 identity provider config.
+ bytebase.v1.OAuth2IdentityProviderContext:
+ type: object
+ properties:
+ code:
+ type: string
+ title: code
+ description: Authorization code from OAuth2 provider.
+ title: OAuth2IdentityProviderContext
+ additionalProperties: false
+ description: OAuth2 authentication context.
+ bytebase.v1.OAuth2IdentityProviderTestRequestContext:
+ type: object
+ properties:
+ code:
+ type: string
+ title: code
+ description: Authorize code from website.
+ title: OAuth2IdentityProviderTestRequestContext
+ additionalProperties: false
+ bytebase.v1.OIDCIdentityProviderConfig:
+ type: object
+ properties:
+ issuer:
+ type: string
+ title: issuer
+ description: The OIDC issuer URL for the identity provider.
+ clientId:
+ type: string
+ title: client_id
+ description: The OIDC client identifier.
+ clientSecret:
+ type: string
+ title: client_secret
+ description: The OIDC client secret for authentication.
+ scopes:
+ type: array
+ items:
+ type: string
+ title: scopes
+ description: |-
+ The scopes that the OIDC provider supports.
+ Should be fetched from the well-known configuration file of the OIDC provider.
+ fieldMapping:
+ title: field_mapping
+ description: Mapping configuration for user attributes from OIDC claims.
+ $ref: '#/components/schemas/bytebase.v1.FieldMapping'
+ skipTlsVerify:
+ type: boolean
+ title: skip_tls_verify
+ description: Whether to skip TLS certificate verification.
+ authStyle:
+ title: auth_style
+ description: The authentication style for client credentials.
+ $ref: '#/components/schemas/bytebase.v1.OAuth2AuthStyle'
+ authEndpoint:
+ type: string
+ title: auth_endpoint
+ description: |-
+ The authorization endpoint of the OIDC provider.
+ Should be fetched from the well-known configuration file of the OIDC provider.
+ readOnly: true
+ title: OIDCIdentityProviderConfig
+ additionalProperties: false
+ description: OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
+ bytebase.v1.OIDCIdentityProviderContext:
+ type: object
+ properties:
+ code:
+ type: string
+ title: code
+ description: Authorization code from OIDC provider.
+ title: OIDCIdentityProviderContext
+ additionalProperties: false
+ description: OpenID Connect authentication context.
+ bytebase.v1.OIDCIdentityProviderTestRequestContext:
+ type: object
+ properties:
+ code:
+ type: string
+ title: code
+ description: Authorize code from OIDC provider.
+ title: OIDCIdentityProviderTestRequestContext
+ additionalProperties: false
+ bytebase.v1.ObjectSchema:
+ type: object
+ allOf:
+ - properties:
+ type:
+ title: type
+ description: The data type of this object.
+ $ref: '#/components/schemas/bytebase.v1.ObjectSchema.Type'
+ semanticType:
+ type: string
+ title: semantic_type
+ description: The semantic type of this object.
+ - oneOf:
+ - properties:
+ arrayKind:
+ title: array_kind
+ description: Array schema.
+ $ref: '#/components/schemas/bytebase.v1.ObjectSchema.ArrayKind'
+ title: array_kind
+ required:
+ - arrayKind
+ - properties:
+ structKind:
+ title: struct_kind
+ description: Struct schema.
+ $ref: '#/components/schemas/bytebase.v1.ObjectSchema.StructKind'
+ title: struct_kind
+ required:
+ - structKind
+ title: ObjectSchema
+ additionalProperties: false
+ description: Schema definition for object-type columns.
+ bytebase.v1.ObjectSchema.ArrayKind:
+ type: object
+ properties:
+ kind:
+ title: kind
+ description: The schema of array elements.
+ $ref: '#/components/schemas/bytebase.v1.ObjectSchema'
+ title: ArrayKind
+ additionalProperties: false
+ description: Array type with element schema.
+ bytebase.v1.ObjectSchema.StructKind:
+ type: object
+ properties:
+ properties:
+ type: object
+ title: properties
+ additionalProperties:
+ title: value
+ $ref: '#/components/schemas/bytebase.v1.ObjectSchema'
+ description: Properties of the struct.
+ title: StructKind
+ additionalProperties: false
+ description: Structure type with named properties.
+ bytebase.v1.ObjectSchema.StructKind.PropertiesEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ title: value
+ $ref: '#/components/schemas/bytebase.v1.ObjectSchema'
+ title: PropertiesEntry
+ additionalProperties: false
+ bytebase.v1.ObjectSchema.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - STRING
+ - NUMBER
+ - BOOLEAN
+ - OBJECT
+ - ARRAY
+ description: Object schema data types.
+ bytebase.v1.PackageMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a package.
+ definition:
+ type: string
+ title: definition
+ description: The definition is the definition of a package.
+ title: PackageMetadata
+ additionalProperties: false
+ description: PackageMetadata is the metadata for packages.
+ bytebase.v1.Plan:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the plan.
+ `plan` is a system generated ID.
+ Format: projects/{project}/plans/{plan}
+ state:
+ title: state
+ description: The state of the plan.
+ $ref: '#/components/schemas/bytebase.v1.State'
+ issue:
+ type: string
+ title: issue
+ description: |-
+ The issue associated with the plan.
+ Can be empty.
+ Format: projects/{project}/issues/{issue}
+ readOnly: true
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The title of the plan.
+ description:
+ type: string
+ title: description
+ maxLength: 10000
+ description: The description of the plan.
+ specs:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Plan.Spec'
+ title: specs
+ description: The deployment specs for the plan.
+ creator:
+ type: string
+ title: creator
+ description: 'Format: users/[email protected]'
+ readOnly: true
+ createTime:
+ title: create_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ updateTime:
+ title: update_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ planCheckRunStatusCount:
+ type: object
+ title: plan_check_run_status_count
+ additionalProperties:
+ type: integer
+ title: value
+ format: int32
+ description: |-
+ The status count of the latest plan check runs.
+ Keys are:
+ - SUCCESS
+ - WARNING
+ - ERROR
+ - RUNNING
+ readOnly: true
+ hasRollout:
+ type: boolean
+ title: has_rollout
+ description: Whether the plan has started the rollout.
+ readOnly: true
+ title: Plan
+ additionalProperties: false
+ bytebase.v1.Plan.ChangeDatabaseConfig:
+ type: object
+ properties:
+ targets:
+ type: array
+ items:
+ type: string
+ title: targets
+ description: |-
+ The list of targets.
+ Multi-database format: [instances/{instance-id}/databases/{database-name}].
+ Single database group format: [projects/{project}/databaseGroups/{databaseGroup}].
+ sheet:
+ type: string
+ title: sheet
+ description: |-
+ The resource name of the sheet.
+ Format: projects/{project}/sheets/{sheet}
+ release:
+ type: string
+ title: release
+ description: |-
+ The resource name of the release.
+ Format: projects/{project}/releases/{release}
+ type:
+ title: type
+ description: Type is the database change type.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseChangeType'
+ ghostFlags:
+ type: object
+ title: ghost_flags
+ additionalProperties:
+ type: string
+ title: value
+ enablePriorBackup:
+ type: boolean
+ title: enable_prior_backup
+ description: If set, a backup of the modified data will be created automatically before any changes are applied.
+ enableGhost:
+ type: boolean
+ title: enable_ghost
+ description: Whether to use gh-ost for online schema migration.
+ title: ChangeDatabaseConfig
+ additionalProperties: false
+ bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: string
+ title: value
+ title: GhostFlagsEntry
+ additionalProperties: false
+ bytebase.v1.Plan.CreateDatabaseConfig:
+ type: object
+ properties:
+ target:
+ type: string
+ title: target
+ description: |-
+ The resource name of the instance on which the database is created.
+ Format: instances/{instance}
+ database:
+ type: string
+ title: database
+ description: The name of the database to create.
+ table:
+ type: string
+ title: table
+ description: |-
+ (OPTIONAL) table is the name of the table, if it is not empty, Bytebase should create a table after creating the database.
+ For example, in MongoDB, it only creates the database when we first store data in that database.
+ characterSet:
+ type: string
+ title: character_set
+ description: (OPTIONAL) character_set is the character set of the database.
+ collation:
+ type: string
+ title: collation
+ description: (OPTIONAL) collation is the collation of the database.
+ cluster:
+ type: string
+ title: cluster
+ description: (OPTIONAL) cluster is the cluster of the database. This is only applicable to ClickHouse for "ON CLUSTER <<cluster>>".
+ owner:
+ type: string
+ title: owner
+ description: (OPTIONAL) owner is the owner of the database. This is only applicable to Postgres for "WITH OWNER <<owner>>".
+ environment:
+ type: string
+ title: environment
+ description: |-
+ (OPTIONAL) The environment resource.
+ Format: environments/prod where prod is the environment resource ID.
+ title: CreateDatabaseConfig
+ required:
+ - target
+ - database
+ additionalProperties: false
+ bytebase.v1.Plan.ExportDataConfig:
+ type: object
+ properties:
+ targets:
+ type: array
+ items:
+ type: string
+ title: targets
+ description: |-
+ The list of targets.
+ Multi-database format: [instances/{instance-id}/databases/{database-name}].
+ Single database group format: [projects/{project}/databaseGroups/{databaseGroup}].
+ sheet:
+ type: string
+ title: sheet
+ description: |-
+ The resource name of the sheet.
+ Format: projects/{project}/sheets/{sheet}
+ format:
+ title: format
+ description: The format of the exported file.
+ $ref: '#/components/schemas/bytebase.v1.ExportFormat'
+ password:
+ type: string
+ title: password
+ description: |-
+ The zip password provide by users.
+ Leave it empty if no needs to encrypt the zip file.
+ nullable: true
+ title: ExportDataConfig
+ additionalProperties: false
+ bytebase.v1.Plan.PlanCheckRunStatusCountEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: integer
+ title: value
+ format: int32
+ title: PlanCheckRunStatusCountEntry
+ additionalProperties: false
+ bytebase.v1.Plan.Spec:
+ type: object
+ allOf:
+ - properties:
+ id:
+ type: string
+ title: id
+ description: A UUID4 string that uniquely identifies the Spec.
+ - oneOf:
+ - properties:
+ changeDatabaseConfig:
+ title: change_database_config
+ $ref: '#/components/schemas/bytebase.v1.Plan.ChangeDatabaseConfig'
+ title: change_database_config
+ required:
+ - changeDatabaseConfig
+ - properties:
+ createDatabaseConfig:
+ title: create_database_config
+ $ref: '#/components/schemas/bytebase.v1.Plan.CreateDatabaseConfig'
+ title: create_database_config
+ required:
+ - createDatabaseConfig
+ - properties:
+ exportDataConfig:
+ title: export_data_config
+ $ref: '#/components/schemas/bytebase.v1.Plan.ExportDataConfig'
+ title: export_data_config
+ required:
+ - exportDataConfig
+ title: Spec
+ additionalProperties: false
+ bytebase.v1.PlanCheckRun:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: projects/{project}/plans/{plan}/planCheckRun'
+ status:
+ title: status
+ $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Status'
+ results:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Result'
+ title: results
+ error:
+ type: string
+ title: error
+ description: error is set if the Status is FAILED.
+ createTime:
+ title: create_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ title: PlanCheckRun
+ additionalProperties: false
+ bytebase.v1.PlanCheckRun.Result:
+ type: object
+ allOf:
+ - properties:
+ status:
+ title: status
+ $ref: '#/components/schemas/bytebase.v1.Advice.Level'
+ title:
+ type: string
+ title: title
+ content:
+ type: string
+ title: content
+ code:
+ type: integer
+ title: code
+ format: int32
+ target:
+ type: string
+ title: target
+ description: |-
+ Target identification for consolidated results.
+ Format: instances/{instance}/databases/{database}
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Result.Type'
+ - oneOf:
+ - properties:
+ sqlReviewReport:
+ title: sql_review_report
+ $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Result.SqlReviewReport'
+ title: sql_review_report
+ required:
+ - sqlReviewReport
+ - properties:
+ sqlSummaryReport:
+ title: sql_summary_report
+ $ref: '#/components/schemas/bytebase.v1.PlanCheckRun.Result.SqlSummaryReport'
+ title: sql_summary_report
+ required:
+ - sqlSummaryReport
+ title: Result
+ additionalProperties: false
+ bytebase.v1.PlanCheckRun.Result.SqlReviewReport:
+ type: object
+ properties:
+ startPosition:
+ title: start_position
+ description: Position of the SQL statement.
+ $ref: '#/components/schemas/bytebase.v1.Position'
+ endPosition:
+ title: end_position
+ $ref: '#/components/schemas/bytebase.v1.Position'
+ title: SqlReviewReport
+ additionalProperties: false
+ bytebase.v1.PlanCheckRun.Result.SqlSummaryReport:
+ type: object
+ properties:
+ statementTypes:
+ type: array
+ items:
+ type: string
+ title: statement_types
+ description: statement_types are the types of statements that are found in the sql.
+ affectedRows:
+ type:
+ - integer
+ - string
+ title: affected_rows
+ format: int64
+ title: SqlSummaryReport
+ additionalProperties: false
+ bytebase.v1.PlanCheckRun.Result.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - STATEMENT_ADVISE
+ - STATEMENT_SUMMARY_REPORT
+ - GHOST_SYNC
+ bytebase.v1.PlanCheckRun.Status:
+ type: string
+ title: Status
+ enum:
+ - STATUS_UNSPECIFIED
+ - RUNNING
+ - DONE
+ - FAILED
+ - CANCELED
+ bytebase.v1.PlanConfig:
+ type: object
+ properties:
+ plans:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.PlanLimitConfig'
+ title: plans
+ instanceFeatures:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.PlanFeature'
+ title: instance_features
+ title: PlanConfig
+ additionalProperties: false
+ description: PlanConfig represents the configuration for all plans loaded from plan.yaml
+ bytebase.v1.PlanFeature:
+ type: string
+ title: PlanFeature
+ enum:
+ - FEATURE_UNSPECIFIED
+ - FEATURE_DATABASE_CHANGE
+ - FEATURE_GIT_BASED_SCHEMA_VERSION_CONTROL
+ - FEATURE_DECLARATIVE_SCHEMA_MIGRATION
+ - FEATURE_COMPARE_AND_SYNC_SCHEMA
+ - FEATURE_ONLINE_SCHEMA_CHANGE
+ - FEATURE_PRE_DEPLOYMENT_SQL_REVIEW
+ - FEATURE_AUTOMATIC_BACKUP_BEFORE_DATA_CHANGES
+ - FEATURE_ONE_CLICK_DATA_ROLLBACK
+ - FEATURE_MULTI_DATABASE_BATCH_CHANGES
+ - FEATURE_PROGRESSIVE_ENVIRONMENT_DEPLOYMENT
+ - FEATURE_SCHEDULED_ROLLOUT_TIME
+ - FEATURE_DATABASE_CHANGELOG
+ - FEATURE_SCHEMA_DRIFT_DETECTION
+ - FEATURE_ROLLOUT_POLICY
+ - FEATURE_WEB_BASED_SQL_EDITOR
+ - FEATURE_SQL_EDITOR_ADMIN_MODE
+ - FEATURE_NATURAL_LANGUAGE_TO_SQL
+ - FEATURE_AI_QUERY_EXPLANATION
+ - FEATURE_AI_QUERY_SUGGESTIONS
+ - FEATURE_AUTO_COMPLETE
+ - FEATURE_SCHEMA_DIAGRAM
+ - FEATURE_SCHEMA_EDITOR
+ - FEATURE_DATA_EXPORT
+ - FEATURE_DATA_OFFLINE_EXPORT
+ - FEATURE_QUERY_HISTORY
+ - FEATURE_SAVED_AND_SHARED_SQL_SCRIPTS
+ - FEATURE_BATCH_QUERY
+ - FEATURE_INSTANCE_READ_ONLY_CONNECTION
+ - FEATURE_QUERY_POLICY
+ - FEATURE_RESTRICT_COPYING_DATA
+ - FEATURE_IAM
+ - FEATURE_INSTANCE_SSL_CONNECTION
+ - FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL
+ - FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION
+ - FEATURE_GOOGLE_AND_GITHUB_SSO
+ - FEATURE_USER_GROUPS
+ - FEATURE_DISALLOW_SELF_SERVICE_SIGNUP
+ - FEATURE_CUSTOM_INSTANCE_SYNC_TIME
+ - FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT
+ - FEATURE_RISK_ASSESSMENT
+ - FEATURE_APPROVAL_WORKFLOW
+ - FEATURE_AUDIT_LOG
+ - FEATURE_ENTERPRISE_SSO
+ - FEATURE_TWO_FA
+ - FEATURE_PASSWORD_RESTRICTIONS
+ - FEATURE_DISALLOW_PASSWORD_SIGNIN
+ - FEATURE_CUSTOM_ROLES
+ - FEATURE_REQUEST_ROLE_WORKFLOW
+ - FEATURE_DATA_MASKING
+ - FEATURE_DATA_CLASSIFICATION
+ - FEATURE_SCIM
+ - FEATURE_DIRECTORY_SYNC
+ - FEATURE_TOKEN_DURATION_CONTROL
+ - FEATURE_EXTERNAL_SECRET_MANAGER
+ - FEATURE_USER_EMAIL_DOMAIN_RESTRICTION
+ - FEATURE_PROJECT_MANAGEMENT
+ - FEATURE_ENVIRONMENT_MANAGEMENT
+ - FEATURE_IM_NOTIFICATIONS
+ - FEATURE_TERRAFORM_PROVIDER
+ - FEATURE_DATABASE_GROUPS
+ - FEATURE_ENVIRONMENT_TIERS
+ - FEATURE_DASHBOARD_ANNOUNCEMENT
+ - FEATURE_API_INTEGRATION_GUIDANCE
+ - FEATURE_CUSTOM_LOGO
+ - FEATURE_WATERMARK
+ - FEATURE_ROADMAP_PRIORITIZATION
+ - FEATURE_CUSTOM_MSA
+ - FEATURE_COMMUNITY_SUPPORT
+ - FEATURE_EMAIL_SUPPORT
+ - FEATURE_DEDICATED_SUPPORT_WITH_SLA
+ description: PlanFeature represents the available features in Bytebase
+ bytebase.v1.PlanLimitConfig:
+ type: object
+ properties:
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.PlanType'
+ maximumInstanceCount:
+ type: integer
+ title: maximum_instance_count
+ format: int32
+ maximumSeatCount:
+ type: integer
+ title: maximum_seat_count
+ format: int32
+ features:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.PlanFeature'
+ title: features
+ title: PlanLimitConfig
+ additionalProperties: false
+ description: PlanLimitConfig represents a single plan's configuration
+ bytebase.v1.PlanType:
+ type: string
+ title: PlanType
+ enum:
+ - PLAN_TYPE_UNSPECIFIED
+ - FREE
+ - TEAM
+ - ENTERPRISE
+ bytebase.v1.Policy:
+ type: object
+ allOf:
+ - properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the policy.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ inheritFromParent:
+ type: boolean
+ title: inherit_from_parent
+ description: Whether this policy inherits from its parent resource.
+ type:
+ title: type
+ description: The type of policy.
+ $ref: '#/components/schemas/bytebase.v1.PolicyType'
+ enforce:
+ type: boolean
+ title: enforce
+ description: Whether the policy is enforced.
+ resourceType:
+ title: resource_type
+ description: The resource type for the policy.
+ readOnly: true
+ $ref: '#/components/schemas/bytebase.v1.PolicyResourceType'
+ - oneOf:
+ - properties:
+ dataSourceQueryPolicy:
+ title: data_source_query_policy
+ $ref: '#/components/schemas/bytebase.v1.DataSourceQueryPolicy'
+ title: data_source_query_policy
+ required:
+ - dataSourceQueryPolicy
+ - properties:
+ maskingExemptionPolicy:
+ title: masking_exemption_policy
+ $ref: '#/components/schemas/bytebase.v1.MaskingExemptionPolicy'
+ title: masking_exemption_policy
+ required:
+ - maskingExemptionPolicy
+ - properties:
+ maskingRulePolicy:
+ title: masking_rule_policy
+ $ref: '#/components/schemas/bytebase.v1.MaskingRulePolicy'
+ title: masking_rule_policy
+ required:
+ - maskingRulePolicy
+ - properties:
+ queryDataPolicy:
+ title: query_data_policy
+ $ref: '#/components/schemas/bytebase.v1.QueryDataPolicy'
+ title: query_data_policy
+ required:
+ - queryDataPolicy
+ - properties:
+ rolloutPolicy:
+ title: rollout_policy
+ $ref: '#/components/schemas/bytebase.v1.RolloutPolicy'
+ title: rollout_policy
+ required:
+ - rolloutPolicy
+ - properties:
+ tagPolicy:
+ title: tag_policy
+ $ref: '#/components/schemas/bytebase.v1.TagPolicy'
+ title: tag_policy
+ required:
+ - tagPolicy
+ title: Policy
+ additionalProperties: false
+ bytebase.v1.PolicyDelta:
+ type: object
+ properties:
+ bindingDeltas:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.BindingDelta'
+ title: binding_deltas
+ description: The delta for Bindings between two policies.
+ title: PolicyDelta
+ additionalProperties: false
+ description: Describes changes between two IAM policies.
+ bytebase.v1.PolicyResourceType:
+ type: string
+ title: PolicyResourceType
+ enum:
+ - RESOURCE_TYPE_UNSPECIFIED
+ - WORKSPACE
+ - ENVIRONMENT
+ - PROJECT
+ description: The resource type that a policy can be attached to.
+ bytebase.v1.PolicyType:
+ type: string
+ title: PolicyType
+ enum:
+ - POLICY_TYPE_UNSPECIFIED
+ - MASKING_RULE
+ - MASKING_EXEMPTION
+ - ROLLOUT_POLICY
+ - TAG
+ - DATA_SOURCE_QUERY
+ - DATA_QUERY
+ description: The type of organizational policy.
+ bytebase.v1.Position:
+ type: object
+ properties:
+ line:
+ type: integer
+ title: line
+ format: int32
+ description: |-
+ Line position in a text (one-based).
+ First line of the text is line 1.
+ A value of 0 indicates the line information is unknown.
+ column:
+ type: integer
+ title: column
+ format: int32
+ description: "Column position in a text (one-based).\n Column is measured in Unicode code points (characters/runes), not bytes or grapheme clusters.\n First character of the line is column 1.\n A value of 0 indicates the column information is unknown.\n\n Examples:\n - \"SELECT * FROM t\" - column 8 is '*'\n - \"SELECT 你好 FROM t\" - column 8 is '你' (even though it's at byte offset 7)\n - \"SELECT \U0001F600 FROM t\" - column 8 is '\U0001F600' (even though it's 4 bytes in UTF-8)"
+ title: Position
+ additionalProperties: false
+ description: |-
+ Position in a text expressed as one-based line and one-based column.
+ We use 1-based numbering to match the majority of industry standards:
+ - Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)
+ - GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)
+ - Most text editors display 1-based positions to users
+ Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),
+ but we follow the canonical user-facing standards.
+
+ Handling unknown positions:
+ - If the entire position is unknown, leave this field as nil/undefined
+ - If only line is known, set line and leave column as 0 (e.g., line=5, column=0)
+ - If only column is known (rare), set column and leave line as 0
+ Frontends should check for nil/undefined/zero values and handle them appropriately.
+ bytebase.v1.PreviewTaskRunRollbackRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
+ title: PreviewTaskRunRollbackRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.PreviewTaskRunRollbackResponse:
+ type: object
+ properties:
+ statement:
+ type: string
+ title: statement
+ description: The rollback SQL statement that would undo the task run.
+ title: PreviewTaskRunRollbackResponse
+ additionalProperties: false
+ bytebase.v1.ProcedureMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a procedure.
+ definition:
+ type: string
+ title: definition
+ description: The definition is the definition of a procedure.
+ signature:
+ type: string
+ title: signature
+ description: |-
+ The signature is the name with the number and type of input arguments the
+ procedure takes.
+ characterSetClient:
+ type: string
+ title: character_set_client
+ description: MySQL specific metadata.
+ collationConnection:
+ type: string
+ title: collation_connection
+ databaseCollation:
+ type: string
+ title: database_collation
+ sqlMode:
+ type: string
+ title: sql_mode
+ comment:
+ type: string
+ title: comment
+ description: The comment is the comment of a procedure.
+ skipDump:
+ type: boolean
+ title: skip_dump
+ title: ProcedureMetadata
+ additionalProperties: false
+ description: ProcedureMetadata is the metadata for procedures.
+ bytebase.v1.Project:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the project.
+ Format: projects/{project}
+ state:
+ title: state
+ description: The lifecycle state of the project.
+ $ref: '#/components/schemas/bytebase.v1.State'
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The title or name of a project. It's not unique within the workspace.
+ webhooks:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Webhook'
+ title: webhooks
+ description: The list of webhooks configured for the project.
+ dataClassificationConfigId:
+ type: string
+ title: data_classification_config_id
+ description: The data classification configuration ID for the project.
+ issueLabels:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Label'
+ title: issue_labels
+ description: Labels available for tagging issues in this project.
+ forceIssueLabels:
+ type: boolean
+ title: force_issue_labels
+ description: Force issue labels to be used when creating an issue.
+ enforceIssueTitle:
+ type: boolean
+ title: enforce_issue_title
+ description: Enforce issue title to be created by user instead of generated by Bytebase.
+ autoEnableBackup:
+ type: boolean
+ title: auto_enable_backup
+ description: Whether to automatically enable backup for database changes.
+ skipBackupErrors:
+ type: boolean
+ title: skip_backup_errors
+ description: Whether to skip backup errors and continue with data migration.
+ postgresDatabaseTenantMode:
+ type: boolean
+ title: postgres_database_tenant_mode
+ description: |-
+ Whether to enable database tenant mode for PostgreSQL.
+ If enabled, issues will include "set role <db_owner>" statement.
+ allowSelfApproval:
+ type: boolean
+ title: allow_self_approval
+ description: Whether to allow issue creators to self-approve their own issues.
+ executionRetryPolicy:
+ title: execution_retry_policy
+ description: Execution retry policy for task runs.
+ $ref: '#/components/schemas/bytebase.v1.Project.ExecutionRetryPolicy'
+ ciSamplingSize:
+ type: integer
+ title: ci_sampling_size
+ format: int32
+ description: |-
+ The maximum number of database rows to sample during CI data validation.
+ Without specification, sampling is disabled, resulting in full validation.
+ parallelTasksPerRollout:
+ type: integer
+ title: parallel_tasks_per_rollout
+ format: int32
+ description: The maximum number of parallel tasks allowed during rollout execution.
+ labels:
+ type: object
+ title: labels
+ additionalProperties:
+ type: string
+ title: value
+ description: |-
+ Labels are key-value pairs that can be attached to the project.
+ For example, { "environment": "production", "team": "backend" }
+ enforceSqlReview:
+ type: boolean
+ title: enforce_sql_review
+ description: |-
+ Whether to enforce SQL review checks to pass before issue creation.
+ If enabled, issues cannot be created when SQL review finds errors.
+ requireIssueApproval:
+ type: boolean
+ title: require_issue_approval
+ description: Whether to require issue approval before rollout.
+ requirePlanCheckNoError:
+ type: boolean
+ title: require_plan_check_no_error
+ description: Whether to require plan check to have no error before rollout.
+ title: Project
+ additionalProperties: false
+ bytebase.v1.Project.ExecutionRetryPolicy:
+ type: object
+ properties:
+ maximumRetries:
+ type: integer
+ title: maximum_retries
+ format: int32
+ description: The maximum number of retries for lock timeout errors.
+ title: ExecutionRetryPolicy
+ additionalProperties: false
+ description: Execution retry policy configuration.
+ bytebase.v1.Project.LabelsEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: string
+ title: value
+ title: LabelsEntry
+ additionalProperties: false
+ bytebase.v1.QueryDataPolicy:
+ type: object
+ properties:
+ timeout:
+ title: timeout
+ description: The query timeout duration.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ disableExport:
+ type: boolean
+ title: disable_export
+ description: Disable data export in the SQL editor.
+ maximumResultSize:
+ type:
+ - integer
+ - string
+ title: maximum_result_size
+ format: int64
+ description: |-
+ The maximum result size limit in bytes.
+ The default value is 100MB, we will use the default value if the setting not exists, or the limit <= 0.
+ maximumResultRows:
+ type: integer
+ title: maximum_result_rows
+ format: int32
+ description: |-
+ The maximum number of rows to return.
+ The default value is -1, means no limit.
+ disableCopyData:
+ type: boolean
+ title: disable_copy_data
+ description: Disable copying query results.
+ title: QueryDataPolicy
+ additionalProperties: false
+ description: QueryDataPolicy is the policy configuration for querying data.
+ bytebase.v1.QueryHistory:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name for the query history.
+ Format: queryHistories/{uid}
+ readOnly: true
+ database:
+ type: string
+ title: database
+ description: |-
+ The database name to execute the query.
+ Format: instances/{instance}/databases/{databaseName}
+ readOnly: true
+ creator:
+ type: string
+ title: creator
+ readOnly: true
+ createTime:
+ title: create_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ statement:
+ type: string
+ title: statement
+ readOnly: true
+ error:
+ type: string
+ title: error
+ nullable: true
+ readOnly: true
+ duration:
+ title: duration
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.QueryHistory.Type'
+ title: QueryHistory
+ additionalProperties: false
+ bytebase.v1.QueryHistory.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - QUERY
+ - EXPORT
+ bytebase.v1.QueryOption:
+ type: object
+ properties:
+ redisRunCommandsOn:
+ title: redis_run_commands_on
+ $ref: '#/components/schemas/bytebase.v1.QueryOption.RedisRunCommandsOn'
+ mssqlExplainFormat:
+ title: mssql_explain_format
+ $ref: '#/components/schemas/bytebase.v1.QueryOption.MSSQLExplainFormat'
+ title: QueryOption
+ additionalProperties: false
+ bytebase.v1.QueryOption.MSSQLExplainFormat:
+ type: string
+ title: MSSQLExplainFormat
+ enum:
+ - MSSQL_EXPLAIN_FORMAT_UNSPECIFIED
+ - MSSQL_EXPLAIN_FORMAT_ALL
+ - MSSQL_EXPLAIN_FORMAT_XML
+ bytebase.v1.QueryOption.RedisRunCommandsOn:
+ type: string
+ title: RedisRunCommandsOn
+ enum:
+ - REDIS_RUN_COMMANDS_ON_UNSPECIFIED
+ - SINGLE_NODE
+ - ALL_NODES
+ bytebase.v1.QueryRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name is the instance name to execute the query against.
+ Format: instances/{instance}/databases/{databaseName}
+ statement:
+ type: string
+ title: statement
+ description: The SQL statement to execute.
+ limit:
+ type: integer
+ title: limit
+ format: int32
+ description: The maximum number of rows to return.
+ dataSourceId:
+ type: string
+ title: data_source_id
+ description: |-
+ The id of data source.
+ It is used for querying admin data source even if the instance has
+ read-only data sources. Or it can be used to query a specific read-only
+ data source.
+ explain:
+ type: boolean
+ title: explain
+ description: Explain the statement.
+ schema:
+ type: string
+ title: schema
+ description: |-
+ The default schema to search objects. Equals to the current schema in
+ Oracle and search path in Postgres.
+ nullable: true
+ queryOption:
+ title: query_option
+ $ref: '#/components/schemas/bytebase.v1.QueryOption'
+ container:
+ type: string
+ title: container
+ description: |-
+ Container is the container name to execute the query against, used for
+ CosmosDB only.
+ nullable: true
+ title: QueryRequest
+ required:
+ - name
+ - dataSourceId
+ additionalProperties: false
+ bytebase.v1.QueryResponse:
+ type: object
+ properties:
+ results:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.QueryResult'
+ title: results
+ description: The query results.
+ title: QueryResponse
+ additionalProperties: false
+ bytebase.v1.QueryResult:
+ type: object
+ allOf:
+ - properties:
+ columnNames:
+ type: array
+ items:
+ type: string
+ title: column_names
+ description: Column names of the query result.
+ columnTypeNames:
+ type: array
+ items:
+ type: string
+ title: column_type_names
+ description: |-
+ Column types of the query result.
+ The types come from the Golang SQL driver.
+ rows:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.QueryRow'
+ title: rows
+ description: Rows of the query result.
+ rowsCount:
+ type:
+ - integer
+ - string
+ title: rows_count
+ format: int64
+ error:
+ type: string
+ title: error
+ description: The error message if the query failed.
+ latency:
+ title: latency
+ description: The time it takes to execute the query.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ statement:
+ type: string
+ title: statement
+ description: The query statement for the result.
+ messages:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.QueryResult.Message'
+ title: messages
+ description: |-
+ Informational or debug messages returned by the database engine during query execution.
+ Examples include PostgreSQL's RAISE NOTICE, MSSQL's PRINT, or Oracle's DBMS_OUTPUT.PUT_LINE.
+ masked:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.MaskingReason'
+ title: masked
+ description: Masking reasons for each column (empty for non-masked columns).
+ - oneOf:
+ - properties:
+ permissionDenied:
+ title: permission_denied
+ $ref: '#/components/schemas/bytebase.v1.QueryResult.PermissionDenied'
+ title: permission_denied
+ required:
+ - permissionDenied
+ - properties:
+ postgresError:
+ title: postgres_error
+ $ref: '#/components/schemas/bytebase.v1.QueryResult.PostgresError'
+ title: postgres_error
+ required:
+ - postgresError
+ - properties:
+ syntaxError:
+ title: syntax_error
+ $ref: '#/components/schemas/bytebase.v1.QueryResult.SyntaxError'
+ title: syntax_error
+ required:
+ - syntaxError
+ title: QueryResult
+ additionalProperties: false
+ bytebase.v1.QueryResult.Message:
+ type: object
+ properties:
+ level:
+ title: level
+ $ref: '#/components/schemas/bytebase.v1.QueryResult.Message.Level'
+ content:
+ type: string
+ title: content
+ title: Message
+ additionalProperties: false
+ bytebase.v1.QueryResult.Message.Level:
+ type: string
+ title: Level
+ enum:
+ - LEVEL_UNSPECIFIED
+ - INFO
+ - WARNING
+ - DEBUG
+ - LOG
+ - NOTICE
+ - EXCEPTION
+ bytebase.v1.QueryResult.PermissionDenied:
+ type: object
+ properties:
+ resources:
+ type: array
+ items:
+ type: string
+ title: resources
+ description: |-
+ Denied to access the resources.
+ Format:
+ instances/{instance}/databases/{database}
+ instances/{instance}/databases/{database}/schemas/{schema}
+ instances/{instance}/databases/{database}/tables/{table}
+ instances/{instance}/databases/{database}/schemas/{schema}/tables/{table}
+ commandType:
+ title: command_type
+ description: Disallowed command_type.
+ $ref: '#/components/schemas/bytebase.v1.QueryResult.PermissionDenied.CommandType'
+ title: PermissionDenied
+ additionalProperties: false
+ description: |-
+ Permission denied with resource information or disallowed command_type.
+ Either resources or command_type is available.
+ bytebase.v1.QueryResult.PermissionDenied.CommandType:
+ type: string
+ title: CommandType
+ enum:
+ - COMMAND_TYPE_UNSPECIFIED
+ - DDL
+ - DML
+ - NON_READ_ONLY
+ bytebase.v1.QueryResult.PostgresError:
+ type: object
+ properties:
+ severity:
+ type: string
+ title: severity
+ code:
+ type: string
+ title: code
+ message:
+ type: string
+ title: message
+ detail:
+ type: string
+ title: detail
+ hint:
+ type: string
+ title: hint
+ position:
+ type: integer
+ title: position
+ format: int32
+ internalPosition:
+ type: integer
+ title: internal_position
+ format: int32
+ internalQuery:
+ type: string
+ title: internal_query
+ where:
+ type: string
+ title: where
+ schemaName:
+ type: string
+ title: schema_name
+ tableName:
+ type: string
+ title: table_name
+ columnName:
+ type: string
+ title: column_name
+ dataTypeName:
+ type: string
+ title: data_type_name
+ constraintName:
+ type: string
+ title: constraint_name
+ file:
+ type: string
+ title: file
+ line:
+ type: integer
+ title: line
+ format: int32
+ routine:
+ type: string
+ title: routine
+ title: PostgresError
+ additionalProperties: false
+ description: |-
+ refer https://www.postgresql.org/docs/11/protocol-error-fields.html
+ for field description.
+ bytebase.v1.QueryResult.SyntaxError:
+ type: object
+ properties:
+ startPosition:
+ title: start_position
+ description: Position information for highlighting in editor
+ $ref: '#/components/schemas/bytebase.v1.Position'
+ title: SyntaxError
+ additionalProperties: false
+ description: Syntax error with position information for editor highlighting
+ bytebase.v1.QueryRow:
+ type: object
+ properties:
+ values:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.RowValue'
+ title: values
+ description: Row values of the query result.
+ title: QueryRow
+ additionalProperties: false
+ bytebase.v1.Range:
+ type: object
+ properties:
+ start:
+ type: integer
+ title: start
+ format: int32
+ description: Start index (inclusive).
+ end:
+ type: integer
+ title: end
+ format: int32
+ description: End index (exclusive).
+ title: Range
+ additionalProperties: false
+ description: |-
+ Range represents a span within a text or sequence.
+ Whether the indices are byte offsets or character indices depends on the context.
+ Check the documentation of the field using Range for specific semantics.
+ bytebase.v1.RefreshRequest:
+ type: object
+ title: RefreshRequest
+ additionalProperties: false
+ description: Request to refresh the access token.
+ bytebase.v1.RefreshResponse:
+ type: object
+ title: RefreshResponse
+ additionalProperties: false
+ description: Response from refreshing the access token.
+ bytebase.v1.RejectIssueRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the issue to add a rejection.
+ Format: projects/{project}/issues/{issue}
+ comment:
+ type: string
+ title: comment
+ description: The comment explaining the rejection decision.
+ title: RejectIssueRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.Release:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: projects/{project}/releases/{release}'
+ readOnly: true
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The title of the release.
+ files:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Release.File'
+ title: files
+ description: The SQL files included in the release.
+ vcsSource:
+ title: vcs_source
+ description: The version control source of the release.
+ $ref: '#/components/schemas/bytebase.v1.Release.VCSSource'
+ creator:
+ type: string
+ title: creator
+ description: 'Format: users/[email protected]'
+ readOnly: true
+ createTime:
+ title: create_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ state:
+ title: state
+ description: The lifecycle state of the release.
+ readOnly: true
+ $ref: '#/components/schemas/bytebase.v1.State'
+ digest:
+ type: string
+ title: digest
+ description: |-
+ The digest of the release.
+ The user can provide the digest of the release. It can be used later to retrieve the release in GetRelease.
+ Whether to provide digest and how to generate it is up to the user.
+ If the digest is not empty, it must be unique in the project. Otherwise, an ALREADY_EXISTS error will be returned.
+ title: Release
+ additionalProperties: false
+ bytebase.v1.Release.File:
+ type: object
+ properties:
+ id:
+ type: string
+ title: id
+ description: The unique identifier for the file.
+ path:
+ type: string
+ title: path
+ description: The path of the file. e.g., `2.2/V0001_create_table.sql`.
+ type:
+ title: type
+ description: The type of the file.
+ $ref: '#/components/schemas/bytebase.v1.Release.File.Type'
+ version:
+ type: string
+ title: version
+ description: The version identifier for the file.
+ enableGhost:
+ type: boolean
+ title: enable_ghost
+ description: Whether to use gh-ost for online schema migration.
+ sheet:
+ type: string
+ title: sheet
+ description: |-
+ For inputs, we must either use `sheet` or `statement`.
+ For outputs, we always use `sheet`. `statement` is the preview of the sheet content.
+
+ The sheet that holds the content.
+ Format: projects/{project}/sheets/{sheet}
+ statement:
+ type: string
+ title: statement
+ format: byte
+ description: The raw SQL statement content.
+ writeOnly: true
+ sheetSha256:
+ type: string
+ title: sheet_sha256
+ description: The SHA256 hash value of the sheet content or the statement.
+ readOnly: true
+ title: File
+ additionalProperties: false
+ description: A SQL file in a release.
+ bytebase.v1.Release.File.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - VERSIONED
+ - DECLARATIVE
+ description: The type of migration file.
+ bytebase.v1.Release.VCSSource:
+ type: object
+ properties:
+ vcsType:
+ title: vcs_type
+ description: The type of VCS.
+ $ref: '#/components/schemas/bytebase.v1.VCSType'
+ url:
+ type: string
+ title: url
+ description: The url link to the e.g., GitHub commit or pull request.
+ title: VCSSource
+ additionalProperties: false
+ description: Version control system source information.
+ bytebase.v1.RemoveDataSourceRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the instance to remove a data source from.
+ Format: instances/{instance}
+ dataSource:
+ title: data_source
+ description: |-
+ Identified by data source ID.
+ Only READ_ONLY data source can be removed.
+ $ref: '#/components/schemas/bytebase.v1.DataSource'
+ title: RemoveDataSourceRequest
+ required:
+ - name
+ - dataSource
+ additionalProperties: false
+ bytebase.v1.RemoveWebhookRequest:
+ type: object
+ properties:
+ webhook:
+ title: webhook
+ description: The webhook to remove. Identified by its url.
+ $ref: '#/components/schemas/bytebase.v1.Webhook'
+ title: RemoveWebhookRequest
+ required:
+ - webhook
+ additionalProperties: false
+ bytebase.v1.RequestIssueRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the issue to request a issue.
+ Format: projects/{project}/issues/{issue}
+ comment:
+ type: string
+ title: comment
+ description: The comment explaining the request.
+ title: RequestIssueRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.RequestMetadata:
+ type: object
+ properties:
+ callerIp:
+ type: string
+ title: caller_ip
+ description: The IP address of the request originator.
+ callerSuppliedUserAgent:
+ type: string
+ title: caller_supplied_user_agent
+ description: |-
+ The user agent string provided by the caller.
+ This is supplied by the client and is not authenticated.
+ title: RequestMetadata
+ additionalProperties: false
+ description: Metadata about the incoming request.
+ bytebase.v1.ResourcePackage:
+ type: object
+ properties:
+ logo:
+ type: string
+ title: logo
+ format: byte
+ description: The branding logo.
+ title: ResourcePackage
+ additionalProperties: false
+ description: Custom branding resources for the Bytebase instance.
+ bytebase.v1.ReviewConfig:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the SQL review config.
+ Format: reviewConfigs/{reviewConfig}
+ readOnly: true
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The title of the review configuration.
+ enabled:
+ type: boolean
+ title: enabled
+ description: Whether the review configuration is enabled.
+ rules:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.SQLReviewRule'
+ title: rules
+ description: The SQL review rules to enforce.
+ resources:
+ type: array
+ items:
+ type: string
+ title: resources
+ description: |-
+ Resources using the config.
+ Format: {resource}/{resource id}, e.g., environments/test.
+ title: ReviewConfig
+ additionalProperties: false
+ bytebase.v1.Revision:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: instances/{instance}/databases/{database}/revisions/{revision}'
+ release:
+ type: string
+ title: release
+ description: |-
+ Format: projects/{project}/releases/{release}
+ Can be empty.
+ createTime:
+ title: create_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ deleter:
+ type: string
+ title: deleter
+ description: |-
+ Format: users/[email protected]
+ Can be empty.
+ readOnly: true
+ deleteTime:
+ title: delete_time
+ description: Can be empty.
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ file:
+ type: string
+ title: file
+ description: |-
+ Format: projects/{project}/releases/{release}/files/{id}
+ Can be empty.
+ version:
+ type: string
+ title: version
+ description: The schema version string for this revision.
+ sheet:
+ type: string
+ title: sheet
+ description: |-
+ The sheet that holds the content.
+ Format: projects/{project}/sheets/{sheet}
+ sheetSha256:
+ type: string
+ title: sheet_sha256
+ description: The SHA256 hash value of the sheet.
+ readOnly: true
+ taskRun:
+ type: string
+ title: task_run
+ description: |-
+ The task run associated with the revision.
+ Can be empty.
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
+ type:
+ title: type
+ description: The type of the revision.
+ $ref: '#/components/schemas/bytebase.v1.Revision.Type'
+ title: Revision
+ additionalProperties: false
+ bytebase.v1.Revision.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - VERSIONED
+ - DECLARATIVE
+ description: The type of schema revision.
+ bytebase.v1.RiskLevel:
+ type: string
+ title: RiskLevel
+ enum:
+ - RISK_LEVEL_UNSPECIFIED
+ - LOW
+ - MODERATE
+ - HIGH
+ description: RiskLevel is the risk level.
+ bytebase.v1.Role:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: 'Resource name. Format: roles/{role}'
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: Human-readable title.
+ description:
+ type: string
+ title: description
+ maxLength: 1000
+ description: Optional description of the role.
+ permissions:
+ type: array
+ items:
+ type: string
+ title: permissions
+ description: List of permission identifiers granted by this role.
+ type:
+ title: type
+ description: Role type indicating if it's built-in or custom.
+ $ref: '#/components/schemas/bytebase.v1.Role.Type'
+ title: Role
+ additionalProperties: false
+ description: Role defines a set of permissions that can be assigned to users.
+ bytebase.v1.Role.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - BUILT_IN
+ - CUSTOM
+ bytebase.v1.Rollout:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The resource name of the rollout.
+ Format: projects/{project}/plans/{plan}/rollout
+ title:
+ type: string
+ title: title
+ description: |-
+ The title of the rollout, inherited from the associated plan.
+ This field is output only and cannot be directly set.
+ readOnly: true
+ stages:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Stage'
+ title: stages
+ description: Stages and thus tasks of the rollout.
+ readOnly: true
+ createTime:
+ title: create_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ updateTime:
+ title: update_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ title: Rollout
+ additionalProperties: false
+ bytebase.v1.RolloutPolicy:
+ type: object
+ properties:
+ automatic:
+ type: boolean
+ title: automatic
+ description: Whether rollout is automatic without manual approval.
+ roles:
+ type: array
+ items:
+ type: string
+ title: roles
+ description: The roles that can approve rollout execution.
+ title: RolloutPolicy
+ additionalProperties: false
+ description: Rollout policy configuration.
+ bytebase.v1.RowValue:
+ type: object
+ oneOf:
+ - properties:
+ boolValue:
+ type: boolean
+ title: bool_value
+ title: bool_value
+ required:
+ - boolValue
+ - properties:
+ bytesValue:
+ type: string
+ title: bytes_value
+ format: byte
+ title: bytes_value
+ required:
+ - bytesValue
+ - properties:
+ doubleValue:
+ type: number
+ title: double_value
+ format: double
+ title: double_value
+ required:
+ - doubleValue
+ - properties:
+ floatValue:
+ type: number
+ title: float_value
+ format: float
+ title: float_value
+ required:
+ - floatValue
+ - properties:
+ int32Value:
+ type: integer
+ title: int32_value
+ format: int32
+ title: int32_value
+ required:
+ - int32Value
+ - properties:
+ int64Value:
+ type:
+ - integer
+ - string
+ title: int64_value
+ format: int64
+ title: int64_value
+ required:
+ - int64Value
+ - properties:
+ nullValue:
+ title: null_value
+ $ref: '#/components/schemas/google.protobuf.NullValue'
+ title: null_value
+ required:
+ - nullValue
+ - properties:
+ stringValue:
+ type: string
+ title: string_value
+ title: string_value
+ required:
+ - stringValue
+ - properties:
+ timestampTzValue:
+ title: timestamp_tz_value
+ description: |-
+ timestamp_tz_value is used for the timestamptz data type, which
+ accurately represents the timestamp with location information.
+ $ref: '#/components/schemas/bytebase.v1.RowValue.TimestampTZ'
+ title: timestamp_tz_value
+ required:
+ - timestampTzValue
+ - properties:
+ timestampValue:
+ title: timestamp_value
+ description: |-
+ timestamp_value is used for the timestamp without time zone data type,
+ meaning it only includes the timestamp without any time zone or location
+ info. Although it may be expressed as a UTC value, it should be seen as a
+ timestamp missing location context.
+ $ref: '#/components/schemas/bytebase.v1.RowValue.Timestamp'
+ title: timestamp_value
+ required:
+ - timestampValue
+ - properties:
+ uint32Value:
+ type: integer
+ title: uint32_value
+ title: uint32_value
+ required:
+ - uint32Value
+ - properties:
+ uint64Value:
+ type:
+ - integer
+ - string
+ title: uint64_value
+ format: int64
+ title: uint64_value
+ required:
+ - uint64Value
+ - properties:
+ valueValue:
+ title: value_value
+ description: value_value is used for Spanner and TUPLE ARRAY MAP in Clickhouse only.
+ $ref: '#/components/schemas/google.protobuf.Value'
+ title: value_value
+ required:
+ - valueValue
+ title: RowValue
+ additionalProperties: false
+ bytebase.v1.RowValue.Timestamp:
+ type: object
+ properties:
+ googleTimestamp:
+ title: google_timestamp
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ accuracy:
+ type: integer
+ title: accuracy
+ format: int32
+ description: The accuracy is the number of digits after the decimal point.
+ title: Timestamp
+ additionalProperties: false
+ bytebase.v1.RowValue.TimestampTZ:
+ type: object
+ properties:
+ googleTimestamp:
+ title: google_timestamp
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ zone:
+ type: string
+ title: zone
+ description: |-
+ Zone is the time zone abbreviations in timezone database such as "PDT",
+ "PST". https://en.wikipedia.org/wiki/List_of_tz_database_time_zones We
+ retrieve the time zone information from the timestamptz field in the
+ database. A timestamp is in UTC or epoch time, and with zone info, we can
+ convert it to a local time string. Zone and offset are returned by
+ time.Time.Zone()
+ offset:
+ type: integer
+ title: offset
+ format: int32
+ description: The offset is in seconds east of UTC
+ accuracy:
+ type: integer
+ title: accuracy
+ format: int32
+ title: TimestampTZ
+ additionalProperties: false
+ bytebase.v1.RunPlanChecksRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The plan to run plan checks.
+ Format: projects/{project}/plans/{plan}
+ specId:
+ type: string
+ title: spec_id
+ description: |-
+ The UUID of the specific spec to run plan checks for.
+ This should match the spec.id field in Plan.Spec.
+ If not set, all specs in the plan will be used.
+ nullable: true
+ title: RunPlanChecksRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.RunPlanChecksResponse:
+ type: object
+ title: RunPlanChecksResponse
+ additionalProperties: false
+ bytebase.v1.SASLConfig:
+ type: object
+ oneOf:
+ - properties:
+ krbConfig:
+ title: krb_config
+ description: Kerberos authentication configuration.
+ $ref: '#/components/schemas/bytebase.v1.KerberosConfig'
+ title: krb_config
+ required:
+ - krbConfig
+ title: SASLConfig
+ additionalProperties: false
+ bytebase.v1.SQLReviewRule:
+ type: object
+ allOf:
+ - properties:
+ type:
+ title: type
+ description: The type of SQL review rule.
+ $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.Type'
+ level:
+ title: level
+ description: The severity level of the rule.
+ $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.Level'
+ engine:
+ title: engine
+ description: The database engine this rule applies to.
+ $ref: '#/components/schemas/bytebase.v1.Engine'
+ - oneOf:
+ - properties:
+ commentConventionPayload:
+ title: comment_convention_payload
+ $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.CommentConventionRulePayload'
+ title: comment_convention_payload
+ required:
+ - commentConventionPayload
+ - properties:
+ namingCasePayload:
+ title: naming_case_payload
+ $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.NamingCaseRulePayload'
+ title: naming_case_payload
+ required:
+ - namingCasePayload
+ - properties:
+ namingPayload:
+ title: naming_payload
+ $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.NamingRulePayload'
+ title: naming_payload
+ required:
+ - namingPayload
+ - properties:
+ numberPayload:
+ title: number_payload
+ $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.NumberRulePayload'
+ title: number_payload
+ required:
+ - numberPayload
+ - properties:
+ stringArrayPayload:
+ title: string_array_payload
+ $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.StringArrayRulePayload'
+ title: string_array_payload
+ required:
+ - stringArrayPayload
+ - properties:
+ stringPayload:
+ title: string_payload
+ $ref: '#/components/schemas/bytebase.v1.SQLReviewRule.StringRulePayload'
+ title: string_payload
+ required:
+ - stringPayload
+ title: SQLReviewRule
+ additionalProperties: false
+ description: SQL review rule configuration. Check the SQL_REVIEW_RULES_DOCUMENTATION.md for details.
+ bytebase.v1.SQLReviewRule.CommentConventionRulePayload:
+ type: object
+ properties:
+ required:
+ type: boolean
+ title: required
+ maxLength:
+ type: integer
+ title: max_length
+ format: int32
+ title: CommentConventionRulePayload
+ additionalProperties: false
+ bytebase.v1.SQLReviewRule.Level:
+ type: string
+ title: Level
+ enum:
+ - LEVEL_UNSPECIFIED
+ - ERROR
+ - WARNING
+ description: The severity level for SQL review rules.
+ bytebase.v1.SQLReviewRule.NamingCaseRulePayload:
+ type: object
+ properties:
+ upper:
+ type: boolean
+ title: upper
+ title: NamingCaseRulePayload
+ additionalProperties: false
+ bytebase.v1.SQLReviewRule.NamingRulePayload:
+ type: object
+ properties:
+ maxLength:
+ type: integer
+ title: max_length
+ format: int32
+ format:
+ type: string
+ title: format
+ title: NamingRulePayload
+ additionalProperties: false
+ description: Payload message types for SQL review rules
+ bytebase.v1.SQLReviewRule.NumberRulePayload:
+ type: object
+ properties:
+ number:
+ type: integer
+ title: number
+ format: int32
+ title: NumberRulePayload
+ additionalProperties: false
+ bytebase.v1.SQLReviewRule.StringArrayRulePayload:
+ type: object
+ properties:
+ list:
+ type: array
+ items:
+ type: string
+ title: list
+ title: StringArrayRulePayload
+ additionalProperties: false
+ bytebase.v1.SQLReviewRule.StringRulePayload:
+ type: object
+ properties:
+ value:
+ type: string
+ title: value
+ title: StringRulePayload
+ additionalProperties: false
+ bytebase.v1.SQLReviewRule.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - ENGINE_MYSQL_USE_INNODB
+ - NAMING_FULLY_QUALIFIED
+ - NAMING_TABLE
+ - NAMING_COLUMN
+ - NAMING_INDEX_PK
+ - NAMING_INDEX_UK
+ - NAMING_INDEX_FK
+ - NAMING_INDEX_IDX
+ - NAMING_COLUMN_AUTO_INCREMENT
+ - NAMING_TABLE_NO_KEYWORD
+ - NAMING_IDENTIFIER_NO_KEYWORD
+ - NAMING_IDENTIFIER_CASE
+ - STATEMENT_SELECT_NO_SELECT_ALL
+ - STATEMENT_WHERE_REQUIRE_SELECT
+ - STATEMENT_WHERE_REQUIRE_UPDATE_DELETE
+ - STATEMENT_WHERE_NO_LEADING_WILDCARD_LIKE
+ - STATEMENT_DISALLOW_ON_DEL_CASCADE
+ - STATEMENT_DISALLOW_RM_TBL_CASCADE
+ - STATEMENT_DISALLOW_COMMIT
+ - STATEMENT_DISALLOW_LIMIT
+ - STATEMENT_DISALLOW_ORDER_BY
+ - STATEMENT_MERGE_ALTER_TABLE
+ - STATEMENT_INSERT_ROW_LIMIT
+ - STATEMENT_INSERT_MUST_SPECIFY_COLUMN
+ - STATEMENT_INSERT_DISALLOW_ORDER_BY_RAND
+ - STATEMENT_AFFECTED_ROW_LIMIT
+ - STATEMENT_DML_DRY_RUN
+ - STATEMENT_DISALLOW_ADD_COLUMN_WITH_DEFAULT
+ - STATEMENT_ADD_CHECK_NOT_VALID
+ - STATEMENT_ADD_FOREIGN_KEY_NOT_VALID
+ - STATEMENT_DISALLOW_ADD_NOT_NULL
+ - STATEMENT_SELECT_FULL_TABLE_SCAN
+ - STATEMENT_CREATE_SPECIFY_SCHEMA
+ - STATEMENT_CHECK_SET_ROLE_VARIABLE
+ - STATEMENT_DISALLOW_USING_FILESORT
+ - STATEMENT_DISALLOW_USING_TEMPORARY
+ - STATEMENT_WHERE_NO_EQUAL_NULL
+ - STATEMENT_WHERE_DISALLOW_FUNCTIONS_AND_CALCULATIONS
+ - STATEMENT_QUERY_MINIMUM_PLAN_LEVEL
+ - STATEMENT_WHERE_MAXIMUM_LOGICAL_OPERATOR_COUNT
+ - STATEMENT_MAXIMUM_LIMIT_VALUE
+ - STATEMENT_MAXIMUM_JOIN_TABLE_COUNT
+ - STATEMENT_MAXIMUM_STATEMENTS_IN_TRANSACTION
+ - STATEMENT_JOIN_STRICT_COLUMN_ATTRS
+ - STATEMENT_NON_TRANSACTIONAL
+ - STATEMENT_ADD_COLUMN_WITHOUT_POSITION
+ - STATEMENT_DISALLOW_OFFLINE_DDL
+ - STATEMENT_DISALLOW_CROSS_DB_QUERIES
+ - STATEMENT_MAX_EXECUTION_TIME
+ - STATEMENT_REQUIRE_ALGORITHM_OPTION
+ - STATEMENT_REQUIRE_LOCK_OPTION
+ - STATEMENT_OBJECT_OWNER_CHECK
+ - TABLE_REQUIRE_PK
+ - TABLE_NO_FOREIGN_KEY
+ - TABLE_DROP_NAMING_CONVENTION
+ - TABLE_COMMENT
+ - TABLE_DISALLOW_PARTITION
+ - TABLE_DISALLOW_TRIGGER
+ - TABLE_NO_DUPLICATE_INDEX
+ - TABLE_TEXT_FIELDS_TOTAL_LENGTH
+ - TABLE_DISALLOW_SET_CHARSET
+ - TABLE_DISALLOW_DDL
+ - TABLE_DISALLOW_DML
+ - TABLE_LIMIT_SIZE
+ - TABLE_REQUIRE_CHARSET
+ - TABLE_REQUIRE_COLLATION
+ - COLUMN_REQUIRED
+ - COLUMN_NO_NULL
+ - COLUMN_DISALLOW_CHANGE_TYPE
+ - COLUMN_SET_DEFAULT_FOR_NOT_NULL
+ - COLUMN_DISALLOW_CHANGE
+ - COLUMN_DISALLOW_CHANGING_ORDER
+ - COLUMN_DISALLOW_DROP
+ - COLUMN_DISALLOW_DROP_IN_INDEX
+ - COLUMN_COMMENT
+ - COLUMN_AUTO_INCREMENT_MUST_INTEGER
+ - COLUMN_TYPE_DISALLOW_LIST
+ - COLUMN_DISALLOW_SET_CHARSET
+ - COLUMN_MAXIMUM_CHARACTER_LENGTH
+ - COLUMN_MAXIMUM_VARCHAR_LENGTH
+ - COLUMN_AUTO_INCREMENT_INITIAL_VALUE
+ - COLUMN_AUTO_INCREMENT_MUST_UNSIGNED
+ - COLUMN_CURRENT_TIME_COUNT_LIMIT
+ - COLUMN_REQUIRE_DEFAULT
+ - COLUMN_DEFAULT_DISALLOW_VOLATILE
+ - COLUMN_ADD_NOT_NULL_REQUIRE_DEFAULT
+ - COLUMN_REQUIRE_CHARSET
+ - COLUMN_REQUIRE_COLLATION
+ - SCHEMA_BACKWARD_COMPATIBILITY
+ - DATABASE_DROP_EMPTY_DATABASE
+ - INDEX_NO_DUPLICATE_COLUMN
+ - INDEX_KEY_NUMBER_LIMIT
+ - INDEX_PK_TYPE_LIMIT
+ - INDEX_TYPE_NO_BLOB
+ - INDEX_TOTAL_NUMBER_LIMIT
+ - INDEX_PRIMARY_KEY_TYPE_ALLOWLIST
+ - INDEX_CREATE_CONCURRENTLY
+ - INDEX_TYPE_ALLOW_LIST
+ - INDEX_NOT_REDUNDANT
+ - SYSTEM_CHARSET_ALLOWLIST
+ - SYSTEM_COLLATION_ALLOWLIST
+ - SYSTEM_COMMENT_LENGTH
+ - SYSTEM_PROCEDURE_DISALLOW_CREATE
+ - SYSTEM_EVENT_DISALLOW_CREATE
+ - SYSTEM_VIEW_DISALLOW_CREATE
+ - SYSTEM_FUNCTION_DISALLOW_CREATE
+ - SYSTEM_FUNCTION_DISALLOWED_LIST
+ - ADVICE_ONLINE_MIGRATION
+ - BUILTIN_PRIOR_BACKUP_CHECK
+ bytebase.v1.SchemaCatalog:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The schema name.
+ tables:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TableCatalog'
+ title: tables
+ description: The tables in the schema.
+ title: SchemaCatalog
+ additionalProperties: false
+ description: Schema metadata within a database.
+ bytebase.v1.SchemaMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name is the schema name.
+ It is an empty string for databases without such concept such as MySQL.
+ tables:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TableMetadata'
+ title: tables
+ description: The tables is the list of tables in a schema.
+ externalTables:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ExternalTableMetadata'
+ title: external_tables
+ description: The external_tables is the list of external tables in a schema.
+ views:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ViewMetadata'
+ title: views
+ description: The views is the list of views in a schema.
+ functions:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.FunctionMetadata'
+ title: functions
+ description: The functions is the list of functions in a schema.
+ procedures:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ProcedureMetadata'
+ title: procedures
+ description: The procedures is the list of procedures in a schema.
+ streams:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.StreamMetadata'
+ title: streams
+ description: |-
+ The streams is the list of streams in a schema, currently, only used for
+ Snowflake.
+ tasks:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TaskMetadata'
+ title: tasks
+ description: |-
+ The routines is the list of routines in a schema, currently, only used for
+ Snowflake.
+ materializedViews:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.MaterializedViewMetadata'
+ title: materialized_views
+ description: The materialized_views is the list of materialized views in a schema.
+ packages:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.PackageMetadata'
+ title: packages
+ description: The packages is the list of packages in a schema.
+ owner:
+ type: string
+ title: owner
+ description: The owner of the schema.
+ sequences:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.SequenceMetadata'
+ title: sequences
+ description: The sequences is the list of sequences in a schema, sorted by name.
+ events:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.EventMetadata'
+ title: events
+ description: The events is the list of scheduled events in a schema.
+ enumTypes:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.EnumTypeMetadata'
+ title: enum_types
+ description: The enum_types is the list of user-defined enum types in a schema.
+ skipDump:
+ type: boolean
+ title: skip_dump
+ description: Whether to skip this schema during schema dump operations.
+ comment:
+ type: string
+ title: comment
+ description: The comment is the comment of a schema.
+ title: SchemaMetadata
+ additionalProperties: false
+ description: |-
+ SchemaMetadata is the metadata for schemas.
+ This is the concept of schema in Postgres, but it's a no-op for MySQL.
+ bytebase.v1.SearchAuditLogsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ filter:
+ type: string
+ title: filter
+ description: |-
+ The filter of the log. It should be a valid CEL expression.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - method: the API name, can be found in the docs, should start with "/bytebase.v1." prefix. For example "/bytebase.v1.UserService/CreateUser". Support "==" operator.
+ - severity: support "==" operator, check Severity enum in AuditLog message for values.
+ - user: the actor, should in "users/{email}" format, support "==" operator.
+ - create_time: support ">=" and "<=" operator.
+
+ For example:
+ - filter = "method == '/bytebase.v1.SQLService/Query'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/[email protected]'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
+ orderBy:
+ type: string
+ title: order_by
+ description: |-
+ The order by of the log.
+ Only support order by create_time. The default sorting order is ascending.
+ For example:
+ - order_by = "create_time asc"
+ - order_by = "create_time desc"
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of logs to return.
+ The service may return fewer than this value.
+ If unspecified, at most 10 log entries will be returned.
+ The maximum value is 5000; values above 5000 will be coerced to 5000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `SearchLogs` call.
+ Provide this to retrieve the subsequent page.
+ title: SearchAuditLogsRequest
+ required:
+ - parent
+ additionalProperties: false
+ description: Request message for searching audit logs.
+ bytebase.v1.SearchAuditLogsResponse:
+ type: object
+ properties:
+ auditLogs:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.AuditLog'
+ title: audit_logs
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token to retrieve next page of log entities.
+ Pass this value in the page_token field in the subsequent call
+ to retrieve the next page of log entities.
+ title: SearchAuditLogsResponse
+ additionalProperties: false
+ description: Response message for searching audit logs.
+ bytebase.v1.SearchIssuesRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent, which owns this collection of issues.
+ Format: projects/{project}
+ Use "projects/-" to list all issues from all projects.
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of issues to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 issues will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `SearchIssues` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `SearchIssues` must match
+ the call that provided the page token.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is used to filter issues returned in the list.
+ Check the filter field in the ListIssuesRequest message.
+ query:
+ type: string
+ title: query
+ description: Query is the query statement.
+ title: SearchIssuesRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.SearchIssuesResponse:
+ type: object
+ properties:
+ issues:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ title: issues
+ description: The issues from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: SearchIssuesResponse
+ additionalProperties: false
+ bytebase.v1.SearchProjectsRequest:
+ type: object
+ properties:
+ showDeleted:
+ type: boolean
+ title: show_deleted
+ description: Show deleted projects if specified.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter the project.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - name: the project name, support "==" and ".matches()" operator.
+ - resource_id: the project id, support "==" and ".matches()" operator.
+ - exclude_default: if not include the default project, should be "true" or "false", support "==" operator.
+ - state: check the State enum for the values, support "==" operator.
+ - labels.{key}: the project label, support "==" and "in" operators.
+
+ For example:
+ name == "project name"
+ name.matches("project name")
+ resource_id == "project id"
+ resource_id.matches("project id")
+ exclude_default == true
+ state == "DELETED"
+ labels.environment == "production"
+ labels.tier == "critical"
+ labels.environment in ["staging", "prod"]
+ You can combine filter conditions like:
+ name == "project name" && resource_id.matches("project id")
+ name.matches("project name") || resource_id == "project id"
+ labels.environment == "production" && labels.tier == "critical"
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of projects to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 projects will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `SearchProjects` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `SearchProjects` must match
+ the call that provided the page token.
+ orderBy:
+ type: string
+ title: order_by
+ description: |-
+ The order by of projects.
+ Support title. The default sorting order is ascending.
+ For example:
+ - order_by = "title"
+ - order_by = "title desc"
+ - order_by = "title asc"
+ title: SearchProjectsRequest
+ additionalProperties: false
+ bytebase.v1.SearchProjectsResponse:
+ type: object
+ properties:
+ projects:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ title: projects
+ description: The projects from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: SearchProjectsResponse
+ additionalProperties: false
+ bytebase.v1.SearchQueryHistoriesRequest:
+ type: object
+ properties:
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of histories to return.
+ The service may return fewer than this value.
+ If unspecified, at most 10 history entries will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListQueryHistory` call.
+ Provide this to retrieve the subsequent page.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter is the filter to apply on the search query history
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - database: the database full name in "instances/{id}/databases/{name}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - type: the type, should be "QUERY" or "EXPORT", support "==" operator.
+ - statement: the SQL statement, support ".matches()" operator.
+
+ For example:
+ project == "projects/{project}"
+ database == "instances/{instance}/databases/{database}"
+ instance == "instances/{instance}"
+ type == "QUERY"
+ type == "EXPORT"
+ statement.matches("select")
+ type == "QUERY" && statement.matches("select")
+ title: SearchQueryHistoriesRequest
+ additionalProperties: false
+ bytebase.v1.SearchQueryHistoriesResponse:
+ type: object
+ properties:
+ queryHistories:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.QueryHistory'
+ title: query_histories
+ description: The list of history.
+ readOnly: true
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token to retrieve next page of history.
+ Pass this value in the page_token field in the subsequent call to
+ `ListQueryHistory` method to retrieve the next page of history.
+ title: SearchQueryHistoriesResponse
+ additionalProperties: false
+ bytebase.v1.SearchReleasesRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: 'Format: projects/{project}'
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of releases to return. The service may return fewer than this value.
+ If unspecified, at most 10 releases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListReleases` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListReleases` must match
+ the call that provided the page token.
+ digest:
+ type: string
+ title: digest
+ description: Search by the digest of the release.
+ nullable: true
+ title: SearchReleasesRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.SearchReleasesResponse:
+ type: object
+ properties:
+ releases:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ title: releases
+ description: The releases matching the search criteria.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: SearchReleasesResponse
+ additionalProperties: false
+ bytebase.v1.SearchWorksheetsRequest:
+ type: object
+ properties:
+ filter:
+ type: string
+ title: filter
+ description: |-
+ To filter the search result.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+
+ For example:
+ creator == "users/{email}"
+ creator != "users/{email}"
+ starred == true
+ starred == false
+ visibility in ["PRIVATE", "PROJECT_READ", "PROJECT_WRITE"]
+ visibility == "PRIVATE"
+ project == "projects/{project resource id}"
+ title: SearchWorksheetsRequest
+ additionalProperties: false
+ bytebase.v1.SearchWorksheetsResponse:
+ type: object
+ properties:
+ worksheets:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ title: worksheets
+ description: The worksheets that matched the search criteria.
+ title: SearchWorksheetsResponse
+ additionalProperties: false
+ bytebase.v1.SemanticTypeSetting:
+ type: object
+ properties:
+ types:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.SemanticTypeSetting.SemanticType'
+ title: types
+ title: SemanticTypeSetting
+ additionalProperties: false
+ bytebase.v1.SemanticTypeSetting.SemanticType:
+ type: object
+ properties:
+ id:
+ type: string
+ title: id
+ description: id is the uuid for semantic type.
+ title:
+ type: string
+ title: title
+ description: the title of the semantic type, it should not be empty.
+ description:
+ type: string
+ title: description
+ description: the description of the semantic type, it can be empty.
+ algorithm:
+ title: algorithm
+ $ref: '#/components/schemas/bytebase.v1.Algorithm'
+ icon:
+ type: string
+ title: icon
+ description: icon is the icon for semantic type, it can be emoji or base64 encoded image.
+ title: SemanticType
+ additionalProperties: false
+ bytebase.v1.SequenceMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name of a sequence.
+ dataType:
+ type: string
+ title: data_type
+ description: The data type of a sequence.
+ start:
+ type: string
+ title: start
+ description: The start value of a sequence.
+ minValue:
+ type: string
+ title: min_value
+ description: The minimum value of a sequence.
+ maxValue:
+ type: string
+ title: max_value
+ description: The maximum value of a sequence.
+ increment:
+ type: string
+ title: increment
+ description: Increment value of a sequence.
+ cycle:
+ type: boolean
+ title: cycle
+ description: Cycle is whether the sequence cycles.
+ cacheSize:
+ type: string
+ title: cache_size
+ description: Cache size of a sequence.
+ lastValue:
+ type: string
+ title: last_value
+ description: Last value of a sequence.
+ ownerTable:
+ type: string
+ title: owner_table
+ description: The owner table of the sequence.
+ ownerColumn:
+ type: string
+ title: owner_column
+ description: The owner column of the sequence.
+ comment:
+ type: string
+ title: comment
+ description: The comment describing the sequence.
+ skipDump:
+ type: boolean
+ title: skip_dump
+ description: Whether to skip this sequence during schema dump operations.
+ title: SequenceMetadata
+ additionalProperties: false
+ bytebase.v1.SetIamPolicyRequest:
+ type: object
+ properties:
+ resource:
+ type: string
+ title: resource
+ description: |-
+ The name of the resource to set the IAM policy.
+ Format: projects/{project}
+ Format: workspaces/{workspace}
+ policy:
+ title: policy
+ $ref: '#/components/schemas/bytebase.v1.IamPolicy'
+ etag:
+ type: string
+ title: etag
+ description: The current etag of the policy.
+ title: SetIamPolicyRequest
+ required:
+ - resource
+ - policy
+ additionalProperties: false
+ description: Request message for setting an IAM policy.
+ bytebase.v1.Setting:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ (IDENTIFIER) The resource name of the setting.
+ Format: settings/{setting}
+ Example: "settings/SEMANTIC_TYPES"
+ value:
+ title: value
+ description: The configuration value of the setting.
+ $ref: '#/components/schemas/bytebase.v1.SettingValue'
+ title: Setting
+ required:
+ - value
+ additionalProperties: false
+ description: The schema of setting.
+ bytebase.v1.Setting.SettingName:
+ type: string
+ title: SettingName
+ enum:
+ - SETTING_NAME_UNSPECIFIED
+ - WORKSPACE_PROFILE
+ - WORKSPACE_APPROVAL
+ - APP_IM
+ - AI
+ - DATA_CLASSIFICATION
+ - SEMANTIC_TYPES
+ - ENVIRONMENT
+ bytebase.v1.SettingValue:
+ type: object
+ oneOf:
+ - properties:
+ ai:
+ title: ai
+ $ref: '#/components/schemas/bytebase.v1.AISetting'
+ title: ai
+ required:
+ - ai
+ - properties:
+ appIm:
+ title: app_im
+ $ref: '#/components/schemas/bytebase.v1.AppIMSetting'
+ title: app_im
+ required:
+ - appIm
+ - properties:
+ dataClassification:
+ title: data_classification
+ $ref: '#/components/schemas/bytebase.v1.DataClassificationSetting'
+ title: data_classification
+ required:
+ - dataClassification
+ - properties:
+ environment:
+ title: environment
+ $ref: '#/components/schemas/bytebase.v1.EnvironmentSetting'
+ title: environment
+ required:
+ - environment
+ - properties:
+ semanticType:
+ title: semantic_type
+ $ref: '#/components/schemas/bytebase.v1.SemanticTypeSetting'
+ title: semantic_type
+ required:
+ - semanticType
+ - properties:
+ workspaceApproval:
+ title: workspace_approval
+ $ref: '#/components/schemas/bytebase.v1.WorkspaceApprovalSetting'
+ title: workspace_approval
+ required:
+ - workspaceApproval
+ - properties:
+ workspaceProfile:
+ title: workspace_profile
+ $ref: '#/components/schemas/bytebase.v1.WorkspaceProfileSetting'
+ title: workspace_profile
+ required:
+ - workspaceProfile
+ title: SettingValue
+ additionalProperties: false
+ description: The data in setting value.
+ bytebase.v1.SetupSampleRequest:
+ type: object
+ title: SetupSampleRequest
+ additionalProperties: false
+ description: Request message for setting up sample data.
+ bytebase.v1.Sheet:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ (IMMUTABLE) The name of the sheet resource.
+ Format: projects/{project}/sheets/{sheet}
+ The sheet ID is generated by the server on creation and cannot be changed.
+ content:
+ type: string
+ title: content
+ format: byte
+ description: |-
+ The content of the sheet.
+ By default, it will be cut off, if it doesn't match the `content_size`, you can
+ set the `raw` to true in GetSheet request to retrieve the full content.
+ contentSize:
+ type:
+ - integer
+ - string
+ title: content_size
+ format: int64
+ description: content_size is the full size of the content, may not match the size of the `content` field.
+ readOnly: true
+ title: Sheet
+ required:
+ - name
+ - content
+ additionalProperties: false
+ bytebase.v1.SpatialIndexConfig:
+ type: object
+ properties:
+ method:
+ type: string
+ title: method
+ description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
+ tessellation:
+ title: tessellation
+ description: Tessellation configuration for grid-based spatial indexes
+ $ref: '#/components/schemas/bytebase.v1.TessellationConfig'
+ storage:
+ title: storage
+ description: Storage and performance configuration
+ $ref: '#/components/schemas/bytebase.v1.StorageConfig'
+ dimensional:
+ title: dimensional
+ description: Dimensional configuration
+ $ref: '#/components/schemas/bytebase.v1.DimensionalConfig'
+ title: SpatialIndexConfig
+ additionalProperties: false
+ description: SpatialIndexConfig defines the spatial index configuration for spatial databases.
+ bytebase.v1.Stage:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ Format: projects/{project}/plans/{plan}/rollout/stages/{stage}
+ Use "-" for {stage} when the stage has no environment or deleted environment.
+ id:
+ type: string
+ title: id
+ description: |-
+ id is the environment id of the stage.
+ e.g., "prod".
+ Use "-" when the stage has no environment or deleted environment.
+ readOnly: true
+ environment:
+ type: string
+ title: environment
+ description: |-
+ environment is the environment of the stage.
+ Format: environments/{environment} for valid environments, or "environments/-" for stages without environment or with deleted environments.
+ tasks:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Task'
+ title: tasks
+ description: The tasks within this stage.
+ title: Stage
+ additionalProperties: false
+ bytebase.v1.State:
+ type: string
+ title: State
+ enum:
+ - STATE_UNSPECIFIED
+ - ACTIVE
+ - DELETED
+ description: Resource lifecycle state.
+ bytebase.v1.StorageConfig:
+ type: object
+ properties:
+ fillfactor:
+ type: integer
+ title: fillfactor
+ format: int32
+ description: Fill factor percentage (1-100)
+ buffering:
+ type: string
+ title: buffering
+ description: Buffering mode for PostgreSQL (auto, on, off)
+ tablespace:
+ type: string
+ title: tablespace
+ description: Tablespace configuration for Oracle
+ workTablespace:
+ type: string
+ title: work_tablespace
+ sdoLevel:
+ type: integer
+ title: sdo_level
+ format: int32
+ commitInterval:
+ type: integer
+ title: commit_interval
+ format: int32
+ padIndex:
+ type: boolean
+ title: pad_index
+ description: SQL Server specific parameters
+ sortInTempdb:
+ type: string
+ title: sort_in_tempdb
+ description: ON, OFF
+ dropExisting:
+ type: boolean
+ title: drop_existing
+ online:
+ type: boolean
+ title: online
+ allowRowLocks:
+ type: boolean
+ title: allow_row_locks
+ allowPageLocks:
+ type: boolean
+ title: allow_page_locks
+ maxdop:
+ type: integer
+ title: maxdop
+ format: int32
+ dataCompression:
+ type: string
+ title: data_compression
+ description: NONE, ROW, PAGE
+ title: StorageConfig
+ additionalProperties: false
+ description: StorageConfig defines storage and performance parameters for spatial indexes.
+ bytebase.v1.StreamMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a stream.
+ tableName:
+ type: string
+ title: table_name
+ description: The table_name is the name of the table/view that the stream is created on.
+ owner:
+ type: string
+ title: owner
+ description: The owner of the stream.
+ comment:
+ type: string
+ title: comment
+ description: The comment of the stream.
+ type:
+ title: type
+ description: The type of the stream.
+ $ref: '#/components/schemas/bytebase.v1.StreamMetadata.Type'
+ stale:
+ type: boolean
+ title: stale
+ description: Indicates whether the stream was last read before the `stale_after` time.
+ mode:
+ title: mode
+ description: The mode of the stream.
+ $ref: '#/components/schemas/bytebase.v1.StreamMetadata.Mode'
+ definition:
+ type: string
+ title: definition
+ description: The definition of the stream.
+ title: StreamMetadata
+ additionalProperties: false
+ bytebase.v1.StreamMetadata.Mode:
+ type: string
+ title: Mode
+ enum:
+ - MODE_UNSPECIFIED
+ - DEFAULT
+ - APPEND_ONLY
+ - INSERT_ONLY
+ bytebase.v1.StreamMetadata.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - DELTA
+ bytebase.v1.Subscription:
+ type: object
+ properties:
+ plan:
+ title: plan
+ readOnly: true
+ $ref: '#/components/schemas/bytebase.v1.PlanType'
+ seats:
+ type: integer
+ title: seats
+ format: int32
+ readOnly: true
+ instances:
+ type: integer
+ title: instances
+ format: int32
+ readOnly: true
+ activeInstances:
+ type: integer
+ title: active_instances
+ format: int32
+ readOnly: true
+ expiresTime:
+ title: expires_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ trialing:
+ type: boolean
+ title: trialing
+ readOnly: true
+ orgName:
+ type: string
+ title: org_name
+ readOnly: true
+ title: Subscription
+ additionalProperties: false
+ bytebase.v1.SyncDatabaseRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the database to sync.
+ Format: instances/{instance}/databases/{database}
+ title: SyncDatabaseRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.SyncDatabaseResponse:
+ type: object
+ title: SyncDatabaseResponse
+ additionalProperties: false
+ bytebase.v1.SyncInstanceRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of instance.
+ Format: instances/{instance}
+ enableFullSync:
+ type: boolean
+ title: enable_full_sync
+ description: |-
+ When full sync is enabled, all databases in the instance will be synchronized. Otherwise, only
+ the instance metadata (such as the database list) and any newly discovered databases will be synced.
+ title: SyncInstanceRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.SyncInstanceResponse:
+ type: object
+ properties:
+ databases:
+ type: array
+ items:
+ type: string
+ title: databases
+ description: All database name list in the instance.
+ title: SyncInstanceResponse
+ additionalProperties: false
+ bytebase.v1.TableCatalog:
+ type: object
+ allOf:
+ - properties:
+ name:
+ type: string
+ title: name
+ description: The table name.
+ classification:
+ type: string
+ title: classification
+ description: The data classification level for this table.
+ - oneOf:
+ - properties:
+ columns:
+ title: columns
+ description: Regular table columns.
+ $ref: '#/components/schemas/bytebase.v1.TableCatalog.Columns'
+ title: columns
+ required:
+ - columns
+ - properties:
+ objectSchema:
+ title: object_schema
+ description: Object schema for JSON/XML columns.
+ $ref: '#/components/schemas/bytebase.v1.ObjectSchema'
+ title: object_schema
+ required:
+ - objectSchema
+ title: TableCatalog
+ additionalProperties: false
+ description: Table metadata within a schema.
+ bytebase.v1.TableCatalog.Columns:
+ type: object
+ properties:
+ columns:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ColumnCatalog'
+ title: columns
+ description: The columns in the table.
+ title: Columns
+ additionalProperties: false
+ description: Column list for regular tables.
+ bytebase.v1.TableMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a table.
+ columns:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ColumnMetadata'
+ title: columns
+ description: The columns is the ordered list of columns in a table.
+ indexes:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.IndexMetadata'
+ title: indexes
+ description: The indexes is the list of indexes in a table.
+ engine:
+ type: string
+ title: engine
+ description: The engine is the engine of a table.
+ collation:
+ type: string
+ title: collation
+ description: The collation is the collation of a table.
+ charset:
+ type: string
+ title: charset
+ description: The character set of table.
+ rowCount:
+ type:
+ - integer
+ - string
+ title: row_count
+ format: int64
+ description: The row_count is the estimated number of rows of a table.
+ dataSize:
+ type:
+ - integer
+ - string
+ title: data_size
+ format: int64
+ description: The data_size is the estimated data size of a table.
+ indexSize:
+ type:
+ - integer
+ - string
+ title: index_size
+ format: int64
+ description: The index_size is the estimated index size of a table.
+ dataFree:
+ type:
+ - integer
+ - string
+ title: data_free
+ format: int64
+ description: The data_free is the estimated free data size of a table.
+ createOptions:
+ type: string
+ title: create_options
+ description: The create_options is the create option of a table.
+ comment:
+ type: string
+ title: comment
+ description: The comment is the comment of a table.
+ foreignKeys:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ForeignKeyMetadata'
+ title: foreign_keys
+ description: The foreign_keys is the list of foreign keys in a table.
+ partitions:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TablePartitionMetadata'
+ title: partitions
+ description: The partitions is the list of partitions in a table.
+ checkConstraints:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.CheckConstraintMetadata'
+ title: check_constraints
+ description: The check_constraints is the list of check constraints in a table.
+ owner:
+ type: string
+ title: owner
+ description: The owner of the table.
+ sortingKeys:
+ type: array
+ items:
+ type: string
+ title: sorting_keys
+ description: |-
+ The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.
+ Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by
+ triggers:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TriggerMetadata'
+ title: triggers
+ description: The triggers is the list of triggers associated with the table.
+ skipDump:
+ type: boolean
+ title: skip_dump
+ description: Whether to skip this table during schema dump operations.
+ shardingInfo:
+ type: string
+ title: sharding_info
+ description: https://docs.pingcap.com/tidb/stable/information-schema-tables/
+ primaryKeyType:
+ type: string
+ title: primary_key_type
+ description: |-
+ https://docs.pingcap.com/tidb/stable/clustered-indexes/#clustered-indexes
+ CLUSTERED or NONCLUSTERED.
+ title: TableMetadata
+ additionalProperties: false
+ description: TableMetadata is the metadata for tables.
+ bytebase.v1.TablePartitionMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a table partition.
+ type:
+ title: type
+ description: The type of a table partition.
+ $ref: '#/components/schemas/bytebase.v1.TablePartitionMetadata.Type'
+ expression:
+ type: string
+ title: expression
+ description: |-
+ The expression is the expression of a table partition.
+ For PostgreSQL, the expression is the text of {FOR VALUES
+ partition_bound_spec}, see
+ https://www.postgresql.org/docs/current/sql-createtable.html. For MySQL,
+ the expression is the `expr` or `column_list` of the following syntax.
+ PARTITION BY
+ { [LINEAR] HASH(expr)
+ | [LINEAR] KEY [ALGORITHM={1 | 2}] (column_list)
+ | RANGE{(expr) | COLUMNS(column_list)}
+ | LIST{(expr) | COLUMNS(column_list)} }.
+ value:
+ type: string
+ title: value
+ description: |-
+ The value is the value of a table partition.
+ For MySQL, the value is for RANGE and LIST partition types,
+ - For a RANGE partition, it contains the value set in the partition's
+ VALUES LESS THAN clause, which can be either an integer or MAXVALUE.
+ - For a LIST partition, this column contains the values defined in the
+ partition's VALUES IN clause, which is a list of comma-separated integer
+ values.
+ - For others, it's an empty string.
+ useDefault:
+ type: string
+ title: use_default
+ description: |-
+ The use_default is whether the users use the default partition, it stores
+ the different value for different database engines. For MySQL, it's [INT]
+ type, 0 means not use default partition, otherwise, it's equals to number
+ in syntax [SUB]PARTITION {number}.
+ subpartitions:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TablePartitionMetadata'
+ title: subpartitions
+ description: The subpartitions is the list of subpartitions in a table partition.
+ indexes:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.IndexMetadata'
+ title: indexes
+ checkConstraints:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.CheckConstraintMetadata'
+ title: check_constraints
+ title: TablePartitionMetadata
+ additionalProperties: false
+ description: TablePartitionMetadata is the metadata for table partitions.
+ bytebase.v1.TablePartitionMetadata.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - RANGE
+ - RANGE_COLUMNS
+ - LIST
+ - LIST_COLUMNS
+ - HASH
+ - LINEAR_HASH
+ - KEY
+ - LINEAR_KEY
+ description: |-
+ Type is the type of a table partition, some database engines may not
+ support all types. Only avilable for the following database engines now:
+ MySQL: RANGE, RANGE COLUMNS, LIST, LIST COLUMNS, HASH, LINEAR HASH, KEY,
+ LINEAR_KEY
+ (https://dev.mysql.com/doc/refman/8.0/en/partitioning-types.html) TiDB:
+ RANGE, RANGE COLUMNS, LIST, LIST COLUMNS, HASH, KEY PostgreSQL: RANGE,
+ LIST, HASH (https://www.postgresql.org/docs/current/ddl-partitioning.html)
+ bytebase.v1.TagPolicy:
+ type: object
+ properties:
+ tags:
+ type: object
+ title: tags
+ additionalProperties:
+ type: string
+ title: value
+ description: |-
+ tags is the key - value map for resources.
+ for example, the environment resource can have the sql review config tag, like "bb.tag.review_config": "reviewConfigs/{review config resource id}"
+ title: TagPolicy
+ additionalProperties: false
+ description: Policy for tagging resources with metadata.
+ bytebase.v1.TagPolicy.TagsEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: string
+ title: value
+ title: TagsEntry
+ additionalProperties: false
+ bytebase.v1.Task:
+ type: object
+ allOf:
+ - properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}'
+ specId:
+ type: string
+ title: spec_id
+ description: A UUID4 string that uniquely identifies the Spec.
+ status:
+ title: status
+ description: Status is the status of the task.
+ $ref: '#/components/schemas/bytebase.v1.Task.Status'
+ skippedReason:
+ type: string
+ title: skipped_reason
+ description: The reason why the task was skipped.
+ type:
+ title: type
+ $ref: '#/components/schemas/bytebase.v1.Task.Type'
+ target:
+ type: string
+ title: target
+ description: |-
+ Format: instances/{instance} if the task is DatabaseCreate.
+ Format: instances/{instance}/databases/{database}
+ updateTime:
+ title: update_time
+ description: |-
+ The update_time is the update time of latest task run.
+ If there are no task runs, it will be empty.
+ nullable: true
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ runTime:
+ title: run_time
+ description: |-
+ The run_time is the scheduled run time of latest task run.
+ If there are no task runs or the task run is not scheduled, it will be empty.
+ nullable: true
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ - oneOf:
+ - properties:
+ databaseCreate:
+ title: database_create
+ $ref: '#/components/schemas/bytebase.v1.Task.DatabaseCreate'
+ title: database_create
+ required:
+ - databaseCreate
+ - properties:
+ databaseDataExport:
+ title: database_data_export
+ $ref: '#/components/schemas/bytebase.v1.Task.DatabaseDataExport'
+ title: database_data_export
+ required:
+ - databaseDataExport
+ - properties:
+ databaseUpdate:
+ title: database_update
+ $ref: '#/components/schemas/bytebase.v1.Task.DatabaseUpdate'
+ title: database_update
+ required:
+ - databaseUpdate
+ title: Task
+ additionalProperties: false
+ bytebase.v1.Task.DatabaseCreate:
+ type: object
+ properties:
+ project:
+ type: string
+ title: project
+ description: |-
+ The project owning the database.
+ Format: projects/{project}
+ database:
+ type: string
+ title: database
+ description: Database name.
+ table:
+ type: string
+ title: table
+ description: Table name.
+ sheet:
+ type: string
+ title: sheet
+ description: 'Format: projects/{project}/sheets/{sheet}'
+ characterSet:
+ type: string
+ title: character_set
+ description: The character set for the database.
+ collation:
+ type: string
+ title: collation
+ description: The collation for the database.
+ environment:
+ type: string
+ title: environment
+ description: The environment the database belongs to.
+ title: DatabaseCreate
+ additionalProperties: false
+ description: Payload for creating a new database.
+ bytebase.v1.Task.DatabaseDataExport:
+ type: object
+ properties:
+ target:
+ type: string
+ title: target
+ description: |-
+ The resource name of the target.
+ Format: instances/{instance-id}/databases/{database-name}
+ sheet:
+ type: string
+ title: sheet
+ description: |-
+ The resource name of the sheet.
+ Format: projects/{project}/sheets/{sheet}
+ format:
+ title: format
+ description: The format of the exported file.
+ $ref: '#/components/schemas/bytebase.v1.ExportFormat'
+ password:
+ type: string
+ title: password
+ description: |-
+ The zip password provided by users.
+ Leave it empty if no needs to encrypt the zip file.
+ nullable: true
+ title: DatabaseDataExport
+ additionalProperties: false
+ description: Payload for exporting database data.
+ bytebase.v1.Task.DatabaseUpdate:
+ type: object
+ properties:
+ sheet:
+ type: string
+ title: sheet
+ description: 'Format: projects/{project}/sheets/{sheet}'
+ schemaVersion:
+ type: string
+ title: schema_version
+ description: The target schema version after this update.
+ databaseChangeType:
+ title: database_change_type
+ description: The type of database change (MIGRATE or SDL).
+ $ref: '#/components/schemas/bytebase.v1.DatabaseChangeType'
+ title: DatabaseUpdate
+ additionalProperties: false
+ description: Payload for updating a database schema.
+ bytebase.v1.Task.Status:
+ type: string
+ title: Status
+ enum:
+ - STATUS_UNSPECIFIED
+ - NOT_STARTED
+ - PENDING
+ - RUNNING
+ - DONE
+ - FAILED
+ - CANCELED
+ - SKIPPED
+ bytebase.v1.Task.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - GENERAL
+ - DATABASE_CREATE
+ - DATABASE_MIGRATE
+ - DATABASE_EXPORT
+ - DATABASE_SDL
+ bytebase.v1.TaskMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a task.
+ id:
+ type: string
+ title: id
+ description: |-
+ The id is the snowflake-generated id of a task.
+ Example: 01ad32a0-1bb6-5e93-0000-000000000001
+ owner:
+ type: string
+ title: owner
+ description: The owner of the task.
+ comment:
+ type: string
+ title: comment
+ description: The comment of the task.
+ warehouse:
+ type: string
+ title: warehouse
+ description: The warehouse of the task.
+ schedule:
+ type: string
+ title: schedule
+ description: The schedule interval of the task.
+ predecessors:
+ type: array
+ items:
+ type: string
+ title: predecessors
+ description: The predecessor tasks of the task.
+ state:
+ title: state
+ description: The state of the task.
+ $ref: '#/components/schemas/bytebase.v1.TaskMetadata.State'
+ condition:
+ type: string
+ title: condition
+ description: The condition of the task.
+ definition:
+ type: string
+ title: definition
+ description: The definition of the task.
+ title: TaskMetadata
+ additionalProperties: false
+ bytebase.v1.TaskMetadata.State:
+ type: string
+ title: State
+ enum:
+ - STATE_UNSPECIFIED
+ - STARTED
+ - SUSPENDED
+ bytebase.v1.TaskRun:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
+ creator:
+ type: string
+ title: creator
+ description: 'Format: users/[email protected]'
+ createTime:
+ title: create_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ updateTime:
+ title: update_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ status:
+ title: status
+ description: The current execution status of the task run.
+ $ref: '#/components/schemas/bytebase.v1.TaskRun.Status'
+ detail:
+ type: string
+ title: detail
+ description: |-
+ Below are the results of a task run.
+ Detailed information about the task run result.
+ changelog:
+ type: string
+ title: changelog
+ description: |-
+ The resource name of the changelog.
+ Format: instances/{instance}/databases/{database}/changelogs/{changelog}
+ readOnly: true
+ schemaVersion:
+ type: string
+ title: schema_version
+ description: The schema version after this task run completes.
+ startTime:
+ title: start_time
+ description: The time when the task run started execution.
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ exportArchiveStatus:
+ title: export_archive_status
+ description: The export archive status for data export tasks.
+ $ref: '#/components/schemas/bytebase.v1.TaskRun.ExportArchiveStatus'
+ priorBackupDetail:
+ title: prior_backup_detail
+ description: The prior backup detail that will be used to rollback the task run.
+ $ref: '#/components/schemas/bytebase.v1.TaskRun.PriorBackupDetail'
+ schedulerInfo:
+ title: scheduler_info
+ description: Scheduling information about the task run.
+ readOnly: true
+ $ref: '#/components/schemas/bytebase.v1.TaskRun.SchedulerInfo'
+ sheet:
+ type: string
+ title: sheet
+ description: 'Format: projects/{project}/sheets/{sheet}'
+ readOnly: true
+ runTime:
+ title: run_time
+ description: |-
+ The task run should run after run_time.
+ This can only be set when creating the task run calling BatchRunTasks.
+ nullable: true
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ title: TaskRun
+ additionalProperties: false
+ bytebase.v1.TaskRun.ExportArchiveStatus:
+ type: string
+ title: ExportArchiveStatus
+ enum:
+ - EXPORT_ARCHIVE_STATUS_UNSPECIFIED
+ - READY
+ - EXPORTED
+ bytebase.v1.TaskRun.PriorBackupDetail:
+ type: object
+ properties:
+ items:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TaskRun.PriorBackupDetail.Item'
+ title: items
+ description: The list of backed up tables.
+ title: PriorBackupDetail
+ additionalProperties: false
+ description: Prior backup detail for rollback purposes.
+ bytebase.v1.TaskRun.PriorBackupDetail.Item:
+ type: object
+ properties:
+ sourceTable:
+ title: source_table
+ description: The original table information.
+ $ref: '#/components/schemas/bytebase.v1.TaskRun.PriorBackupDetail.Item.Table'
+ targetTable:
+ title: target_table
+ description: The target backup table information.
+ $ref: '#/components/schemas/bytebase.v1.TaskRun.PriorBackupDetail.Item.Table'
+ startPosition:
+ title: start_position
+ description: The start position in the SQL statement.
+ $ref: '#/components/schemas/bytebase.v1.Position'
+ endPosition:
+ title: end_position
+ description: The end position in the SQL statement.
+ $ref: '#/components/schemas/bytebase.v1.Position'
+ title: Item
+ additionalProperties: false
+ description: A single backup table mapping.
+ bytebase.v1.TaskRun.PriorBackupDetail.Item.Table:
+ type: object
+ properties:
+ database:
+ type: string
+ title: database
+ description: |-
+ The database information.
+ Format: instances/{instance}/databases/{database}
+ schema:
+ type: string
+ title: schema
+ description: The schema name.
+ table:
+ type: string
+ title: table
+ description: The table name.
+ title: Table
+ additionalProperties: false
+ description: Table information.
+ bytebase.v1.TaskRun.SchedulerInfo:
+ type: object
+ properties:
+ reportTime:
+ title: report_time
+ description: The time when the scheduling info was reported.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ waitingCause:
+ title: waiting_cause
+ description: The cause for the task run waiting.
+ $ref: '#/components/schemas/bytebase.v1.TaskRun.SchedulerInfo.WaitingCause'
+ title: SchedulerInfo
+ additionalProperties: false
+ description: Information about task run scheduling.
+ bytebase.v1.TaskRun.SchedulerInfo.WaitingCause:
+ type: object
+ oneOf:
+ - properties:
+ connectionLimit:
+ type: boolean
+ title: connection_limit
+ description: Waiting due to connection limit reached.
+ title: connection_limit
+ required:
+ - connectionLimit
+ - properties:
+ parallelTasksLimit:
+ type: boolean
+ title: parallel_tasks_limit
+ description: Waiting due to parallel tasks limit.
+ title: parallel_tasks_limit
+ required:
+ - parallelTasksLimit
+ - properties:
+ task:
+ title: task
+ description: Waiting for another task to complete.
+ $ref: '#/components/schemas/bytebase.v1.TaskRun.SchedulerInfo.WaitingCause.Task'
+ title: task
+ required:
+ - task
+ title: WaitingCause
+ additionalProperties: false
+ description: Information about why a task run is waiting.
+ bytebase.v1.TaskRun.SchedulerInfo.WaitingCause.Task:
+ type: object
+ properties:
+ task:
+ type: string
+ title: task
+ description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}'
+ title: Task
+ additionalProperties: false
+ description: Information about a blocking task.
+ bytebase.v1.TaskRun.Status:
+ type: string
+ title: Status
+ enum:
+ - STATUS_UNSPECIFIED
+ - PENDING
+ - RUNNING
+ - DONE
+ - FAILED
+ - CANCELED
+ bytebase.v1.TaskRunLog:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}/log'
+ entries:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry'
+ title: entries
+ description: The log entries for this task run.
+ title: TaskRunLog
+ additionalProperties: false
+ bytebase.v1.TaskRunLogEntry:
+ type: object
+ properties:
+ type:
+ title: type
+ description: The type of this log entry.
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.Type'
+ logTime:
+ title: log_time
+ description: The time when the log was recorded.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ deployId:
+ type: string
+ title: deploy_id
+ description: The deployment ID for this log entry.
+ schemaDump:
+ title: schema_dump
+ description: Schema dump details (if type is SCHEMA_DUMP).
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.SchemaDump'
+ commandExecute:
+ title: command_execute
+ description: Command execution details (if type is COMMAND_EXECUTE).
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.CommandExecute'
+ databaseSync:
+ title: database_sync
+ description: Database sync details (if type is DATABASE_SYNC).
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.DatabaseSync'
+ taskRunStatusUpdate:
+ title: task_run_status_update
+ description: Task run status update details (if type is TASK_RUN_STATUS_UPDATE).
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.TaskRunStatusUpdate'
+ transactionControl:
+ title: transaction_control
+ description: Transaction control details (if type is TRANSACTION_CONTROL).
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.TransactionControl'
+ priorBackup:
+ title: prior_backup
+ description: Prior backup details (if type is PRIOR_BACKUP).
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.PriorBackup'
+ retryInfo:
+ title: retry_info
+ description: Retry information details (if type is RETRY_INFO).
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.RetryInfo'
+ computeDiff:
+ title: compute_diff
+ description: Compute diff details (if type is COMPUTE_DIFF).
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.ComputeDiff'
+ title: TaskRunLogEntry
+ additionalProperties: false
+ bytebase.v1.TaskRunLogEntry.CommandExecute:
+ type: object
+ properties:
+ logTime:
+ title: log_time
+ description: When the command was logged.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ range:
+ title: range
+ description: |-
+ The byte offset range of the executed command in the sheet.
+ Uses byte offsets (not character indices) for efficient slicing of sheet content bytes.
+ Example: For "SELECT 你好;" in a UTF-8 sheet, range [0, 13) represents all 13 bytes.
+ $ref: '#/components/schemas/bytebase.v1.Range'
+ statement:
+ type: string
+ title: statement
+ description: The executed statement.
+ response:
+ title: response
+ description: The response from executing the command.
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.CommandExecute.CommandResponse'
+ title: CommandExecute
+ additionalProperties: false
+ description: Command execution details.
+ bytebase.v1.TaskRunLogEntry.CommandExecute.CommandResponse:
+ type: object
+ properties:
+ logTime:
+ title: log_time
+ description: When the response was logged.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ error:
+ type: string
+ title: error
+ description: Error message if command execution failed.
+ affectedRows:
+ type:
+ - integer
+ - string
+ title: affected_rows
+ format: int64
+ description: Total affected rows.
+ allAffectedRows:
+ type: array
+ items:
+ type:
+ - integer
+ - string
+ format: int64
+ title: all_affected_rows
+ description: |-
+ `all_affected_rows` is the affected rows of each command.
+ `all_affected_rows` may be unavailable if the database driver doesn't support it. Caller should fallback to `affected_rows` in that case.
+ title: CommandResponse
+ additionalProperties: false
+ description: Command execution response.
+ bytebase.v1.TaskRunLogEntry.ComputeDiff:
+ type: object
+ properties:
+ startTime:
+ title: start_time
+ description: When diff computation started.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ endTime:
+ title: end_time
+ description: When diff computation ended.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ error:
+ type: string
+ title: error
+ description: Error message if computation failed.
+ title: ComputeDiff
+ additionalProperties: false
+ description: Schema diff computation details.
+ bytebase.v1.TaskRunLogEntry.DatabaseSync:
+ type: object
+ properties:
+ startTime:
+ title: start_time
+ description: When the database sync started.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ endTime:
+ title: end_time
+ description: When the database sync ended.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ error:
+ type: string
+ title: error
+ description: Error message if sync failed.
+ title: DatabaseSync
+ additionalProperties: false
+ description: Database synchronization details.
+ bytebase.v1.TaskRunLogEntry.PriorBackup:
+ type: object
+ properties:
+ startTime:
+ title: start_time
+ description: When the backup started.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ endTime:
+ title: end_time
+ description: When the backup ended.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ priorBackupDetail:
+ title: prior_backup_detail
+ description: The backup details.
+ $ref: '#/components/schemas/bytebase.v1.TaskRun.PriorBackupDetail'
+ error:
+ type: string
+ title: error
+ description: Error message if the backup failed.
+ title: PriorBackup
+ additionalProperties: false
+ description: Prior backup operation details.
+ bytebase.v1.TaskRunLogEntry.RetryInfo:
+ type: object
+ properties:
+ error:
+ type: string
+ title: error
+ description: The error that triggered the retry.
+ retryCount:
+ type: integer
+ title: retry_count
+ format: int32
+ description: Current retry attempt number.
+ maximumRetries:
+ type: integer
+ title: maximum_retries
+ format: int32
+ description: Maximum number of retries allowed.
+ title: RetryInfo
+ additionalProperties: false
+ description: Retry information for failed operations.
+ bytebase.v1.TaskRunLogEntry.SchemaDump:
+ type: object
+ properties:
+ startTime:
+ title: start_time
+ description: When the schema dump started.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ endTime:
+ title: end_time
+ description: When the schema dump ended.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ error:
+ type: string
+ title: error
+ description: Error message if the schema dump failed.
+ title: SchemaDump
+ additionalProperties: false
+ description: Schema dump operation details.
+ bytebase.v1.TaskRunLogEntry.TaskRunStatusUpdate:
+ type: object
+ properties:
+ status:
+ title: status
+ description: The new status.
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.TaskRunStatusUpdate.Status'
+ title: TaskRunStatusUpdate
+ additionalProperties: false
+ description: Task run status update details.
+ bytebase.v1.TaskRunLogEntry.TaskRunStatusUpdate.Status:
+ type: string
+ title: Status
+ enum:
+ - STATUS_UNSPECIFIED
+ - RUNNING_WAITING
+ - RUNNING_RUNNING
+ description: Internal status for task run execution.
+ bytebase.v1.TaskRunLogEntry.TransactionControl:
+ type: object
+ properties:
+ type:
+ title: type
+ description: The type of transaction control.
+ $ref: '#/components/schemas/bytebase.v1.TaskRunLogEntry.TransactionControl.Type'
+ error:
+ type: string
+ title: error
+ description: Error message if the operation failed.
+ title: TransactionControl
+ additionalProperties: false
+ description: Transaction control operation details.
+ bytebase.v1.TaskRunLogEntry.TransactionControl.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - BEGIN
+ - COMMIT
+ - ROLLBACK
+ description: Transaction control type.
+ bytebase.v1.TaskRunLogEntry.Type:
+ type: string
+ title: Type
+ enum:
+ - TYPE_UNSPECIFIED
+ - SCHEMA_DUMP
+ - COMMAND_EXECUTE
+ - DATABASE_SYNC
+ - TASK_RUN_STATUS_UPDATE
+ - TRANSACTION_CONTROL
+ - PRIOR_BACKUP
+ - RETRY_INFO
+ - COMPUTE_DIFF
+ description: The type of log entry.
+ bytebase.v1.TaskRunSession:
+ type: object
+ allOf:
+ - properties:
+ name:
+ type: string
+ title: name
+ description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}/session'
+ - oneOf:
+ - properties:
+ postgres:
+ title: postgres
+ description: PostgreSQL session information.
+ $ref: '#/components/schemas/bytebase.v1.TaskRunSession.Postgres'
+ title: postgres
+ required:
+ - postgres
+ title: TaskRunSession
+ additionalProperties: false
+ bytebase.v1.TaskRunSession.Postgres:
+ type: object
+ properties:
+ session:
+ title: session
+ description: '`session` is the session of the task run executing commands.'
+ $ref: '#/components/schemas/bytebase.v1.TaskRunSession.Postgres.Session'
+ blockingSessions:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TaskRunSession.Postgres.Session'
+ title: blocking_sessions
+ description: '`blocking_sessions` block `session`.'
+ blockedSessions:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TaskRunSession.Postgres.Session'
+ title: blocked_sessions
+ description: '`blocked_sessions` are blocked by `session`.'
+ title: Postgres
+ additionalProperties: false
+ description: PostgreSQL session information.
+ bytebase.v1.TaskRunSession.Postgres.Session:
+ type: object
+ properties:
+ pid:
+ type: string
+ title: pid
+ description: Process ID of the session.
+ blockedByPids:
+ type: array
+ items:
+ type: string
+ title: blocked_by_pids
+ description: PIDs of sessions blocking this session.
+ query:
+ type: string
+ title: query
+ description: Current query being executed.
+ state:
+ type: string
+ title: state
+ description: Session state (active, idle, etc.).
+ nullable: true
+ waitEventType:
+ type: string
+ title: wait_event_type
+ description: Wait event type if session is waiting.
+ nullable: true
+ waitEvent:
+ type: string
+ title: wait_event
+ description: Specific wait event if session is waiting.
+ nullable: true
+ datname:
+ type: string
+ title: datname
+ description: Database name.
+ nullable: true
+ usename:
+ type: string
+ title: usename
+ description: User name.
+ nullable: true
+ applicationName:
+ type: string
+ title: application_name
+ description: Application name.
+ clientAddr:
+ type: string
+ title: client_addr
+ description: Client IP address.
+ nullable: true
+ clientPort:
+ type: string
+ title: client_port
+ description: Client port number.
+ nullable: true
+ backendStart:
+ title: backend_start
+ description: When the backend process started.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ xactStart:
+ title: xact_start
+ description: When the current transaction started.
+ nullable: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ queryStart:
+ title: query_start
+ description: When the current query started.
+ nullable: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ title: Session
+ additionalProperties: false
+ description: PostgreSQL session information read from `pg_stat_activity`.
+ bytebase.v1.TessellationConfig:
+ type: object
+ properties:
+ scheme:
+ type: string
+ title: scheme
+ description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
+ gridLevels:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.GridLevel'
+ title: grid_levels
+ description: Grid levels and densities for multi-level tessellation
+ cellsPerObject:
+ type: integer
+ title: cells_per_object
+ format: int32
+ description: Number of cells per object (1-8192 for SQL Server)
+ boundingBox:
+ title: bounding_box
+ description: Bounding box for GEOMETRY tessellation (not used for GEOGRAPHY)
+ $ref: '#/components/schemas/bytebase.v1.BoundingBox'
+ title: TessellationConfig
+ additionalProperties: false
+ description: TessellationConfig defines tessellation parameters for spatial indexes.
+ bytebase.v1.TestIdentityProviderRequest:
+ type: object
+ allOf:
+ - properties:
+ identityProvider:
+ title: identity_provider
+ description: The identity provider to test connection including uncreated.
+ $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
+ - oneOf:
+ - properties:
+ oauth2Context:
+ title: oauth2_context
+ $ref: '#/components/schemas/bytebase.v1.OAuth2IdentityProviderTestRequestContext'
+ title: oauth2_context
+ required:
+ - oauth2Context
+ - properties:
+ oidcContext:
+ title: oidc_context
+ description: OIDC authentication context for test connection.
+ $ref: '#/components/schemas/bytebase.v1.OIDCIdentityProviderTestRequestContext'
+ title: oidc_context
+ required:
+ - oidcContext
+ title: TestIdentityProviderRequest
+ additionalProperties: false
+ bytebase.v1.TestIdentityProviderResponse:
+ type: object
+ properties:
+ claims:
+ type: object
+ title: claims
+ additionalProperties:
+ type: string
+ title: value
+ description: The map of claims returned by the identity provider.
+ userInfo:
+ type: object
+ title: user_info
+ additionalProperties:
+ type: string
+ title: value
+ description: The matched user info from the claims.
+ title: TestIdentityProviderResponse
+ additionalProperties: false
+ bytebase.v1.TestIdentityProviderResponse.ClaimsEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: string
+ title: value
+ title: ClaimsEntry
+ additionalProperties: false
+ bytebase.v1.TestIdentityProviderResponse.UserInfoEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ type: string
+ title: value
+ title: UserInfoEntry
+ additionalProperties: false
+ bytebase.v1.TestWebhookRequest:
+ type: object
+ properties:
+ project:
+ type: string
+ title: project
+ description: |-
+ The name of the project which owns the webhook to test.
+ Format: projects/{project}
+ webhook:
+ title: webhook
+ description: The webhook to test. Identified by its url.
+ $ref: '#/components/schemas/bytebase.v1.Webhook'
+ title: TestWebhookRequest
+ required:
+ - project
+ - webhook
+ additionalProperties: false
+ bytebase.v1.TestWebhookResponse:
+ type: object
+ properties:
+ error:
+ type: string
+ title: error
+ description: The result of the test, empty if the test is successful.
+ title: TestWebhookResponse
+ additionalProperties: false
+ bytebase.v1.TriggerMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of the trigger.
+ event:
+ type: string
+ title: event
+ description: |-
+ The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
+ TRUNCATE.
+ timing:
+ type: string
+ title: timing
+ description: The timing is the timing of the trigger, such as BEFORE, AFTER.
+ body:
+ type: string
+ title: body
+ description: The body is the body of the trigger.
+ sqlMode:
+ type: string
+ title: sql_mode
+ description: The SQL mode setting for the trigger.
+ characterSetClient:
+ type: string
+ title: character_set_client
+ description: The character set used by the client creating the trigger.
+ collationConnection:
+ type: string
+ title: collation_connection
+ description: The collation used for the connection when creating the trigger.
+ comment:
+ type: string
+ title: comment
+ description: The comment describing the trigger.
+ skipDump:
+ type: boolean
+ title: skip_dump
+ description: Whether to skip this trigger during schema dump operations.
+ title: TriggerMetadata
+ additionalProperties: false
+ bytebase.v1.UndeleteInstanceRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the deleted instance.
+ Format: instances/{instance}
+ title: UndeleteInstanceRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.UndeleteProjectRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the deleted project.
+ Format: projects/{project}
+ title: UndeleteProjectRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.UndeleteReleaseRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the deleted release.
+ Format: projects/{project}/releases/{release}
+ title: UndeleteReleaseRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.UndeleteUserRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the deleted user.
+ Format: users/{email}
+ title: UndeleteUserRequest
+ required:
+ - name
+ additionalProperties: false
+ bytebase.v1.UpdateActuatorInfoRequest:
+ type: object
+ properties:
+ actuator:
+ title: actuator
+ description: The actuator to update.
+ $ref: '#/components/schemas/bytebase.v1.ActuatorInfo'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the actuator is not found, a new actuator will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateActuatorInfoRequest
+ required:
+ - actuator
+ - updateMask
+ additionalProperties: false
+ description: Request message for updating actuator information.
+ bytebase.v1.UpdateDataSourceRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the instance to update a data source.
+ Format: instances/{instance}
+ dataSource:
+ title: data_source
+ description: Identified by data source ID.
+ $ref: '#/components/schemas/bytebase.v1.DataSource'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ validateOnly:
+ type: boolean
+ title: validate_only
+ description: Validate only also tests the data source connection.
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the data source is not found, a new data source will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateDataSourceRequest
+ required:
+ - name
+ - dataSource
+ additionalProperties: false
+ bytebase.v1.UpdateDatabaseCatalogRequest:
+ type: object
+ properties:
+ catalog:
+ title: catalog
+ description: |-
+ The database catalog to update.
+
+ The catalog's `name` field is used to identify the database catalog to update.
+ Format: instances/{instance}/databases/{database}/catalog
+ $ref: '#/components/schemas/bytebase.v1.DatabaseCatalog'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the database catalog is not found, a new database catalog will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateDatabaseCatalogRequest
+ required:
+ - catalog
+ additionalProperties: false
+ description: Request message for updating a database catalog.
+ bytebase.v1.UpdateDatabaseGroupRequest:
+ type: object
+ properties:
+ databaseGroup:
+ title: database_group
+ description: |-
+ The database group to update.
+
+ The database group's `name` field is used to identify the database group to update.
+ Format: projects/{project}/databaseGroups/{databaseGroup}
+ $ref: '#/components/schemas/bytebase.v1.DatabaseGroup'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the database group is not found, a new database group will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateDatabaseGroupRequest
+ required:
+ - databaseGroup
+ additionalProperties: false
+ description: Request message for updating a database group.
+ bytebase.v1.UpdateDatabaseRequest:
+ type: object
+ properties:
+ database:
+ title: database
+ description: |-
+ The database to update.
+
+ The database's `name` field is used to identify the database to update.
+ Format: instances/{instance}/databases/{database}
+ $ref: '#/components/schemas/bytebase.v1.Database'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the database is not found, a new database will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateDatabaseRequest
+ required:
+ - database
+ additionalProperties: false
+ bytebase.v1.UpdateEmailRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the user whose email to update.
+ Format: users/{email}
+ Note: This is the current (old) email address. The new email is specified in the 'email' field.
+ email:
+ type: string
+ title: email
+ description: The new email address.
+ title: UpdateEmailRequest
+ required:
+ - name
+ - email
+ additionalProperties: false
+ bytebase.v1.UpdateGroupRequest:
+ type: object
+ properties:
+ group:
+ title: group
+ description: |-
+ The group to update.
+
+ The group's `name` field is used to identify the group to update.
+ Format: groups/{email}
+ $ref: '#/components/schemas/bytebase.v1.Group'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the group is not found, a new group will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateGroupRequest
+ required:
+ - group
+ additionalProperties: false
+ description: Request message for updating a group.
+ bytebase.v1.UpdateIdentityProviderRequest:
+ type: object
+ properties:
+ identityProvider:
+ title: identity_provider
+ description: |-
+ The identity provider to update.
+
+ The identity provider's `name` field is used to identify the identity provider to update.
+ Format: idps/{identity_provider}
+ $ref: '#/components/schemas/bytebase.v1.IdentityProvider'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the identity provider is not found, a new identity provider will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateIdentityProviderRequest
+ required:
+ - identityProvider
+ additionalProperties: false
+ bytebase.v1.UpdateInstanceRequest:
+ type: object
+ properties:
+ instance:
+ title: instance
+ description: |-
+ The instance to update.
+
+ The instance's `name` field is used to identify the instance to update.
+ Format: instances/{instance}
+ $ref: '#/components/schemas/bytebase.v1.Instance'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the instance is not found, a new instance will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateInstanceRequest
+ required:
+ - instance
+ additionalProperties: false
+ bytebase.v1.UpdateIssueCommentRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The issue name
+ Format: projects/{project}/issues/{issue}
+ issueComment:
+ title: issue_comment
+ description: The comment to update.
+ $ref: '#/components/schemas/bytebase.v1.IssueComment'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the issue comment is not found, a new issue comment will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateIssueCommentRequest
+ required:
+ - parent
+ - updateMask
+ additionalProperties: false
+ bytebase.v1.UpdateIssueRequest:
+ type: object
+ properties:
+ issue:
+ title: issue
+ description: |-
+ The issue to update.
+
+ The issue's `name` field is used to identify the issue to update.
+ Format: projects/{project}/issues/{issue}
+ $ref: '#/components/schemas/bytebase.v1.Issue'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the issue is not found, a new issue will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateIssueRequest
+ required:
+ - issue
+ - updateMask
+ additionalProperties: false
+ bytebase.v1.UpdatePlanRequest:
+ type: object
+ properties:
+ plan:
+ title: plan
+ description: |-
+ The plan to update.
+
+ The plan's `name` field is used to identify the plan to update.
+ Format: projects/{project}/plans/{plan}
+ $ref: '#/components/schemas/bytebase.v1.Plan'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the plan is not found, a new plan will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdatePlanRequest
+ required:
+ - plan
+ - updateMask
+ additionalProperties: false
+ bytebase.v1.UpdatePolicyRequest:
+ type: object
+ properties:
+ policy:
+ title: policy
+ description: |-
+ The policy to update.
+
+ The policy's `name` field is used to identify the instance to update.
+ Format: {resource name}/policies/{policy type}
+ Workspace resource name: "".
+ Environment resource name: environments/environment-id.
+ Instance resource name: instances/instance-id.
+ Database resource name: instances/instance-id/databases/database-name.
+ $ref: '#/components/schemas/bytebase.v1.Policy'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the policy is not found, a new policy will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdatePolicyRequest
+ required:
+ - policy
+ additionalProperties: false
+ bytebase.v1.UpdateProjectRequest:
+ type: object
+ properties:
+ project:
+ title: project
+ description: |-
+ The project to update.
+
+ The project's `name` field is used to identify the project to update.
+ Format: projects/{project}
+ $ref: '#/components/schemas/bytebase.v1.Project'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the project is not found, a new project will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateProjectRequest
+ required:
+ - project
+ additionalProperties: false
+ bytebase.v1.UpdateReleaseRequest:
+ type: object
+ properties:
+ release:
+ title: release
+ description: The release to update.
+ $ref: '#/components/schemas/bytebase.v1.Release'
+ updateMask:
+ title: update_mask
+ description: The list of fields to be updated.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the release is not found, a new release will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateReleaseRequest
+ required:
+ - release
+ additionalProperties: false
+ bytebase.v1.UpdateReviewConfigRequest:
+ type: object
+ properties:
+ reviewConfig:
+ title: review_config
+ description: |-
+ The SQL review config to update.
+
+ The name field is used to identify the SQL review config to update.
+ $ref: '#/components/schemas/bytebase.v1.ReviewConfig'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the config is not found, a new config will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateReviewConfigRequest
+ required:
+ - reviewConfig
+ additionalProperties: false
+ bytebase.v1.UpdateRoleRequest:
+ type: object
+ properties:
+ role:
+ title: role
+ description: The role to update.
+ $ref: '#/components/schemas/bytebase.v1.Role'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the role is not found, a new role will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateRoleRequest
+ required:
+ - role
+ additionalProperties: false
+ bytebase.v1.UpdateSettingRequest:
+ type: object
+ properties:
+ setting:
+ title: setting
+ description: The setting to update.
+ $ref: '#/components/schemas/bytebase.v1.Setting'
+ validateOnly:
+ type: boolean
+ title: validate_only
+ description: |-
+ validate_only is a flag to indicate whether to validate the setting value,
+ server would not persist the setting value if it is true.
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ updateMask:
+ title: update_mask
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ title: UpdateSettingRequest
+ required:
+ - setting
+ additionalProperties: false
+ description: The request message for updating or creating a setting.
+ bytebase.v1.UpdateSubscriptionRequest:
+ type: object
+ properties:
+ license:
+ type: string
+ title: license
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the subscription is not found, a new subscription will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateSubscriptionRequest
+ additionalProperties: false
+ bytebase.v1.UpdateUserRequest:
+ type: object
+ properties:
+ user:
+ title: user
+ description: |-
+ The user to update.
+
+ The user's `name` field is used to identify the user to update.
+ Format: users/{email}
+ $ref: '#/components/schemas/bytebase.v1.User'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ otpCode:
+ type: string
+ title: otp_code
+ description: The otp_code is used to verify the user's identity by MFA.
+ nullable: true
+ regenerateTempMfaSecret:
+ type: boolean
+ title: regenerate_temp_mfa_secret
+ description: |-
+ The regenerate_temp_mfa_secret flag means to regenerate temporary MFA secret for user.
+ This is used for MFA setup. The temporary MFA secret and recovery codes will be returned in the response.
+ regenerateRecoveryCodes:
+ type: boolean
+ title: regenerate_recovery_codes
+ description: The regenerate_recovery_codes flag means to regenerate recovery codes for user.
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the user is not found, a new user will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateUserRequest
+ required:
+ - user
+ additionalProperties: false
+ bytebase.v1.UpdateWebhookRequest:
+ type: object
+ properties:
+ webhook:
+ title: webhook
+ description: The webhook to modify.
+ $ref: '#/components/schemas/bytebase.v1.Webhook'
+ updateMask:
+ title: update_mask
+ description: The list of fields to update.
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the webhook is not found, a new webhook will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateWebhookRequest
+ required:
+ - webhook
+ additionalProperties: false
+ bytebase.v1.UpdateWorksheetOrganizerRequest:
+ type: object
+ properties:
+ organizer:
+ title: organizer
+ description: |-
+ The organizer to update.
+
+ The organizer's `worksheet` field is used to identify the worksheet.
+ Format: worksheets/{worksheet}
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ updateMask:
+ title: update_mask
+ description: |-
+ The list of fields to be updated.
+ Fields are specified relative to the worksheet organizer.
+ Only support update the following fields for now:
+ - `starred`
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the worksheet organizer is not found, a new worksheet organizer will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateWorksheetOrganizerRequest
+ required:
+ - organizer
+ additionalProperties: false
+ bytebase.v1.UpdateWorksheetRequest:
+ type: object
+ properties:
+ worksheet:
+ title: worksheet
+ description: |-
+ The worksheet to update.
+
+ The worksheet's `name` field is used to identify the worksheet to update.
+ Format: worksheets/{worksheet}
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ updateMask:
+ title: update_mask
+ description: |-
+ The list of fields to be updated.
+ Fields are specified relative to the worksheet.
+ (e.g., `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`)
+ Only support update the following fields for now:
+ - `title`
+ - `statement`
+ - `starred`
+ - `visibility`
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ title: UpdateWorksheetRequest
+ required:
+ - worksheet
+ additionalProperties: false
+ bytebase.v1.User:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the user.
+ Format: users/{email}
+ readOnly: true
+ state:
+ title: state
+ description: The lifecycle state of the user account.
+ $ref: '#/components/schemas/bytebase.v1.State'
+ email:
+ type: string
+ title: email
+ description: The email address of the user, used for login and notifications.
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The display title or full name of the user.
+ userType:
+ title: user_type
+ description: The type of user account.
+ $ref: '#/components/schemas/bytebase.v1.UserType'
+ password:
+ type: string
+ title: password
+ description: The password for authentication. Only used during user creation or password updates.
+ writeOnly: true
+ serviceKey:
+ type: string
+ title: service_key
+ description: The service key for service account authentication. Only used for service accounts.
+ writeOnly: true
+ mfaEnabled:
+ type: boolean
+ title: mfa_enabled
+ description: The mfa_enabled flag means if the user has enabled MFA.
+ tempOtpSecret:
+ type: string
+ title: temp_otp_secret
+ description: Temporary OTP secret used during MFA setup and regeneration.
+ tempRecoveryCodes:
+ type: array
+ items:
+ type: string
+ title: temp_recovery_codes
+ description: Temporary recovery codes used during MFA setup and regeneration.
+ tempOtpSecretCreatedTime:
+ title: temp_otp_secret_created_time
+ description: Timestamp when temp_otp_secret was created. Used by frontend to show countdown timer.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ phone:
+ type: string
+ title: phone
+ description: |-
+ Should be a valid E.164 compliant phone number.
+ Could be empty.
+ profile:
+ title: profile
+ description: User profile metadata.
+ $ref: '#/components/schemas/bytebase.v1.User.Profile'
+ groups:
+ type: array
+ items:
+ type: string
+ readOnly: true
+ title: groups
+ description: |-
+ The groups for the user.
+ Format: groups/{email}
+ readOnly: true
+ workloadIdentityConfig:
+ title: workload_identity_config
+ description: Workload Identity configuration (only for WORKLOAD_IDENTITY type)
+ $ref: '#/components/schemas/bytebase.v1.WorkloadIdentityConfig'
+ title: User
+ additionalProperties: false
+ bytebase.v1.User.Profile:
+ type: object
+ properties:
+ lastLoginTime:
+ title: last_login_time
+ description: The last time the user successfully logged in.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ lastChangePasswordTime:
+ title: last_change_password_time
+ description: The last time the user changed their password.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ source:
+ type: string
+ title: source
+ description: source means where the user comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID.
+ title: Profile
+ additionalProperties: false
+ bytebase.v1.UserType:
+ type: string
+ title: UserType
+ enum:
+ - USER_TYPE_UNSPECIFIED
+ - USER
+ - SYSTEM_BOT
+ - SERVICE_ACCOUNT
+ - WORKLOAD_IDENTITY
+ bytebase.v1.VCSType:
+ type: string
+ title: VCSType
+ enum:
+ - VCS_TYPE_UNSPECIFIED
+ - GITHUB
+ - GITLAB
+ - BITBUCKET
+ - AZURE_DEVOPS
+ description: Version control system type.
+ bytebase.v1.ViewMetadata:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: The name is the name of a view.
+ definition:
+ type: string
+ title: definition
+ description: The definition is the definition of a view.
+ comment:
+ type: string
+ title: comment
+ description: The comment is the comment of a view.
+ dependencyColumns:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.DependencyColumn'
+ title: dependency_columns
+ description: The dependency_columns is the list of dependency columns of a view.
+ columns:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.ColumnMetadata'
+ title: columns
+ description: The columns is the ordered list of columns in a table.
+ triggers:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.TriggerMetadata'
+ title: triggers
+ description: The triggers is the list of triggers in a view.
+ skipDump:
+ type: boolean
+ title: skip_dump
+ title: ViewMetadata
+ additionalProperties: false
+ description: ViewMetadata is the metadata for views.
+ bytebase.v1.Webhook:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ name is the name of the webhook, generated by the server.
+ format: projects/{project}/webhooks/{webhook}
+ type:
+ title: type
+ description: |-
+ Webhook integration type.
+ type is the type of the webhook.
+ $ref: '#/components/schemas/bytebase.v1.WebhookType'
+ title:
+ type: string
+ title: title
+ description: title is the title of the webhook.
+ url:
+ type: string
+ title: url
+ description: url is the url of the webhook, should be unique within the project.
+ directMessage:
+ type: boolean
+ title: direct_message
+ description: |-
+ if direct_message is set, the notification is sent directly
+ to the persons and url will be ignored.
+ IM integration setting should be set for this function to work.
+ notificationTypes:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Activity.Type'
+ title: notification_types
+ description: |-
+ (UNORDERED_LIST) notification_types is the list of activities types that the webhook is interested in.
+ Bytebase will only send notifications to the webhook if the activity type is in the list.
+ It should not be empty, and should be a subset of the following:
+ - ISSUE_CREATED
+ - ISSUE_APPROVAL_REQUESTED
+ - ISSUE_SENT_BACK
+ - PIPELINE_FAILED
+ - PIPELINE_COMPLETED
+ title: Webhook
+ required:
+ - type
+ - title
+ - url
+ additionalProperties: false
+ bytebase.v1.WebhookType:
+ type: string
+ title: WebhookType
+ enum:
+ - WEBHOOK_TYPE_UNSPECIFIED
+ - SLACK
+ - DISCORD
+ - TEAMS
+ - DINGTALK
+ - FEISHU
+ - WECOM
+ - LARK
+ description: Webhook integration type.
+ bytebase.v1.WorkloadIdentityConfig:
+ type: object
+ properties:
+ providerType:
+ title: provider_type
+ description: Platform type (currently only GITHUB is supported)
+ $ref: '#/components/schemas/bytebase.v1.WorkloadIdentityConfig.ProviderType'
+ issuerUrl:
+ type: string
+ title: issuer_url
+ description: OIDC Issuer URL (auto-filled based on provider_type, can be overridden)
+ allowedAudiences:
+ type: array
+ items:
+ type: string
+ title: allowed_audiences
+ description: Allowed audiences for token validation
+ subjectPattern:
+ type: string
+ title: subject_pattern
+ description: Subject pattern to match (e.g., "repo:owner/repo:ref:refs/heads/main")
+ title: WorkloadIdentityConfig
+ additionalProperties: false
+ description: WorkloadIdentityConfig for API layer
+ bytebase.v1.WorkloadIdentityConfig.ProviderType:
+ type: string
+ title: ProviderType
+ enum:
+ - PROVIDER_TYPE_UNSPECIFIED
+ - GITHUB
+ - GITLAB
+ description: ProviderType identifies the CI/CD platform.
+ bytebase.v1.Worksheet:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ (IMMUTABLE) The name of the worksheet resource, generated by the server.
+ Canonical parent is project.
+ Format: worksheets/{worksheet}
+ project:
+ type: string
+ title: project
+ description: |-
+ The project resource name.
+ Format: projects/{project}
+ database:
+ type: string
+ title: database
+ description: |-
+ The database resource name.
+ Format: instances/{instance}/databases/{database}
+ If the database parent doesn't exist, the database field is empty.
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The title of the worksheet.
+ creator:
+ type: string
+ title: creator
+ description: |-
+ The creator of the Worksheet.
+ Format: users/{email}
+ readOnly: true
+ createTime:
+ title: create_time
+ description: The create time of the worksheet.
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ updateTime:
+ title: update_time
+ description: The last update time of the worksheet.
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ content:
+ type: string
+ title: content
+ format: byte
+ description: |-
+ The content of the worksheet.
+ By default, it will be cut off in SearchWorksheet() method. If it doesn't match the `content_size`, you can
+ use GetWorksheet() request to retrieve the full content.
+ contentSize:
+ type:
+ - integer
+ - string
+ title: content_size
+ format: int64
+ description: content_size is the full size of the content, may not match the size of the `content` field.
+ readOnly: true
+ visibility:
+ title: visibility
+ $ref: '#/components/schemas/bytebase.v1.Worksheet.Visibility'
+ starred:
+ type: boolean
+ title: starred
+ description: starred indicates whether the worksheet is starred by the current authenticated user.
+ readOnly: true
+ folders:
+ type: array
+ items:
+ type: string
+ readOnly: true
+ title: folders
+ readOnly: true
+ title: Worksheet
+ required:
+ - name
+ - project
+ - title
+ - content
+ - visibility
+ additionalProperties: false
+ bytebase.v1.Worksheet.Visibility:
+ type: string
+ title: Visibility
+ enum:
+ - VISIBILITY_UNSPECIFIED
+ - PROJECT_READ
+ - PROJECT_WRITE
+ - PRIVATE
+ bytebase.v1.WorksheetOrganizer:
+ type: object
+ properties:
+ worksheet:
+ type: string
+ title: worksheet
+ description: |-
+ The name of the worksheet.
+ Format: worksheets/{worksheet}
+ starred:
+ type: boolean
+ title: starred
+ description: starred means if the worksheet is starred.
+ folders:
+ type: array
+ items:
+ type: string
+ title: folders
+ title: WorksheetOrganizer
+ required:
+ - worksheet
+ additionalProperties: false
+ bytebase.v1.WorkspaceApprovalSetting:
+ type: object
+ properties:
+ rules:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.WorkspaceApprovalSetting.Rule'
+ title: rules
+ title: WorkspaceApprovalSetting
+ additionalProperties: false
+ bytebase.v1.WorkspaceApprovalSetting.Rule:
+ type: object
+ properties:
+ template:
+ title: template
+ $ref: '#/components/schemas/bytebase.v1.ApprovalTemplate'
+ condition:
+ title: condition
+ description: |-
+ The condition that is associated with the rule.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ The `source` field filters which rules apply. The `condition` field then evaluates with full context.
+
+ All supported variables:
+ statement.affected_rows: affected row count in the DDL/DML, support "==", "!=", "<", "<=", ">", ">=" operations.
+ statement.table_rows: table row count number, support "==", "!=", "<", "<=", ">", ">=" operations.
+ resource.environment_id: the environment resource id, support "==", "!=", "in [xx]", "!(in [xx])" operations.
+ resource.project_id: the project resource id, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
+ resource.db_engine: the database engine type, support "==", "!=", "in [xx]", "!(in [xx])" operations. Check the Engine enum for values.
+ statement.sql_type: the SQL type, support "==", "!=", "in [xx]", "!(in [xx])" operations.
+ resource.database_name: the database name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
+ resource.schema_name: the schema name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
+ resource.table_name: the table name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
+ statement.text: the SQL statement, support "contains()", "matches()", "startsWith()", "endsWith()" operations.
+ request.expiration_days: the role expiration days for the request, support "==", "!=", "<", "<=", ">", ">=" operations.
+ request.role: the request role full name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
+
+ When source is CHANGE_DATABASE, support: statement.*, resource.* (excluding request.*)
+ When source is CREATE_DATABASE, support: resource.environment_id, resource.project_id, resource.db_engine, resource.database_name
+ When source is EXPORT_DATA, support: resource.environment_id, resource.project_id, resource.db_engine, resource.database_name, resource.schema_name, resource.table_name
+ When source is REQUEST_ROLE, support: resource.project_id, request.expiration_days, request.role
+
+ For examples:
+ resource.environment_id == "prod" && statement.affected_rows >= 100
+ resource.table_name.matches("sensitive_.*") && resource.db_engine == "MYSQL"
+ $ref: '#/components/schemas/google.type.Expr'
+ source:
+ title: source
+ $ref: '#/components/schemas/bytebase.v1.WorkspaceApprovalSetting.Rule.Source'
+ title: Rule
+ additionalProperties: false
+ bytebase.v1.WorkspaceApprovalSetting.Rule.Source:
+ type: string
+ title: Source
+ enum:
+ - SOURCE_UNSPECIFIED
+ - CHANGE_DATABASE
+ - CREATE_DATABASE
+ - EXPORT_DATA
+ - REQUEST_ROLE
+ bytebase.v1.WorkspaceProfileSetting:
+ type: object
+ properties:
+ externalUrl:
+ type: string
+ title: external_url
+ description: The external URL is used for sso authentication callback.
+ disallowSignup:
+ type: boolean
+ title: disallow_signup
+ description: Disallow self-service signup, users can only be invited by the owner.
+ require2fa:
+ type: boolean
+ title: require_2fa
+ description: Require 2FA for all users.
+ refreshTokenDuration:
+ title: refresh_token_duration
+ description: The duration for refresh token. Default is 7 days.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ accessTokenDuration:
+ title: access_token_duration
+ description: The duration for access token. Default is 1 hour.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ announcement:
+ title: announcement
+ description: The setting of custom announcement
+ $ref: '#/components/schemas/bytebase.v1.Announcement'
+ maximumRoleExpiration:
+ title: maximum_role_expiration
+ description: The max duration for role expired.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ domains:
+ type: array
+ items:
+ type: string
+ title: domains
+ description: The workspace domain, e.g., bytebase.com.
+ enforceIdentityDomain:
+ type: boolean
+ title: enforce_identity_domain
+ description: Only user and group from the domains can be created and login.
+ databaseChangeMode:
+ title: database_change_mode
+ description: The workspace database change mode.
+ $ref: '#/components/schemas/bytebase.v1.DatabaseChangeMode'
+ disallowPasswordSignin:
+ type: boolean
+ title: disallow_password_signin
+ description: Whether to disallow password signin. (Except workspace admins)
+ enableMetricCollection:
+ type: boolean
+ title: enable_metric_collection
+ description: Whether to enable metric collection for the workspace.
+ inactiveSessionTimeout:
+ title: inactive_session_timeout
+ description: The session expiration time if not activity detected for the user. Value <= 0 means no limit.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ enableAuditLogStdout:
+ type: boolean
+ title: enable_audit_log_stdout
+ description: |-
+ Whether to enable audit logging to stdout in structured JSON format.
+ Requires TEAM or ENTERPRISE license.
+ watermark:
+ type: boolean
+ title: watermark
+ description: |-
+ Whether to display watermark on pages.
+ Requires ENTERPRISE license.
+ directorySyncToken:
+ type: string
+ title: directory_sync_token
+ description: The token for directory sync authentication.
+ brandingLogo:
+ type: string
+ title: branding_logo
+ description: The branding logo as a data URI (e.g. data:image/png;base64,...).
+ passwordRestriction:
+ title: password_restriction
+ description: Password restriction settings.
+ $ref: '#/components/schemas/bytebase.v1.WorkspaceProfileSetting.PasswordRestriction'
+ title: WorkspaceProfileSetting
+ additionalProperties: false
+ bytebase.v1.WorkspaceProfileSetting.PasswordRestriction:
+ type: object
+ properties:
+ minLength:
+ type: integer
+ title: min_length
+ format: int32
+ description: min_length is the minimum length for password, should no less than 8.
+ requireNumber:
+ type: boolean
+ title: require_number
+ description: require_number requires the password must contains at least one number.
+ requireLetter:
+ type: boolean
+ title: require_letter
+ description: require_letter requires the password must contains at least one letter, regardless of upper case or lower case
+ requireUppercaseLetter:
+ type: boolean
+ title: require_uppercase_letter
+ description: require_uppercase_letter requires the password must contains at least one upper case letter.
+ requireSpecialCharacter:
+ type: boolean
+ title: require_special_character
+ description: require_special_character requires the password must contains at least one special character.
+ requireResetPasswordForFirstLogin:
+ type: boolean
+ title: require_reset_password_for_first_login
+ description: require_reset_password_for_first_login requires users to reset their password after the 1st login.
+ passwordRotation:
+ title: password_rotation
+ description: password_rotation requires users to reset their password after the duration.
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ title: PasswordRestriction
+ additionalProperties: false
+ google.api.expr.v1alpha1.Constant:
+ type: object
+ oneOf:
+ - properties:
+ boolValue:
+ type: boolean
+ title: bool_value
+ description: boolean value.
+ title: bool_value
+ required:
+ - boolValue
+ - properties:
+ bytesValue:
+ type: string
+ title: bytes_value
+ format: byte
+ description: bytes value.
+ title: bytes_value
+ required:
+ - bytesValue
+ - properties:
+ doubleValue:
+ type: number
+ title: double_value
+ format: double
+ description: double value.
+ title: double_value
+ required:
+ - doubleValue
+ - properties:
+ durationValue:
+ title: duration_value
+ description: |-
+ protobuf.Duration value.
+
+ Deprecated: duration is no longer considered a builtin cel type.
+ deprecated: true
+ $ref: '#/components/schemas/google.protobuf.Duration'
+ title: duration_value
+ required:
+ - durationValue
+ - properties:
+ int64Value:
+ type:
+ - integer
+ - string
+ title: int64_value
+ format: int64
+ description: int64 value.
+ title: int64_value
+ required:
+ - int64Value
+ - properties:
+ nullValue:
+ title: null_value
+ description: null value.
+ $ref: '#/components/schemas/google.protobuf.NullValue'
+ title: null_value
+ required:
+ - nullValue
+ - properties:
+ stringValue:
+ type: string
+ title: string_value
+ description: string value.
+ title: string_value
+ required:
+ - stringValue
+ - properties:
+ timestampValue:
+ title: timestamp_value
+ description: |-
+ protobuf.Timestamp value.
+
+ Deprecated: timestamp is no longer considered a builtin cel type.
+ deprecated: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ title: timestamp_value
+ required:
+ - timestampValue
+ - properties:
+ uint64Value:
+ type:
+ - integer
+ - string
+ title: uint64_value
+ format: int64
+ description: uint64 value.
+ title: uint64_value
+ required:
+ - uint64Value
+ title: Constant
+ additionalProperties: false
+ description: |-
+ Represents a primitive literal.
+
+ Named 'Constant' here for backwards compatibility.
+
+ This is similar as the primitives supported in the well-known type
+ `google.protobuf.Value`, but richer so it can represent CEL's full range of
+ primitives.
+
+ Lists and structs are not included as constants as these aggregate types may
+ contain [Expr][google.api.expr.v1alpha1.Expr] elements which require
+ evaluation and are thus not constant.
+
+ Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`,
+ `true`, `null`.
+ google.api.expr.v1alpha1.Expr:
+ type: object
+ allOf:
+ - properties:
+ id:
+ type:
+ - integer
+ - string
+ title: id
+ format: int64
+ description: |-
+ Required. An id assigned to this node by the parser which is unique in a
+ given expression tree. This is used to associate type information and other
+ attributes to a node in the parse tree.
+ - oneOf:
+ - properties:
+ callExpr:
+ title: call_expr
+ description: A call expression, including calls to predefined functions and operators.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.Call'
+ title: call_expr
+ required:
+ - callExpr
+ - properties:
+ comprehensionExpr:
+ title: comprehension_expr
+ description: A comprehension expression.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.Comprehension'
+ title: comprehension_expr
+ required:
+ - comprehensionExpr
+ - properties:
+ constExpr:
+ title: const_expr
+ description: A literal expression.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Constant'
+ title: const_expr
+ required:
+ - constExpr
+ - properties:
+ identExpr:
+ title: ident_expr
+ description: An identifier expression.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.Ident'
+ title: ident_expr
+ required:
+ - identExpr
+ - properties:
+ listExpr:
+ title: list_expr
+ description: A list creation expression.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.CreateList'
+ title: list_expr
+ required:
+ - listExpr
+ - properties:
+ selectExpr:
+ title: select_expr
+ description: A field selection expression, e.g. `request.auth`.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.Select'
+ title: select_expr
+ required:
+ - selectExpr
+ - properties:
+ structExpr:
+ title: struct_expr
+ description: A map or message creation expression.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.CreateStruct'
+ title: struct_expr
+ required:
+ - structExpr
+ title: Expr
+ additionalProperties: false
+ description: |-
+ An abstract representation of a common expression.
+
+ Expressions are abstractly represented as a collection of identifiers,
+ select statements, function calls, literals, and comprehensions. All
+ operators with the exception of the '.' operator are modelled as function
+ calls. This makes it easy to represent new operators into the existing AST.
+
+ All references within expressions must resolve to a
+ [Decl][google.api.expr.v1alpha1.Decl] provided at type-check for an
+ expression to be valid. A reference may either be a bare identifier `name` or
+ a qualified identifier `google.api.name`. References may either refer to a
+ value or a function declaration.
+
+ For example, the expression `google.api.name.startsWith('expr')` references
+ the declaration `google.api.name` within a
+ [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and the
+ function declaration `startsWith`.
+ google.api.expr.v1alpha1.Expr.Call:
+ type: object
+ properties:
+ target:
+ title: target
+ description: |-
+ The target of an method call-style expression. For example, `x` in
+ `x.f()`.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ function:
+ type: string
+ title: function
+ description: Required. The name of the function or method being called.
+ args:
+ type: array
+ items:
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ title: args
+ description: The arguments.
+ title: Call
+ additionalProperties: false
+ description: |-
+ A call expression, including calls to predefined functions and operators.
+
+ For example, `value == 10`, `size(map_value)`.
+ google.api.expr.v1alpha1.Expr.Comprehension:
+ type: object
+ properties:
+ iterVar:
+ type: string
+ title: iter_var
+ description: |-
+ The name of the first iteration variable.
+ When the iter_range is a list, this variable is the list element.
+ When the iter_range is a map, this variable is the map entry key.
+ iterVar2:
+ type: string
+ title: iter_var2
+ description: |-
+ The name of the second iteration variable, empty if not set.
+ When the iter_range is a list, this variable is the integer index.
+ When the iter_range is a map, this variable is the map entry value.
+ This field is only set for comprehension v2 macros.
+ iterRange:
+ title: iter_range
+ description: The range over which the comprehension iterates.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ accuVar:
+ type: string
+ title: accu_var
+ description: The name of the variable used for accumulation of the result.
+ accuInit:
+ title: accu_init
+ description: The initial value of the accumulator.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ loopCondition:
+ title: loop_condition
+ description: |-
+ An expression which can contain iter_var, iter_var2, and accu_var.
+
+ Returns false when the result has been computed and may be used as
+ a hint to short-circuit the remainder of the comprehension.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ loopStep:
+ title: loop_step
+ description: |-
+ An expression which can contain iter_var, iter_var2, and accu_var.
+
+ Computes the next value of accu_var.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ result:
+ title: result
+ description: |-
+ An expression which can contain accu_var.
+
+ Computes the result.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ title: Comprehension
+ additionalProperties: false
+ description: |-
+ A comprehension expression applied to a list or map.
+
+ Comprehensions are not part of the core syntax, but enabled with macros.
+ A macro matches a specific call signature within a parsed AST and replaces
+ the call with an alternate AST block. Macro expansion happens at parse
+ time.
+
+ The following macros are supported within CEL:
+
+ Aggregate type macros may be applied to all elements in a list or all keys
+ in a map:
+
+ * `all`, `exists`, `exists_one` - test a predicate expression against
+ the inputs and return `true` if the predicate is satisfied for all,
+ any, or only one value `list.all(x, x < 10)`.
+ * `filter` - test a predicate expression against the inputs and return
+ the subset of elements which satisfy the predicate:
+ `payments.filter(p, p > 1000)`.
+ * `map` - apply an expression to all elements in the input and return the
+ output aggregate type: `[1, 2, 3].map(i, i * i)`.
+
+ The `has(m.x)` macro tests whether the property `x` is present in struct
+ `m`. The semantics of this macro depend on the type of `m`. For proto2
+ messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the
+ macro tests whether the property is set to its default. For map and struct
+ types, the macro tests whether the property `x` is defined on `m`.
+
+ Comprehensions for the standard environment macros evaluation can be best
+ visualized as the following pseudocode:
+
+ ```
+ let `accu_var` = `accu_init`
+ for (let `iter_var` in `iter_range`) {
+ if (!`loop_condition`) {
+ break
+ }
+ `accu_var` = `loop_step`
+ }
+ return `result`
+ ```
+
+ Comprehensions for the optional V2 macros which support map-to-map
+ translation differ slightly from the standard environment macros in that
+ they expose both the key or index in addition to the value for each list
+ or map entry:
+
+ ```
+ let `accu_var` = `accu_init`
+ for (let `iter_var`, `iter_var2` in `iter_range`) {
+ if (!`loop_condition`) {
+ break
+ }
+ `accu_var` = `loop_step`
+ }
+ return `result`
+ ```
+ google.api.expr.v1alpha1.Expr.CreateList:
+ type: object
+ properties:
+ elements:
+ type: array
+ items:
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ title: elements
+ description: The elements part of the list.
+ optionalIndices:
+ type: array
+ items:
+ type: integer
+ format: int32
+ title: optional_indices
+ description: |-
+ The indices within the elements list which are marked as optional
+ elements.
+
+ When an optional-typed value is present, the value it contains
+ is included in the list. If the optional-typed value is absent, the list
+ element is omitted from the CreateList result.
+ title: CreateList
+ additionalProperties: false
+ description: |-
+ A list creation expression.
+
+ Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogeneous, e.g.
+ `dyn([1, 'hello', 2.0])`
+ google.api.expr.v1alpha1.Expr.CreateStruct:
+ type: object
+ properties:
+ messageName:
+ type: string
+ title: message_name
+ description: |-
+ The type name of the message to be created, empty when creating map
+ literals.
+ entries:
+ type: array
+ items:
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr.CreateStruct.Entry'
+ title: entries
+ description: The entries in the creation expression.
+ title: CreateStruct
+ additionalProperties: false
+ description: |-
+ A map or message creation expression.
+
+ Maps are constructed as `{'key_name': 'value'}`. Message construction is
+ similar, but prefixed with a type name and composed of field ids:
+ `types.MyType{field_id: 'value'}`.
+ google.api.expr.v1alpha1.Expr.CreateStruct.Entry:
+ type: object
+ allOf:
+ - properties:
+ id:
+ type:
+ - integer
+ - string
+ title: id
+ format: int64
+ description: |-
+ Required. An id assigned to this node by the parser which is unique
+ in a given expression tree. This is used to associate type
+ information and other attributes to the node.
+ value:
+ title: value
+ description: |-
+ Required. The value assigned to the key.
+
+ If the optional_entry field is true, the expression must resolve to an
+ optional-typed value. If the optional value is present, the key will be
+ set; however, if the optional value is absent, the key will be unset.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ optionalEntry:
+ type: boolean
+ title: optional_entry
+ description: Whether the key-value pair is optional.
+ - oneOf:
+ - properties:
fieldKey:
- type: string
- description: The field key for a message creator statement.
+ type: string
+ title: field_key
+ description: The field key for a message creator statement.
+ title: field_key
+ required:
+ - fieldKey
+ - properties:
mapKey:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: The key expression for a map creation statement.
- value:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- Required. The value assigned to the key.
-
- If the optional_entry field is true, the expression must resolve to an
- optional-typed value. If the optional value is present, the key will be
- set; however, if the optional value is absent, the key will be unset.
- optionalEntry:
- type: boolean
- description: Whether the key-value pair is optional.
- description: Represents an entry.
- DataClassificationConfig_DataClassification:
- type: object
- properties:
- id:
- type: string
- description: id is the classification id in [0-9]+-[0-9]+-[0-9]+ format.
- title:
- type: string
- description:
- type: string
- levelId:
- type: string
- DataClassificationConfig_Level:
- type: object
- properties:
- id:
- type: string
- title:
- type: string
- description:
- type: string
- DataClassificationSetting:
- type: object
- properties:
- configs:
- type: array
- items:
- $ref: '#/components/schemas/DataClassificationSetting_DataClassificationConfig'
- DataClassificationSetting_DataClassificationConfig:
- type: object
- properties:
- id:
- type: string
- description: id is the uuid for classification. Each project can chose one classification config.
- title:
- type: string
- levels:
- type: array
- items:
- $ref: '#/components/schemas/DataClassificationConfig_Level'
- description: |-
- levels is user defined level list for classification.
- The order for the level decides its priority.
- classification:
- type: object
- additionalProperties:
- $ref: '#/components/schemas/DataClassificationConfig_DataClassification'
- description: |-
- classification is the id - DataClassification map.
- The id should in [0-9]+-[0-9]+-[0-9]+ format.
- DataSource:
- type: object
- properties:
- id:
- type: string
- description: The unique identifier for this data source.
- type:
- enum:
- - DATA_SOURCE_UNSPECIFIED
- - ADMIN
- - READ_ONLY
- type: string
- description: The type of data source (ADMIN or READ_ONLY).
- format: enum
- username:
- type: string
- description: The username for database authentication.
- password:
- writeOnly: true
- type: string
- description: The password for database authentication.
- useSsl:
- type: boolean
- description: Use SSL to connect to the data source. By default, we use system default SSL configuration.
- sslCa:
- writeOnly: true
- type: string
- description: The SSL certificate authority certificate.
- sslCert:
- writeOnly: true
- type: string
- description: The SSL client certificate.
- sslKey:
- writeOnly: true
- type: string
- description: The SSL client private key.
- verifyTlsCertificate:
- type: boolean
- description: |-
- verify_tls_certificate enables TLS certificate verification for SSL connections.
- Default is false (no verification) for backward compatibility.
- Set to true for secure connections (recommended for production).
- Only set to false for development or when certificates cannot be properly
- validated (e.g., self-signed certs, VPN environments).
- host:
- type: string
- description: The hostname or IP address of the database server.
- port:
- type: string
- description: The port number of the database server.
- database:
- type: string
- description: The name of the database to connect to.
- srv:
- type: boolean
- description: |-
- srv, authentication_database and replica_set are used for MongoDB.
- srv is a boolean flag that indicates whether the host is a DNS SRV record.
- authenticationDatabase:
- type: string
- description: authentication_database is the database name to authenticate against, which stores the user credentials.
- replicaSet:
- type: string
- description: replica_set is used for MongoDB replica set.
- sid:
- type: string
- description: sid and service_name are used for Oracle.
- serviceName:
- type: string
- sshHost:
- type: string
- description: |-
- Connection over SSH.
- The hostname of the SSH server agent.
- Required.
- sshPort:
- type: string
- description: |-
- The port of the SSH server agent. It's 22 typically.
- Required.
- sshUser:
- type: string
- description: |-
- The user to login the server.
- Required.
- sshPassword:
- writeOnly: true
- type: string
- description: The password to login the server. If it's empty string, no password is required.
- sshPrivateKey:
- writeOnly: true
- type: string
- description: The private key to login the server. If it's empty string, we will use the system default private key from os.Getenv("SSH_AUTH_SOCK").
- authenticationPrivateKey:
- writeOnly: true
- type: string
- description: |-
- PKCS#8 private key in PEM format. If it's empty string, no private key is required.
- Used for authentication when connecting to the data source.
- authenticationPrivateKeyPassphrase:
- writeOnly: true
- type: string
- description: Passphrase for the encrypted PKCS#8 private key. Only used when the private key is encrypted.
- externalSecret:
- $ref: '#/components/schemas/DataSourceExternalSecret'
- authenticationType:
- enum:
- - AUTHENTICATION_UNSPECIFIED
- - PASSWORD
- - GOOGLE_CLOUD_SQL_IAM
- - AWS_RDS_IAM
- - AZURE_IAM
- type: string
- format: enum
- azureCredential:
- $ref: '#/components/schemas/DataSource_AzureCredential'
- awsCredential:
- $ref: '#/components/schemas/DataSource_AWSCredential'
- gcpCredential:
- $ref: '#/components/schemas/DataSource_GCPCredential'
- saslConfig:
- $ref: '#/components/schemas/SASLConfig'
- additionalAddresses:
- type: array
- items:
- $ref: '#/components/schemas/DataSource_Address'
- description: additional_addresses is used for MongoDB replica set.
- directConnection:
- type: boolean
- description: direct_connection is used for MongoDB to dispatch all the operations to the node specified in the connection string.
- region:
- type: string
- description: region is the location of where the DB is, works for AWS RDS. For example, us-east-1.
- warehouseId:
- type: string
- description: warehouse_id is used by Databricks.
- masterName:
- type: string
- description: master_name is the master name used by connecting redis-master via redis sentinel.
- masterUsername:
- type: string
- description: master_username and master_password are master credentials used by redis sentinel mode.
- masterPassword:
- type: string
- redisType:
- enum:
- - REDIS_TYPE_UNSPECIFIED
- - STANDALONE
- - SENTINEL
- - CLUSTER
- type: string
- format: enum
- cluster:
- type: string
- description: Cluster is the cluster name for the data source. Used by CockroachDB.
- extraConnectionParameters:
- type: object
- additionalProperties:
- type: string
- description: |-
- Extra connection parameters for the database connection.
- For PostgreSQL HA, this can be used to set target_session_attrs=read-write
- DataSourceExternalSecret:
- type: object
- properties:
- secretType:
- enum:
- - SECRET_TYPE_UNSPECIFIED
- - VAULT_KV_V2
- - AWS_SECRETS_MANAGER
- - GCP_SECRET_MANAGER
- - AZURE_KEY_VAULT
- type: string
- description: The type of external secret store.
- format: enum
- url:
- type: string
- description: The URL of the external secret store.
- authType:
- enum:
- - AUTH_TYPE_UNSPECIFIED
- - TOKEN
- - VAULT_APP_ROLE
- type: string
- description: The authentication method for accessing the secret store.
- format: enum
- appRole:
- allOf:
- - $ref: '#/components/schemas/DataSourceExternalSecret_AppRoleAuthOption'
- description: AppRole authentication configuration.
- token:
- writeOnly: true
- type: string
- description: Token for direct authentication.
- engineName:
- type: string
- description: engine name is the name for secret engine.
- secretName:
- type: string
- description: the secret name in the engine to store the password.
- passwordKeyName:
- type: string
- description: the key name for the password.
- skipVaultTlsVerification:
- type: boolean
- description: |-
- TLS configuration for connecting to Vault server.
- These fields are separate from the database TLS configuration in DataSource.
- skip_vault_tls_verification disables TLS certificate verification for Vault connections.
- Default is false (verification enabled) for security.
- Only set to true for development or when certificates cannot be properly validated.
- vaultSslCa:
- writeOnly: true
- type: string
- description: CA certificate for Vault server verification.
- vaultSslCert:
- writeOnly: true
- type: string
- description: Client certificate for mutual TLS authentication with Vault.
- vaultSslKey:
- writeOnly: true
- type: string
- description: Client private key for mutual TLS authentication with Vault.
- DataSourceExternalSecret_AppRoleAuthOption:
- type: object
- properties:
- roleId:
- writeOnly: true
- type: string
- description: The role ID for Vault AppRole authentication.
- secretId:
- writeOnly: true
- type: string
- description: the secret id for the role without ttl.
- type:
- enum:
- - SECRET_TYPE_UNSPECIFIED
- - PLAIN
- - ENVIRONMENT
- type: string
- description: The type of secret for AppRole authentication.
- format: enum
- mountPath:
- type: string
- description: The path where the approle auth method is mounted.
- DataSourceQueryPolicy:
- type: object
- properties:
- adminDataSourceRestriction:
- enum:
- - RESTRICTION_UNSPECIFIED
- - FALLBACK
- - DISALLOW
- type: string
- description: Restriction for admin data source queries.
- format: enum
- disallowDdl:
- type: boolean
- description: Disallow running DDL statements in the SQL editor.
- disallowDml:
- type: boolean
- description: Disallow running DML statements in the SQL editor.
- description: Policy for controlling which data sources can be queried in the SQL editor.
- DataSource_AWSCredential:
- type: object
- properties:
- accessKeyId:
- writeOnly: true
- type: string
- secretAccessKey:
- writeOnly: true
- type: string
- sessionToken:
- writeOnly: true
- type: string
- roleArn:
- writeOnly: true
- type: string
- description: |-
- ARN of IAM role to assume for cross-account access.
- See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
- externalId:
- writeOnly: true
- type: string
- description: |-
- Optional external ID for additional security when assuming role.
- See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
- DataSource_Address:
- type: object
- properties:
- host:
- type: string
- port:
- type: string
- DataSource_AzureCredential:
- type: object
- properties:
- tenantId:
- type: string
- clientId:
- type: string
- clientSecret:
- writeOnly: true
- type: string
- DataSource_GCPCredential:
- type: object
- properties:
- content:
- writeOnly: true
- type: string
- Database:
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the database.
- Format: instances/{instance}/databases/{database}
- {database} is the database name in the instance.
- state:
- readOnly: true
- enum:
- - STATE_UNSPECIFIED
- - ACTIVE
- - DELETED
- type: string
- description: The existence of a database.
- format: enum
- successfulSyncTime:
- readOnly: true
- type: string
- description: The latest synchronization time.
- format: date-time
- project:
- type: string
- description: |-
- The project for a database.
- Format: projects/{project}
- schemaVersion:
- readOnly: true
- type: string
- description: The version of database schema.
- environment:
- type: string
- description: |-
- The environment resource.
- Format: environments/prod where prod is the environment resource ID.
- effectiveEnvironment:
- readOnly: true
- type: string
- description: |-
- The effective environment based on environment tag above and environment
- tag on the instance. Inheritance follows
- https://cloud.google.com/resource-manager/docs/tags/tags-overview.
- labels:
- type: object
- additionalProperties:
- type: string
- description: Labels will be used for deployment and policy control.
- instanceResource:
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/InstanceResource'
- description: The instance resource.
- backupAvailable:
- readOnly: true
- type: boolean
- description: The database is available for DML prior backup.
- drifted:
- readOnly: true
- type: boolean
- description: The schema is drifted from the source of truth.
- DatabaseCatalog:
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the database catalog.
- Format: instances/{instance}/databases/{database}/catalog
- schemas:
- type: array
- items:
- $ref: '#/components/schemas/SchemaCatalog'
- description: The schemas in the database.
- description: Catalog metadata for a database including schemas, tables, and columns.
- DatabaseGroup:
- required:
- - title
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the database group.
- Format: projects/{project}/databaseGroups/{databaseGroup}
- title:
- type: string
- description: The short name used in actual databases specified by users.
- databaseExpr:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- The condition that is associated with this database group.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Support variables:
- resource.environment_id: the environment resource id. Support "==", "!=", "in [XX]", "!(in [xx])" operations.
- resource.instance_id: the instance resource id. Support "==", "!=", "in [XX]", "!(in [xx])", "contains", "matches", "startsWith", "endsWith" operations.
- resource.database_name: the database name. Support "==", "!=", "in [XX]", "!(in [xx])", "contains", "matches", "startsWith", "endsWith" operations.
- resource.database_labels: the database labels. Support map access operations.
- All variables should join with "&&" condition.
-
- For example:
- resource.environment_id == "test" && resource.database_name.startsWith("sample_")
- resource.database_labels["tenant"] == "tenant1"
- matchedDatabases:
- readOnly: true
- type: array
- items:
- $ref: '#/components/schemas/DatabaseGroup_Database'
- description: The list of databases that match the database group condition.
- description: A group of databases matched by expressions.
- DatabaseGroup_Database:
- type: object
- properties:
- name:
- type: string
- description: |-
- The resource name of the database.
- Format: instances/{instance}/databases/{database}
- description: A database within a database group.
- DatabaseMetadata:
- type: object
- properties:
- name:
- type: string
- description: |-
- The database metadata name.
-
- Format: instances/{instance}/databases/{database}/metadata
- schemas:
- type: array
- items:
- $ref: '#/components/schemas/SchemaMetadata'
- description: The schemas is the list of schemas in a database.
- characterSet:
- type: string
- description: The character_set is the character set of a database.
- collation:
- type: string
- description: The collation is the collation of a database.
- extensions:
- type: array
- items:
- $ref: '#/components/schemas/ExtensionMetadata'
- description: The extensions is the list of extensions in a database.
- owner:
- type: string
- description: The owner of the database.
- searchPath:
- type: string
- description: The search_path is the search path of a PostgreSQL database.
- description: DatabaseMetadata is the metadata for databases.
- DatabaseSDLSchema:
- type: object
- properties:
- schema:
- type: string
- description: |-
- The SDL schema content.
- - For SINGLE_FILE format: contains the complete SDL schema as a text string.
- - For MULTI_FILE format: contains the ZIP archive as binary data.
- format: bytes
- contentType:
- readOnly: true
- type: string
- description: |-
- The MIME type of the schema content.
- Indicates how the client should interpret the schema field.
- Examples:
- - "text/plain; charset=utf-8" for SINGLE_FILE format
- - "application/zip" for MULTI_FILE format
- description: DatabaseSDLSchema contains the schema in SDL format.
- DatabaseSchema:
- type: object
- properties:
- schema:
- type: string
- description: The schema dump from database.
- description: DatabaseSchema is the metadata for databases.
- DependencyColumn:
- type: object
- properties:
- schema:
- type: string
- description: The schema is the schema of a reference column.
- table:
- type: string
- description: The table is the table of a reference column.
- column:
- type: string
- description: The column is the name of a reference column.
- description: DependencyColumn is the metadata for dependency columns.
- DependencyTable:
- type: object
- properties:
- schema:
- type: string
- description: The schema is the schema of a reference table.
- table:
- type: string
- description: The table is the name of a reference table.
- DiffMetadataRequest:
- required:
- - sourceMetadata
- - targetMetadata
- type: object
- properties:
- sourceMetadata:
- allOf:
- - $ref: '#/components/schemas/DatabaseMetadata'
- description: The metadata of the source schema.
- targetMetadata:
- allOf:
- - $ref: '#/components/schemas/DatabaseMetadata'
- description: The metadata of the target schema.
- engine:
- enum:
- - ENGINE_UNSPECIFIED
- - CLICKHOUSE
- - MYSQL
- - POSTGRES
- - SNOWFLAKE
- - SQLITE
- - TIDB
- - MONGODB
- - REDIS
- - ORACLE
- - SPANNER
- - MSSQL
- - REDSHIFT
- - MARIADB
- - OCEANBASE
- - STARROCKS
- - DORIS
- - HIVE
- - ELASTICSEARCH
- - BIGQUERY
- - DYNAMODB
- - DATABRICKS
- - COCKROACHDB
- - COSMOSDB
- - TRINO
- - CASSANDRA
- type: string
- description: The database engine of the schema.
- format: enum
- DiffMetadataResponse:
- type: object
- properties:
- diff:
- type: string
- description: The diff of the metadata.
- DiffSchemaRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the database or changelog.
- Format:
- database: instances/{instance}/databases/{database}
- changelog: instances/{instance}/databases/{database}/changelogs/{changelog}
- schema:
- type: string
- description: The target schema.
- changelog:
- type: string
- description: |-
- The resource name of the changelog
- Format:
- instances/{instance}/databases/{database}/changelogs/{changelog}
- DiffSchemaResponse:
- type: object
- properties:
- diff:
- type: string
- DimensionConstraint:
- type: object
- properties:
- dimension:
- type: string
- description: Dimension name/type (X, Y, Z, M, etc.)
- minValue:
- type: number
- description: Minimum value for this dimension
- format: double
- maxValue:
- type: number
- description: Maximum value for this dimension
- format: double
- tolerance:
- type: number
- description: Tolerance for this dimension
- format: double
- description: DimensionConstraint defines constraints for a spatial dimension.
- DimensionalConfig:
- type: object
- properties:
- dimensions:
- type: integer
- description: Number of dimensions (2-4, default 2)
- format: int32
- dataType:
- type: string
- description: Spatial data type (GEOMETRY, GEOGRAPHY, POINT, POLYGON, etc.)
- srid:
- type: integer
- description: Spatial reference system identifier (SRID)
- format: int32
- constraints:
- type: array
- items:
- $ref: '#/components/schemas/DimensionConstraint'
- description: Coordinate system constraints
- description: DimensionalConfig defines dimensional and constraint parameters for spatial indexes.
- EnumTypeMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name of a type.
- values:
- type: array
- items:
- type: string
- description: The enum values of a type.
- comment:
- type: string
- description: The comment describing the enum type.
- skipDump:
- type: boolean
- description: Whether to skip this enum type during schema dump operations.
- EnvironmentSetting:
- type: object
- properties:
- environments:
- type: array
- items:
- $ref: '#/components/schemas/EnvironmentSetting_Environment'
- EnvironmentSetting_Environment:
- type: object
- properties:
- name:
- readOnly: true
- type: string
- description: |-
- The resource name of the environment.
- Format: environments/{environment}.
- Output only.
- id:
- type: string
- description: |-
- The resource id of the environment.
- This value should be 4-63 characters, and valid characters
- are /[a-z][0-9]-/.
- title:
- type: string
- description: The display name of the environment.
- tags:
- type: object
- additionalProperties:
- type: string
- color:
- type: string
- EventMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name of the event.
- definition:
- type: string
- description: The schedule of the event.
- timeZone:
- type: string
- description: The time zone of the event.
- sqlMode:
- type: string
- description: The SQL mode setting for the event.
- characterSetClient:
- type: string
- description: The character set used by the client creating the event.
- collationConnection:
- type: string
- description: The collation used for the connection when creating the event.
- comment:
- type: string
- description: The comment is the comment of an event.
- ExchangeTokenRequest:
- type: object
- properties:
- token:
- type: string
- description: External OIDC token (JWT) from CI/CD platform.
- email:
- type: string
- description: |-
- Workload Identity email for identifying which identity to authenticate as.
- Format: {name}@workload.bytebase.com
- ExchangeTokenResponse:
- type: object
- properties:
- accessToken:
- type: string
- description: Bytebase access token.
- ExportAuditLogsRequest:
- required:
- - parent
- type: object
- properties:
- parent:
- type: string
- filter:
- type: string
- description: |-
- The filter of the log. It should be a valid CEL expression.
- Check the filter field in the SearchAuditLogsRequest message.
- orderBy:
- type: string
- description: |-
- The order by of the log.
- Only support order by create_time. The default sorting order is ascending.
- For example:
- - order_by = "create_time asc"
- - order_by = "create_time desc"
- format:
- enum:
- - FORMAT_UNSPECIFIED
- - CSV
- - JSON
- - SQL
- - XLSX
- type: string
- description: The export format.
- format: enum
- pageSize:
- type: integer
- description: |-
- The maximum number of logs to return.
- The service may return fewer than this value.
- If unspecified, at most 10 log entries will be returned.
- The maximum value is 5000; values above 5000 will be coerced to 5000.
- format: int32
- pageToken:
- type: string
- description: |-
- A page token, received from a previous `ExportAuditLogs` call.
- Provide this to retrieve the subsequent page.
- description: Request message for exporting audit logs.
- ExportAuditLogsResponse:
- type: object
- properties:
- content:
- type: string
- description: The exported audit log content in the requested format.
- format: bytes
- nextPageToken:
- type: string
- description: |-
- A token to retrieve next page of log entities.
- Pass this value in the page_token field in the subsequent call
- to retrieve the next page of log entities.
- description: Response message for exporting audit logs.
- ExportRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name is the resource name to execute the export against.
- Format: instances/{instance}/databases/{database}
- Format: instances/{instance}
- Format: projects/{project}/rollouts/{rollout}
- Format: projects/{project}/rollouts/{rollout}/stages/{stage}
- statement:
- type: string
- description: The SQL statement to execute.
- limit:
- type: integer
- description: The maximum number of rows to return.
- format: int32
- format:
- enum:
- - FORMAT_UNSPECIFIED
- - CSV
- - JSON
- - SQL
- - XLSX
- type: string
- description: The export format.
- format: enum
- admin:
- type: boolean
- description: |-
- The admin is used for workspace owner and DBA for exporting data from SQL
- Editor Admin mode. The exported data is not masked.
- password:
- type: string
- description: The zip password provide by users.
- dataSourceId:
- type: string
- description: |-
- The id of data source.
- It is used for querying admin data source even if the instance has
- read-only data sources. Or it can be used to query a specific read-only
- data source.
- schema:
- type: string
- description: |-
- The default schema to search objects. Equals to the current schema in
- Oracle and search path in Postgres.
- ExportResponse:
- type: object
- properties:
- content:
- type: string
- description: The export file content.
- format: bytes
- Expr:
- type: object
- properties:
- id:
- type: string
- description: |-
- Required. An id assigned to this node by the parser which is unique in a
- given expression tree. This is used to associate type information and other
- attributes to a node in the parse tree.
- constExpr:
- allOf:
- - $ref: '#/components/schemas/Constant'
- description: A literal expression.
- identExpr:
- allOf:
- - $ref: '#/components/schemas/Expr_Ident'
- description: An identifier expression.
- selectExpr:
- allOf:
- - $ref: '#/components/schemas/Expr_Select'
- description: A field selection expression, e.g. `request.auth`.
- callExpr:
- allOf:
- - $ref: '#/components/schemas/Expr_Call'
- description: A call expression, including calls to predefined functions and operators.
- listExpr:
- allOf:
- - $ref: '#/components/schemas/Expr_CreateList'
- description: A list creation expression.
- structExpr:
- allOf:
- - $ref: '#/components/schemas/Expr_CreateStruct'
- description: A map or message creation expression.
- comprehensionExpr:
- allOf:
- - $ref: '#/components/schemas/Expr_Comprehension'
- description: A comprehension expression.
- description: |-
- An abstract representation of a common expression.
-
- Expressions are abstractly represented as a collection of identifiers,
- select statements, function calls, literals, and comprehensions. All
- operators with the exception of the '.' operator are modelled as function
- calls. This makes it easy to represent new operators into the existing AST.
-
- All references within expressions must resolve to a
- [Decl][google.api.expr.v1alpha1.Decl] provided at type-check for an
- expression to be valid. A reference may either be a bare identifier `name` or
- a qualified identifier `google.api.name`. References may either refer to a
- value or a function declaration.
-
- For example, the expression `google.api.name.startsWith('expr')` references
- the declaration `google.api.name` within a
- [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and the
- function declaration `startsWith`.
- Expr_Call:
- type: object
- properties:
- target:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- The target of an method call-style expression. For example, `x` in
- `x.f()`.
- function:
- type: string
- description: Required. The name of the function or method being called.
- args:
- type: array
- items:
- $ref: '#/components/schemas/Expr'
- description: The arguments.
- description: |-
- A call expression, including calls to predefined functions and operators.
-
- For example, `value == 10`, `size(map_value)`.
- Expr_Comprehension:
- type: object
- properties:
- iterVar:
- type: string
- description: |-
- The name of the first iteration variable.
- When the iter_range is a list, this variable is the list element.
- When the iter_range is a map, this variable is the map entry key.
- iterVar2:
- type: string
- description: |-
- The name of the second iteration variable, empty if not set.
- When the iter_range is a list, this variable is the integer index.
- When the iter_range is a map, this variable is the map entry value.
- This field is only set for comprehension v2 macros.
- iterRange:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: The range over which the comprehension iterates.
- accuVar:
- type: string
- description: The name of the variable used for accumulation of the result.
- accuInit:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: The initial value of the accumulator.
- loopCondition:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- An expression which can contain iter_var, iter_var2, and accu_var.
-
- Returns false when the result has been computed and may be used as
- a hint to short-circuit the remainder of the comprehension.
- loopStep:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- An expression which can contain iter_var, iter_var2, and accu_var.
-
- Computes the next value of accu_var.
- result:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- An expression which can contain accu_var.
-
- Computes the result.
- description: |-
- A comprehension expression applied to a list or map.
-
- Comprehensions are not part of the core syntax, but enabled with macros.
- A macro matches a specific call signature within a parsed AST and replaces
- the call with an alternate AST block. Macro expansion happens at parse
- time.
-
- The following macros are supported within CEL:
-
- Aggregate type macros may be applied to all elements in a list or all keys
- in a map:
-
- * `all`, `exists`, `exists_one` - test a predicate expression against
- the inputs and return `true` if the predicate is satisfied for all,
- any, or only one value `list.all(x, x < 10)`.
- * `filter` - test a predicate expression against the inputs and return
- the subset of elements which satisfy the predicate:
- `payments.filter(p, p > 1000)`.
- * `map` - apply an expression to all elements in the input and return the
- output aggregate type: `[1, 2, 3].map(i, i * i)`.
-
- The `has(m.x)` macro tests whether the property `x` is present in struct
- `m`. The semantics of this macro depend on the type of `m`. For proto2
- messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the
- macro tests whether the property is set to its default. For map and struct
- types, the macro tests whether the property `x` is defined on `m`.
-
- Comprehensions for the standard environment macros evaluation can be best
- visualized as the following pseudocode:
-
- ```
- let `accu_var` = `accu_init`
- for (let `iter_var` in `iter_range`) {
- if (!`loop_condition`) {
- break
- }
- `accu_var` = `loop_step`
- }
- return `result`
- ```
-
- Comprehensions for the optional V2 macros which support map-to-map
- translation differ slightly from the standard environment macros in that
- they expose both the key or index in addition to the value for each list
- or map entry:
-
- ```
- let `accu_var` = `accu_init`
- for (let `iter_var`, `iter_var2` in `iter_range`) {
- if (!`loop_condition`) {
- break
- }
- `accu_var` = `loop_step`
- }
- return `result`
- ```
- Expr_CreateList:
- type: object
- properties:
- elements:
- type: array
- items:
- $ref: '#/components/schemas/Expr'
- description: The elements part of the list.
- optionalIndices:
- type: array
- items:
- type: integer
- format: int32
- description: |-
- The indices within the elements list which are marked as optional
- elements.
-
- When an optional-typed value is present, the value it contains
- is included in the list. If the optional-typed value is absent, the list
- element is omitted from the CreateList result.
- description: |-
- A list creation expression.
-
- Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogeneous, e.g.
- `dyn([1, 'hello', 2.0])`
- Expr_CreateStruct:
- type: object
- properties:
- messageName:
- type: string
- description: |-
- The type name of the message to be created, empty when creating map
- literals.
- entries:
- type: array
- items:
- $ref: '#/components/schemas/CreateStruct_Entry'
- description: The entries in the creation expression.
- description: |-
- A map or message creation expression.
-
- Maps are constructed as `{'key_name': 'value'}`. Message construction is
- similar, but prefixed with a type name and composed of field ids:
- `types.MyType{field_id: 'value'}`.
- Expr_Ident:
- type: object
- properties:
- name:
- type: string
- description: |-
- Required. Holds a single, unqualified identifier, possibly preceded by a
- '.'.
-
- Qualified names are represented by the
- [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression.
- description: An identifier expression. e.g. `request`.
- Expr_Select:
- type: object
- properties:
- operand:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- Required. The target of the selection expression.
-
- For example, in the select expression `request.auth`, the `request`
- portion of the expression is the `operand`.
- field:
- type: string
- description: |-
- Required. The name of the field to select.
-
- For example, in the select expression `request.auth`, the `auth` portion
- of the expression would be the `field`.
- testOnly:
- type: boolean
- description: |-
- Whether the select is to be interpreted as a field presence test.
-
- This results from the macro `has(request.auth)`.
- description: A field selection expression. e.g. `request.auth`.
- ExtensionMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of an extension.
- schema:
- type: string
- description: |-
- The schema is the extension that is installed to. But the extension usage
- is not limited to the schema.
- version:
- type: string
- description: The version is the version of an extension.
- description:
- type: string
- description: The description is the description of an extension.
- description: ExtensionMetadata is the metadata for extensions.
- ExternalTableMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a external table.
- externalServerName:
- type: string
- description: The external_server_name is the name of the external server.
- externalDatabaseName:
- type: string
- description: The external_database_name is the name of the external database.
- columns:
- type: array
- items:
- $ref: '#/components/schemas/ColumnMetadata'
- description: The columns is the ordered list of columns in a foreign table.
- FieldMapping:
- type: object
- properties:
- identifier:
- type: string
- description: Identifier is the field name of the unique identifier in 3rd-party idp user info. Required.
- displayName:
- type: string
- description: DisplayName is the field name of display name in 3rd-party idp user info. Optional.
- phone:
- type: string
- description: Phone is the field name of primary phone in 3rd-party idp user info. Optional.
- groups:
- type: string
- description: |-
- Groups is the field name of groups in 3rd-party idp user info. Optional.
- Mainly used for OIDC: https://developer.okta.com/docs/guides/customize-tokens-groups-claim/main/
- description: |-
- FieldMapping saves the field names from user info API of identity provider.
- As we save all raw json string of user info response data into `principal.idp_user_info`,
- we can extract the relevant data based with `FieldMapping`.
- ForeignKeyMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a foreign key.
- columns:
- type: array
- items:
- type: string
- description: The columns are the ordered referencing columns of a foreign key.
- referencedSchema:
- type: string
- description: |-
- The referenced_schema is the referenced schema name of a foreign key.
- It is an empty string for databases without such concept such as MySQL.
- referencedTable:
- type: string
- description: The referenced_table is the referenced table name of a foreign key.
- referencedColumns:
- type: array
- items:
- type: string
- description: The referenced_columns are the ordered referenced columns of a foreign key.
- onDelete:
- type: string
- description: The on_delete is the on delete action of a foreign key.
- onUpdate:
- type: string
- description: The on_update is the on update action of a foreign key.
- matchType:
- type: string
- description: |-
- The match_type is the match type of a foreign key.
- The match_type is the PostgreSQL specific field.
- It's empty string for other databases.
- description: ForeignKeyMetadata is the metadata for foreign keys.
- FunctionMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a function.
- definition:
- type: string
- description: The definition is the definition of a function.
- signature:
- type: string
- description: |-
- The signature is the name with the number and type of input arguments the
- function takes.
- characterSetClient:
- type: string
- description: MySQL specific metadata.
- collationConnection:
- type: string
- databaseCollation:
- type: string
- sqlMode:
- type: string
- comment:
- type: string
- dependencyTables:
- type: array
- items:
- $ref: '#/components/schemas/DependencyTable'
- description: |-
- The dependency_tables is the list of dependency tables of a function.
- For PostgreSQL, it's the list of tables that the function depends on the return type definition.
- skipDump:
- type: boolean
- description: FunctionMetadata is the metadata for functions.
- GenerationMetadata:
- type: object
- properties:
- type:
- enum:
- - TYPE_UNSPECIFIED
- - VIRTUAL
- - STORED
- type: string
- format: enum
- expression:
- type: string
- GetSchemaStringResponse:
- type: object
- properties:
- schemaString:
- type: string
- GoogleProtobufAny:
- type: object
- properties:
- '@type':
- type: string
- description: The type of the serialized message.
- additionalProperties: true
- description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
- GoogleProtobufValue:
- description: Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.
- GrantRequest:
- type: object
- properties:
- role:
- type: string
- description: |-
- The requested role.
- Format: roles/EXPORTER.
- user:
- type: string
- description: |-
- The user to be granted.
- Format: users/{email}.
- condition:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: The condition for the role. Same as the condition in IAM Binding message.
- expiration:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: The duration for which the grant is valid.
- GridLevel:
- type: object
- properties:
- level:
- type: integer
- description: Grid level number (1-4 for SQL Server)
- format: int32
- density:
- type: string
- description: Grid density (LOW, MEDIUM, HIGH)
- description: GridLevel defines a tessellation grid level with its density.
- Group:
- type: object
- properties:
- name:
- readOnly: true
- type: string
- description: |-
- The name of the group to retrieve.
- Format: groups/{group}, the group should be email or uuid.
- title:
- type: string
- description: The display title of the group.
- description:
- type: string
- description: The description of the group.
- members:
- type: array
- items:
- $ref: '#/components/schemas/GroupMember'
- description: The members of the group.
- source:
- type: string
- description: The source system where the group originated (e.g., Entra ID for SCIM sync).
- email:
- type: string
- description: The unique email for the group.
- description: A group of users within the workspace.
- GroupMember:
- type: object
- properties:
- member:
- type: string
- description: |-
- Member is the principal who belong to this group.
-
- Format: users/[email protected]
- role:
- enum:
- - ROLE_UNSPECIFIED
- - OWNER
- - MEMBER
- type: string
- description: The member's role in the group.
- format: enum
- description: A member of a group with a role.
- IamPolicy:
- type: object
- properties:
- bindings:
- type: array
- items:
- $ref: '#/components/schemas/Binding'
- description: |-
- Collection of binding.
- A binding binds one or more project members to a single project role.
- etag:
- type: string
- description: |-
- The current etag of the policy.
- If an etag is provided and does not match the current etag of the policy,
- the call will be blocked and an ABORTED error will be returned.
- description: IAM policy that binds members to roles.
- IdentityProvider:
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the identity provider.
- Format: idps/{idp}
- title:
- type: string
- description: The display title of the identity provider.
- domain:
- type: string
- description: The domain for email matching when using this identity provider.
- type:
- enum:
- - IDENTITY_PROVIDER_TYPE_UNSPECIFIED
- - OAUTH2
- - OIDC
- - LDAP
- type: string
- description: The type of identity provider protocol.
- format: enum
- config:
- allOf:
- - $ref: '#/components/schemas/IdentityProviderConfig'
- description: The configuration details for the identity provider.
- IdentityProviderConfig:
- type: object
- properties:
- oauth2Config:
- allOf:
- - $ref: '#/components/schemas/OAuth2IdentityProviderConfig'
- description: OAuth2 protocol configuration.
- oidcConfig:
- allOf:
- - $ref: '#/components/schemas/OIDCIdentityProviderConfig'
- description: OIDC protocol configuration.
- ldapConfig:
- allOf:
- - $ref: '#/components/schemas/LDAPIdentityProviderConfig'
- description: LDAP protocol configuration.
- IdentityProviderContext:
- type: object
- properties:
- oauth2Context:
- allOf:
- - $ref: '#/components/schemas/OAuth2IdentityProviderContext'
- description: OAuth2 authentication context.
- oidcContext:
- allOf:
- - $ref: '#/components/schemas/OIDCIdentityProviderContext'
- description: OpenID Connect authentication context.
- description: Context for identity provider authentication.
- IndexMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of an index.
- expressions:
- type: array
- items:
- type: string
- description: |-
- The expressions are the ordered columns or expressions of an index.
- This could refer to a column or an expression.
- keyLength:
- type: array
- items:
- type: string
- description: |-
- The key_lengths are the ordered key lengths of an index.
- If the key length is not specified, it's -1.
- descending:
- type: array
- items:
- type: boolean
- description: The descending is the ordered descending of an index.
- type:
- type: string
- description: The type is the type of an index.
- unique:
- type: boolean
- description: The unique is whether the index is unique.
- primary:
- type: boolean
- description: The primary is whether the index is a primary key index.
- visible:
- type: boolean
- description: The visible is whether the index is visible.
- comment:
- type: string
- description: The comment is the comment of an index.
- definition:
- type: string
- description: The definition of an index.
- parentIndexSchema:
- type: string
- description: The schema name of the parent index.
- parentIndexName:
- type: string
- description: The index name of the parent index.
- granularity:
- type: string
- description: The number of granules in the block. It's a ClickHouse specific field.
- isConstraint:
- type: boolean
- description: |-
- It's a PostgreSQL specific field.
- The unique constraint and unique index are not the same thing in PostgreSQL.
- spatialConfig:
- allOf:
- - $ref: '#/components/schemas/SpatialIndexConfig'
- description: Spatial index configuration for spatial databases like SQL Server, PostgreSQL with PostGIS, etc.
- opclassNames:
- type: array
- items:
- type: string
- description: |-
- https://www.postgresql.org/docs/current/catalog-pg-opclass.html
- Name of the operator class for each column. (PostgreSQL specific).
- opclassDefaults:
- type: array
- items:
- type: boolean
- description: True if the operator class is the default. (PostgreSQL specific).
- description: IndexMetadata is the metadata for indexes.
- Instance:
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the instance.
- Format: instances/{instance}
- state:
- enum:
- - STATE_UNSPECIFIED
- - ACTIVE
- - DELETED
- type: string
- description: The lifecycle state of the instance.
- format: enum
- title:
- type: string
- description: The display title of the instance.
- engine:
- enum:
- - ENGINE_UNSPECIFIED
- - CLICKHOUSE
- - MYSQL
- - POSTGRES
- - SNOWFLAKE
- - SQLITE
- - TIDB
- - MONGODB
- - REDIS
- - ORACLE
- - SPANNER
- - MSSQL
- - REDSHIFT
- - MARIADB
- - OCEANBASE
- - STARROCKS
- - DORIS
- - HIVE
- - ELASTICSEARCH
- - BIGQUERY
- - DYNAMODB
- - DATABRICKS
- - COCKROACHDB
- - COSMOSDB
- - TRINO
- - CASSANDRA
- type: string
- description: The database engine type.
- format: enum
- engineVersion:
- readOnly: true
- type: string
- description: The version of the database engine.
- externalLink:
- type: string
- description: External URL to the database instance console.
- dataSources:
- type: array
- items:
- $ref: '#/components/schemas/DataSource'
- description: Data source configurations for connecting to the instance.
- environment:
- type: string
- description: |-
- The environment resource.
- Format: environments/prod where prod is the environment resource ID.
- activation:
- type: boolean
- description: Whether the instance is activated for use.
- roles:
- readOnly: true
- type: array
- items:
- $ref: '#/components/schemas/InstanceRole'
- description: Database roles available in this instance.
- syncInterval:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: How often the instance is synced.
- syncDatabases:
- type: array
- items:
- type: string
- description: |-
- Enable sync for following databases.
- Default empty, means sync all schemas & databases.
- lastSyncTime:
- readOnly: true
- type: string
- description: The last time the instance was synced.
- format: date-time
- labels:
- type: object
- additionalProperties:
- type: string
- description: |-
- Labels are key-value pairs that can be attached to the instance.
- For example, { "org_group": "infrastructure", "environment": "production" }
- InstanceResource:
- type: object
- properties:
- title:
- type: string
- description: The display title of the instance.
- engine:
- enum:
- - ENGINE_UNSPECIFIED
- - CLICKHOUSE
- - MYSQL
- - POSTGRES
- - SNOWFLAKE
- - SQLITE
- - TIDB
- - MONGODB
- - REDIS
- - ORACLE
- - SPANNER
- - MSSQL
- - REDSHIFT
- - MARIADB
- - OCEANBASE
- - STARROCKS
- - DORIS
- - HIVE
- - ELASTICSEARCH
- - BIGQUERY
- - DYNAMODB
- - DATABRICKS
- - COCKROACHDB
- - COSMOSDB
- - TRINO
- - CASSANDRA
- type: string
- description: The database engine type.
- format: enum
- engineVersion:
- readOnly: true
- type: string
- description: The version of the database engine.
- dataSources:
- type: array
- items:
- $ref: '#/components/schemas/DataSource'
- description: Data source configurations for the instance.
- activation:
- type: boolean
- description: Whether the instance is activated.
- name:
- type: string
- description: |-
- The name of the instance.
- Format: instances/{instance}
- environment:
- type: string
- description: |-
- The environment resource.
- Format: environments/prod where prod is the environment resource ID.
- InstanceRole:
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the role.
- Format: instances/{instance}/roles/{role}
- The role name is the unique name for the role.
- roleName:
- type: string
- description: The role name. It's unique within the instance.
- password:
- writeOnly: true
- type: string
- description: The role password.
- connectionLimit:
- type: integer
- description: The connection count limit for this role.
- format: int32
- validUntil:
- type: string
- description: The expiration for the role's password.
- attribute:
- type: string
- description: |-
- The role attribute.
- For PostgreSQL, it contains super_user, no_inherit, create_role, create_db, can_login, replication, and bypass_rls. Docs: https://www.postgresql.org/docs/current/role-attributes.html
- For MySQL, it's the global privileges as GRANT statements, which means it only contains "GRANT ... ON *.* TO ...". Docs: https://dev.mysql.com/doc/refman/8.0/en/grant.html
- description: InstanceRole is the API message for instance role.
- Issue:
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the issue.
- Format: projects/{project}/issues/{issue}
- title:
- type: string
- description: The title of the issue.
- description:
- type: string
- description: The description of the issue.
- type:
- enum:
- - TYPE_UNSPECIFIED
- - DATABASE_CHANGE
- - GRANT_REQUEST
- - DATABASE_EXPORT
- type: string
- format: enum
- status:
- enum:
- - ISSUE_STATUS_UNSPECIFIED
- - OPEN
- - DONE
- - CANCELED
- type: string
- description: The status of the issue.
- format: enum
- approvers:
- type: array
- items:
- $ref: '#/components/schemas/Issue_Approver'
- approvalTemplate:
- allOf:
- - $ref: '#/components/schemas/ApprovalTemplate'
- description: The approval template for the issue.
- creator:
- readOnly: true
- type: string
- description: 'Format: users/[email protected]'
- createTime:
- readOnly: true
- type: string
- format: date-time
- updateTime:
- readOnly: true
- type: string
- format: date-time
- plan:
- type: string
- description: |-
- The plan associated with the issue.
- Can be empty.
- Format: projects/{project}/plans/{plan}
- grantRequest:
- allOf:
- - $ref: '#/components/schemas/GrantRequest'
- description: Used if the issue type is GRANT_REQUEST.
- riskLevel:
- enum:
- - RISK_LEVEL_UNSPECIFIED
- - LOW
- - MODERATE
- - HIGH
- type: string
- description: The risk level of the issue.
- format: enum
- labels:
- type: array
- items:
- type: string
- description: Labels attached to the issue for categorization and filtering.
- approvalStatus:
- readOnly: true
- enum:
- - APPROVAL_STATUS_UNSPECIFIED
- - CHECKING
- - PENDING
- - APPROVED
- - REJECTED
- - SKIPPED
- - ERROR
- type: string
- format: enum
- approvalStatusError:
- readOnly: true
- type: string
- description: Only populated when approval_status == ERROR
- IssueComment:
- type: object
- properties:
- name:
- type: string
- description: 'Format: projects/{project}/issues/{issue}/issueComments/{issueComment-uid}'
- comment:
- type: string
- description: The text content of the comment.
- payload:
- type: string
- description: 'TODO: use struct message instead.'
- createTime:
- readOnly: true
- type: string
- format: date-time
- updateTime:
- readOnly: true
- type: string
- format: date-time
- creator:
- readOnly: true
- type: string
- description: 'Format: users/{email}'
- approval:
- allOf:
- - $ref: '#/components/schemas/IssueComment_Approval'
- description: Approval event.
- issueUpdate:
- allOf:
- - $ref: '#/components/schemas/IssueComment_IssueUpdate'
- description: Issue update event.
- planSpecUpdate:
- allOf:
- - $ref: '#/components/schemas/IssueComment_PlanSpecUpdate'
- description: Plan spec update event.
- description: A comment on an issue.
- IssueComment_Approval:
- type: object
- properties:
- status:
- enum:
- - STATUS_UNSPECIFIED
- - PENDING
- - APPROVED
- - REJECTED
- type: string
- description: The approval status.
- format: enum
- description: Approval event information.
- IssueComment_IssueUpdate:
- type: object
- properties:
- fromTitle:
- type: string
- toTitle:
- type: string
- fromDescription:
- type: string
- toDescription:
- type: string
- fromStatus:
- enum:
- - ISSUE_STATUS_UNSPECIFIED
- - OPEN
- - DONE
- - CANCELED
- type: string
- format: enum
- toStatus:
- enum:
- - ISSUE_STATUS_UNSPECIFIED
- - OPEN
- - DONE
- - CANCELED
- type: string
- format: enum
- fromLabels:
- type: array
- items:
- type: string
- toLabels:
- type: array
- items:
- type: string
- description: Issue update event information.
- IssueComment_PlanSpecUpdate:
- type: object
- properties:
- spec:
- type: string
- description: |-
- The spec that was updated.
- Format: projects/{project}/plans/{plan}/specs/{spec}
- fromSheet:
- type: string
- description: |-
- The previous sheet.
- Format: projects/{project}/sheets/{sheet}
- toSheet:
- type: string
- description: |-
- The new sheet.
- Format: projects/{project}/sheets/{sheet}
- description: Plan spec update event information (tracks sheet changes to plan specs).
- Issue_Approver:
- type: object
- properties:
- status:
- enum:
- - STATUS_UNSPECIFIED
- - PENDING
- - APPROVED
- - REJECTED
- type: string
- description: The new status.
- format: enum
- principal:
- type: string
- description: 'Format: users/[email protected]'
- description: Approvers and their approval status for the issue.
- Item_Table:
- type: object
- properties:
- database:
- type: string
- description: |-
- The database information.
- Format: instances/{instance}/databases/{database}
- schema:
- type: string
- description: The schema name.
- table:
- type: string
- description: The table name.
- description: Table information.
- KerberosConfig:
- type: object
- properties:
- primary:
- type: string
- description: The primary component of the Kerberos principal.
- instance:
- type: string
- description: The instance component of the Kerberos principal.
- realm:
- type: string
- description: The Kerberos realm.
- keytab:
- type: string
- description: The keytab file contents for authentication.
- format: bytes
- kdcHost:
- type: string
- description: The hostname of the Key Distribution Center (KDC).
- kdcPort:
- type: string
- description: The port of the Key Distribution Center (KDC).
- kdcTransportProtocol:
- type: string
- description: The transport protocol for KDC communication (tcp or udp).
- LDAPIdentityProviderConfig:
- type: object
- properties:
- host:
- type: string
- description: |-
- Host is the hostname or IP address of the LDAP server, e.g.,
- "ldap.example.com".
- port:
- type: integer
- description: |-
- Port is the port number of the LDAP server, e.g., 389. When not set, the
- default port of the corresponding security protocol will be used, i.e. 389
- for StartTLS and 636 for LDAPS.
- format: int32
- skipTlsVerify:
- type: boolean
- description: SkipTLSVerify controls whether to skip TLS certificate verification.
- bindDn:
- type: string
- description: |-
- BindDN is the DN of the user to bind as a service account to perform
- search requests.
- bindPassword:
- type: string
- description: BindPassword is the password of the user to bind as a service account.
- baseDn:
- type: string
- description: BaseDN is the base DN to search for users, e.g., "ou=users,dc=example,dc=com".
- userFilter:
- type: string
- description: UserFilter is the filter to search for users, e.g., "(uid=%s)".
- securityProtocol:
- enum:
- - SECURITY_PROTOCOL_UNSPECIFIED
- - START_TLS
- - LDAPS
- type: string
- description: |-
- SecurityProtocol is the security protocol to be used for establishing
- connections with the LDAP server.
- format: enum
- fieldMapping:
- allOf:
- - $ref: '#/components/schemas/FieldMapping'
- description: |-
- FieldMapping is the mapping of the user attributes returned by the LDAP
- server.
- description: LDAPIdentityProviderConfig is the structure for LDAP identity provider config.
- Label:
- type: object
- properties:
- value:
- type: string
- description: The label value/name.
- color:
- type: string
- description: The color code for the label (e.g., hex color).
- group:
- type: string
- description: The group this label belongs to.
- description: A label for categorizing and organizing issues.
- ListChangelogsResponse:
- type: object
- properties:
- changelogs:
- type: array
- items:
- $ref: '#/components/schemas/Changelog'
- description: The list of changelogs.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListDatabaseGroupsResponse:
- type: object
- properties:
- databaseGroups:
- type: array
- items:
- $ref: '#/components/schemas/DatabaseGroup'
- description: The database groups from the specified request.
- description: Response message for listing database groups.
- ListDatabasesResponse:
- type: object
- properties:
- databases:
- type: array
- items:
- $ref: '#/components/schemas/Database'
- description: The databases from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListGroupsResponse:
- type: object
- properties:
- groups:
- type: array
- items:
- $ref: '#/components/schemas/Group'
- description: The groups from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- description: Response message for listing groups.
- ListIdentityProvidersResponse:
- type: object
- properties:
- identityProviders:
- type: array
- items:
- $ref: '#/components/schemas/IdentityProvider'
- description: The identity providers from the specified request.
- ListInstanceDatabaseRequest:
- required:
- - name
- - instance
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the instance.
- Format: instances/{instance}
- instance:
- allOf:
- - $ref: '#/components/schemas/Instance'
- description: The target instance. We need to set this field if the target instance is not created yet.
- ListInstanceDatabaseResponse:
- type: object
- properties:
- databases:
- type: array
- items:
- type: string
- description: All database name list in the instance.
- ListInstanceRolesResponse:
- type: object
- properties:
- roles:
- type: array
- items:
- $ref: '#/components/schemas/InstanceRole'
- description: The roles from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListInstancesResponse:
- type: object
- properties:
- instances:
- type: array
- items:
- $ref: '#/components/schemas/Instance'
- description: The instances from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListIssueCommentsResponse:
- type: object
- properties:
- issueComments:
- type: array
- items:
- $ref: '#/components/schemas/IssueComment'
- description: The issue comments from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListIssuesResponse:
- type: object
- properties:
- issues:
- type: array
- items:
- $ref: '#/components/schemas/Issue'
- description: The issues from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListPlansResponse:
- type: object
- properties:
- plans:
- type: array
- items:
- $ref: '#/components/schemas/Plan'
- description: The plans from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListPoliciesResponse:
- type: object
- properties:
- policies:
- type: array
- items:
- $ref: '#/components/schemas/Policy'
- description: The policies from the specified request.
- ListProjectsResponse:
- type: object
- properties:
- projects:
- type: array
- items:
- $ref: '#/components/schemas/Project'
- description: The projects from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListReleasesResponse:
- type: object
- properties:
- releases:
- type: array
- items:
- $ref: '#/components/schemas/Release'
- description: The releases from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListReviewConfigsResponse:
- type: object
- properties:
- reviewConfigs:
- type: array
- items:
- $ref: '#/components/schemas/ReviewConfig'
- description: The SQL review configs from the specified request.
- ListRevisionsResponse:
- type: object
- properties:
- revisions:
- type: array
- items:
- $ref: '#/components/schemas/Revision'
- description: The revisions from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListRolesResponse:
- type: object
- properties:
- roles:
- type: array
- items:
- $ref: '#/components/schemas/Role'
- description: The roles from the specified request.
- ListRolloutsResponse:
- type: object
- properties:
- rollouts:
- type: array
- items:
- $ref: '#/components/schemas/Rollout'
- description: The rollouts from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- ListSettingsResponse:
- type: object
- properties:
- settings:
- type: array
- items:
- $ref: '#/components/schemas/Setting'
- description: The settings from the specified request.
- ListTaskRunsResponse:
- type: object
- properties:
- taskRuns:
- type: array
- items:
- $ref: '#/components/schemas/TaskRun'
- description: The taskRuns from the specified request.
- ListUsersResponse:
- type: object
- properties:
- users:
- type: array
- items:
- $ref: '#/components/schemas/User'
- description: The users from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- LoginRequest:
- type: object
- properties:
- email:
- type: string
- description: User's email address.
- password:
- type: string
- description: User's password for authentication.
- web:
- type: boolean
- description: |-
- If true, sets access token and refresh token as HTTP-only cookies instead of
- returning the token in the response body. Use for browser-based clients.
- idpName:
- type: string
- description: |-
- The name of the identity provider.
- Format: idps/{idp}
- idpContext:
- allOf:
- - $ref: '#/components/schemas/IdentityProviderContext'
- description: The idp_context is used to get the user information from identity provider.
- otpCode:
- type: string
- description: The otp_code is used to verify the user's identity by MFA.
- recoveryCode:
- type: string
- description: The recovery_code is used to recovery the user's identity with MFA.
- mfaTempToken:
- type: string
- description: The mfa_temp_token is used to verify the user's identity by MFA.
- LoginResponse:
- type: object
- properties:
- token:
- type: string
- description: |-
- Access token for authenticated requests.
- Only returned when web=false. For web=true, the token is set as an HTTP-only cookie.
- mfaTempToken:
- type: string
- description: Temporary token for MFA verification.
- requireResetPassword:
- type: boolean
- description: Whether user must reset password before continuing.
- user:
- allOf:
- - $ref: '#/components/schemas/User'
- description: The user from the successful login.
- LogoutRequest:
- type: object
- properties: {}
- description: Request to logout current user session.
- MaskingExemptionPolicy:
- type: object
- properties:
- exemptions:
- type: array
- items:
- $ref: '#/components/schemas/MaskingExemptionPolicy_Exemption'
- description: MaskingExemptionPolicy is the allowlist of users who can access sensitive data.
- MaskingExemptionPolicy_Exemption:
- type: object
- properties:
- members:
- type: array
- items:
- type: string
- description: |-
- Specifies the principals who are exempt from masking.
- For users, the member should be: user:{email}
- For groups, the member should be: group:{email}
- condition:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- The condition that is associated with this exception policy instance.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
- If the condition is empty, means the user can access all databases without expiration.
-
- Support variables:
- resource.instance_id: the instance resource id. Only support "==" operation.
- resource.database_name: the database name. Only support "==" operation.
- resource.schema_name: the schema name. Only support "==" operation.
- resource.table_name: the table name. Only support "==" operation.
- resource.column_name: the column name. Only support "==" operation.
- request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`
- All variables should join with "&&" condition.
-
- For example:
- resource.instance_id == "local" && resource.database_name == "employee" && request.time < timestamp("2025-04-30T11:10:39.000Z")
- resource.instance_id == "local" && resource.database_name == "employee"
- MaskingReason:
- type: object
- properties:
- semanticTypeId:
- type: string
- description: The semantic type that triggered masking (e.g., "SSN", "email", "phone").
- semanticTypeTitle:
- type: string
- description: Human-readable semantic type title.
- maskingRuleId:
- type: string
- description: The masking rule ID that matched (if applicable).
- algorithm:
- type: string
- description: The masking algorithm used.
- context:
- type: string
- description: 'Additional context (e.g., "Matched global rule: PII Protection").'
- classificationLevel:
- type: string
- description: Whether masking was due to classification level.
- semanticTypeIcon:
- type: string
- description: Icon associated with the semantic type (if any).
- MaskingRulePolicy:
- type: object
- properties:
- rules:
- type: array
- items:
- $ref: '#/components/schemas/MaskingRulePolicy_MaskingRule'
- description: The list of masking rules.
- description: Policy for configuring data masking rules.
- MaskingRulePolicy_MaskingRule:
- type: object
- properties:
- id:
- type: string
- description: A unique identifier for the rule in UUID format.
- condition:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- The condition for the masking rule.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Support variables:
- resource.environment_id: the environment resource id.
- resource.project_id: the project resource id.
- resource.instance_id: the instance resource id.
- resource.database_name: the database name.
- resource.table_name: the table name.
- resource.column_name: the column name.
- resource.classification_level: the classification level.
-
- Each variable support following operations:
- ==: the value equals the target.
- !=: the value not equals the target.
- in: the value matches one of the targets.
- !(in): the value not matches any of the targets.
-
- For example:
- resource.environment_id == "test" && resource.project_id == "sample-project"
- resource.instance_id == "sample-instance" && resource.database_name == "employee" && resource.table_name in ["table1", "table2"]
- resource.environment_id != "test" || !(resource.project_id in ["poject1", "prject2"])
- resource.instance_id == "sample-instance" && (resource.database_name == "db1" || resource.database_name == "db2")
- semanticType:
- type: string
- description: The semantic type of data to mask (e.g., "SSN", "EMAIL").
- description: A rule that defines when and how to mask data.
- MaterializedViewMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a materialized view.
- definition:
- type: string
- description: The definition is the definition of a materialized view.
- comment:
- type: string
- description: The comment is the comment of a materialized view.
- dependencyColumns:
- type: array
- items:
- $ref: '#/components/schemas/DependencyColumn'
- description: |-
- The dependency_columns is the list of dependency columns of a materialized
- view.
- triggers:
- type: array
- items:
- $ref: '#/components/schemas/TriggerMetadata'
- description: The columns is the ordered list of columns in a table.
- indexes:
- type: array
- items:
- $ref: '#/components/schemas/IndexMetadata'
- description: The indexes is the list of indexes in a table.
- skipDump:
- type: boolean
- description: MaterializedViewMetadata is the metadata for materialized views.
- OAuth2IdentityProviderConfig:
- type: object
- properties:
- authUrl:
- type: string
- description: The authorization endpoint URL for OAuth2 flow.
- tokenUrl:
- type: string
- description: The token endpoint URL for exchanging authorization code.
- userInfoUrl:
- type: string
- description: The user information endpoint URL.
- clientId:
- type: string
- description: The OAuth2 client identifier.
- clientSecret:
- type: string
- description: The OAuth2 client secret for authentication.
- scopes:
- type: array
- items:
- type: string
- description: The list of OAuth2 scopes to request.
- fieldMapping:
- allOf:
- - $ref: '#/components/schemas/FieldMapping'
- description: Mapping configuration for user attributes from OAuth2 response.
- skipTlsVerify:
- type: boolean
- description: Whether to skip TLS certificate verification.
- authStyle:
- enum:
- - OAUTH2_AUTH_STYLE_UNSPECIFIED
- - IN_PARAMS
- - IN_HEADER
- type: string
- description: The authentication style for client credentials.
- format: enum
- description: OAuth2IdentityProviderConfig is the structure for OAuth2 identity provider config.
- OAuth2IdentityProviderContext:
- type: object
- properties:
- code:
- type: string
- description: Authorization code from OAuth2 provider.
- description: OAuth2 authentication context.
- OAuth2IdentityProviderTestRequestContext:
- type: object
- properties:
- code:
- type: string
- description: Authorize code from website.
- OIDCIdentityProviderConfig:
- type: object
- properties:
- issuer:
- type: string
- description: The OIDC issuer URL for the identity provider.
- clientId:
- type: string
- description: The OIDC client identifier.
- clientSecret:
- type: string
- description: The OIDC client secret for authentication.
- scopes:
- type: array
- items:
- type: string
- description: |-
- The scopes that the OIDC provider supports.
- Should be fetched from the well-known configuration file of the OIDC provider.
- fieldMapping:
- allOf:
- - $ref: '#/components/schemas/FieldMapping'
- description: Mapping configuration for user attributes from OIDC claims.
- skipTlsVerify:
- type: boolean
- description: Whether to skip TLS certificate verification.
- authStyle:
- enum:
- - OAUTH2_AUTH_STYLE_UNSPECIFIED
- - IN_PARAMS
- - IN_HEADER
- type: string
- description: The authentication style for client credentials.
- format: enum
- authEndpoint:
- readOnly: true
- type: string
- description: |-
- The authorization endpoint of the OIDC provider.
- Should be fetched from the well-known configuration file of the OIDC provider.
- description: OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
- OIDCIdentityProviderContext:
- type: object
- properties:
- code:
- type: string
- description: Authorization code from OIDC provider.
- description: OpenID Connect authentication context.
- OIDCIdentityProviderTestRequestContext:
- type: object
- properties:
- code:
- type: string
- description: Authorize code from OIDC provider.
- ObjectSchema:
- type: object
- properties:
- type:
- enum:
- - TYPE_UNSPECIFIED
- - STRING
- - NUMBER
- - BOOLEAN
- - OBJECT
- - ARRAY
- type: string
- description: The data type of this object.
- format: enum
- structKind:
- allOf:
- - $ref: '#/components/schemas/ObjectSchema_StructKind'
- description: Struct schema.
- arrayKind:
- allOf:
- - $ref: '#/components/schemas/ObjectSchema_ArrayKind'
- description: Array schema.
- semanticType:
- type: string
- description: The semantic type of this object.
- description: Schema definition for object-type columns.
- ObjectSchema_ArrayKind:
- type: object
- properties:
- kind:
- allOf:
- - $ref: '#/components/schemas/ObjectSchema'
- description: The schema of array elements.
- description: Array type with element schema.
- ObjectSchema_StructKind:
- type: object
- properties:
- properties:
- type: object
- additionalProperties:
- $ref: '#/components/schemas/ObjectSchema'
- description: Properties of the struct.
- description: Structure type with named properties.
- PackageMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a package.
- definition:
- type: string
- description: The definition is the definition of a package.
- description: PackageMetadata is the metadata for packages.
- Plan:
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the plan.
- `plan` is a system generated ID.
- Format: projects/{project}/plans/{plan}
- state:
- enum:
- - STATE_UNSPECIFIED
- - ACTIVE
- - DELETED
- type: string
- description: The state of the plan.
- format: enum
- issue:
- readOnly: true
- type: string
- description: |-
- The issue associated with the plan.
- Can be empty.
- Format: projects/{project}/issues/{issue}
- title:
- type: string
- description: The title of the plan.
- description:
- type: string
- description: The description of the plan.
- specs:
- type: array
- items:
- $ref: '#/components/schemas/Plan_Spec'
- description: The deployment specs for the plan.
- creator:
- readOnly: true
- type: string
- description: 'Format: users/[email protected]'
- createTime:
- readOnly: true
- type: string
- format: date-time
- updateTime:
- readOnly: true
- type: string
- format: date-time
- planCheckRunStatusCount:
- readOnly: true
- type: object
- additionalProperties:
- type: integer
- format: int32
- description: |-
- The status count of the latest plan check runs.
- Keys are:
- - SUCCESS
- - WARNING
- - ERROR
- - RUNNING
- hasRollout:
- readOnly: true
- type: boolean
- description: Whether the plan has started the rollout.
- PlanCheckRun:
- type: object
- properties:
- name:
- type: string
- description: 'Format: projects/{project}/plans/{plan}/planCheckRun'
- status:
- enum:
- - STATUS_UNSPECIFIED
- - RUNNING
- - DONE
- - FAILED
- - CANCELED
- type: string
- format: enum
- results:
- type: array
- items:
- $ref: '#/components/schemas/PlanCheckRun_Result'
- error:
- type: string
- description: error is set if the Status is FAILED.
- createTime:
- readOnly: true
- type: string
- format: date-time
- PlanCheckRun_Result:
- type: object
- properties:
- status:
- enum:
- - ADVICE_LEVEL_UNSPECIFIED
- - SUCCESS
- - WARNING
- - ERROR
- type: string
- format: enum
- title:
- type: string
- content:
- type: string
- code:
- type: integer
- format: int32
- target:
- type: string
- description: |-
- Target identification for consolidated results.
- Format: instances/{instance}/databases/{database}
- type:
- enum:
- - TYPE_UNSPECIFIED
- - STATEMENT_ADVISE
- - STATEMENT_SUMMARY_REPORT
- - GHOST_SYNC
- type: string
- format: enum
- sqlSummaryReport:
- $ref: '#/components/schemas/Result_SqlSummaryReport'
- sqlReviewReport:
- $ref: '#/components/schemas/Result_SqlReviewReport'
- Plan_ChangeDatabaseConfig:
- type: object
- properties:
- targets:
- type: array
- items:
- type: string
- description: |-
- The list of targets.
- Multi-database format: [instances/{instance-id}/databases/{database-name}].
- Single database group format: [projects/{project}/databaseGroups/{databaseGroup}].
- sheet:
- type: string
- description: |-
- The resource name of the sheet.
- Format: projects/{project}/sheets/{sheet}
- release:
- type: string
- description: |-
- The resource name of the release.
- Format: projects/{project}/releases/{release}
- type:
- enum:
- - DATABASE_CHANGE_TYPE_UNSPECIFIED
- - MIGRATE
- - SDL
- type: string
- description: Type is the database change type.
- format: enum
- ghostFlags:
- type: object
- additionalProperties:
- type: string
- enablePriorBackup:
- type: boolean
- description: If set, a backup of the modified data will be created automatically before any changes are applied.
- enableGhost:
- type: boolean
- description: Whether to use gh-ost for online schema migration.
- Plan_CreateDatabaseConfig:
- required:
- - target
- - database
- type: object
- properties:
- target:
- type: string
- description: |-
- The resource name of the instance on which the database is created.
- Format: instances/{instance}
- database:
- type: string
- description: The name of the database to create.
- table:
- type: string
- description: |-
- table is the name of the table, if it is not empty, Bytebase should create a table after creating the database.
- For example, in MongoDB, it only creates the database when we first store data in that database.
- characterSet:
- type: string
- description: character_set is the character set of the database.
- collation:
- type: string
- description: collation is the collation of the database.
- cluster:
- type: string
- description: cluster is the cluster of the database. This is only applicable to ClickHouse for "ON CLUSTER <<cluster>>".
- owner:
- type: string
- description: owner is the owner of the database. This is only applicable to Postgres for "WITH OWNER <<owner>>".
- environment:
- type: string
- description: |-
- The environment resource.
- Format: environments/prod where prod is the environment resource ID.
- Plan_ExportDataConfig:
- type: object
- properties:
- targets:
- type: array
- items:
- type: string
- description: |-
- The list of targets.
- Multi-database format: [instances/{instance-id}/databases/{database-name}].
- Single database group format: [projects/{project}/databaseGroups/{databaseGroup}].
- sheet:
- type: string
- description: |-
- The resource name of the sheet.
- Format: projects/{project}/sheets/{sheet}
- format:
- enum:
- - FORMAT_UNSPECIFIED
- - CSV
- - JSON
- - SQL
- - XLSX
- type: string
- description: The format of the exported file.
- format: enum
- password:
- type: string
- description: |-
- The zip password provide by users.
- Leave it empty if no needs to encrypt the zip file.
- Plan_Spec:
- type: object
- properties:
- id:
- type: string
- description: A UUID4 string that uniquely identifies the Spec.
- createDatabaseConfig:
- $ref: '#/components/schemas/Plan_CreateDatabaseConfig'
- changeDatabaseConfig:
- $ref: '#/components/schemas/Plan_ChangeDatabaseConfig'
- exportDataConfig:
- $ref: '#/components/schemas/Plan_ExportDataConfig'
- Policy:
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the policy.
- Format: {resource name}/policies/{policy type}
- Workspace resource name: "".
- Environment resource name: environments/environment-id.
- Instance resource name: instances/instance-id.
- Database resource name: instances/instance-id/databases/database-name.
- inheritFromParent:
- type: boolean
- description: Whether this policy inherits from its parent resource.
- type:
- enum:
- - POLICY_TYPE_UNSPECIFIED
- - MASKING_RULE
- - MASKING_EXEMPTION
- - ROLLOUT_POLICY
- - TAG
- - DATA_SOURCE_QUERY
- - DATA_QUERY
- type: string
- description: The type of policy.
- format: enum
- rolloutPolicy:
- $ref: '#/components/schemas/RolloutPolicy'
- maskingRulePolicy:
- $ref: '#/components/schemas/MaskingRulePolicy'
- maskingExemptionPolicy:
- $ref: '#/components/schemas/MaskingExemptionPolicy'
- tagPolicy:
- $ref: '#/components/schemas/TagPolicy'
- dataSourceQueryPolicy:
- $ref: '#/components/schemas/DataSourceQueryPolicy'
- queryDataPolicy:
- $ref: '#/components/schemas/QueryDataPolicy'
- enforce:
- type: boolean
- description: Whether the policy is enforced.
- resourceType:
- readOnly: true
- enum:
- - RESOURCE_TYPE_UNSPECIFIED
- - WORKSPACE
- - ENVIRONMENT
- - PROJECT
- type: string
- description: The resource type for the policy.
- format: enum
- Position:
- type: object
- properties:
- line:
- type: integer
- description: |-
- Line position in a text (one-based).
- First line of the text is line 1.
- A value of 0 indicates the line information is unknown.
- format: int32
- column:
- type: integer
- description: "Column position in a text (one-based).\n Column is measured in Unicode code points (characters/runes), not bytes or grapheme clusters.\n First character of the line is column 1.\n A value of 0 indicates the column information is unknown.\n\n Examples:\n - \"SELECT * FROM t\" - column 8 is '*'\n - \"SELECT 你好 FROM t\" - column 8 is '你' (even though it's at byte offset 7)\n - \"SELECT \U0001F600 FROM t\" - column 8 is '\U0001F600' (even though it's 4 bytes in UTF-8)"
- format: int32
- description: |-
- Position in a text expressed as one-based line and one-based column.
- We use 1-based numbering to match the majority of industry standards:
- - Monaco Editor uses 1-based (https://microsoft.github.io/monaco-editor/typedoc/interfaces/IPosition.html)
- - GitHub Actions uses 1-based (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message)
- - Most text editors display 1-based positions to users
- Note: LSP uses 0-based (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position),
- but we follow the canonical user-facing standards.
-
- Handling unknown positions:
- - If the entire position is unknown, leave this field as nil/undefined
- - If only line is known, set line and leave column as 0 (e.g., line=5, column=0)
- - If only column is known (rare), set column and leave line as 0
- Frontends should check for nil/undefined/zero values and handle them appropriately.
- Postgres_Session:
- type: object
- properties:
- pid:
- type: string
- description: Process ID of the session.
- blockedByPids:
- type: array
- items:
- type: string
- description: PIDs of sessions blocking this session.
- query:
- type: string
- description: Current query being executed.
- state:
- type: string
- description: Session state (active, idle, etc.).
- waitEventType:
- type: string
- description: Wait event type if session is waiting.
- waitEvent:
- type: string
- description: Specific wait event if session is waiting.
- datname:
- type: string
- description: Database name.
- usename:
- type: string
- description: User name.
- applicationName:
- type: string
- description: Application name.
- clientAddr:
- type: string
- description: Client IP address.
- clientPort:
- type: string
- description: Client port number.
- backendStart:
- type: string
- description: When the backend process started.
- format: date-time
- xactStart:
- type: string
- description: When the current transaction started.
- format: date-time
- queryStart:
- type: string
- description: When the current query started.
- format: date-time
- description: PostgreSQL session information read from `pg_stat_activity`.
- PreviewTaskRunRollbackRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
- PreviewTaskRunRollbackResponse:
- type: object
- properties:
- statement:
- type: string
- description: The rollback SQL statement that would undo the task run.
- PriorBackupDetail_Item:
- type: object
- properties:
- sourceTable:
- allOf:
- - $ref: '#/components/schemas/Item_Table'
- description: The original table information.
- targetTable:
- allOf:
- - $ref: '#/components/schemas/Item_Table'
- description: The target backup table information.
- startPosition:
- allOf:
- - $ref: '#/components/schemas/Position'
- description: The start position in the SQL statement.
- endPosition:
- allOf:
- - $ref: '#/components/schemas/Position'
- description: The end position in the SQL statement.
- description: A single backup table mapping.
- ProcedureMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a procedure.
- definition:
- type: string
- description: The definition is the definition of a procedure.
- signature:
- type: string
- description: |-
- The signature is the name with the number and type of input arguments the
- procedure takes.
- characterSetClient:
- type: string
- description: MySQL specific metadata.
- collationConnection:
- type: string
- databaseCollation:
- type: string
- sqlMode:
- type: string
- comment:
- type: string
- description: The comment is the comment of a procedure.
- skipDump:
- type: boolean
- description: ProcedureMetadata is the metadata for procedures.
- Project:
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the project.
- Format: projects/{project}
- state:
- enum:
- - STATE_UNSPECIFIED
- - ACTIVE
- - DELETED
- type: string
- description: The lifecycle state of the project.
- format: enum
- title:
- type: string
- description: The title or name of a project. It's not unique within the workspace.
- webhooks:
- type: array
- items:
- $ref: '#/components/schemas/Webhook'
- description: The list of webhooks configured for the project.
- dataClassificationConfigId:
- type: string
- description: The data classification configuration ID for the project.
- issueLabels:
- type: array
- items:
- $ref: '#/components/schemas/Label'
- description: Labels available for tagging issues in this project.
- forceIssueLabels:
- type: boolean
- description: Force issue labels to be used when creating an issue.
- enforceIssueTitle:
- type: boolean
- description: Enforce issue title to be created by user instead of generated by Bytebase.
- autoEnableBackup:
- type: boolean
- description: Whether to automatically enable backup for database changes.
- skipBackupErrors:
- type: boolean
- description: Whether to skip backup errors and continue with data migration.
- postgresDatabaseTenantMode:
- type: boolean
- description: |-
- Whether to enable database tenant mode for PostgreSQL.
- If enabled, issues will include "set role <db_owner>" statement.
- allowSelfApproval:
- type: boolean
- description: Whether to allow issue creators to self-approve their own issues.
- executionRetryPolicy:
- allOf:
- - $ref: '#/components/schemas/Project_ExecutionRetryPolicy'
- description: Execution retry policy for task runs.
- ciSamplingSize:
- type: integer
- description: |-
- The maximum number of database rows to sample during CI data validation.
- Without specification, sampling is disabled, resulting in full validation.
- format: int32
- parallelTasksPerRollout:
- type: integer
- description: The maximum number of parallel tasks allowed during rollout execution.
- format: int32
- labels:
- type: object
- additionalProperties:
- type: string
- description: |-
- Labels are key-value pairs that can be attached to the project.
- For example, { "environment": "production", "team": "backend" }
- enforceSqlReview:
- type: boolean
- description: |-
- Whether to enforce SQL review checks to pass before issue creation.
- If enabled, issues cannot be created when SQL review finds errors.
- requireIssueApproval:
- type: boolean
- description: Whether to require issue approval before rollout.
- requirePlanCheckNoError:
- type: boolean
- description: Whether to require plan check to have no error before rollout.
- Project_ExecutionRetryPolicy:
- type: object
- properties:
- maximumRetries:
- type: integer
- description: The maximum number of retries for lock timeout errors.
- format: int32
- description: Execution retry policy configuration.
- QueryDataPolicy:
- type: object
- properties:
- timeout:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: The query timeout duration.
- disableExport:
- type: boolean
- description: Disable data export in the SQL editor.
- maximumResultSize:
- type: string
- description: |-
- The maximum result size limit in bytes.
- The default value is 100MB, we will use the default value if the setting not exists, or the limit <= 0.
- maximumResultRows:
- type: integer
- description: |-
- The maximum number of rows to return.
- The default value is -1, means no limit.
- format: int32
- disableCopyData:
- type: boolean
- description: Disable copying query results.
- description: QueryDataPolicy is the policy configuration for querying data.
- QueryHistory:
- type: object
- properties:
- name:
- readOnly: true
- type: string
- description: |-
- The name for the query history.
- Format: queryHistories/{uid}
- database:
- readOnly: true
- type: string
- description: |-
- The database name to execute the query.
- Format: instances/{instance}/databases/{databaseName}
- creator:
- readOnly: true
- type: string
- createTime:
- readOnly: true
- type: string
- format: date-time
- statement:
- readOnly: true
- type: string
- error:
- readOnly: true
- type: string
- duration:
- readOnly: true
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- type:
- enum:
- - TYPE_UNSPECIFIED
- - QUERY
- - EXPORT
- type: string
- format: enum
- QueryOption:
- type: object
- properties:
- redisRunCommandsOn:
- enum:
- - REDIS_RUN_COMMANDS_ON_UNSPECIFIED
- - SINGLE_NODE
- - ALL_NODES
- type: string
- format: enum
- mssqlExplainFormat:
- enum:
- - MSSQL_EXPLAIN_FORMAT_UNSPECIFIED
- - MSSQL_EXPLAIN_FORMAT_ALL
- - MSSQL_EXPLAIN_FORMAT_XML
- type: string
- format: enum
- QueryRequest:
- required:
- - name
- - dataSourceId
- type: object
- properties:
- name:
- type: string
- description: |-
- The name is the instance name to execute the query against.
- Format: instances/{instance}/databases/{databaseName}
- statement:
- type: string
- description: The SQL statement to execute.
- limit:
- type: integer
- description: The maximum number of rows to return.
- format: int32
- dataSourceId:
- type: string
- description: |-
- The id of data source.
- It is used for querying admin data source even if the instance has
- read-only data sources. Or it can be used to query a specific read-only
- data source.
- explain:
- type: boolean
- description: Explain the statement.
- schema:
- type: string
- description: |-
- The default schema to search objects. Equals to the current schema in
- Oracle and search path in Postgres.
- queryOption:
- $ref: '#/components/schemas/QueryOption'
- container:
- type: string
- description: |-
- Container is the container name to execute the query against, used for
- CosmosDB only.
- QueryResponse:
- type: object
- properties:
- results:
- type: array
- items:
- $ref: '#/components/schemas/QueryResult'
- description: The query results.
- QueryResult:
- type: object
- properties:
- columnNames:
- type: array
- items:
- type: string
- description: Column names of the query result.
- columnTypeNames:
- type: array
- items:
- type: string
- description: |-
- Column types of the query result.
- The types come from the Golang SQL driver.
- rows:
- type: array
- items:
- $ref: '#/components/schemas/QueryRow'
- description: Rows of the query result.
- rowsCount:
- type: string
- error:
- type: string
- description: The error message if the query failed.
- latency:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: The time it takes to execute the query.
- statement:
- type: string
- description: The query statement for the result.
- postgresError:
- $ref: '#/components/schemas/QueryResult_PostgresError'
- syntaxError:
- $ref: '#/components/schemas/QueryResult_SyntaxError'
- permissionDenied:
- $ref: '#/components/schemas/QueryResult_PermissionDenied'
- messages:
- type: array
- items:
- $ref: '#/components/schemas/QueryResult_Message'
- description: |-
- Informational or debug messages returned by the database engine during query execution.
- Examples include PostgreSQL's RAISE NOTICE, MSSQL's PRINT, or Oracle's DBMS_OUTPUT.PUT_LINE.
- masked:
- type: array
- items:
- $ref: '#/components/schemas/MaskingReason'
- description: Masking reasons for each column (empty for non-masked columns).
- QueryResult_Message:
- type: object
- properties:
- level:
- enum:
- - LEVEL_UNSPECIFIED
- - INFO
- - WARNING
- - DEBUG
- - LOG
- - NOTICE
- - EXCEPTION
- type: string
- format: enum
- content:
- type: string
- QueryResult_PermissionDenied:
- type: object
- properties:
- resources:
- type: array
- items:
- type: string
- description: |-
- Denied to access the resources.
- Format:
- instances/{instance}/databases/{database}
- instances/{instance}/databases/{database}/schemas/{schema}
- instances/{instance}/databases/{database}/tables/{table}
- instances/{instance}/databases/{database}/schemas/{schema}/tables/{table}
- commandType:
- enum:
- - COMMAND_TYPE_UNSPECIFIED
- - DDL
- - DML
- - NON_READ_ONLY
- type: string
- description: Disallowed command_type.
- format: enum
- description: |-
- Permission denied with resource information or disallowed command_type.
- Either resources or command_type is available.
- QueryResult_PostgresError:
- type: object
- properties:
- severity:
- type: string
- code:
- type: string
- message:
- type: string
- detail:
- type: string
- hint:
- type: string
- position:
- type: integer
- format: int32
- internalPosition:
- type: integer
- format: int32
- internalQuery:
- type: string
- where:
- type: string
- schemaName:
- type: string
- tableName:
- type: string
- columnName:
- type: string
- dataTypeName:
- type: string
- constraintName:
- type: string
- file:
- type: string
- line:
- type: integer
- format: int32
- routine:
- type: string
- description: |-
- refer https://www.postgresql.org/docs/11/protocol-error-fields.html
- for field description.
- QueryResult_SyntaxError:
- type: object
- properties:
- startPosition:
- allOf:
- - $ref: '#/components/schemas/Position'
- description: Position information for highlighting in editor
- description: Syntax error with position information for editor highlighting
- QueryRow:
- type: object
- properties:
- values:
- type: array
- items:
- $ref: '#/components/schemas/RowValue'
- description: Row values of the query result.
- Range:
- type: object
- properties:
- start:
- type: integer
- description: Start index (inclusive).
- format: int32
- end:
- type: integer
- description: End index (exclusive).
- format: int32
- description: |-
- Range represents a span within a text or sequence.
- Whether the indices are byte offsets or character indices depends on the context.
- Check the documentation of the field using Range for specific semantics.
- RangeMask_Slice:
- type: object
- properties:
- start:
- type: integer
- description: |-
- start is the start character index (0-based) of the original value, should be less than end.
- Uses character indices (not byte offsets) for display-oriented masking.
- Example: For "你好world", character index 2 refers to 'w' (the 3rd character).
- format: int32
- end:
- type: integer
- description: |-
- end is the end character index (exclusive) of the original value.
- Uses character indices (not byte offsets) for display-oriented masking.
- format: int32
- substitution:
- type: string
- description: substitution is the string used to replace the OriginalValue[start:end).
- RefreshRequest:
- type: object
- properties: {}
- description: Request to refresh the access token.
- RefreshResponse:
- type: object
- properties: {}
- description: Response from refreshing the access token.
- RejectIssueRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the issue to add a rejection.
- Format: projects/{project}/issues/{issue}
- comment:
- type: string
- description: The comment explaining the rejection decision.
- Release:
- type: object
- properties:
- name:
- readOnly: true
- type: string
- description: 'Format: projects/{project}/releases/{release}'
- title:
- type: string
- description: The title of the release.
- files:
- type: array
- items:
- $ref: '#/components/schemas/Release_File'
- description: The SQL files included in the release.
- vcsSource:
- allOf:
- - $ref: '#/components/schemas/Release_VCSSource'
- description: The version control source of the release.
- creator:
- readOnly: true
- type: string
- description: 'Format: users/[email protected]'
- createTime:
- readOnly: true
- type: string
- format: date-time
- state:
- readOnly: true
- enum:
- - STATE_UNSPECIFIED
- - ACTIVE
- - DELETED
- type: string
- description: The lifecycle state of the release.
- format: enum
- digest:
- type: string
- description: |-
- The digest of the release.
- The user can provide the digest of the release. It can be used later to retrieve the release in GetRelease.
- Whether to provide digest and how to generate it is up to the user.
- If the digest is not empty, it must be unique in the project. Otherwise, an ALREADY_EXISTS error will be returned.
- Release_File:
- type: object
- properties:
- id:
- type: string
- description: The unique identifier for the file.
- path:
- type: string
- description: The path of the file. e.g., `2.2/V0001_create_table.sql`.
- type:
- enum:
- - TYPE_UNSPECIFIED
- - VERSIONED
- - DECLARATIVE
- type: string
- description: The type of the file.
- format: enum
- version:
- type: string
- description: The version identifier for the file.
- enableGhost:
- type: boolean
- description: Whether to use gh-ost for online schema migration.
- sheet:
- type: string
- description: |-
- For inputs, we must either use `sheet` or `statement`.
- For outputs, we always use `sheet`. `statement` is the preview of the sheet content.
+ title: map_key
+ description: The key expression for a map creation statement.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ title: map_key
+ required:
+ - mapKey
+ title: Entry
+ additionalProperties: false
+ description: Represents an entry.
+ google.api.expr.v1alpha1.Expr.Ident:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ Required. Holds a single, unqualified identifier, possibly preceded by a
+ '.'.
- The sheet that holds the content.
- Format: projects/{project}/sheets/{sheet}
- statement:
- writeOnly: true
- type: string
- description: The raw SQL statement content.
- format: bytes
- sheetSha256:
- readOnly: true
- type: string
- description: The SHA256 hash value of the sheet content or the statement.
- description: A SQL file in a release.
- Release_VCSSource:
- type: object
- properties:
- vcsType:
- enum:
- - VCS_TYPE_UNSPECIFIED
- - GITHUB
- - GITLAB
- - BITBUCKET
- - AZURE_DEVOPS
- type: string
- description: The type of VCS.
- format: enum
- url:
- type: string
- description: The url link to the e.g., GitHub commit or pull request.
- description: Version control system source information.
- RemoveDataSourceRequest:
- required:
- - name
- - dataSource
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the instance to remove a data source from.
- Format: instances/{instance}
- dataSource:
- allOf:
- - $ref: '#/components/schemas/DataSource'
- description: |-
- Identified by data source ID.
- Only READ_ONLY data source can be removed.
- RemoveWebhookRequest:
- required:
- - webhook
- type: object
- properties:
- webhook:
- allOf:
- - $ref: '#/components/schemas/Webhook'
- description: The webhook to remove. Identified by its url.
- RequestIssueRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the issue to request a issue.
- Format: projects/{project}/issues/{issue}
- comment:
- type: string
- description: The comment explaining the request.
- RequestMetadata:
- type: object
- properties:
- callerIp:
- type: string
- description: The IP address of the request originator.
- callerSuppliedUserAgent:
- type: string
- description: |-
- The user agent string provided by the caller.
- This is supplied by the client and is not authenticated.
- description: Metadata about the incoming request.
- ResourcePackage:
- type: object
- properties:
- logo:
- type: string
- description: The branding logo.
- format: bytes
- description: Custom branding resources for the Bytebase instance.
- Result_SqlReviewReport:
- type: object
- properties:
- startPosition:
- allOf:
- - $ref: '#/components/schemas/Position'
- description: Position of the SQL statement.
- endPosition:
- $ref: '#/components/schemas/Position'
- Result_SqlSummaryReport:
- type: object
- properties:
- statementTypes:
- type: array
- items:
- type: string
- description: statement_types are the types of statements that are found in the sql.
- affectedRows:
- type: string
- ReviewConfig:
- type: object
- properties:
- name:
- readOnly: true
- type: string
- description: |-
- The name of the SQL review config.
- Format: reviewConfigs/{reviewConfig}
- title:
- type: string
- description: The title of the review configuration.
- enabled:
- type: boolean
- description: Whether the review configuration is enabled.
- rules:
- type: array
- items:
- $ref: '#/components/schemas/SQLReviewRule'
- description: The SQL review rules to enforce.
- resources:
- type: array
- items:
- type: string
- description: |-
- Resources using the config.
- Format: {resource}/{resource id}, e.g., environments/test.
- Revision:
- type: object
- properties:
- name:
- type: string
- description: 'Format: instances/{instance}/databases/{database}/revisions/{revision}'
- release:
- type: string
- description: |-
- Format: projects/{project}/releases/{release}
- Can be empty.
- createTime:
- readOnly: true
- type: string
- format: date-time
- deleter:
- readOnly: true
- type: string
- description: |-
- Format: users/[email protected]
- Can be empty.
- deleteTime:
- readOnly: true
- type: string
- description: Can be empty.
- format: date-time
- file:
- type: string
- description: |-
- Format: projects/{project}/releases/{release}/files/{id}
- Can be empty.
- version:
- type: string
- description: The schema version string for this revision.
- sheet:
- type: string
- description: |-
- The sheet that holds the content.
- Format: projects/{project}/sheets/{sheet}
- sheetSha256:
- readOnly: true
- type: string
- description: The SHA256 hash value of the sheet.
- taskRun:
- type: string
- description: |-
- The task run associated with the revision.
- Can be empty.
- Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
- type:
- enum:
- - TYPE_UNSPECIFIED
- - VERSIONED
- - DECLARATIVE
- type: string
- description: The type of the revision.
- format: enum
- Role:
- type: object
- properties:
- name:
- type: string
- description: 'Resource name. Format: roles/{role}'
- title:
- type: string
- description: Human-readable title.
- description:
- type: string
- description: Optional description of the role.
- permissions:
- type: array
- items:
- type: string
- description: List of permission identifiers granted by this role.
- type:
- enum:
- - TYPE_UNSPECIFIED
- - BUILT_IN
- - CUSTOM
- type: string
- description: Role type indicating if it's built-in or custom.
- format: enum
- description: Role defines a set of permissions that can be assigned to users.
- Rollout:
- type: object
- properties:
- name:
- type: string
- description: |-
- The resource name of the rollout.
- Format: projects/{project}/plans/{plan}/rollout
- title:
- readOnly: true
- type: string
- description: |-
- The title of the rollout, inherited from the associated plan.
- This field is output only and cannot be directly set.
- stages:
- readOnly: true
- type: array
- items:
- $ref: '#/components/schemas/Stage'
- description: Stages and thus tasks of the rollout.
- createTime:
- readOnly: true
- type: string
- format: date-time
- updateTime:
- readOnly: true
- type: string
- format: date-time
- RolloutPolicy:
- type: object
- properties:
- automatic:
- type: boolean
- description: Whether rollout is automatic without manual approval.
- roles:
- type: array
- items:
- type: string
- description: The roles that can approve rollout execution.
- description: Rollout policy configuration.
- RowValue:
- type: object
- properties:
- nullValue:
- enum:
- - NULL_VALUE
- type: string
- format: enum
- boolValue:
- type: boolean
- bytesValue:
- type: string
- format: bytes
- doubleValue:
- type: number
- format: double
- floatValue:
- type: number
- format: float
- int32Value:
- type: integer
- format: int32
- int64Value:
- type: string
- stringValue:
- type: string
- uint32Value:
- type: integer
- format: uint32
- uint64Value:
- type: string
- valueValue:
- allOf:
- - $ref: '#/components/schemas/GoogleProtobufValue'
- description: value_value is used for Spanner and TUPLE ARRAY MAP in Clickhouse only.
- timestampValue:
- allOf:
- - $ref: '#/components/schemas/RowValue_Timestamp'
- description: |-
- timestamp_value is used for the timestamp without time zone data type,
- meaning it only includes the timestamp without any time zone or location
- info. Although it may be expressed as a UTC value, it should be seen as a
- timestamp missing location context.
- timestampTzValue:
- allOf:
- - $ref: '#/components/schemas/RowValue_TimestampTZ'
- description: |-
- timestamp_tz_value is used for the timestamptz data type, which
- accurately represents the timestamp with location information.
- RowValue_Timestamp:
- type: object
- properties:
- googleTimestamp:
- type: string
- format: date-time
- accuracy:
- type: integer
- description: The accuracy is the number of digits after the decimal point.
- format: int32
- RowValue_TimestampTZ:
- type: object
- properties:
- googleTimestamp:
- type: string
- format: date-time
- zone:
- type: string
- description: |-
- Zone is the time zone abbreviations in timezone database such as "PDT",
- "PST". https://en.wikipedia.org/wiki/List_of_tz_database_time_zones We
- retrieve the time zone information from the timestamptz field in the
- database. A timestamp is in UTC or epoch time, and with zone info, we can
- convert it to a local time string. Zone and offset are returned by
- time.Time.Zone()
- offset:
- type: integer
- description: The offset is in seconds east of UTC
- format: int32
- accuracy:
- type: integer
- format: int32
- RunPlanChecksRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The plan to run plan checks.
- Format: projects/{project}/plans/{plan}
- specId:
- type: string
- description: |-
- The UUID of the specific spec to run plan checks for.
- This should match the spec.id field in Plan.Spec.
- If not set, all specs in the plan will be used.
- RunPlanChecksResponse:
- type: object
- properties: {}
- SASLConfig:
- type: object
- properties:
- krbConfig:
- allOf:
- - $ref: '#/components/schemas/KerberosConfig'
- description: Kerberos authentication configuration.
- SQLReviewRule:
- type: object
- properties:
- type:
- enum:
- - TYPE_UNSPECIFIED
- - ENGINE_MYSQL_USE_INNODB
- - NAMING_FULLY_QUALIFIED
- - NAMING_TABLE
- - NAMING_COLUMN
- - NAMING_INDEX_PK
- - NAMING_INDEX_UK
- - NAMING_INDEX_FK
- - NAMING_INDEX_IDX
- - NAMING_COLUMN_AUTO_INCREMENT
- - NAMING_TABLE_NO_KEYWORD
- - NAMING_IDENTIFIER_NO_KEYWORD
- - NAMING_IDENTIFIER_CASE
- - STATEMENT_SELECT_NO_SELECT_ALL
- - STATEMENT_WHERE_REQUIRE_SELECT
- - STATEMENT_WHERE_REQUIRE_UPDATE_DELETE
- - STATEMENT_WHERE_NO_LEADING_WILDCARD_LIKE
- - STATEMENT_DISALLOW_ON_DEL_CASCADE
- - STATEMENT_DISALLOW_RM_TBL_CASCADE
- - STATEMENT_DISALLOW_COMMIT
- - STATEMENT_DISALLOW_LIMIT
- - STATEMENT_DISALLOW_ORDER_BY
- - STATEMENT_MERGE_ALTER_TABLE
- - STATEMENT_INSERT_ROW_LIMIT
- - STATEMENT_INSERT_MUST_SPECIFY_COLUMN
- - STATEMENT_INSERT_DISALLOW_ORDER_BY_RAND
- - STATEMENT_AFFECTED_ROW_LIMIT
- - STATEMENT_DML_DRY_RUN
- - STATEMENT_DISALLOW_ADD_COLUMN_WITH_DEFAULT
- - STATEMENT_ADD_CHECK_NOT_VALID
- - STATEMENT_ADD_FOREIGN_KEY_NOT_VALID
- - STATEMENT_DISALLOW_ADD_NOT_NULL
- - STATEMENT_SELECT_FULL_TABLE_SCAN
- - STATEMENT_CREATE_SPECIFY_SCHEMA
- - STATEMENT_CHECK_SET_ROLE_VARIABLE
- - STATEMENT_DISALLOW_USING_FILESORT
- - STATEMENT_DISALLOW_USING_TEMPORARY
- - STATEMENT_WHERE_NO_EQUAL_NULL
- - STATEMENT_WHERE_DISALLOW_FUNCTIONS_AND_CALCULATIONS
- - STATEMENT_QUERY_MINIMUM_PLAN_LEVEL
- - STATEMENT_WHERE_MAXIMUM_LOGICAL_OPERATOR_COUNT
- - STATEMENT_MAXIMUM_LIMIT_VALUE
- - STATEMENT_MAXIMUM_JOIN_TABLE_COUNT
- - STATEMENT_MAXIMUM_STATEMENTS_IN_TRANSACTION
- - STATEMENT_JOIN_STRICT_COLUMN_ATTRS
- - STATEMENT_NON_TRANSACTIONAL
- - STATEMENT_ADD_COLUMN_WITHOUT_POSITION
- - STATEMENT_DISALLOW_OFFLINE_DDL
- - STATEMENT_DISALLOW_CROSS_DB_QUERIES
- - STATEMENT_MAX_EXECUTION_TIME
- - STATEMENT_REQUIRE_ALGORITHM_OPTION
- - STATEMENT_REQUIRE_LOCK_OPTION
- - STATEMENT_OBJECT_OWNER_CHECK
- - TABLE_REQUIRE_PK
- - TABLE_NO_FOREIGN_KEY
- - TABLE_DROP_NAMING_CONVENTION
- - TABLE_COMMENT
- - TABLE_DISALLOW_PARTITION
- - TABLE_DISALLOW_TRIGGER
- - TABLE_NO_DUPLICATE_INDEX
- - TABLE_TEXT_FIELDS_TOTAL_LENGTH
- - TABLE_DISALLOW_SET_CHARSET
- - TABLE_DISALLOW_DDL
- - TABLE_DISALLOW_DML
- - TABLE_LIMIT_SIZE
- - TABLE_REQUIRE_CHARSET
- - TABLE_REQUIRE_COLLATION
- - COLUMN_REQUIRED
- - COLUMN_NO_NULL
- - COLUMN_DISALLOW_CHANGE_TYPE
- - COLUMN_SET_DEFAULT_FOR_NOT_NULL
- - COLUMN_DISALLOW_CHANGE
- - COLUMN_DISALLOW_CHANGING_ORDER
- - COLUMN_DISALLOW_DROP
- - COLUMN_DISALLOW_DROP_IN_INDEX
- - COLUMN_COMMENT
- - COLUMN_AUTO_INCREMENT_MUST_INTEGER
- - COLUMN_TYPE_DISALLOW_LIST
- - COLUMN_DISALLOW_SET_CHARSET
- - COLUMN_MAXIMUM_CHARACTER_LENGTH
- - COLUMN_MAXIMUM_VARCHAR_LENGTH
- - COLUMN_AUTO_INCREMENT_INITIAL_VALUE
- - COLUMN_AUTO_INCREMENT_MUST_UNSIGNED
- - COLUMN_CURRENT_TIME_COUNT_LIMIT
- - COLUMN_REQUIRE_DEFAULT
- - COLUMN_DEFAULT_DISALLOW_VOLATILE
- - COLUMN_ADD_NOT_NULL_REQUIRE_DEFAULT
- - COLUMN_REQUIRE_CHARSET
- - COLUMN_REQUIRE_COLLATION
- - SCHEMA_BACKWARD_COMPATIBILITY
- - DATABASE_DROP_EMPTY_DATABASE
- - INDEX_NO_DUPLICATE_COLUMN
- - INDEX_KEY_NUMBER_LIMIT
- - INDEX_PK_TYPE_LIMIT
- - INDEX_TYPE_NO_BLOB
- - INDEX_TOTAL_NUMBER_LIMIT
- - INDEX_PRIMARY_KEY_TYPE_ALLOWLIST
- - INDEX_CREATE_CONCURRENTLY
- - INDEX_TYPE_ALLOW_LIST
- - INDEX_NOT_REDUNDANT
- - SYSTEM_CHARSET_ALLOWLIST
- - SYSTEM_COLLATION_ALLOWLIST
- - SYSTEM_COMMENT_LENGTH
- - SYSTEM_PROCEDURE_DISALLOW_CREATE
- - SYSTEM_EVENT_DISALLOW_CREATE
- - SYSTEM_VIEW_DISALLOW_CREATE
- - SYSTEM_FUNCTION_DISALLOW_CREATE
- - SYSTEM_FUNCTION_DISALLOWED_LIST
- - ADVICE_ONLINE_MIGRATION
- - BUILTIN_PRIOR_BACKUP_CHECK
- type: string
- description: The type of SQL review rule.
- format: enum
- level:
- enum:
- - LEVEL_UNSPECIFIED
- - ERROR
- - WARNING
- type: string
- description: The severity level of the rule.
- format: enum
- namingPayload:
- $ref: '#/components/schemas/SQLReviewRule_NamingRulePayload'
- numberPayload:
- $ref: '#/components/schemas/SQLReviewRule_NumberRulePayload'
- stringArrayPayload:
- $ref: '#/components/schemas/SQLReviewRule_StringArrayRulePayload'
- commentConventionPayload:
- $ref: '#/components/schemas/SQLReviewRule_CommentConventionRulePayload'
- stringPayload:
- $ref: '#/components/schemas/SQLReviewRule_StringRulePayload'
- namingCasePayload:
- $ref: '#/components/schemas/SQLReviewRule_NamingCaseRulePayload'
- engine:
- enum:
- - ENGINE_UNSPECIFIED
- - CLICKHOUSE
- - MYSQL
- - POSTGRES
- - SNOWFLAKE
- - SQLITE
- - TIDB
- - MONGODB
- - REDIS
- - ORACLE
- - SPANNER
- - MSSQL
- - REDSHIFT
- - MARIADB
- - OCEANBASE
- - STARROCKS
- - DORIS
- - HIVE
- - ELASTICSEARCH
- - BIGQUERY
- - DYNAMODB
- - DATABRICKS
- - COCKROACHDB
- - COSMOSDB
- - TRINO
- - CASSANDRA
- type: string
- description: The database engine this rule applies to.
- format: enum
- description: SQL review rule configuration. Check the SQL_REVIEW_RULES_DOCUMENTATION.md for details.
- SQLReviewRule_CommentConventionRulePayload:
- type: object
- properties:
- required:
- type: boolean
- maxLength:
- type: integer
- format: int32
- SQLReviewRule_NamingCaseRulePayload:
- type: object
- properties:
- upper:
- type: boolean
- SQLReviewRule_NamingRulePayload:
- type: object
- properties:
- maxLength:
- type: integer
- format: int32
- format:
- type: string
- description: Payload message types for SQL review rules
- SQLReviewRule_NumberRulePayload:
- type: object
- properties:
- number:
- type: integer
- format: int32
- SQLReviewRule_StringArrayRulePayload:
- type: object
- properties:
- list:
- type: array
- items:
- type: string
- SQLReviewRule_StringRulePayload:
- type: object
- properties:
- value:
- type: string
- SchedulerInfo_WaitingCause:
- type: object
- properties:
- connectionLimit:
- type: boolean
- description: Waiting due to connection limit reached.
- task:
- allOf:
- - $ref: '#/components/schemas/WaitingCause_Task'
- description: Waiting for another task to complete.
- parallelTasksLimit:
- type: boolean
- description: Waiting due to parallel tasks limit.
- description: Information about why a task run is waiting.
- SchemaCatalog:
- type: object
- properties:
- name:
- type: string
- description: The schema name.
- tables:
- type: array
- items:
- $ref: '#/components/schemas/TableCatalog'
- description: The tables in the schema.
- description: Schema metadata within a database.
- SchemaMetadata:
- type: object
- properties:
- name:
- type: string
- description: |-
- The name is the schema name.
- It is an empty string for databases without such concept such as MySQL.
- tables:
- type: array
- items:
- $ref: '#/components/schemas/TableMetadata'
- description: The tables is the list of tables in a schema.
- externalTables:
- type: array
- items:
- $ref: '#/components/schemas/ExternalTableMetadata'
- description: The external_tables is the list of external tables in a schema.
- views:
- type: array
- items:
- $ref: '#/components/schemas/ViewMetadata'
- description: The views is the list of views in a schema.
- functions:
- type: array
- items:
- $ref: '#/components/schemas/FunctionMetadata'
- description: The functions is the list of functions in a schema.
- procedures:
- type: array
- items:
- $ref: '#/components/schemas/ProcedureMetadata'
- description: The procedures is the list of procedures in a schema.
- streams:
- type: array
- items:
- $ref: '#/components/schemas/StreamMetadata'
- description: |-
- The streams is the list of streams in a schema, currently, only used for
- Snowflake.
- tasks:
- type: array
- items:
- $ref: '#/components/schemas/TaskMetadata'
- description: |-
- The routines is the list of routines in a schema, currently, only used for
- Snowflake.
- materializedViews:
- type: array
- items:
- $ref: '#/components/schemas/MaterializedViewMetadata'
- description: The materialized_views is the list of materialized views in a schema.
- packages:
- type: array
- items:
- $ref: '#/components/schemas/PackageMetadata'
- description: The packages is the list of packages in a schema.
- owner:
- type: string
- description: The owner of the schema.
- sequences:
- type: array
- items:
- $ref: '#/components/schemas/SequenceMetadata'
- description: The sequences is the list of sequences in a schema, sorted by name.
- events:
- type: array
- items:
- $ref: '#/components/schemas/EventMetadata'
- description: The events is the list of scheduled events in a schema.
- enumTypes:
- type: array
- items:
- $ref: '#/components/schemas/EnumTypeMetadata'
- description: The enum_types is the list of user-defined enum types in a schema.
- skipDump:
- type: boolean
- description: Whether to skip this schema during schema dump operations.
- comment:
- type: string
- description: The comment is the comment of a schema.
- description: |-
- SchemaMetadata is the metadata for schemas.
- This is the concept of schema in Postgres, but it's a no-op for MySQL.
- SearchAuditLogsRequest:
- required:
- - parent
- type: object
- properties:
- parent:
- type: string
- filter:
- type: string
- description: |-
- The filter of the log. It should be a valid CEL expression.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Supported filter:
- - method: the API name, can be found in the docs, should start with "/bytebase.v1." prefix. For example "/bytebase.v1.UserService/CreateUser". Support "==" operator.
- - severity: support "==" operator, check Severity enum in AuditLog message for values.
- - user: the actor, should in "users/{email}" format, support "==" operator.
- - create_time: support ">=" and "<=" operator.
-
- For example:
- - filter = "method == '/bytebase.v1.SQLService/Query'"
- - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
- - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/[email protected]'"
- - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
- orderBy:
- type: string
- description: |-
- The order by of the log.
- Only support order by create_time. The default sorting order is ascending.
- For example:
- - order_by = "create_time asc"
- - order_by = "create_time desc"
- pageSize:
- type: integer
- description: |-
- The maximum number of logs to return.
- The service may return fewer than this value.
- If unspecified, at most 10 log entries will be returned.
- The maximum value is 5000; values above 5000 will be coerced to 5000.
- format: int32
- pageToken:
- type: string
- description: |-
- A page token, received from a previous `SearchLogs` call.
- Provide this to retrieve the subsequent page.
- description: Request message for searching audit logs.
- SearchAuditLogsResponse:
- type: object
- properties:
- auditLogs:
- type: array
- items:
- $ref: '#/components/schemas/AuditLog'
- nextPageToken:
- type: string
- description: |-
- A token to retrieve next page of log entities.
- Pass this value in the page_token field in the subsequent call
- to retrieve the next page of log entities.
- description: Response message for searching audit logs.
- SearchIssuesRequest:
- required:
- - parent
- type: object
- properties:
- parent:
- type: string
- description: |-
- The parent, which owns this collection of issues.
- Format: projects/{project}
- Use "projects/-" to list all issues from all projects.
- pageSize:
- type: integer
- description: |-
- The maximum number of issues to return. The service may return fewer than
- this value.
- If unspecified, at most 10 issues will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- format: int32
- pageToken:
- type: string
- description: |-
- A page token, received from a previous `SearchIssues` call.
- Provide this to retrieve the subsequent page.
+ Qualified names are represented by the
+ [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression.
+ title: Ident
+ additionalProperties: false
+ description: An identifier expression. e.g. `request`.
+ google.api.expr.v1alpha1.Expr.Select:
+ type: object
+ properties:
+ operand:
+ title: operand
+ description: |-
+ Required. The target of the selection expression.
- When paginating, all other parameters provided to `SearchIssues` must match
- the call that provided the page token.
- filter:
- type: string
- description: |-
- Filter is used to filter issues returned in the list.
- Check the filter field in the ListIssuesRequest message.
- query:
- type: string
- description: Query is the query statement.
- SearchIssuesResponse:
- type: object
- properties:
- issues:
- type: array
- items:
- $ref: '#/components/schemas/Issue'
- description: The issues from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- SearchProjectsRequest:
- type: object
- properties:
- showDeleted:
- type: boolean
- description: Show deleted projects if specified.
- filter:
- type: string
- description: |-
- Filter the project.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Supported filters:
- - name: the project name, support "==" and ".matches()" operator.
- - resource_id: the project id, support "==" and ".matches()" operator.
- - exclude_default: if not include the default project, should be "true" or "false", support "==" operator.
- - state: check the State enum for the values, support "==" operator.
- - labels.{key}: the project label, support "==" and "in" operators.
-
- For example:
- name == "project name"
- name.matches("project name")
- resource_id == "project id"
- resource_id.matches("project id")
- exclude_default == true
- state == "DELETED"
- labels.environment == "production"
- labels.tier == "critical"
- labels.environment in ["staging", "prod"]
- You can combine filter conditions like:
- name == "project name" && resource_id.matches("project id")
- name.matches("project name") || resource_id == "project id"
- labels.environment == "production" && labels.tier == "critical"
- pageSize:
- type: integer
- description: |-
- The maximum number of projects to return. The service may return fewer than
- this value.
- If unspecified, at most 10 projects will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- format: int32
- pageToken:
- type: string
- description: |-
- A page token, received from a previous `SearchProjects` call.
- Provide this to retrieve the subsequent page.
+ For example, in the select expression `request.auth`, the `request`
+ portion of the expression is the `operand`.
+ $ref: '#/components/schemas/google.api.expr.v1alpha1.Expr'
+ field:
+ type: string
+ title: field
+ description: |-
+ Required. The name of the field to select.
+
+ For example, in the select expression `request.auth`, the `auth` portion
+ of the expression would be the `field`.
+ testOnly:
+ type: boolean
+ title: test_only
+ description: |-
+ Whether the select is to be interpreted as a field presence test.
+
+ This results from the macro `has(request.auth)`.
+ title: Select
+ additionalProperties: false
+ description: A field selection expression. e.g. `request.auth`.
+ google.protobuf.Any:
+ type: object
+ properties:
+ type:
+ type: string
+ value:
+ type: string
+ format: binary
+ additionalProperties: true
+ description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
+ google.protobuf.Duration:
+ type: string
+ format: duration
+ description: |-
+ A Duration represents a signed, fixed-length span of time represented
+ as a count of seconds and fractions of seconds at nanosecond
+ resolution. It is independent of any calendar and concepts like "day"
+ or "month". It is related to Timestamp in that the difference between
+ two Timestamp values is a Duration and it can be added or subtracted
+ from a Timestamp. Range is approximately +-10,000 years.
+
+ # Examples
+
+ Example 1: Compute Duration from two Timestamps in pseudo code.
+
+ Timestamp start = ...;
+ Timestamp end = ...;
+ Duration duration = ...;
+
+ duration.seconds = end.seconds - start.seconds;
+ duration.nanos = end.nanos - start.nanos;
+
+ if (duration.seconds < 0 && duration.nanos > 0) {
+ duration.seconds += 1;
+ duration.nanos -= 1000000000;
+ } else if (duration.seconds > 0 && duration.nanos < 0) {
+ duration.seconds -= 1;
+ duration.nanos += 1000000000;
+ }
+
+ Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
+
+ Timestamp start = ...;
+ Duration duration = ...;
+ Timestamp end = ...;
+
+ end.seconds = start.seconds + duration.seconds;
+ end.nanos = start.nanos + duration.nanos;
+
+ if (end.nanos < 0) {
+ end.seconds -= 1;
+ end.nanos += 1000000000;
+ } else if (end.nanos >= 1000000000) {
+ end.seconds += 1;
+ end.nanos -= 1000000000;
+ }
+
+ Example 3: Compute Duration from datetime.timedelta in Python.
+
+ td = datetime.timedelta(days=3, minutes=10)
+ duration = Duration()
+ duration.FromTimedelta(td)
+
+ # JSON Mapping
+
+ In JSON format, the Duration type is encoded as a string rather than an
+ object, where the string ends in the suffix "s" (indicating seconds) and
+ is preceded by the number of seconds, with nanoseconds expressed as
+ fractional seconds. For example, 3 seconds with 0 nanoseconds should be
+ encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
+ be expressed in JSON format as "3.000000001s", and 3 seconds and 1
+ microsecond should be expressed in JSON format as "3.000001s".
+ google.protobuf.Empty:
+ type: object
+ description: |-
+ A generic empty message that you can re-use to avoid defining duplicated
+ empty messages in your APIs. A typical example is to use it as the request
+ or the response type of an API method. For instance:
+
+ service Foo {
+ rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
+ }
+ google.protobuf.FieldMask:
+ type: string
+ description: |-
+ `FieldMask` represents a set of symbolic field paths, for example:
+
+ paths: "f.a"
+ paths: "f.b.d"
+
+ Here `f` represents a field in some root message, `a` and `b`
+ fields in the message found in `f`, and `d` a field found in the
+ message in `f.b`.
+
+ Field masks are used to specify a subset of fields that should be
+ returned by a get operation or modified by an update operation.
+ Field masks also have a custom JSON encoding (see below).
+
+ # Field Masks in Projections
+
+ When used in the context of a projection, a response message or
+ sub-message is filtered by the API to only contain those fields as
+ specified in the mask. For example, if the mask in the previous
+ example is applied to a response message as follows:
+
+ f {
+ a : 22
+ b {
+ d : 1
+ x : 2
+ }
+ y : 13
+ }
+ z: 8
+
+ The result will not contain specific values for fields x,y and z
+ (their value will be set to the default, and omitted in proto text
+ output):
+
+
+ f {
+ a : 22
+ b {
+ d : 1
+ }
+ }
+
+ A repeated field is not allowed except at the last position of a
+ paths string.
+
+ If a FieldMask object is not present in a get operation, the
+ operation applies to all fields (as if a FieldMask of all fields
+ had been specified).
+
+ Note that a field mask does not necessarily apply to the
+ top-level response message. In case of a REST get operation, the
+ field mask applies directly to the response, but in case of a REST
+ list operation, the mask instead applies to each individual message
+ in the returned resource list. In case of a REST custom method,
+ other definitions may be used. Where the mask applies will be
+ clearly documented together with its declaration in the API. In
+ any case, the effect on the returned resource/resources is required
+ behavior for APIs.
+
+ # Field Masks in Update Operations
+
+ A field mask in update operations specifies which fields of the
+ targeted resource are going to be updated. The API is required
+ to only change the values of the fields as specified in the mask
+ and leave the others untouched. If a resource is passed in to
+ describe the updated values, the API ignores the values of all
+ fields not covered by the mask.
+
+ If a repeated field is specified for an update operation, new values will
+ be appended to the existing repeated field in the target resource. Note that
+ a repeated field is only allowed in the last position of a `paths` string.
+
+ If a sub-message is specified in the last position of the field mask for an
+ update operation, then new value will be merged into the existing sub-message
+ in the target resource.
+
+ For example, given the target message:
+
+ f {
+ b {
+ d: 1
+ x: 2
+ }
+ c: [1]
+ }
+
+ And an update message:
+
+ f {
+ b {
+ d: 10
+ }
+ c: [2]
+ }
+
+ then if the field mask is:
+
+ paths: ["f.b", "f.c"]
+
+ then the result will be:
+
+ f {
+ b {
+ d: 10
+ x: 2
+ }
+ c: [1, 2]
+ }
+
+ An implementation may provide options to override this default behavior for
+ repeated and message fields.
+
+ In order to reset a field's value to the default, the field must
+ be in the mask and set to the default value in the provided resource.
+ Hence, in order to reset all fields of a resource, provide a default
+ instance of the resource and set all fields in the mask, or do
+ not provide a mask as described below.
+
+ If a field mask is not present on update, the operation applies to
+ all fields (as if a field mask of all fields has been specified).
+ Note that in the presence of schema evolution, this may mean that
+ fields the client does not know and has therefore not filled into
+ the request will be reset to their default. If this is unwanted
+ behavior, a specific service may require a client to always specify
+ a field mask, producing an error if not.
+
+ As with get operations, the location of the resource which
+ describes the updated values in the request message depends on the
+ operation kind. In any case, the effect of the field mask is
+ required to be honored by the API.
+
+ ## Considerations for HTTP REST
+
+ The HTTP kind of an update operation which uses a field mask must
+ be set to PATCH instead of PUT in order to satisfy HTTP semantics
+ (PUT must only be used for full updates).
+
+ # JSON Encoding of Field Masks
+
+ In JSON, a field mask is encoded as a single string where paths are
+ separated by a comma. Fields name in each path are converted
+ to/from lower-camel naming conventions.
+
+ As an example, consider the following message declarations:
+
+ message Profile {
+ User user = 1;
+ Photo photo = 2;
+ }
+ message User {
+ string display_name = 1;
+ string address = 2;
+ }
+
+ In proto a field mask for `Profile` may look as such:
+
+ mask {
+ paths: "user.display_name"
+ paths: "photo"
+ }
+
+ In JSON, the same mask is represented as below:
+
+ {
+ mask: "user.displayName,photo"
+ }
+
+ # Field Masks and Oneof Fields
+
+ Field masks treat fields in oneofs just as regular fields. Consider the
+ following message:
+
+ message SampleMessage {
+ oneof test_oneof {
+ string name = 4;
+ SubMessage sub_message = 9;
+ }
+ }
+
+ The field mask can be:
+
+ mask {
+ paths: "name"
+ }
+
+ Or:
+
+ mask {
+ paths: "sub_message"
+ }
+
+ Note that oneof type names ("test_oneof" in this case) cannot be used in
+ paths.
+
+ ## Field Mask Verification
+
+ The implementation of any API method which has a FieldMask type field in the
+ request should verify the included field paths, and return an
+ `INVALID_ARGUMENT` error if any path is unmappable.
+ google.protobuf.ListValue:
+ type: object
+ properties:
+ values:
+ type: array
+ items:
+ $ref: '#/components/schemas/google.protobuf.Value'
+ title: values
+ description: Repeated field of dynamically typed values.
+ title: ListValue
+ additionalProperties: false
+ description: |-
+ `ListValue` is a wrapper around a repeated field of values.
+
+ The JSON representation for `ListValue` is JSON array.
+ google.protobuf.NullValue:
+ type: string
+ title: NullValue
+ enum:
+ - NULL_VALUE
+ description: |-
+ `NullValue` is a singleton enumeration to represent the null value for the
+ `Value` type union.
+
+ The JSON representation for `NullValue` is JSON `null`.
+ google.protobuf.Struct:
+ type: object
+ additionalProperties:
+ $ref: '#/components/schemas/google.protobuf.Value'
+ description: |-
+ `Struct` represents a structured data value, consisting of fields
+ which map to dynamically typed values. In some languages, `Struct`
+ might be supported by a native representation. For example, in
+ scripting languages like JS a struct is represented as an
+ object. The details of that representation are described together
+ with the proto support for the language.
+
+ The JSON representation for `Struct` is JSON object.
+ google.protobuf.Struct.FieldsEntry:
+ type: object
+ properties:
+ key:
+ type: string
+ title: key
+ value:
+ title: value
+ $ref: '#/components/schemas/google.protobuf.Value'
+ title: FieldsEntry
+ additionalProperties: false
+ google.protobuf.Timestamp:
+ type: string
+ examples:
+ - "2023-01-15T01:30:15.01Z"
+ - "2024-12-25T12:00:00Z"
+ format: date-time
+ description: |-
+ A Timestamp represents a point in time independent of any time zone or local
+ calendar, encoded as a count of seconds and fractions of seconds at
+ nanosecond resolution. The count is relative to an epoch at UTC midnight on
+ January 1, 1970, in the proleptic Gregorian calendar which extends the
+ Gregorian calendar backwards to year one.
+
+ All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
+ second table is needed for interpretation, using a [24-hour linear
+ smear](https://developers.google.com/time/smear).
+
+ The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
+ restricting to that range, we ensure that we can convert to and from [RFC
+ 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
+
+ # Examples
+
+ Example 1: Compute Timestamp from POSIX `time()`.
+
+ Timestamp timestamp;
+ timestamp.set_seconds(time(NULL));
+ timestamp.set_nanos(0);
+
+ Example 2: Compute Timestamp from POSIX `gettimeofday()`.
+
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+
+ Timestamp timestamp;
+ timestamp.set_seconds(tv.tv_sec);
+ timestamp.set_nanos(tv.tv_usec * 1000);
+
+ Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
+
+ FILETIME ft;
+ GetSystemTimeAsFileTime(&ft);
+ UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
+
+ // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
+ // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
+ Timestamp timestamp;
+ timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
+ timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
+
+ Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
+
+ long millis = System.currentTimeMillis();
+
+ Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
+ .setNanos((int) ((millis % 1000) * 1000000)).build();
+
+ Example 5: Compute Timestamp from Java `Instant.now()`.
+
+ Instant now = Instant.now();
+
+ Timestamp timestamp =
+ Timestamp.newBuilder().setSeconds(now.getEpochSecond())
+ .setNanos(now.getNano()).build();
+
+ Example 6: Compute Timestamp from current time in Python.
+
+ timestamp = Timestamp()
+ timestamp.GetCurrentTime()
+
+ # JSON Mapping
+
+ In JSON format, the Timestamp type is encoded as a string in the
+ [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
+ format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
+ where {year} is always expressed using four digits while {month}, {day},
+ {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
+ seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
+ are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
+ is required. A proto3 JSON serializer should always use UTC (as indicated by
+ "Z") when printing the Timestamp type and a proto3 JSON parser should be
+ able to accept both UTC and other timezones (as indicated by an offset).
+
+ For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
+ 01:30 UTC on January 15, 2017.
+
+ In JavaScript, one can convert a Date object to this format using the
+ standard
+ [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
+ method. In Python, a standard `datetime.datetime` object can be converted
+ to this format using
+ [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
+ the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
+ the Joda Time's [`ISODateTimeFormat.dateTime()`](
+ http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
+ ) to obtain a formatter capable of generating timestamps in this format.
+ google.protobuf.Value:
+ oneOf:
+ - type: "null"
+ - type: number
+ - type: string
+ - type: boolean
+ - type: array
+ - type: object
+ additionalProperties: true
+ description: |-
+ `Value` represents a dynamically typed value which can be either
+ null, a number, a string, a boolean, a recursive struct value, or a
+ list of values. A producer of value is expected to set one of these
+ variants. Absence of any variant indicates an error.
+
+ The JSON representation for `Value` is JSON value.
+ google.rpc.Status:
+ type: object
+ properties:
+ code:
+ type: integer
+ title: code
+ format: int32
+ description: |-
+ The status code, which should be an enum value of
+ [google.rpc.Code][google.rpc.Code].
+ message:
+ type: string
+ title: message
+ description: |-
+ A developer-facing error message, which should be in English. Any
+ user-facing error message should be localized and sent in the
+ [google.rpc.Status.details][google.rpc.Status.details] field, or localized
+ by the client.
+ details:
+ type: array
+ items:
+ $ref: '#/components/schemas/google.protobuf.Any'
+ title: details
+ description: |-
+ A list of messages that carry the error details. There is a common set of
+ message types for APIs to use.
+ title: Status
+ additionalProperties: false
+ description: |-
+ The `Status` type defines a logical error model that is suitable for
+ different programming environments, including REST APIs and RPC APIs. It is
+ used by [gRPC](https://github.com/grpc). Each `Status` message contains
+ three pieces of data: error code, error message, and error details.
+
+ You can find out more about this error model and how to work with it in the
+ [API Design Guide](https://cloud.google.com/apis/design/errors).
+ google.type.Expr:
+ type: object
+ properties:
+ expression:
+ type: string
+ title: expression
+ description: |-
+ Textual representation of an expression in Common Expression Language
+ syntax.
+ title:
+ type: string
+ title: title
+ description: |-
+ Optional. Title for the expression, i.e. a short string describing
+ its purpose. This can be used e.g. in UIs which allow to enter the
+ expression.
+ description:
+ type: string
+ title: description
+ description: |-
+ Optional. Description of the expression. This is a longer text which
+ describes the expression, e.g. when hovered over it in a UI.
+ location:
+ type: string
+ title: location
+ description: |-
+ Optional. String indicating the location of the expression for error
+ reporting, e.g. a file name and a position in the file.
+ title: Expr
+ additionalProperties: false
+ description: |-
+ Represents a textual expression in the Common Expression Language (CEL)
+ syntax. CEL is a C-like expression language. The syntax and semantics of CEL
+ are documented at https://github.com/google/cel-spec.
- When paginating, all other parameters provided to `SearchProjects` must match
- the call that provided the page token.
- orderBy:
- type: string
- description: |-
- The order by of projects.
- Support title. The default sorting order is ascending.
- For example:
- - order_by = "title"
- - order_by = "title desc"
- - order_by = "title asc"
- SearchProjectsResponse:
- type: object
- properties:
- projects:
- type: array
- items:
- $ref: '#/components/schemas/Project'
- description: The projects from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- SearchQueryHistoriesRequest:
- type: object
- properties:
- pageSize:
- type: integer
- description: |-
- The maximum number of histories to return.
- The service may return fewer than this value.
- If unspecified, at most 10 history entries will be returned.
- The maximum value is 1000; values above 1000 will be coerced to 1000.
- format: int32
- pageToken:
- type: string
- description: |-
- A page token, received from a previous `ListQueryHistory` call.
- Provide this to retrieve the subsequent page.
- filter:
- type: string
- description: |-
- Filter is the filter to apply on the search query history
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Supported filter:
- - project: the project full name in "projects/{id}" format, support "==" operator.
- - database: the database full name in "instances/{id}/databases/{name}" format, support "==" operator.
- - instance: the instance full name in "instances/{id}" format, support "==" operator.
- - type: the type, should be "QUERY" or "EXPORT", support "==" operator.
- - statement: the SQL statement, support ".matches()" operator.
-
- For example:
- project == "projects/{project}"
- database == "instances/{instance}/databases/{database}"
- instance == "instances/{instance}"
- type == "QUERY"
- type == "EXPORT"
- statement.matches("select")
- type == "QUERY" && statement.matches("select")
- SearchQueryHistoriesResponse:
- type: object
- properties:
- queryHistories:
- readOnly: true
- type: array
- items:
- $ref: '#/components/schemas/QueryHistory'
- description: The list of history.
- nextPageToken:
- type: string
- description: |-
- A token to retrieve next page of history.
- Pass this value in the page_token field in the subsequent call to
- `ListQueryHistory` method to retrieve the next page of history.
- SearchReleasesResponse:
- type: object
- properties:
- releases:
- type: array
- items:
- $ref: '#/components/schemas/Release'
- description: The releases matching the search criteria.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
- SearchWorksheetsRequest:
- type: object
- properties:
- filter:
- type: string
- description: |-
- To filter the search result.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- Supported filter:
- - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
- - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
- - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
- - project: the project full name in "projects/{id}" format, support "==" operator.
-
- For example:
- creator == "users/{email}"
- creator != "users/{email}"
- starred == true
- starred == false
- visibility in ["PRIVATE", "PROJECT_READ", "PROJECT_WRITE"]
- visibility == "PRIVATE"
- project == "projects/{project resource id}"
- SearchWorksheetsResponse:
- type: object
- properties:
- worksheets:
- type: array
- items:
- $ref: '#/components/schemas/Worksheet'
- description: The worksheets that matched the search criteria.
- SemanticTypeSetting:
- type: object
- properties:
- types:
- type: array
- items:
- $ref: '#/components/schemas/SemanticTypeSetting_SemanticType'
- SemanticTypeSetting_SemanticType:
- type: object
- properties:
- id:
- type: string
- description: id is the uuid for semantic type.
- title:
- type: string
- description: the title of the semantic type, it should not be empty.
- description:
- type: string
- description: the description of the semantic type, it can be empty.
- algorithm:
- $ref: '#/components/schemas/Algorithm'
- icon:
- type: string
- description: icon is the icon for semantic type, it can be emoji or base64 encoded image.
- SequenceMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name of a sequence.
- dataType:
- type: string
- description: The data type of a sequence.
- start:
- type: string
- description: The start value of a sequence.
- minValue:
- type: string
- description: The minimum value of a sequence.
- maxValue:
- type: string
- description: The maximum value of a sequence.
- increment:
- type: string
- description: Increment value of a sequence.
- cycle:
- type: boolean
- description: Cycle is whether the sequence cycles.
- cacheSize:
- type: string
- description: Cache size of a sequence.
- lastValue:
- type: string
- description: Last value of a sequence.
- ownerTable:
- type: string
- description: The owner table of the sequence.
- ownerColumn:
- type: string
- description: The owner column of the sequence.
- comment:
- type: string
- description: The comment describing the sequence.
- skipDump:
- type: boolean
- description: Whether to skip this sequence during schema dump operations.
- SetIamPolicyRequest:
- required:
- - resource
- - policy
- type: object
- properties:
- resource:
- type: string
- description: |-
- The name of the resource to set the IAM policy.
- Format: projects/{project}
- Format: workspaces/{workspace}
- policy:
- $ref: '#/components/schemas/IamPolicy'
- etag:
- type: string
- description: The current etag of the policy.
- description: Request message for setting an IAM policy.
- Setting:
- required:
- - value
- type: object
- properties:
- name:
- type: string
- description: |-
- The resource name of the setting.
- Format: settings/{setting}
- Example: "settings/SEMANTIC_TYPES"
- value:
- allOf:
- - $ref: '#/components/schemas/SettingValue'
- description: The configuration value of the setting.
- description: The schema of setting.
- SettingValue:
- type: object
- properties:
- appIm:
- $ref: '#/components/schemas/AppIMSetting'
- workspaceProfile:
- $ref: '#/components/schemas/WorkspaceProfileSetting'
- workspaceApproval:
- $ref: '#/components/schemas/WorkspaceApprovalSetting'
- dataClassification:
- $ref: '#/components/schemas/DataClassificationSetting'
- semanticType:
- $ref: '#/components/schemas/SemanticTypeSetting'
- ai:
- $ref: '#/components/schemas/AISetting'
- environment:
- $ref: '#/components/schemas/EnvironmentSetting'
- description: The data in setting value.
- Sheet:
- required:
- - name
- - content
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the sheet resource.
- Format: projects/{project}/sheets/{sheet}
- The sheet ID is generated by the server on creation and cannot be changed.
- content:
- type: string
- description: |-
- The content of the sheet.
- By default, it will be cut off, if it doesn't match the `content_size`, you can
- set the `raw` to true in GetSheet request to retrieve the full content.
- format: bytes
- contentSize:
- readOnly: true
- type: string
- description: content_size is the full size of the content, may not match the size of the `content` field.
- SpatialIndexConfig:
- type: object
- properties:
- method:
- type: string
- description: Spatial indexing method (e.g., "SPATIAL", "R-TREE", "GIST")
- tessellation:
- allOf:
- - $ref: '#/components/schemas/TessellationConfig'
- description: Tessellation configuration for grid-based spatial indexes
- storage:
- allOf:
- - $ref: '#/components/schemas/StorageConfig'
- description: Storage and performance configuration
- dimensional:
- allOf:
- - $ref: '#/components/schemas/DimensionalConfig'
- description: Dimensional configuration
- description: SpatialIndexConfig defines the spatial index configuration for spatial databases.
- Stage:
- type: object
- properties:
- name:
- type: string
- description: |-
- Format: projects/{project}/plans/{plan}/rollout/stages/{stage}
- Use "-" for {stage} when the stage has no environment or deleted environment.
- id:
- readOnly: true
- type: string
- description: |-
- id is the environment id of the stage.
- e.g., "prod".
- Use "-" when the stage has no environment or deleted environment.
- environment:
- type: string
- description: |-
- environment is the environment of the stage.
- Format: environments/{environment} for valid environments, or "environments/-" for stages without environment or with deleted environments.
- tasks:
- type: array
- items:
- $ref: '#/components/schemas/Task'
- description: The tasks within this stage.
- Status:
- type: object
- properties:
- code:
- type: integer
- description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
- format: int32
- message:
- type: string
- description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
- details:
- type: array
- items:
- $ref: '#/components/schemas/GoogleProtobufAny'
- description: A list of messages that carry the error details. There is a common set of message types for APIs to use.
- description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).'
- StorageConfig:
- type: object
- properties:
- fillfactor:
- type: integer
- description: Fill factor percentage (1-100)
- format: int32
- buffering:
- type: string
- description: Buffering mode for PostgreSQL (auto, on, off)
- tablespace:
- type: string
- description: Tablespace configuration for Oracle
- workTablespace:
- type: string
- sdoLevel:
- type: integer
- format: int32
- commitInterval:
- type: integer
- format: int32
- padIndex:
- type: boolean
- description: SQL Server specific parameters
- sortInTempdb:
- type: string
- dropExisting:
- type: boolean
- online:
- type: boolean
- allowRowLocks:
- type: boolean
- allowPageLocks:
- type: boolean
- maxdop:
- type: integer
- format: int32
- dataCompression:
- type: string
- description: StorageConfig defines storage and performance parameters for spatial indexes.
- StreamMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a stream.
- tableName:
- type: string
- description: The table_name is the name of the table/view that the stream is created on.
- owner:
- type: string
- description: The owner of the stream.
- comment:
- type: string
- description: The comment of the stream.
- type:
- enum:
- - TYPE_UNSPECIFIED
- - DELTA
- type: string
- description: The type of the stream.
- format: enum
- stale:
- type: boolean
- description: Indicates whether the stream was last read before the `stale_after` time.
- mode:
- enum:
- - MODE_UNSPECIFIED
- - DEFAULT
- - APPEND_ONLY
- - INSERT_ONLY
- type: string
- description: The mode of the stream.
- format: enum
- definition:
- type: string
- description: The definition of the stream.
- Subscription:
- type: object
- properties:
- plan:
- readOnly: true
- enum:
- - PLAN_TYPE_UNSPECIFIED
- - FREE
- - TEAM
- - ENTERPRISE
- type: string
- format: enum
- seats:
- readOnly: true
- type: integer
- format: int32
- instances:
- readOnly: true
- type: integer
- format: int32
- activeInstances:
- readOnly: true
- type: integer
- format: int32
- expiresTime:
- readOnly: true
- type: string
- format: date-time
- trialing:
- readOnly: true
- type: boolean
- orgName:
- readOnly: true
- type: string
- SyncDatabaseRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the database to sync.
- Format: instances/{instance}/databases/{database}
- SyncDatabaseResponse:
- type: object
- properties: {}
- SyncInstanceRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of instance.
- Format: instances/{instance}
- enableFullSync:
- type: boolean
- description: |-
- When full sync is enabled, all databases in the instance will be synchronized. Otherwise, only
- the instance metadata (such as the database list) and any newly discovered databases will be synced.
- SyncInstanceResponse:
- type: object
- properties:
- databases:
- type: array
- items:
- type: string
- description: All database name list in the instance.
- TableCatalog:
- type: object
- properties:
- name:
- type: string
- description: The table name.
- columns:
- allOf:
- - $ref: '#/components/schemas/TableCatalog_Columns'
- description: Regular table columns.
- objectSchema:
- allOf:
- - $ref: '#/components/schemas/ObjectSchema'
- description: Object schema for JSON/XML columns.
- classification:
- type: string
- description: The data classification level for this table.
- description: Table metadata within a schema.
- TableCatalog_Columns:
- type: object
- properties:
- columns:
- type: array
- items:
- $ref: '#/components/schemas/ColumnCatalog'
- description: The columns in the table.
- description: Column list for regular tables.
- TableMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a table.
- columns:
- type: array
- items:
- $ref: '#/components/schemas/ColumnMetadata'
- description: The columns is the ordered list of columns in a table.
- indexes:
- type: array
- items:
- $ref: '#/components/schemas/IndexMetadata'
- description: The indexes is the list of indexes in a table.
- engine:
- type: string
- description: The engine is the engine of a table.
- collation:
- type: string
- description: The collation is the collation of a table.
- charset:
- type: string
- description: The character set of table.
- rowCount:
- type: string
- description: The row_count is the estimated number of rows of a table.
- dataSize:
- type: string
- description: The data_size is the estimated data size of a table.
- indexSize:
- type: string
- description: The index_size is the estimated index size of a table.
- dataFree:
- type: string
- description: The data_free is the estimated free data size of a table.
- createOptions:
- type: string
- description: The create_options is the create option of a table.
- comment:
- type: string
- description: The comment is the comment of a table.
- foreignKeys:
- type: array
- items:
- $ref: '#/components/schemas/ForeignKeyMetadata'
- description: The foreign_keys is the list of foreign keys in a table.
- partitions:
- type: array
- items:
- $ref: '#/components/schemas/TablePartitionMetadata'
- description: The partitions is the list of partitions in a table.
- checkConstraints:
- type: array
- items:
- $ref: '#/components/schemas/CheckConstraintMetadata'
- description: The check_constraints is the list of check constraints in a table.
- owner:
- type: string
- description: The owner of the table.
- sortingKeys:
- type: array
- items:
- type: string
- description: |-
- The sorting_keys is a tuple of column names or arbitrary expressions. ClickHouse specific field.
- Reference: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#order_by
- triggers:
- type: array
- items:
- $ref: '#/components/schemas/TriggerMetadata'
- description: The triggers is the list of triggers associated with the table.
- skipDump:
- type: boolean
- description: Whether to skip this table during schema dump operations.
- shardingInfo:
- type: string
- description: https://docs.pingcap.com/tidb/stable/information-schema-tables/
- primaryKeyType:
- type: string
- description: |-
- https://docs.pingcap.com/tidb/stable/clustered-indexes/#clustered-indexes
- CLUSTERED or NONCLUSTERED.
- description: TableMetadata is the metadata for tables.
- TablePartitionMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a table partition.
- type:
- enum:
- - TYPE_UNSPECIFIED
- - RANGE
- - RANGE_COLUMNS
- - LIST
- - LIST_COLUMNS
- - HASH
- - LINEAR_HASH
- - KEY
- - LINEAR_KEY
- type: string
- description: The type of a table partition.
- format: enum
- expression:
- type: string
- description: |-
- The expression is the expression of a table partition.
- For PostgreSQL, the expression is the text of {FOR VALUES
- partition_bound_spec}, see
- https://www.postgresql.org/docs/current/sql-createtable.html. For MySQL,
- the expression is the `expr` or `column_list` of the following syntax.
- PARTITION BY
- { [LINEAR] HASH(expr)
- | [LINEAR] KEY [ALGORITHM={1 | 2}] (column_list)
- | RANGE{(expr) | COLUMNS(column_list)}
- | LIST{(expr) | COLUMNS(column_list)} }.
- value:
- type: string
- description: |-
- The value is the value of a table partition.
- For MySQL, the value is for RANGE and LIST partition types,
- - For a RANGE partition, it contains the value set in the partition's
- VALUES LESS THAN clause, which can be either an integer or MAXVALUE.
- - For a LIST partition, this column contains the values defined in the
- partition's VALUES IN clause, which is a list of comma-separated integer
- values.
- - For others, it's an empty string.
- useDefault:
- type: string
- description: |-
- The use_default is whether the users use the default partition, it stores
- the different value for different database engines. For MySQL, it's [INT]
- type, 0 means not use default partition, otherwise, it's equals to number
- in syntax [SUB]PARTITION {number}.
- subpartitions:
- type: array
- items:
- $ref: '#/components/schemas/TablePartitionMetadata'
- description: The subpartitions is the list of subpartitions in a table partition.
- indexes:
- type: array
- items:
- $ref: '#/components/schemas/IndexMetadata'
- checkConstraints:
- type: array
- items:
- $ref: '#/components/schemas/CheckConstraintMetadata'
- description: TablePartitionMetadata is the metadata for table partitions.
- TagPolicy:
- type: object
- properties:
- tags:
- type: object
- additionalProperties:
- type: string
- description: |-
- tags is the key - value map for resources.
- for example, the environment resource can have the sql review config tag, like "bb.tag.review_config": "reviewConfigs/{review config resource id}"
- description: Policy for tagging resources with metadata.
- Task:
- type: object
- properties:
- name:
- type: string
- description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}'
- specId:
- type: string
- description: A UUID4 string that uniquely identifies the Spec.
- status:
- enum:
- - STATUS_UNSPECIFIED
- - NOT_STARTED
- - PENDING
- - RUNNING
- - DONE
- - FAILED
- - CANCELED
- - SKIPPED
- type: string
- description: Status is the status of the task.
- format: enum
- skippedReason:
- type: string
- description: The reason why the task was skipped.
- type:
- enum:
- - TYPE_UNSPECIFIED
- - GENERAL
- - DATABASE_CREATE
- - DATABASE_MIGRATE
- - DATABASE_EXPORT
- - DATABASE_SDL
- type: string
- format: enum
- target:
- type: string
- description: |-
- Format: instances/{instance} if the task is DatabaseCreate.
- Format: instances/{instance}/databases/{database}
- databaseCreate:
- $ref: '#/components/schemas/Task_DatabaseCreate'
- databaseUpdate:
- $ref: '#/components/schemas/Task_DatabaseUpdate'
- databaseDataExport:
- $ref: '#/components/schemas/Task_DatabaseDataExport'
- updateTime:
- readOnly: true
- type: string
- description: |-
- The update_time is the update time of latest task run.
- If there are no task runs, it will be empty.
- format: date-time
- runTime:
- readOnly: true
- type: string
- description: |-
- The run_time is the scheduled run time of latest task run.
- If there are no task runs or the task run is not scheduled, it will be empty.
- format: date-time
- TaskMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a task.
- id:
- type: string
- description: |-
- The id is the snowflake-generated id of a task.
- Example: 01ad32a0-1bb6-5e93-0000-000000000001
- owner:
- type: string
- description: The owner of the task.
- comment:
- type: string
- description: The comment of the task.
- warehouse:
- type: string
- description: The warehouse of the task.
- schedule:
- type: string
- description: The schedule interval of the task.
- predecessors:
- type: array
- items:
- type: string
- description: The predecessor tasks of the task.
- state:
- enum:
- - STATE_UNSPECIFIED
- - STARTED
- - SUSPENDED
- type: string
- description: The state of the task.
- format: enum
- condition:
- type: string
- description: The condition of the task.
- definition:
- type: string
- description: The definition of the task.
- TaskRun:
- type: object
- properties:
- name:
- type: string
- description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}'
- creator:
- type: string
- description: 'Format: users/[email protected]'
- createTime:
- readOnly: true
- type: string
- format: date-time
- updateTime:
- readOnly: true
- type: string
- format: date-time
- status:
- enum:
- - STATUS_UNSPECIFIED
- - PENDING
- - RUNNING
- - DONE
- - FAILED
- - CANCELED
- type: string
- description: The current execution status of the task run.
- format: enum
- detail:
- type: string
- description: |-
- Below are the results of a task run.
- Detailed information about the task run result.
- changelog:
- readOnly: true
- type: string
- description: |-
- The resource name of the changelog.
- Format: instances/{instance}/databases/{database}/changelogs/{changelog}
- schemaVersion:
- type: string
- description: The schema version after this task run completes.
- startTime:
- readOnly: true
- type: string
- description: The time when the task run started execution.
- format: date-time
- exportArchiveStatus:
- enum:
- - EXPORT_ARCHIVE_STATUS_UNSPECIFIED
- - READY
- - EXPORTED
- type: string
- description: The export archive status for data export tasks.
- format: enum
- priorBackupDetail:
- allOf:
- - $ref: '#/components/schemas/TaskRun_PriorBackupDetail'
- description: The prior backup detail that will be used to rollback the task run.
- schedulerInfo:
- readOnly: true
- allOf:
- - $ref: '#/components/schemas/TaskRun_SchedulerInfo'
- description: Scheduling information about the task run.
- sheet:
- readOnly: true
- type: string
- description: 'Format: projects/{project}/sheets/{sheet}'
- runTime:
- readOnly: true
- type: string
- description: |-
- The task run should run after run_time.
- This can only be set when creating the task run calling BatchRunTasks.
- format: date-time
- TaskRunLog:
- type: object
- properties:
- name:
- type: string
- description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}/log'
- entries:
- type: array
- items:
- $ref: '#/components/schemas/TaskRunLogEntry'
- description: The log entries for this task run.
- TaskRunLogEntry:
- type: object
- properties:
- type:
- enum:
- - TYPE_UNSPECIFIED
- - SCHEMA_DUMP
- - COMMAND_EXECUTE
- - DATABASE_SYNC
- - TASK_RUN_STATUS_UPDATE
- - TRANSACTION_CONTROL
- - PRIOR_BACKUP
- - RETRY_INFO
- - COMPUTE_DIFF
- type: string
- description: The type of this log entry.
- format: enum
- logTime:
- type: string
- description: The time when the log was recorded.
- format: date-time
- deployId:
- type: string
- description: The deployment ID for this log entry.
- schemaDump:
- allOf:
- - $ref: '#/components/schemas/TaskRunLogEntry_SchemaDump'
- description: Schema dump details (if type is SCHEMA_DUMP).
- commandExecute:
- allOf:
- - $ref: '#/components/schemas/TaskRunLogEntry_CommandExecute'
- description: Command execution details (if type is COMMAND_EXECUTE).
- databaseSync:
- allOf:
- - $ref: '#/components/schemas/TaskRunLogEntry_DatabaseSync'
- description: Database sync details (if type is DATABASE_SYNC).
- taskRunStatusUpdate:
- allOf:
- - $ref: '#/components/schemas/TaskRunLogEntry_TaskRunStatusUpdate'
- description: Task run status update details (if type is TASK_RUN_STATUS_UPDATE).
- transactionControl:
- allOf:
- - $ref: '#/components/schemas/TaskRunLogEntry_TransactionControl'
- description: Transaction control details (if type is TRANSACTION_CONTROL).
- priorBackup:
- allOf:
- - $ref: '#/components/schemas/TaskRunLogEntry_PriorBackup'
- description: Prior backup details (if type is PRIOR_BACKUP).
- retryInfo:
- allOf:
- - $ref: '#/components/schemas/TaskRunLogEntry_RetryInfo'
- description: Retry information details (if type is RETRY_INFO).
- computeDiff:
- allOf:
- - $ref: '#/components/schemas/TaskRunLogEntry_ComputeDiff'
- description: Compute diff details (if type is COMPUTE_DIFF).
- TaskRunLogEntry_CommandExecute:
- type: object
- properties:
- logTime:
- type: string
- description: When the command was logged.
- format: date-time
- range:
- allOf:
- - $ref: '#/components/schemas/Range'
- description: |-
- The byte offset range of the executed command in the sheet.
- Uses byte offsets (not character indices) for efficient slicing of sheet content bytes.
- Example: For "SELECT 你好;" in a UTF-8 sheet, range [0, 13) represents all 13 bytes.
- statement:
- type: string
- description: The executed statement.
- response:
- allOf:
- - $ref: '#/components/schemas/CommandExecute_CommandResponse'
- description: The response from executing the command.
- description: Command execution details.
- TaskRunLogEntry_ComputeDiff:
- type: object
- properties:
- startTime:
- type: string
- description: When diff computation started.
- format: date-time
- endTime:
- type: string
- description: When diff computation ended.
- format: date-time
- error:
- type: string
- description: Error message if computation failed.
- description: Schema diff computation details.
- TaskRunLogEntry_DatabaseSync:
- type: object
- properties:
- startTime:
- type: string
- description: When the database sync started.
- format: date-time
- endTime:
- type: string
- description: When the database sync ended.
- format: date-time
- error:
- type: string
- description: Error message if sync failed.
- description: Database synchronization details.
- TaskRunLogEntry_PriorBackup:
- type: object
- properties:
- startTime:
- type: string
- description: When the backup started.
- format: date-time
- endTime:
- type: string
- description: When the backup ended.
- format: date-time
- priorBackupDetail:
- allOf:
- - $ref: '#/components/schemas/TaskRun_PriorBackupDetail'
- description: The backup details.
- error:
- type: string
- description: Error message if the backup failed.
- description: Prior backup operation details.
- TaskRunLogEntry_RetryInfo:
- type: object
- properties:
- error:
- type: string
- description: The error that triggered the retry.
- retryCount:
- type: integer
- description: Current retry attempt number.
- format: int32
- maximumRetries:
- type: integer
- description: Maximum number of retries allowed.
- format: int32
- description: Retry information for failed operations.
- TaskRunLogEntry_SchemaDump:
- type: object
- properties:
- startTime:
- type: string
- description: When the schema dump started.
- format: date-time
- endTime:
- type: string
- description: When the schema dump ended.
- format: date-time
- error:
- type: string
- description: Error message if the schema dump failed.
- description: Schema dump operation details.
- TaskRunLogEntry_TaskRunStatusUpdate:
- type: object
- properties:
- status:
- enum:
- - STATUS_UNSPECIFIED
- - RUNNING_WAITING
- - RUNNING_RUNNING
- type: string
- description: The new status.
- format: enum
- description: Task run status update details.
- TaskRunLogEntry_TransactionControl:
- type: object
- properties:
- type:
- enum:
- - TYPE_UNSPECIFIED
- - BEGIN
- - COMMIT
- - ROLLBACK
- type: string
- description: The type of transaction control.
- format: enum
- error:
- type: string
- description: Error message if the operation failed.
- description: Transaction control operation details.
- TaskRunSession:
- type: object
- properties:
- name:
- type: string
- description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}/session'
- postgres:
- allOf:
- - $ref: '#/components/schemas/TaskRunSession_Postgres'
- description: PostgreSQL session information.
- TaskRunSession_Postgres:
- type: object
- properties:
- session:
- allOf:
- - $ref: '#/components/schemas/Postgres_Session'
- description: '`session` is the session of the task run executing commands.'
- blockingSessions:
- type: array
- items:
- $ref: '#/components/schemas/Postgres_Session'
- description: '`blocking_sessions` block `session`.'
- blockedSessions:
- type: array
- items:
- $ref: '#/components/schemas/Postgres_Session'
- description: '`blocked_sessions` are blocked by `session`.'
- description: PostgreSQL session information.
- TaskRun_PriorBackupDetail:
- type: object
- properties:
- items:
- type: array
- items:
- $ref: '#/components/schemas/PriorBackupDetail_Item'
- description: The list of backed up tables.
- description: Prior backup detail for rollback purposes.
- TaskRun_SchedulerInfo:
- type: object
- properties:
- reportTime:
- type: string
- description: The time when the scheduling info was reported.
- format: date-time
- waitingCause:
- allOf:
- - $ref: '#/components/schemas/SchedulerInfo_WaitingCause'
- description: The cause for the task run waiting.
- description: Information about task run scheduling.
- Task_DatabaseCreate:
- type: object
- properties:
- project:
- type: string
- description: |-
- The project owning the database.
- Format: projects/{project}
- database:
- type: string
- description: Database name.
- table:
- type: string
- description: Table name.
- sheet:
- type: string
- description: 'Format: projects/{project}/sheets/{sheet}'
- characterSet:
- type: string
- description: The character set for the database.
- collation:
- type: string
- description: The collation for the database.
- environment:
- type: string
- description: The environment the database belongs to.
- description: Payload for creating a new database.
- Task_DatabaseDataExport:
- type: object
- properties:
- target:
- type: string
- description: |-
- The resource name of the target.
- Format: instances/{instance-id}/databases/{database-name}
- sheet:
- type: string
- description: |-
- The resource name of the sheet.
- Format: projects/{project}/sheets/{sheet}
- format:
- enum:
- - FORMAT_UNSPECIFIED
- - CSV
- - JSON
- - SQL
- - XLSX
- type: string
- description: The format of the exported file.
- format: enum
- password:
- type: string
- description: |-
- The zip password provided by users.
- Leave it empty if no needs to encrypt the zip file.
- description: Payload for exporting database data.
- Task_DatabaseUpdate:
- type: object
- properties:
- sheet:
- type: string
- description: 'Format: projects/{project}/sheets/{sheet}'
- schemaVersion:
- type: string
- description: The target schema version after this update.
- databaseChangeType:
- enum:
- - DATABASE_CHANGE_TYPE_UNSPECIFIED
- - MIGRATE
- - SDL
- type: string
- description: The type of database change (MIGRATE or SDL).
- format: enum
- description: Payload for updating a database schema.
- TessellationConfig:
- type: object
- properties:
- scheme:
- type: string
- description: Tessellation scheme (e.g., "GEOMETRY_GRID", "GEOGRAPHY_GRID", "GEOMETRY_AUTO_GRID")
- gridLevels:
- type: array
- items:
- $ref: '#/components/schemas/GridLevel'
- description: Grid levels and densities for multi-level tessellation
- cellsPerObject:
- type: integer
- description: Number of cells per object (1-8192 for SQL Server)
- format: int32
- boundingBox:
- allOf:
- - $ref: '#/components/schemas/BoundingBox'
- description: Bounding box for GEOMETRY tessellation (not used for GEOGRAPHY)
- description: TessellationConfig defines tessellation parameters for spatial indexes.
- TestIdentityProviderRequest:
- type: object
- properties:
- identityProvider:
- allOf:
- - $ref: '#/components/schemas/IdentityProvider'
- description: The identity provider to test connection including uncreated.
- oauth2Context:
- $ref: '#/components/schemas/OAuth2IdentityProviderTestRequestContext'
- oidcContext:
- allOf:
- - $ref: '#/components/schemas/OIDCIdentityProviderTestRequestContext'
- description: OIDC authentication context for test connection.
- TestIdentityProviderResponse:
- type: object
- properties:
- claims:
- type: object
- additionalProperties:
- type: string
- description: The map of claims returned by the identity provider.
- userInfo:
- type: object
- additionalProperties:
- type: string
- description: The matched user info from the claims.
- TestWebhookRequest:
- required:
- - project
- - webhook
- type: object
- properties:
- project:
- type: string
- description: |-
- The name of the project which owns the webhook to test.
- Format: projects/{project}
- webhook:
- allOf:
- - $ref: '#/components/schemas/Webhook'
- description: The webhook to test. Identified by its url.
- TestWebhookResponse:
- type: object
- properties:
- error:
- type: string
- description: The result of the test, empty if the test is successful.
- TriggerMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of the trigger.
- event:
- type: string
- description: |-
- The event is the event of the trigger, such as INSERT, UPDATE, DELETE,
- TRUNCATE.
- timing:
- type: string
- description: The timing is the timing of the trigger, such as BEFORE, AFTER.
- body:
- type: string
- description: The body is the body of the trigger.
- sqlMode:
- type: string
- description: The SQL mode setting for the trigger.
- characterSetClient:
- type: string
- description: The character set used by the client creating the trigger.
- collationConnection:
- type: string
- description: The collation used for the connection when creating the trigger.
- comment:
- type: string
- description: The comment describing the trigger.
- skipDump:
- type: boolean
- description: Whether to skip this trigger during schema dump operations.
- UndeleteInstanceRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the deleted instance.
- Format: instances/{instance}
- UndeleteProjectRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the deleted project.
- Format: projects/{project}
- UndeleteUserRequest:
- required:
- - name
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the deleted user.
- Format: users/{email}
- UpdateDatabaseRequest:
- required:
- - database
- type: object
- properties:
- database:
- allOf:
- - $ref: '#/components/schemas/Database'
- description: |-
- The database to update.
-
- The database's `name` field is used to identify the database to update.
- Format: instances/{instance}/databases/{database}
- updateMask:
- type: string
- description: The list of fields to update.
- format: field-mask
- allowMissing:
- type: boolean
- description: |-
- If set to true, and the database is not found, a new database will be created.
- In this situation, `update_mask` is ignored.
- UpdateEmailRequest:
- required:
- - name
- - email
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the user whose email to update.
- Format: users/{email}
- Note: This is the current (old) email address. The new email is specified in the 'email' field.
- email:
- type: string
- description: The new email address.
- UpdateInstanceRequest:
- required:
- - instance
- type: object
- properties:
- instance:
- allOf:
- - $ref: '#/components/schemas/Instance'
- description: |-
- The instance to update.
-
- The instance's `name` field is used to identify the instance to update.
- Format: instances/{instance}
- updateMask:
- type: string
- description: The list of fields to update.
- format: field-mask
- allowMissing:
- type: boolean
- description: |-
- If set to true, and the instance is not found, a new instance will be created.
- In this situation, `update_mask` is ignored.
- UpdateWorksheetOrganizerRequest:
- required:
- - organizer
- type: object
- properties:
- organizer:
- allOf:
- - $ref: '#/components/schemas/WorksheetOrganizer'
- description: |-
- The organizer to update.
-
- The organizer's `worksheet` field is used to identify the worksheet.
- Format: worksheets/{worksheet}
- updateMask:
- type: string
- description: |-
- The list of fields to be updated.
- Fields are specified relative to the worksheet organizer.
- Only support update the following fields for now:
- - `starred`
- format: field-mask
- allowMissing:
- type: boolean
- description: |-
- If set to true, and the worksheet organizer is not found, a new worksheet organizer will be created.
- In this situation, `update_mask` is ignored.
- User:
- type: object
- properties:
- name:
- readOnly: true
- type: string
- description: |-
- The name of the user.
- Format: users/{email}
- state:
- enum:
- - STATE_UNSPECIFIED
- - ACTIVE
- - DELETED
- type: string
- description: The lifecycle state of the user account.
- format: enum
- email:
- type: string
- description: The email address of the user, used for login and notifications.
- title:
- type: string
- description: The display title or full name of the user.
- userType:
- enum:
- - USER_TYPE_UNSPECIFIED
- - USER
- - SYSTEM_BOT
- - SERVICE_ACCOUNT
- - WORKLOAD_IDENTITY
- type: string
- description: The type of user account.
- format: enum
- password:
- writeOnly: true
- type: string
- description: The password for authentication. Only used during user creation or password updates.
- serviceKey:
- writeOnly: true
- type: string
- description: The service key for service account authentication. Only used for service accounts.
- mfaEnabled:
- type: boolean
- description: The mfa_enabled flag means if the user has enabled MFA.
- tempOtpSecret:
- type: string
- description: Temporary OTP secret used during MFA setup and regeneration.
- tempRecoveryCodes:
- type: array
- items:
- type: string
- description: Temporary recovery codes used during MFA setup and regeneration.
- tempOtpSecretCreatedTime:
- type: string
- description: Timestamp when temp_otp_secret was created. Used by frontend to show countdown timer.
- format: date-time
- phone:
- type: string
- description: |-
- Should be a valid E.164 compliant phone number.
- Could be empty.
- profile:
- allOf:
- - $ref: '#/components/schemas/User_Profile'
- description: User profile metadata.
- groups:
- readOnly: true
- type: array
- items:
- type: string
- description: |-
- The groups for the user.
- Format: groups/{email}
- workloadIdentityConfig:
- allOf:
- - $ref: '#/components/schemas/WorkloadIdentityConfig'
- description: Workload Identity configuration (only for WORKLOAD_IDENTITY type)
- User_Profile:
- type: object
- properties:
- lastLoginTime:
- type: string
- description: The last time the user successfully logged in.
- format: date-time
- lastChangePasswordTime:
- type: string
- description: The last time the user changed their password.
- format: date-time
- source:
- type: string
- description: source means where the user comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID.
- ViewMetadata:
- type: object
- properties:
- name:
- type: string
- description: The name is the name of a view.
- definition:
- type: string
- description: The definition is the definition of a view.
- comment:
- type: string
- description: The comment is the comment of a view.
- dependencyColumns:
- type: array
- items:
- $ref: '#/components/schemas/DependencyColumn'
- description: The dependency_columns is the list of dependency columns of a view.
- columns:
- type: array
- items:
- $ref: '#/components/schemas/ColumnMetadata'
- description: The columns is the ordered list of columns in a table.
- triggers:
- type: array
- items:
- $ref: '#/components/schemas/TriggerMetadata'
- description: The triggers is the list of triggers in a view.
- skipDump:
- type: boolean
- description: ViewMetadata is the metadata for views.
- WaitingCause_Task:
- type: object
- properties:
- task:
- type: string
- description: 'Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}'
- description: Information about a blocking task.
- Webhook:
- required:
- - type
- - title
- - url
- type: object
- properties:
- name:
- type: string
- description: |-
- name is the name of the webhook, generated by the server.
- format: projects/{project}/webhooks/{webhook}
- type:
- enum:
- - WEBHOOK_TYPE_UNSPECIFIED
- - SLACK
- - DISCORD
- - TEAMS
- - DINGTALK
- - FEISHU
- - WECOM
- - LARK
- type: string
- description: |-
- Webhook integration type.
- type is the type of the webhook.
- format: enum
- title:
- type: string
- description: title is the title of the webhook.
- url:
- type: string
- description: url is the url of the webhook, should be unique within the project.
- directMessage:
- type: boolean
- description: |-
- if direct_message is set, the notification is sent directly
- to the persons and url will be ignored.
- IM integration setting should be set for this function to work.
- notificationTypes:
- type: array
- items:
- enum:
- - TYPE_UNSPECIFIED
- - ISSUE_CREATED
- - ISSUE_APPROVAL_REQUESTED
- - ISSUE_SENT_BACK
- - PIPELINE_FAILED
- - PIPELINE_COMPLETED
- type: string
- format: enum
- description: |-
- notification_types is the list of activities types that the webhook is interested in.
- Bytebase will only send notifications to the webhook if the activity type is in the list.
- It should not be empty, and should be a subset of the following:
- - ISSUE_CREATED
- - ISSUE_APPROVAL_REQUESTED
- - ISSUE_SENT_BACK
- - PIPELINE_FAILED
- - PIPELINE_COMPLETED
- WorkloadIdentityConfig:
- type: object
- properties:
- providerType:
- enum:
- - PROVIDER_TYPE_UNSPECIFIED
- - GITHUB
- - GITLAB
- type: string
- description: Platform type (currently only GITHUB is supported)
- format: enum
- issuerUrl:
- type: string
- description: OIDC Issuer URL (auto-filled based on provider_type, can be overridden)
- allowedAudiences:
- type: array
- items:
- type: string
- description: Allowed audiences for token validation
- subjectPattern:
- type: string
- description: Subject pattern to match (e.g., "repo:owner/repo:ref:refs/heads/main")
- description: WorkloadIdentityConfig for API layer
- Worksheet:
- required:
- - name
- - project
- - title
- - content
- - visibility
- type: object
- properties:
- name:
- type: string
- description: |-
- The name of the worksheet resource, generated by the server.
- Canonical parent is project.
- Format: worksheets/{worksheet}
- project:
- type: string
- description: |-
- The project resource name.
- Format: projects/{project}
- database:
- type: string
- description: |-
- The database resource name.
- Format: instances/{instance}/databases/{database}
- If the database parent doesn't exist, the database field is empty.
- title:
- type: string
- description: The title of the worksheet.
- creator:
- readOnly: true
- type: string
- description: |-
- The creator of the Worksheet.
- Format: users/{email}
- createTime:
- readOnly: true
- type: string
- description: The create time of the worksheet.
- format: date-time
- updateTime:
- readOnly: true
- type: string
- description: The last update time of the worksheet.
- format: date-time
- content:
- type: string
- description: |-
- The content of the worksheet.
- By default, it will be cut off in SearchWorksheet() method. If it doesn't match the `content_size`, you can
- use GetWorksheet() request to retrieve the full content.
- format: bytes
- contentSize:
- readOnly: true
- type: string
- description: content_size is the full size of the content, may not match the size of the `content` field.
- visibility:
- enum:
- - VISIBILITY_UNSPECIFIED
- - PROJECT_READ
- - PROJECT_WRITE
- - PRIVATE
- type: string
- format: enum
- starred:
- readOnly: true
- type: boolean
- description: starred indicates whether the worksheet is starred by the current authenticated user.
- folders:
- readOnly: true
- type: array
- items:
- type: string
- WorksheetOrganizer:
- required:
- - worksheet
- type: object
- properties:
- worksheet:
- type: string
- description: |-
- The name of the worksheet.
- Format: worksheets/{worksheet}
- starred:
- type: boolean
- description: starred means if the worksheet is starred.
- folders:
- type: array
- items:
- type: string
- WorkspaceApprovalSetting:
- type: object
- properties:
- rules:
- type: array
- items:
- $ref: '#/components/schemas/WorkspaceApprovalSetting_Rule'
- WorkspaceApprovalSetting_Rule:
- type: object
- properties:
- template:
- $ref: '#/components/schemas/ApprovalTemplate'
- condition:
- allOf:
- - $ref: '#/components/schemas/Expr'
- description: |-
- The condition that is associated with the rule.
- The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-
- The `source` field filters which rules apply. The `condition` field then evaluates with full context.
-
- All supported variables:
- statement.affected_rows: affected row count in the DDL/DML, support "==", "!=", "<", "<=", ">", ">=" operations.
- statement.table_rows: table row count number, support "==", "!=", "<", "<=", ">", ">=" operations.
- resource.environment_id: the environment resource id, support "==", "!=", "in [xx]", "!(in [xx])" operations.
- resource.project_id: the project resource id, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
- resource.db_engine: the database engine type, support "==", "!=", "in [xx]", "!(in [xx])" operations. Check the Engine enum for values.
- statement.sql_type: the SQL type, support "==", "!=", "in [xx]", "!(in [xx])" operations.
- resource.database_name: the database name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
- resource.schema_name: the schema name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
- resource.table_name: the table name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
- statement.text: the SQL statement, support "contains()", "matches()", "startsWith()", "endsWith()" operations.
- request.expiration_days: the role expiration days for the request, support "==", "!=", "<", "<=", ">", ">=" operations.
- request.role: the request role full name, support "==", "!=", "in [xx]", "!(in [xx])", "contains()", "matches()", "startsWith()", "endsWith()" operations.
-
- When source is CHANGE_DATABASE, support: statement.*, resource.* (excluding request.*)
- When source is CREATE_DATABASE, support: resource.environment_id, resource.project_id, resource.db_engine, resource.database_name
- When source is EXPORT_DATA, support: resource.environment_id, resource.project_id, resource.db_engine, resource.database_name, resource.schema_name, resource.table_name
- When source is REQUEST_ROLE, support: resource.project_id, request.expiration_days, request.role
-
- For examples:
- resource.environment_id == "prod" && statement.affected_rows >= 100
- resource.table_name.matches("sensitive_.*") && resource.db_engine == "MYSQL"
- source:
- enum:
- - SOURCE_UNSPECIFIED
- - CHANGE_DATABASE
- - CREATE_DATABASE
- - EXPORT_DATA
- - REQUEST_ROLE
- type: string
- format: enum
- WorkspaceProfileSetting:
- type: object
- properties:
- externalUrl:
- type: string
- description: The external URL is used for sso authentication callback.
- disallowSignup:
- type: boolean
- description: Disallow self-service signup, users can only be invited by the owner.
- require2fa:
- type: boolean
- description: Require 2FA for all users.
- refreshTokenDuration:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: The duration for refresh token. Default is 7 days.
- accessTokenDuration:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: The duration for access token. Default is 1 hour.
- announcement:
- allOf:
- - $ref: '#/components/schemas/Announcement'
- description: The setting of custom announcement
- maximumRoleExpiration:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: The max duration for role expired.
- domains:
- type: array
- items:
- type: string
- description: The workspace domain, e.g., bytebase.com.
- enforceIdentityDomain:
- type: boolean
- description: Only user and group from the domains can be created and login.
- databaseChangeMode:
- enum:
- - DATABASE_CHANGE_MODE_UNSPECIFIED
- - PIPELINE
- - EDITOR
- type: string
- description: The workspace database change mode.
- format: enum
- disallowPasswordSignin:
- type: boolean
- description: Whether to disallow password signin. (Except workspace admins)
- enableMetricCollection:
- type: boolean
- description: Whether to enable metric collection for the workspace.
- inactiveSessionTimeout:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: The session expiration time if not activity detected for the user. Value <= 0 means no limit.
- enableAuditLogStdout:
- type: boolean
- description: |-
- Whether to enable audit logging to stdout in structured JSON format.
- Requires TEAM or ENTERPRISE license.
- watermark:
- type: boolean
- description: |-
- Whether to display watermark on pages.
- Requires ENTERPRISE license.
- directorySyncToken:
- type: string
- description: The token for directory sync authentication.
- brandingLogo:
- type: string
- description: The branding logo as a data URI (e.g. data:image/png;base64,...).
- passwordRestriction:
- allOf:
- - $ref: '#/components/schemas/WorkspaceProfileSetting_PasswordRestriction'
- description: Password restriction settings.
- WorkspaceProfileSetting_PasswordRestriction:
- type: object
- properties:
- minLength:
- type: integer
- description: min_length is the minimum length for password, should no less than 8.
- format: int32
- requireNumber:
- type: boolean
- description: require_number requires the password must contains at least one number.
- requireLetter:
- type: boolean
- description: require_letter requires the password must contains at least one letter, regardless of upper case or lower case
- requireUppercaseLetter:
- type: boolean
- description: require_uppercase_letter requires the password must contains at least one upper case letter.
- requireSpecialCharacter:
- type: boolean
- description: require_special_character requires the password must contains at least one special character.
- requireResetPasswordForFirstLogin:
- type: boolean
- description: require_reset_password_for_first_login requires users to reset their password after the 1st login.
- passwordRotation:
- pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
- type: string
- description: password_rotation requires users to reset their password after the duration.
+ Example (Comparison):
+
+ title: "Summary size limit"
+ description: "Determines if a summary is less than 100 chars"
+ expression: "document.summary.size() < 100"
+
+ Example (Equality):
+
+ title: "Requestor is owner"
+ description: "Determines if requestor is the document owner"
+ expression: "document.owner == request.auth.claims.email"
+
+ Example (Logic):
+
+ title: "Public documents"
+ description: "Determine whether the document should be publicly visible"
+ expression: "document.type != 'private' && document.type != 'internal'"
+
+ Example (Data Manipulation):
+
+ title: "Notification string"
+ description: "Create a notification string with a timestamp."
+ expression: "'New message received at ' + string(document.create_time)"
+
+ The exact variables and functions that may be referenced within an expression
+ are determined by the service that evaluates it. See the service
+ documentation for additional information.
+security: []
tags:
- - name: ActuatorService
- description: ActuatorService manages system health and operational information.
- - name: AuditLogService
- description: AuditLogService manages audit logs for system activities and API calls.
- - name: AuthService
- description: AuthService handles user authentication operations.
- - name: CelService
- description: CelService manages CEL (Common Expression Language) parsing and formatting operations.
- - name: DatabaseCatalogService
- description: DatabaseCatalogService manages database schema metadata and classification.
- - name: DatabaseGroupService
- description: DatabaseGroupService manages database groups for organizing databases by criteria.
- - name: DatabaseService
- description: DatabaseService manages databases and their schemas.
- - name: GroupService
- description: GroupService manages user groups for organizing users and permissions.
- - name: IdentityProviderService
- description: IdentityProviderService manages external identity providers for SSO authentication.
- - name: InstanceRoleService
- description: InstanceRoleService manages database roles within instances.
- - name: InstanceService
- description: InstanceService manages database instances and their connections.
- - name: IssueService
- description: IssueService manages issues for tracking database changes and tasks.
- - name: OrgPolicyService
- description: OrgPolicyService manages organizational policies at various resource levels.
- - name: PlanService
- description: PlanService manages deployment plans for database changes.
- - name: ProjectService
- description: ProjectService manages projects that group databases and changes.
- - name: ReleaseService
- description: ReleaseService manages releases for coordinating deployments.
- - name: ReviewConfigService
- description: ReviewConfigService manages approval flow configurations.
- - name: RevisionService
- description: RevisionService manages schema revision history.
- - name: RoleService
- description: RoleService manages workspace roles and permissions.
- - name: RolloutService
- description: RolloutService manages the execution of deployment plans.
- - name: SQLService
- description: SQLService executes SQL queries and manages query operations.
- - name: SettingService
- description: SettingService manages workspace-level settings and configurations.
- - name: SheetService
- description: SheetService manages SQL scripts and saved queries.
- - name: SubscriptionService
- description: SubscriptionService manages enterprise subscriptions and licensing.
- - name: UserService
- description: UserService manages user accounts and authentication.
- - name: WorksheetService
- description: WorksheetService manages SQL worksheets for query development.
- - name: WorkspaceService
- description: WorkspaceService manages workspace-level operations and profile.
+ - name: bytebase.v1.IssueService
+ description: IssueService manages issues for tracking database changes and tasks.
+ - name: bytebase.v1.SettingService
+ description: SettingService manages workspace-level settings and configurations.
+ - name: bytebase.v1.UserService
+ description: UserService manages user accounts and authentication.
+ - name: bytebase.v1.ActuatorService
+ description: ActuatorService manages system health and operational information.
+ - name: bytebase.v1.AuditLogService
+ description: AuditLogService manages audit logs for system activities and API calls.
+ - name: bytebase.v1.AuthService
+ description: AuthService handles user authentication operations.
+ - name: bytebase.v1.CelService
+ description: CelService manages CEL (Common Expression Language) parsing and formatting operations.
+ - name: bytebase.v1.DatabaseCatalogService
+ description: DatabaseCatalogService manages database schema metadata and classification.
+ - name: bytebase.v1.DatabaseGroupService
+ description: DatabaseGroupService manages database groups for organizing databases by criteria.
+ - name: bytebase.v1.InstanceRoleService
+ description: InstanceRoleService manages database roles within instances.
+ - name: bytebase.v1.InstanceService
+ description: InstanceService manages database instances and their connections.
+ - name: bytebase.v1.DatabaseService
+ description: DatabaseService manages databases and their schemas.
+ - name: bytebase.v1.GroupService
+ description: GroupService manages user groups for organizing users and permissions.
+ - name: bytebase.v1.IdentityProviderService
+ description: IdentityProviderService manages external identity providers for SSO authentication.
+ - name: bytebase.v1.OrgPolicyService
+ description: OrgPolicyService manages organizational policies at various resource levels.
+ - name: bytebase.v1.SQLService
+ description: SQLService executes SQL queries and manages query operations.
+ - name: bytebase.v1.PlanService
+ description: PlanService manages deployment plans for database changes.
+ - name: bytebase.v1.ProjectService
+ description: ProjectService manages projects that group databases and changes.
+ - name: bytebase.v1.ReleaseService
+ description: ReleaseService manages releases for coordinating deployments.
+ - name: bytebase.v1.ReviewConfigService
+ description: ReviewConfigService manages approval flow configurations.
+ - name: bytebase.v1.RevisionService
+ description: RevisionService manages schema revision history.
+ - name: bytebase.v1.RoleService
+ description: RoleService manages workspace roles and permissions.
+ - name: bytebase.v1.RolloutService
+ description: RolloutService manages the execution of deployment plans.
+ - name: bytebase.v1.SheetService
+ description: SheetService manages SQL scripts and saved queries.
+ - name: bytebase.v1.SubscriptionService
+ description: SubscriptionService manages enterprise subscriptions and licensing.
+ - name: bytebase.v1.WorksheetService
+ description: WorksheetService manages SQL worksheets for query development.
+ - name: bytebase.v1.WorkspaceService
+ description: WorkspaceService manages workspace-level operations and profile.