Skip to content

Commit d368df2

Browse files
committed
feat(byoc): self-hosted data-plane packaging + entitlement enrollment (#1119)
Synced from sferarc/pgbeam@0db5320
1 parent 32a2022 commit d368df2

13 files changed

Lines changed: 403 additions & 4 deletions

src/generated/describe-map.gen.ts

Lines changed: 7 additions & 4 deletions
Large diffs are not rendered by default.

src/generated/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export type { CreateProjectRequest, CreateProjectRequestCloudEnumKey } from "./t
2525
export type { CreateProjectResponse } from "./types/CreateProjectResponse";
2626
export type { CreateReplicaData, CreateReplicaPathDatabaseId, CreateReplicaRequestConfig, CreateReplicaResponse, CreateReplicaResponses, CreateReplicaStatus201, CreateReplicaStatus400, CreateReplicaStatus401, CreateReplicaStatus403, CreateReplicaStatus404, CreateReplicaStatus429 } from "./types/CreateReplica";
2727
export type { CreateReplicaRequest } from "./types/CreateReplicaRequest";
28+
export type { CreateSelfHostEnrollmentData, CreateSelfHostEnrollmentPathOrgId, CreateSelfHostEnrollmentRequestConfig, CreateSelfHostEnrollmentResponse, CreateSelfHostEnrollmentResponses, CreateSelfHostEnrollmentStatus201, CreateSelfHostEnrollmentStatus400, CreateSelfHostEnrollmentStatus401, CreateSelfHostEnrollmentStatus403, CreateSelfHostEnrollmentStatus429 } from "./types/CreateSelfHostEnrollment";
29+
export type { CreateSelfHostEnrollmentRequest } from "./types/CreateSelfHostEnrollmentRequest";
2830
export type { CreateSupportCaseData, CreateSupportCasePathOrgId, CreateSupportCaseRequestConfig, CreateSupportCaseResponse, CreateSupportCaseResponses, CreateSupportCaseStatus201, CreateSupportCaseStatus400, CreateSupportCaseStatus401, CreateSupportCaseStatus403 } from "./types/CreateSupportCase";
2931
export type { CreateSupportCaseRequest } from "./types/CreateSupportCaseRequest";
3032
export type { CreateSupportMessageData, CreateSupportMessagePathCaseId, CreateSupportMessagePathOrgId, CreateSupportMessageRequestConfig, CreateSupportMessageResponse, CreateSupportMessageResponses, CreateSupportMessageStatus201, CreateSupportMessageStatus400, CreateSupportMessageStatus401, CreateSupportMessageStatus403, CreateSupportMessageStatus404 } from "./types/CreateSupportMessage";
@@ -97,6 +99,8 @@ export type { ListRegionsRequestConfig, ListRegionsResponses, ListRegionsStatus2
9799
export type { ListRegionsResponse } from "./types/ListRegionsResponse";
98100
export type { ListReplicasPathDatabaseId, ListReplicasRequestConfig, ListReplicasResponses, ListReplicasStatus200, ListReplicasStatus400, ListReplicasStatus401, ListReplicasStatus403, ListReplicasStatus404, ListReplicasStatus429 } from "./types/ListReplicas";
99101
export type { ListReplicasResponse } from "./types/ListReplicasResponse";
102+
export type { ListSelfHostEnrollmentsPathOrgId, ListSelfHostEnrollmentsRequestConfig, ListSelfHostEnrollmentsResponses, ListSelfHostEnrollmentsStatus200, ListSelfHostEnrollmentsStatus401, ListSelfHostEnrollmentsStatus403 } from "./types/ListSelfHostEnrollments";
103+
export type { ListSelfHostEnrollmentsResponse } from "./types/ListSelfHostEnrollmentsResponse";
100104
export type { ListSupportCasesPathOrgId, ListSupportCasesQueryPage, ListSupportCasesQueryPageSize, ListSupportCasesQuerySearch, ListSupportCasesQueryStatus, ListSupportCasesRequestConfig, ListSupportCasesResponses, ListSupportCasesStatus200, ListSupportCasesStatus400, ListSupportCasesStatus401, ListSupportCasesStatus403 } from "./types/ListSupportCases";
101105
export type { ListSupportCasesResponse } from "./types/ListSupportCasesResponse";
102106
export type { ListWebhookEndpointsPathProjectId, ListWebhookEndpointsQueryPageSize, ListWebhookEndpointsQueryPageToken, ListWebhookEndpointsRequestConfig, ListWebhookEndpointsResponses, ListWebhookEndpointsStatus200, ListWebhookEndpointsStatus400, ListWebhookEndpointsStatus401, ListWebhookEndpointsStatus403, ListWebhookEndpointsStatus404, ListWebhookEndpointsStatus429 } from "./types/ListWebhookEndpoints";
@@ -129,6 +133,7 @@ export type { Region, RegionProviderEnumKey, RegionStatusEnumKey } from "./types
129133
export type { RejectApprovalRequestData, RejectApprovalRequestPathApprovalId, RejectApprovalRequestPathProjectId, RejectApprovalRequestRequestConfig, RejectApprovalRequestResponse, RejectApprovalRequestResponses, RejectApprovalRequestStatus200, RejectApprovalRequestStatus400, RejectApprovalRequestStatus401, RejectApprovalRequestStatus403, RejectApprovalRequestStatus404, RejectApprovalRequestStatus409 } from "./types/RejectApprovalRequest";
130134
export type { Replica } from "./types/Replica";
131135
export type { RevokeAgentCredentialPathAgentId, RevokeAgentCredentialPathProjectId, RevokeAgentCredentialRequestConfig, RevokeAgentCredentialResponse, RevokeAgentCredentialResponses, RevokeAgentCredentialStatus204, RevokeAgentCredentialStatus400, RevokeAgentCredentialStatus401, RevokeAgentCredentialStatus403, RevokeAgentCredentialStatus404 } from "./types/RevokeAgentCredential";
136+
export type { RevokeSelfHostEnrollmentPathEnrollmentId, RevokeSelfHostEnrollmentPathOrgId, RevokeSelfHostEnrollmentRequestConfig, RevokeSelfHostEnrollmentResponse, RevokeSelfHostEnrollmentResponses, RevokeSelfHostEnrollmentStatus204, RevokeSelfHostEnrollmentStatus401, RevokeSelfHostEnrollmentStatus403, RevokeSelfHostEnrollmentStatus404 } from "./types/RevokeSelfHostEnrollment";
132137
export type { RotateAgentCredentialPathAgentId, RotateAgentCredentialPathProjectId, RotateAgentCredentialRequestConfig, RotateAgentCredentialResponse, RotateAgentCredentialResponses, RotateAgentCredentialStatus200, RotateAgentCredentialStatus400, RotateAgentCredentialStatus401, RotateAgentCredentialStatus403, RotateAgentCredentialStatus404, RotateAgentCredentialStatus409 } from "./types/RotateAgentCredential";
133138
export type { RowFilter } from "./types/RowFilter";
134139
export type { SSLModeKey } from "./types/SSLMode";
@@ -137,6 +142,8 @@ export type { ScanPiiResult } from "./types/ScanPiiResult";
137142
export type { SchemaCatalog } from "./types/SchemaCatalog";
138143
export type { SchemaCatalogColumn } from "./types/SchemaCatalogColumn";
139144
export type { SchemaCatalogRelation, SchemaCatalogRelationKindEnumKey } from "./types/SchemaCatalogRelation";
145+
export type { SelfHostEnrollment } from "./types/SelfHostEnrollment";
146+
export type { SelfHostEnrollmentSecret } from "./types/SelfHostEnrollmentSecret";
140147
export type { SlackEventPayload } from "./types/SlackEventPayload";
141148
export type { StatementRules } from "./types/StatementRules";
142149
export type { SubmitCancellationFeedbackData, SubmitCancellationFeedbackPathOrgId, SubmitCancellationFeedbackRequestConfig, SubmitCancellationFeedbackResponse, SubmitCancellationFeedbackResponses, SubmitCancellationFeedbackStatus204, SubmitCancellationFeedbackStatus400, SubmitCancellationFeedbackStatus401, SubmitCancellationFeedbackStatus403, SubmitCancellationFeedbackStatus429 } from "./types/SubmitCancellationFeedback";

src/generated/operations-map.gen.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ import type { ListRegionsStatus200 } from "./types/ListRegions";
5959
import type { ListReplicasRequestConfig, ListReplicasStatus200 } from "./types/ListReplicas";
6060
import type { CreateReplicaRequestConfig, CreateReplicaStatus201 } from "./types/CreateReplica";
6161
import type { DeleteReplicaRequestConfig } from "./types/DeleteReplica";
62+
import type { ListSelfHostEnrollmentsRequestConfig, ListSelfHostEnrollmentsStatus200 } from "./types/ListSelfHostEnrollments";
63+
import type { CreateSelfHostEnrollmentRequestConfig, CreateSelfHostEnrollmentStatus201 } from "./types/CreateSelfHostEnrollment";
64+
import type { RevokeSelfHostEnrollmentRequestConfig } from "./types/RevokeSelfHostEnrollment";
6265
import type { ListSupportCasesRequestConfig, ListSupportCasesStatus200 } from "./types/ListSupportCases";
6366
import type { CreateSupportCaseRequestConfig, CreateSupportCaseStatus201 } from "./types/CreateSupportCase";
6467
import type { GetSupportCaseRequestConfig, GetSupportCaseStatus200 } from "./types/GetSupportCase";
@@ -143,6 +146,9 @@ export const operationsByTag = {
143146
platform: {
144147
getHealth: { method: "GET", path: "/v1/health" },
145148
listRegions: { method: "GET", path: "/v1/regions" },
149+
listSelfHostEnrollments: { method: "GET", path: "/v1/organizations/{org_id}/self-host-enrollments" },
150+
createSelfHostEnrollment: { method: "POST", path: "/v1/organizations/{org_id}/self-host-enrollments" },
151+
revokeSelfHostEnrollment: { method: "DELETE", path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}" },
146152
},
147153
migrations: {
148154
lintMigration: { method: "POST", path: "/v1/projects/{project_id}/migrations:lint" },
@@ -232,6 +238,9 @@ export const operationsByPath = {
232238
"GET /v1/databases/{database_id}/replicas": { method: "GET", path: "/v1/databases/{database_id}/replicas", operationId: "listReplicas" },
233239
"POST /v1/databases/{database_id}/replicas": { method: "POST", path: "/v1/databases/{database_id}/replicas", operationId: "createReplica" },
234240
"DELETE /v1/databases/{database_id}/replicas/{replica_id}": { method: "DELETE", path: "/v1/databases/{database_id}/replicas/{replica_id}", operationId: "deleteReplica" },
241+
"GET /v1/organizations/{org_id}/self-host-enrollments": { method: "GET", path: "/v1/organizations/{org_id}/self-host-enrollments", operationId: "listSelfHostEnrollments" },
242+
"POST /v1/organizations/{org_id}/self-host-enrollments": { method: "POST", path: "/v1/organizations/{org_id}/self-host-enrollments", operationId: "createSelfHostEnrollment" },
243+
"DELETE /v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}": { method: "DELETE", path: "/v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}", operationId: "revokeSelfHostEnrollment" },
235244
"GET /v1/organizations/{org_id}/support/cases": { method: "GET", path: "/v1/organizations/{org_id}/support/cases", operationId: "listSupportCases" },
236245
"POST /v1/organizations/{org_id}/support/cases": { method: "POST", path: "/v1/organizations/{org_id}/support/cases", operationId: "createSupportCase" },
237246
"GET /v1/organizations/{org_id}/support/cases/{case_id}": { method: "GET", path: "/v1/organizations/{org_id}/support/cases/{case_id}", operationId: "getSupportCase" },
@@ -300,6 +309,9 @@ type GetProjectMetricsParams = { pathParams: NonNullable<GetProjectMetricsReques
300309
type ListReplicasParams = { pathParams: NonNullable<ListReplicasRequestConfig["pathParams"]> };
301310
type CreateReplicaParams = { pathParams: NonNullable<CreateReplicaRequestConfig["pathParams"]>; body: NonNullable<CreateReplicaRequestConfig["data"]> };
302311
type DeleteReplicaParams = { pathParams: NonNullable<DeleteReplicaRequestConfig["pathParams"]> };
312+
type ListSelfHostEnrollmentsParams = { pathParams: NonNullable<ListSelfHostEnrollmentsRequestConfig["pathParams"]> };
313+
type CreateSelfHostEnrollmentParams = { pathParams: NonNullable<CreateSelfHostEnrollmentRequestConfig["pathParams"]>; body: NonNullable<CreateSelfHostEnrollmentRequestConfig["data"]> };
314+
type RevokeSelfHostEnrollmentParams = { pathParams: NonNullable<RevokeSelfHostEnrollmentRequestConfig["pathParams"]> };
303315
type ListSupportCasesParams = { pathParams: NonNullable<ListSupportCasesRequestConfig["pathParams"]>; queryParams?: NonNullable<ListSupportCasesRequestConfig["queryParams"]> };
304316
type CreateSupportCaseParams = { pathParams: NonNullable<CreateSupportCaseRequestConfig["pathParams"]>; body: NonNullable<CreateSupportCaseRequestConfig["data"]> };
305317
type GetSupportCaseParams = { pathParams: NonNullable<GetSupportCaseRequestConfig["pathParams"]> };
@@ -384,6 +396,9 @@ export interface ApiOperations {
384396
platform: {
385397
getHealth(): Promise<GetHealthStatus200>;
386398
listRegions(): Promise<ListRegionsStatus200>;
399+
listSelfHostEnrollments(params: ListSelfHostEnrollmentsParams): Promise<ListSelfHostEnrollmentsStatus200>;
400+
createSelfHostEnrollment(params: CreateSelfHostEnrollmentParams): Promise<CreateSelfHostEnrollmentStatus201>;
401+
revokeSelfHostEnrollment(params: RevokeSelfHostEnrollmentParams): Promise<void>;
387402
};
388403
migrations: {
389404
lintMigration(params: LintMigrationParams): Promise<LintMigrationStatus200>;
@@ -473,6 +488,9 @@ export interface RequestMap {
473488
"GET /v1/databases/{database_id}/replicas": { params: ListReplicasParams; response: ListReplicasStatus200 };
474489
"POST /v1/databases/{database_id}/replicas": { params: CreateReplicaParams; response: CreateReplicaStatus201 };
475490
"DELETE /v1/databases/{database_id}/replicas/{replica_id}": { params: DeleteReplicaParams; response: void };
491+
"GET /v1/organizations/{org_id}/self-host-enrollments": { params: ListSelfHostEnrollmentsParams; response: ListSelfHostEnrollmentsStatus200 };
492+
"POST /v1/organizations/{org_id}/self-host-enrollments": { params: CreateSelfHostEnrollmentParams; response: CreateSelfHostEnrollmentStatus201 };
493+
"DELETE /v1/organizations/{org_id}/self-host-enrollments/{enrollment_id}": { params: RevokeSelfHostEnrollmentParams; response: void };
476494
"GET /v1/organizations/{org_id}/support/cases": { params: ListSupportCasesParams; response: ListSupportCasesStatus200 };
477495
"POST /v1/organizations/{org_id}/support/cases": { params: CreateSupportCaseParams; response: CreateSupportCaseStatus201 };
478496
"GET /v1/organizations/{org_id}/support/cases/{case_id}": { params: GetSupportCaseParams; response: GetSupportCaseStatus200 };

src/generated/types/CreateProjectRequest.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ export type CreateProjectRequest = {
5454
* @type string | undefined
5555
*/
5656
cloud?: CreateProjectRequestCloudEnumKey;
57+
/**
58+
* @description Mark this project as running on a self-hosted (BYOC) data plane in the customer\'s own VPC/cluster. Requires the Scale or enterprise plan.\n
59+
* @default false
60+
* @type boolean | undefined
61+
*/
62+
self_hosted?: boolean;
5763
/**
5864
* @description Primary database. Created atomically with the project.
5965
* @type object
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
import type { CreateSelfHostEnrollmentRequest } from "./CreateSelfHostEnrollmentRequest";
7+
import type { Error } from "./Error";
8+
import type { SelfHostEnrollmentSecret } from "./SelfHostEnrollmentSecret";
9+
10+
/**
11+
* @description Unique organization identifier.
12+
* @pattern ^[a-zA-Z0-9_.-]+$
13+
* @example org_abc123
14+
* @type string
15+
*/
16+
export type CreateSelfHostEnrollmentPathOrgId = string;
17+
18+
/**
19+
* @description Response returned once when an enrollment is created. The token is shown a single time and cannot be retrieved again; set it as GRPC_AUTH_TOKEN on the self-hosted proxy.\n
20+
* @type object
21+
*/
22+
export type CreateSelfHostEnrollmentStatus201 = SelfHostEnrollmentSecret;
23+
24+
/**
25+
* @description Standard error response envelope for PgBeam API requests.
26+
* @type object
27+
*/
28+
export type CreateSelfHostEnrollmentStatus400 = Error;
29+
30+
/**
31+
* @description Standard error response envelope for PgBeam API requests.
32+
* @type object
33+
*/
34+
export type CreateSelfHostEnrollmentStatus401 = Error;
35+
36+
/**
37+
* @description Standard error response envelope for PgBeam API requests.
38+
* @type object
39+
*/
40+
export type CreateSelfHostEnrollmentStatus403 = Error;
41+
42+
/**
43+
* @description Standard error response envelope for PgBeam API requests.
44+
* @type object
45+
*/
46+
export type CreateSelfHostEnrollmentStatus429 = Error;
47+
48+
/**
49+
* @description Request body for issuing a self-host enrollment token.
50+
* @type object | undefined
51+
*/
52+
export type CreateSelfHostEnrollmentData = CreateSelfHostEnrollmentRequest | undefined;
53+
54+
/**
55+
* @type object
56+
*/
57+
export type CreateSelfHostEnrollmentRequestConfig = {
58+
data?: CreateSelfHostEnrollmentData;
59+
/**
60+
* @type object
61+
*/
62+
pathParams: {
63+
org_id: CreateSelfHostEnrollmentPathOrgId;
64+
};
65+
queryParams?: never;
66+
headerParams?: never;
67+
/**
68+
* @type string
69+
*/
70+
url: `/v1/organizations/${string}/self-host-enrollments`;
71+
};
72+
73+
/**
74+
* @type object
75+
*/
76+
export type CreateSelfHostEnrollmentResponses = {
77+
"201": CreateSelfHostEnrollmentStatus201;
78+
"400": CreateSelfHostEnrollmentStatus400;
79+
"401": CreateSelfHostEnrollmentStatus401;
80+
"403": CreateSelfHostEnrollmentStatus403;
81+
"429": CreateSelfHostEnrollmentStatus429;
82+
};
83+
84+
/**
85+
* @description Union of all possible responses
86+
*/
87+
export type CreateSelfHostEnrollmentResponse = (CreateSelfHostEnrollmentStatus201 | CreateSelfHostEnrollmentStatus400 | CreateSelfHostEnrollmentStatus401 | CreateSelfHostEnrollmentStatus403 | CreateSelfHostEnrollmentStatus429);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
/**
7+
* @description Request body for issuing a self-host enrollment token.
8+
* @type object
9+
*/
10+
export type CreateSelfHostEnrollmentRequest = {
11+
/**
12+
* @description Operator-supplied label for where the proxy runs.
13+
* @maxLength 100
14+
* @pattern ^[^\x00]*$
15+
* @example customer-vpc-us-east
16+
* @type string | undefined
17+
*/
18+
region_label?: string;
19+
/**
20+
* @description Optional human-readable note.
21+
* @maxLength 500
22+
* @pattern ^[^\x00]*$
23+
* @example prod cluster
24+
* @type string | undefined
25+
*/
26+
description?: string;
27+
};
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
import type { Error } from "./Error";
7+
import type { ListSelfHostEnrollmentsResponse } from "./ListSelfHostEnrollmentsResponse";
8+
9+
/**
10+
* @description Unique organization identifier.
11+
* @pattern ^[a-zA-Z0-9_.-]+$
12+
* @example org_abc123
13+
* @type string
14+
*/
15+
export type ListSelfHostEnrollmentsPathOrgId = string;
16+
17+
/**
18+
* @description List of self-host enrollments for an organization.
19+
* @type object
20+
*/
21+
export type ListSelfHostEnrollmentsStatus200 = ListSelfHostEnrollmentsResponse;
22+
23+
/**
24+
* @description Standard error response envelope for PgBeam API requests.
25+
* @type object
26+
*/
27+
export type ListSelfHostEnrollmentsStatus401 = Error;
28+
29+
/**
30+
* @description Standard error response envelope for PgBeam API requests.
31+
* @type object
32+
*/
33+
export type ListSelfHostEnrollmentsStatus403 = Error;
34+
35+
/**
36+
* @type object
37+
*/
38+
export type ListSelfHostEnrollmentsRequestConfig = {
39+
data?: never;
40+
/**
41+
* @type object
42+
*/
43+
pathParams: {
44+
org_id: ListSelfHostEnrollmentsPathOrgId;
45+
};
46+
queryParams?: never;
47+
headerParams?: never;
48+
/**
49+
* @type string
50+
*/
51+
url: `/v1/organizations/${string}/self-host-enrollments`;
52+
};
53+
54+
/**
55+
* @type object
56+
*/
57+
export type ListSelfHostEnrollmentsResponses = {
58+
"200": ListSelfHostEnrollmentsStatus200;
59+
"401": ListSelfHostEnrollmentsStatus401;
60+
"403": ListSelfHostEnrollmentsStatus403;
61+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
import type { SelfHostEnrollment } from "./SelfHostEnrollment";
7+
8+
/**
9+
* @description List of self-host enrollments for an organization.
10+
* @type object
11+
*/
12+
export type ListSelfHostEnrollmentsResponse = {
13+
/**
14+
* @description The organization\'s self-host enrollments, newest first.
15+
* @type array
16+
*/
17+
enrollments: SelfHostEnrollment[];
18+
};

src/generated/types/Project.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ export type Project = {
5858
* @type string | undefined
5959
*/
6060
readonly cloud?: ProjectCloudEnumKey;
61+
/**
62+
* @description When true, this project\'s data plane runs in the customer\'s own VPC/cluster (BYOC): the control plane does not provision hosted infra, and a self-hosted proxy dials home over the config/audit gRPC stream. Requires the Scale or enterprise plan.\n
63+
* @example false
64+
* @type boolean | undefined
65+
*/
66+
readonly self_hosted?: boolean;
6167
/**
6268
* @description Proxy hostname for connecting through PgBeam (e.g., myproject.proxy.pgbeam.app).
6369
* @type string | undefined

0 commit comments

Comments
 (0)