mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-19 07:18:20 +00:00
191 lines
6.7 KiB
Protocol Buffer
191 lines
6.7 KiB
Protocol Buffer
syntax = "proto2";
|
|
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";
|
|
import "github.com/argoproj/argo-cd/reposerver/repository/repository.proto";
|
|
|
|
|
|
// ApplicationQuery is a query for application resources
|
|
message ApplicationQuery {
|
|
optional string name = 1;
|
|
optional bool refresh = 2 [(gogoproto.nullable) = false];
|
|
repeated string project = 3 [(gogoproto.customname) = "Projects"];
|
|
}
|
|
|
|
// ApplicationEventsQuery is a query for application resource events
|
|
message ApplicationResourceEventsQuery {
|
|
required string name = 1;
|
|
required string resourceName = 2 [(gogoproto.nullable) = false];
|
|
required string resourceUID = 3 [(gogoproto.nullable) = false];
|
|
}
|
|
|
|
// ManifestQuery is a query for manifest resources
|
|
message ApplicationManifestQuery {
|
|
required string name = 1;
|
|
optional string revision = 2 [(gogoproto.nullable) = false];
|
|
}
|
|
|
|
message ApplicationResponse {}
|
|
|
|
message ApplicationCreateRequest {
|
|
required github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application application = 1 [(gogoproto.nullable) = false];
|
|
optional bool upsert = 2;
|
|
}
|
|
|
|
message ApplicationUpdateRequest {
|
|
required github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application application = 1;
|
|
}
|
|
|
|
message ApplicationDeleteRequest {
|
|
required string name = 1;
|
|
optional bool cascade = 2;
|
|
}
|
|
|
|
// ApplicationSyncRequest is a request to apply the config state to live state
|
|
message ApplicationSyncRequest {
|
|
required string name = 1;
|
|
optional string revision = 2 [(gogoproto.nullable) = false];
|
|
optional bool dryRun = 3 [(gogoproto.nullable) = false];
|
|
optional bool prune = 4 [(gogoproto.nullable) = false];
|
|
optional github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.SyncStrategy strategy = 5;
|
|
}
|
|
|
|
// ApplicationUpdateSpecRequest is a request to update application spec
|
|
message ApplicationUpdateSpecRequest {
|
|
required string name = 1;
|
|
required github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ApplicationSpec spec = 2 [(gogoproto.nullable) = false];
|
|
}
|
|
|
|
message ApplicationRollbackRequest {
|
|
required string name = 1;
|
|
required int64 id = 2 [(gogoproto.customname) = "ID", (gogoproto.nullable) = false];
|
|
optional bool dryRun = 3 [(gogoproto.nullable) = false];
|
|
optional bool prune = 4 [(gogoproto.nullable) = false];
|
|
}
|
|
|
|
message ApplicationDeletePodRequest {
|
|
required string name = 1;
|
|
required string podName = 2;
|
|
}
|
|
|
|
message ApplicationPodLogsQuery {
|
|
required string name = 1;
|
|
required string podName = 2;
|
|
required string container = 3 [(gogoproto.nullable) = false];
|
|
required int64 sinceSeconds = 4 [(gogoproto.nullable) = false];
|
|
optional k8s.io.apimachinery.pkg.apis.meta.v1.Time sinceTime = 5;
|
|
required int64 tailLines = 6 [(gogoproto.nullable) = false];
|
|
required bool follow = 7 [(gogoproto.nullable) = false];
|
|
}
|
|
|
|
message LogEntry {
|
|
required string content = 1 [(gogoproto.nullable) = false];
|
|
required k8s.io.apimachinery.pkg.apis.meta.v1.Time timeStamp = 2 [(gogoproto.nullable) = false];
|
|
}
|
|
|
|
message OperationTerminateRequest {
|
|
required string name = 1;
|
|
}
|
|
|
|
message OperationTerminateResponse {
|
|
}
|
|
|
|
// 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";
|
|
}
|
|
|
|
// ListResourceEvents returns a list of event resources
|
|
rpc ListResourceEvents(ApplicationResourceEventsQuery) returns (k8s.io.api.core.v1.EventList) {
|
|
option (google.api.http).get = "/api/v1/applications/{name}/events";
|
|
}
|
|
|
|
// 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(ApplicationCreateRequest) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) {
|
|
option (google.api.http) = {
|
|
post: "/api/v1/applications"
|
|
body: "application"
|
|
};
|
|
}
|
|
|
|
// 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}";
|
|
}
|
|
|
|
// GetManifests returns application manifests
|
|
rpc GetManifests(ApplicationManifestQuery) returns (repository.ManifestResponse) {
|
|
option (google.api.http).get = "/api/v1/applications/{name}/manifests";
|
|
}
|
|
|
|
// Update updates an application
|
|
rpc Update(ApplicationUpdateRequest) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) {
|
|
option (google.api.http) = {
|
|
put: "/api/v1/applications/{application.metadata.name}"
|
|
body: "application"
|
|
};
|
|
}
|
|
|
|
// UpdateSpec updates an application spec
|
|
rpc UpdateSpec(ApplicationUpdateSpecRequest) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.ApplicationSpec) {
|
|
option (google.api.http) = {
|
|
put: "/api/v1/applications/{name}/spec"
|
|
body: "spec"
|
|
};
|
|
}
|
|
|
|
// Delete deletes an application
|
|
rpc Delete(ApplicationDeleteRequest) returns (ApplicationResponse) {
|
|
option (google.api.http).delete = "/api/v1/applications/{name}";
|
|
}
|
|
|
|
// Sync syncs an application to its target state
|
|
rpc Sync(ApplicationSyncRequest) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) {
|
|
option (google.api.http) = {
|
|
post: "/api/v1/applications/{name}/sync"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
// Rollback syncs an application to its target state
|
|
rpc Rollback(ApplicationRollbackRequest) returns (github.com.argoproj.argo_cd.pkg.apis.application.v1alpha1.Application) {
|
|
option (google.api.http) = {
|
|
post: "/api/v1/applications/{name}/rollback"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
// TerminateOperation terminates the currently running operation
|
|
rpc TerminateOperation(OperationTerminateRequest) returns (OperationTerminateResponse) {
|
|
option (google.api.http) = {
|
|
delete: "/api/v1/applications/{name}/operation";
|
|
};
|
|
}
|
|
|
|
// DeletePod returns stream of log entries for the specified pod. Pod
|
|
rpc DeletePod(ApplicationDeletePodRequest) returns (ApplicationResponse) {
|
|
option (google.api.http).delete = "/api/v1/applications/{name}/pods/{podName}";
|
|
}
|
|
|
|
// PodLogs returns stream of log entries for the specified pod. Pod
|
|
rpc PodLogs(ApplicationPodLogsQuery) returns (stream LogEntry) {
|
|
option (google.api.http).get = "/api/v1/applications/{name}/pods/{podName}/logs";
|
|
}
|
|
}
|