Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions docs/docs/api/platform-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
| /api.v1.capsule.Service/Update | [UpdateRequest](#api-v1-capsule-UpdateRequest) | [UpdateResponse](#api-v1-capsule-UpdateResponse) | Update a capsule. |
| /api.v1.capsule.Service/List | [ListRequest](#api-v1-capsule-ListRequest) | [ListResponse](#api-v1-capsule-ListResponse) | Lists all capsules for current project. |
| /api.v1.capsule.Service/Deploy | [DeployRequest](#api-v1-capsule-DeployRequest) | [DeployResponse](#api-v1-capsule-DeployResponse) | Deploy changes to a capsule. When deploying, a new rollout will be initiated. Only one rollout can be running at a single point in time. Use `Abort` to abort an already running rollout. |
| /api.v1.capsule.Service/ApplyCapsuleSpec | [ApplyCapsuleSpecRequest](#api-v1-capsule-ApplyCapsuleSpecRequest) | [ApplyCapsuleSpecResponse](#api-v1-capsule-ApplyCapsuleSpecResponse) | Applies a Capsule spec in an environment which will be rolled out |
| /api.v1.capsule.Service/ListInstances | [ListInstancesRequest](#api-v1-capsule-ListInstancesRequest) | [ListInstancesResponse](#api-v1-capsule-ListInstancesResponse) | Lists all instances for the capsule. |
| /api.v1.capsule.Service/RestartInstance | [RestartInstanceRequest](#api-v1-capsule-RestartInstanceRequest) | [RestartInstanceResponse](#api-v1-capsule-RestartInstanceResponse) | Restart a single capsule instance. |
| /api.v1.capsule.Service/GetRollout | [GetRolloutRequest](#api-v1-capsule-GetRolloutRequest) | [GetRolloutResponse](#api-v1-capsule-GetRolloutResponse) | Get a single rollout by ID. |
Expand All @@ -77,6 +78,7 @@
| /api.v1.capsule.Service/GetCustomInstanceMetrics | [GetCustomInstanceMetricsRequest](#api-v1-capsule-GetCustomInstanceMetricsRequest) | [GetCustomInstanceMetricsResponse](#api-v1-capsule-GetCustomInstanceMetricsResponse) | |
| /api.v1.capsule.Service/GetJobExecutions | [GetJobExecutionsRequest](#api-v1-capsule-GetJobExecutionsRequest) | [GetJobExecutionsResponse](#api-v1-capsule-GetJobExecutionsResponse) | Get list of job executions performed by the Capsule. |
| /api.v1.capsule.Service/GetStatus | [GetStatusRequest](#api-v1-capsule-GetStatusRequest) | [GetStatusResponse](#api-v1-capsule-GetStatusResponse) | |
| /api.v1.capsule.Service/GetRevision | [GetRevisionRequest](#api-v1-capsule-GetRevisionRequest) | [GetRevisionResponse](#api-v1-capsule-GetRevisionResponse) | |



Expand Down Expand Up @@ -4640,6 +4642,41 @@ AbortRolloutResponse is an empty response.



<a name="api-v1-capsule-ApplyCapsuleSpecRequest"></a>

### ApplyCapsuleSpecRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| spec | [platform.v1.CapsuleSpec](#platform-v1-CapsuleSpec) | | |
| project_id | [string](#string) | | |
| environment_id | [string](#string) | | |
| capsule_id | [string](#string) | | |
| current_fingerprint | [model.Fingerprint](#model-Fingerprint) | | |
| dry_run | [bool](#bool) | | |






<a name="api-v1-capsule-ApplyCapsuleSpecResponse"></a>

### ApplyCapsuleSpecResponse



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| fingerprint | [model.Fingerprint](#model-Fingerprint) | | |






<a name="api-v1-capsule-CapsuleMetricsRequest"></a>

### CapsuleMetricsRequest
Expand Down Expand Up @@ -4990,6 +5027,57 @@ Response to get a capsule.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| capsule | [Capsule](#api-v1-capsule-Capsule) | | The capsule. |
| revision | [SetRevision](#api-v1-capsule-SetRevision) | | |
| environment_revisions | [GetResponse.EnvironmentRevisionsEntry](#api-v1-capsule-GetResponse-EnvironmentRevisionsEntry) | repeated | |






<a name="api-v1-capsule-GetResponse-EnvironmentRevisionsEntry"></a>

### GetResponse.EnvironmentRevisionsEntry



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [Revision](#api-v1-capsule-Revision) | | |






<a name="api-v1-capsule-GetRevisionRequest"></a>

### GetRevisionRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| project_id | [string](#string) | | |
| environment_id | [string](#string) | | |
| capsule_id | [string](#string) | | |
| fingerprint | [model.Fingerprint](#model-Fingerprint) | | |






<a name="api-v1-capsule-GetRevisionResponse"></a>

### GetRevisionResponse



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| revision | [Revision](#api-v1-capsule-Revision) | | |



Expand Down Expand Up @@ -5023,6 +5111,7 @@ in a project.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| rollout | [Rollout](#api-v1-capsule-Rollout) | | The rollout. |
| revision | [Revision](#api-v1-capsule-Revision) | | |



Expand Down
34 changes: 34 additions & 0 deletions proto/rig/api/v1/capsule/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ import "api/v1/capsule/rollout.proto";
import "api/v1/capsule/instance/status.proto";
import "api/v1/capsule/event.proto";
import "api/v1/capsule/job.proto";
import "platform/v1/generated.proto";
import "api/v1/capsule/metrics.proto";
import "api/v1/capsule/change.proto";
import "api/v1/capsule/status.proto";
import "api/v1/capsule/revision.proto";
import "model/common.proto";
import "model/revision.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

Expand All @@ -35,6 +38,9 @@ service Service {
// running at a single point in time.
// Use `Abort` to abort an already running rollout.
rpc Deploy(DeployRequest) returns (DeployResponse) {}
// Applies a Capsule spec in an environment which will be rolled out
rpc ApplyCapsuleSpec(ApplyCapsuleSpecRequest)
returns (ApplyCapsuleSpecResponse) {}
// Lists all instances for the capsule.
rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {}
// Restart a single capsule instance.
Expand Down Expand Up @@ -70,6 +76,7 @@ service Service {
returns (GetJobExecutionsResponse) {}

rpc GetStatus(GetStatusRequest) returns (GetStatusResponse) {}
rpc GetRevision(GetRevisionRequest) returns (GetRevisionResponse) {}
}

// GetStatusRequest is a request to start streaming the capsule status
Expand Down Expand Up @@ -180,6 +187,8 @@ message GetRequest {
message GetResponse {
// The capsule.
api.v1.capsule.Capsule capsule = 1;
api.v1.capsule.SetRevision revision = 2;
map<string, api.v1.capsule.Revision> environment_revisions = 3;
}

// Request to delete a capsule.
Expand Down Expand Up @@ -289,6 +298,19 @@ message DeployResponse {
api.v1.capsule.RolloutConfig rollout_config = 3;
}

message ApplyCapsuleSpecRequest {
platform.v1.CapsuleSpec spec = 1;
string project_id = 2;
string environment_id = 3;
string capsule_id = 4;
model.Fingerprint current_fingerprint = 5;
bool dry_run = 6;
}

message ApplyCapsuleSpecResponse {
model.Fingerprint fingerprint = 1;
}

// List instances request.
message ListInstancesRequest {
// Capsule to list instances from.
Expand Down Expand Up @@ -404,6 +426,7 @@ message GetRolloutRequest {
message GetRolloutResponse {
// The rollout.
api.v1.capsule.Rollout rollout = 1;
capsule.Revision revision = 2;
}

// AbortRolloutRequest aborts a rollout.
Expand Down Expand Up @@ -528,3 +551,14 @@ message GetJobExecutionsResponse {
// Total number of executions ignorring pagination.
uint64 total = 2;
}

message GetRevisionRequest {
string project_id = 1;
string environment_id = 2;
string capsule_id = 3;
model.Fingerprint fingerprint = 4;
}

message GetRevisionResponse {
Revision revision = 1;
}