mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
140 lines
4 KiB
Protocol Buffer
140 lines
4 KiB
Protocol Buffer
syntax = "proto3";
|
|
option go_package = "github.com/argoproj/argo-cd/server/application";
|
|
|
|
// Application Service
|
|
//
|
|
// Application Service API performs CRUD actions against application resources
|
|
package application;
|
|
|
|
import "gogoproto/gogo.proto";
|
|
import "google/api/annotations.proto";
|
|
import "k8s.io/api/core/v1/generated.proto";
|
|
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
|
|
import "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/generated.proto";
|
|
|
|
|
|
// ApplicationQuery is a query for application resources
|
|
message ApplicationQuery {
|
|
string name = 1;
|
|
}
|
|
|
|
message ApplicationResponse {}
|
|
|
|
message DeleteApplicationRequest {
|
|
string name = 1;
|
|
string namespace = 2;
|
|
string server = 3;
|
|
bool force = 4;
|
|
}
|
|
|
|
// ApplicationSyncRequest is a request to apply the config state to live state
|
|
message ApplicationSyncRequest {
|
|
string name = 1;
|
|
string revision = 2;
|
|
bool dryRun = 3;
|
|
}
|
|
|
|
// ApplicationSyncResult is a result of a sync requeswt
|
|
message ApplicationSyncResult {
|
|
string message = 1;
|
|
repeated ResourceDetails resources = 2;
|
|
}
|
|
|
|
message ApplicationRollbackRequest {
|
|
string name = 1;
|
|
int64 id = 2 [(gogoproto.customname) = "ID"];
|
|
bool dryRun = 3;
|
|
}
|
|
|
|
message ResourceDetails {
|
|
string name = 1;
|
|
string kind = 2;
|
|
string namespace = 3;
|
|
string message = 4;
|
|
}
|
|
|
|
message DeletePodQuery {
|
|
string applicationName = 1;
|
|
string podName = 2;
|
|
}
|
|
|
|
message PodLogsQuery {
|
|
string applicationName = 1;
|
|
string podName = 2;
|
|
string container = 3;
|
|
int64 sinceSeconds = 4;
|
|
k8s.io.apimachinery.pkg.apis.meta.v1.Time sinceTime = 5;
|
|
int64 tailLines = 6;
|
|
bool follow = 7;
|
|
}
|
|
|
|
message LogEntry {
|
|
string content = 1;
|
|
k8s.io.apimachinery.pkg.apis.meta.v1.Time timeStamp = 2;
|
|
}
|
|
|
|
// ApplicationService
|
|
service ApplicationService {
|
|
|
|
// List returns list of applications
|
|
rpc List(ApplicationQuery) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ApplicationList) {
|
|
option (google.api.http).get = "/api/v1/applications";
|
|
}
|
|
|
|
// Watch returns stream of application change events.
|
|
rpc Watch(ApplicationQuery) returns (stream github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ApplicationWatchEvent) {
|
|
option (google.api.http).get = "/api/v1/stream/applications";
|
|
}
|
|
|
|
// Create creates an application
|
|
rpc Create(github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) {
|
|
option (google.api.http) = {
|
|
post: "/api/v1/applications"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
// Get returns an application by name
|
|
rpc Get(ApplicationQuery) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) {
|
|
option (google.api.http).get = "/api/v1/applications/{name}";
|
|
}
|
|
|
|
// Update updates an application
|
|
rpc Update(github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) {
|
|
option (google.api.http) = {
|
|
put: "/api/v1/applications/{metadata.name}"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
// Delete deletes an application
|
|
rpc Delete(DeleteApplicationRequest) returns (ApplicationResponse) {
|
|
option (google.api.http).delete = "/api/v1/applications/{name}";
|
|
}
|
|
|
|
// Sync syncs an application to its target state
|
|
rpc Sync(ApplicationSyncRequest) returns (ApplicationSyncResult) {
|
|
option (google.api.http) = {
|
|
post: "/api/v1/applications/{name}/sync"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
// Sync syncs an application to its target state
|
|
rpc Rollback(ApplicationRollbackRequest) returns (ApplicationSyncResult) {
|
|
option (google.api.http) = {
|
|
post: "/api/v1/applications/{name}/rollback"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
// PodLogs returns stream of log entries for the specified pod. Pod
|
|
rpc DeletePod(DeletePodQuery) returns (ApplicationResponse) {
|
|
option (google.api.http).delete = "/api/v1/applications/{applicationName}/pods/{podName}";
|
|
}
|
|
|
|
// PodLogs returns stream of log entries for the specified pod. Pod
|
|
rpc PodLogs(PodLogsQuery) returns (stream LogEntry) {
|
|
option (google.api.http).get = "/api/v1/applications/{applicationName}/pods/{podName}/logs";
|
|
}
|
|
}
|