Skip to content

Commit dbc4693

Browse files
chore: deployment dependency api endpoints
1 parent f461582 commit dbc4693

5 files changed

Lines changed: 595 additions & 1 deletion

File tree

apps/api/openapi/openapi.json

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,26 @@
495495
],
496496
"type": "object"
497497
},
498+
"DeploymentDependency": {
499+
"properties": {
500+
"dependencyDeploymentId": {
501+
"type": "string"
502+
},
503+
"deploymentId": {
504+
"type": "string"
505+
},
506+
"versionSelector": {
507+
"description": "CEL expression evaluated against the dependency deployment's current release version on the same resource.",
508+
"type": "string"
509+
}
510+
},
511+
"required": [
512+
"deploymentId",
513+
"dependencyDeploymentId",
514+
"versionSelector"
515+
],
516+
"type": "object"
517+
},
498518
"DeploymentDependencyRule": {
499519
"properties": {
500520
"dependsOn": {
@@ -2578,6 +2598,18 @@
25782598
},
25792599
"type": "object"
25802600
},
2601+
"UpsertDeploymentDependencyRequest": {
2602+
"properties": {
2603+
"versionSelector": {
2604+
"description": "CEL expression evaluated against the dependency deployment's current release version on the same resource.",
2605+
"type": "string"
2606+
}
2607+
},
2608+
"required": [
2609+
"versionSelector"
2610+
],
2611+
"type": "object"
2612+
},
25812613
"UpsertDeploymentRequest": {
25822614
"properties": {
25832615
"description": {
@@ -4805,6 +4837,191 @@
48054837
"summary": "Upsert deployment"
48064838
}
48074839
},
4840+
"/v1/workspaces/{workspaceId}/deployments/{deploymentId}/dependencies": {
4841+
"get": {
4842+
"description": "Returns the dependency edges declared by this deployment.",
4843+
"operationId": "listDeploymentDependencies",
4844+
"parameters": [
4845+
{
4846+
"description": "ID of the workspace",
4847+
"in": "path",
4848+
"name": "workspaceId",
4849+
"required": true,
4850+
"schema": {
4851+
"type": "string"
4852+
}
4853+
},
4854+
{
4855+
"description": "ID of the deployment",
4856+
"in": "path",
4857+
"name": "deploymentId",
4858+
"required": true,
4859+
"schema": {
4860+
"type": "string"
4861+
}
4862+
}
4863+
],
4864+
"responses": {
4865+
"200": {
4866+
"content": {
4867+
"application/json": {
4868+
"schema": {
4869+
"items": {
4870+
"$ref": "#/components/schemas/DeploymentDependency"
4871+
},
4872+
"type": "array"
4873+
}
4874+
}
4875+
},
4876+
"description": "OK response"
4877+
},
4878+
"404": {
4879+
"content": {
4880+
"application/json": {
4881+
"schema": {
4882+
"$ref": "#/components/schemas/ErrorResponse"
4883+
}
4884+
}
4885+
},
4886+
"description": "Resource not found"
4887+
}
4888+
},
4889+
"summary": "List deployment dependencies"
4890+
}
4891+
},
4892+
"/v1/workspaces/{workspaceId}/deployments/{deploymentId}/dependencies/{dependencyDeploymentId}": {
4893+
"delete": {
4894+
"operationId": "requestDeploymentDependencyDeletion",
4895+
"parameters": [
4896+
{
4897+
"description": "ID of the workspace",
4898+
"in": "path",
4899+
"name": "workspaceId",
4900+
"required": true,
4901+
"schema": {
4902+
"type": "string"
4903+
}
4904+
},
4905+
{
4906+
"description": "ID of the deployment",
4907+
"in": "path",
4908+
"name": "deploymentId",
4909+
"required": true,
4910+
"schema": {
4911+
"type": "string"
4912+
}
4913+
},
4914+
{
4915+
"description": "ID of the dependency deployment",
4916+
"in": "path",
4917+
"name": "dependencyDeploymentId",
4918+
"required": true,
4919+
"schema": {
4920+
"type": "string"
4921+
}
4922+
}
4923+
],
4924+
"responses": {
4925+
"202": {
4926+
"content": {
4927+
"application/json": {
4928+
"schema": {
4929+
"$ref": "#/components/schemas/DeploymentRequestAccepted"
4930+
}
4931+
}
4932+
},
4933+
"description": "Accepted response"
4934+
},
4935+
"404": {
4936+
"content": {
4937+
"application/json": {
4938+
"schema": {
4939+
"$ref": "#/components/schemas/ErrorResponse"
4940+
}
4941+
}
4942+
},
4943+
"description": "Resource not found"
4944+
}
4945+
},
4946+
"summary": "Delete deployment dependency"
4947+
},
4948+
"put": {
4949+
"description": "Declare or update a version-selector dependency from this deployment to another deployment. Identified by the (deploymentId, dependencyDeploymentId) pair.",
4950+
"operationId": "requestDeploymentDependencyUpsert",
4951+
"parameters": [
4952+
{
4953+
"description": "ID of the workspace",
4954+
"in": "path",
4955+
"name": "workspaceId",
4956+
"required": true,
4957+
"schema": {
4958+
"type": "string"
4959+
}
4960+
},
4961+
{
4962+
"description": "ID of the deployment",
4963+
"in": "path",
4964+
"name": "deploymentId",
4965+
"required": true,
4966+
"schema": {
4967+
"type": "string"
4968+
}
4969+
},
4970+
{
4971+
"description": "ID of the dependency deployment",
4972+
"in": "path",
4973+
"name": "dependencyDeploymentId",
4974+
"required": true,
4975+
"schema": {
4976+
"type": "string"
4977+
}
4978+
}
4979+
],
4980+
"requestBody": {
4981+
"content": {
4982+
"application/json": {
4983+
"schema": {
4984+
"$ref": "#/components/schemas/UpsertDeploymentDependencyRequest"
4985+
}
4986+
}
4987+
},
4988+
"required": true
4989+
},
4990+
"responses": {
4991+
"202": {
4992+
"content": {
4993+
"application/json": {
4994+
"schema": {
4995+
"$ref": "#/components/schemas/DeploymentRequestAccepted"
4996+
}
4997+
}
4998+
},
4999+
"description": "Accepted response"
5000+
},
5001+
"400": {
5002+
"content": {
5003+
"application/json": {
5004+
"schema": {
5005+
"$ref": "#/components/schemas/ErrorResponse"
5006+
}
5007+
}
5008+
},
5009+
"description": "Invalid request"
5010+
},
5011+
"404": {
5012+
"content": {
5013+
"application/json": {
5014+
"schema": {
5015+
"$ref": "#/components/schemas/ErrorResponse"
5016+
}
5017+
}
5018+
},
5019+
"description": "Resource not found"
5020+
}
5021+
},
5022+
"summary": "Upsert deployment dependency"
5023+
}
5024+
},
48085025
"/v1/workspaces/{workspaceId}/deployments/{deploymentId}/plan": {
48095026
"post": {
48105027
"description": "Compute a dry-run plan showing rendered diffs for each release target without creating a version.",

apps/api/openapi/paths/deployments.jsonnet

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,56 @@ local openapi = import '../lib/openapi.libsonnet';
8888
+ openapi.badRequestResponse(),
8989
},
9090
},
91+
'/v1/workspaces/{workspaceId}/deployments/{deploymentId}/dependencies': {
92+
get: {
93+
summary: 'List deployment dependencies',
94+
description: "Returns the dependency edges declared by this deployment.",
95+
operationId: 'listDeploymentDependencies',
96+
parameters: [
97+
openapi.workspaceIdParam(),
98+
openapi.deploymentIdParam(),
99+
],
100+
responses: openapi.okResponse({
101+
type: 'array',
102+
items: openapi.schemaRef('DeploymentDependency'),
103+
})
104+
+ openapi.notFoundResponse(),
105+
},
106+
},
107+
'/v1/workspaces/{workspaceId}/deployments/{deploymentId}/dependencies/{dependencyDeploymentId}': {
108+
put: {
109+
summary: 'Upsert deployment dependency',
110+
description: 'Declare or update a version-selector dependency from this deployment to another deployment. Identified by the (deploymentId, dependencyDeploymentId) pair.',
111+
operationId: 'requestDeploymentDependencyUpsert',
112+
parameters: [
113+
openapi.workspaceIdParam(),
114+
openapi.deploymentIdParam(),
115+
openapi.stringParam('dependencyDeploymentId', 'ID of the dependency deployment'),
116+
],
117+
requestBody: {
118+
required: true,
119+
content: {
120+
'application/json': {
121+
schema: openapi.schemaRef('UpsertDeploymentDependencyRequest'),
122+
},
123+
},
124+
},
125+
responses: openapi.acceptedResponse(openapi.schemaRef('DeploymentRequestAccepted'))
126+
+ openapi.notFoundResponse()
127+
+ openapi.badRequestResponse(),
128+
},
129+
delete: {
130+
summary: 'Delete deployment dependency',
131+
operationId: 'requestDeploymentDependencyDeletion',
132+
parameters: [
133+
openapi.workspaceIdParam(),
134+
openapi.deploymentIdParam(),
135+
openapi.stringParam('dependencyDeploymentId', 'ID of the dependency deployment'),
136+
],
137+
responses: openapi.acceptedResponse(openapi.schemaRef('DeploymentRequestAccepted'))
138+
+ openapi.notFoundResponse(),
139+
},
140+
},
91141
'/v1/workspaces/{workspaceId}/deployments/{deploymentId}/plan': {
92142
post: {
93143
summary: 'Create a deployment plan',

apps/api/openapi/schemas/deployments.jsonnet

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ local jobAgentConfig = {
3535
},
3636
},
3737

38+
UpsertDeploymentDependencyRequest: {
39+
type: 'object',
40+
required: ['versionSelector'],
41+
properties: {
42+
versionSelector: {
43+
type: 'string',
44+
description: "CEL expression evaluated against the dependency deployment's current release version on the same resource.",
45+
},
46+
},
47+
},
48+
49+
DeploymentDependency: {
50+
type: 'object',
51+
required: ['deploymentId', 'dependencyDeploymentId', 'versionSelector'],
52+
properties: {
53+
deploymentId: { type: 'string' },
54+
dependencyDeploymentId: { type: 'string' },
55+
versionSelector: {
56+
type: 'string',
57+
description: "CEL expression evaluated against the dependency deployment's current release version on the same resource.",
58+
},
59+
},
60+
},
61+
3862
DeploymentRequestAccepted: {
3963
type: 'object',
4064
required: ['id', 'message'],

0 commit comments

Comments
 (0)