github.com/argoproj/argo-cd/v2@v2.10.9/server/project/project.proto (about)

     1  syntax = "proto3";
     2  option go_package = "github.com/argoproj/argo-cd/v2/pkg/apiclient/project";
     3  
     4  // Project Service
     5  //
     6  // Project Service API performs CRUD actions against project resources
     7  package project;
     8  
     9  import "google/api/annotations.proto";
    10  import "k8s.io/api/core/v1/generated.proto";
    11  import "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1/generated.proto";
    12  import "github.com/argoproj/argo-cd/v2/server/application/application.proto";
    13  
    14  // ProjectCreateRequest defines project creation parameters.
    15  message ProjectCreateRequest {
    16    github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.AppProject project = 1;
    17    bool upsert = 2;
    18  }
    19  
    20  // ProjectTokenCreateRequest defines project token deletion parameters.
    21  message ProjectTokenDeleteRequest {
    22      string project = 1;
    23      string role = 2;
    24      int64 iat = 3;
    25      string id = 4;
    26  }
    27  
    28  // ProjectTokenCreateRequest defines project token creation parameters. 
    29  message ProjectTokenCreateRequest {
    30      string project = 1;
    31      string description = 2;
    32      string role = 3;
    33      // expiresIn represents a duration in seconds
    34      int64 expiresIn = 4;
    35      string id = 5;
    36  }
    37  // ProjectTokenResponse wraps the created token or returns an empty string if deleted.
    38  message ProjectTokenResponse {
    39      string token = 1;
    40  }
    41  
    42  
    43  // ProjectQuery is a query for Project resources
    44  message ProjectQuery {
    45  	string name = 1;
    46  }
    47  
    48  message ProjectUpdateRequest {
    49      github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.AppProject project = 1;
    50  }
    51  
    52  message EmptyResponse {}
    53  
    54  message SyncWindowsQuery {
    55      string name = 1;
    56  }
    57  
    58  message SyncWindowsResponse {
    59      repeated github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.SyncWindow windows = 1;
    60  }
    61  
    62  message GlobalProjectsResponse {
    63      repeated github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.AppProject items = 1;
    64  }
    65  
    66  message DetailedProjectsResponse {
    67      repeated github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.AppProject globalProjects = 1;
    68      github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.AppProject project = 2;
    69      repeated github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.Repository repositories = 3;
    70      repeated github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.Cluster clusters = 4;
    71  }
    72  
    73  message ListProjectLinksRequest {
    74    string name = 1;
    75  }
    76  
    77  // ProjectService
    78  service ProjectService {
    79  
    80    // Create a new project token
    81    rpc CreateToken(ProjectTokenCreateRequest) returns (ProjectTokenResponse) {
    82      option (google.api.http) = {
    83        post: "/api/v1/projects/{project}/roles/{role}/token"
    84        body: "*"
    85      };
    86    }
    87  
    88      // Delete a new project token
    89    rpc DeleteToken(ProjectTokenDeleteRequest) returns (EmptyResponse) {
    90      option (google.api.http).delete = "/api/v1/projects/{project}/roles/{role}/token/{iat}";
    91    }
    92  
    93    // Create a new project
    94    rpc Create(ProjectCreateRequest) returns (github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.AppProject) {
    95      option (google.api.http) = {
    96        post: "/api/v1/projects"
    97        body: "*"
    98      };
    99    }
   100  
   101    // List returns list of projects
   102    rpc List(ProjectQuery) returns (github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.AppProjectList) {
   103        option (google.api.http).get = "/api/v1/projects";
   104    }
   105  
   106    // GetDetailedProject returns a project that include project, global project and scoped resources by name
   107    rpc GetDetailedProject(ProjectQuery) returns (DetailedProjectsResponse) {
   108        option (google.api.http).get = "/api/v1/projects/{name}/detailed";
   109    }
   110  
   111    // Get returns a project by name
   112    rpc Get(ProjectQuery) returns (github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.AppProject) {
   113        option (google.api.http).get = "/api/v1/projects/{name}";
   114    }
   115  
   116    // Get returns a virtual project by name
   117    rpc GetGlobalProjects(ProjectQuery) returns (GlobalProjectsResponse) {
   118        option (google.api.http).get = "/api/v1/projects/{name}/globalprojects";
   119    }
   120  
   121    // Update updates a project
   122    rpc Update(ProjectUpdateRequest) returns (github.com.argoproj.argo_cd.v2.pkg.apis.application.v1alpha1.AppProject) {
   123        option (google.api.http) = {
   124            put: "/api/v1/projects/{project.metadata.name}"
   125            body: "*"
   126        };
   127    }
   128  
   129    // Delete deletes a project
   130    rpc Delete(ProjectQuery) returns (EmptyResponse) {
   131        option (google.api.http).delete = "/api/v1/projects/{name}";
   132    }
   133  
   134    // ListEvents returns a list of project events
   135    rpc ListEvents(ProjectQuery) returns (k8s.io.api.core.v1.EventList) {
   136        option (google.api.http).get = "/api/v1/projects/{name}/events";
   137    }
   138  
   139    // GetSchedulesState returns true if there are any active sync syncWindows
   140    rpc GetSyncWindowsState(SyncWindowsQuery) returns (SyncWindowsResponse) {
   141        option (google.api.http).get = "/api/v1/projects/{name}/syncwindows";
   142    }
   143  
   144    // ListLinks returns all deep links for the particular project
   145    rpc ListLinks(ListProjectLinksRequest) returns (application.LinksResponse) {
   146      option (google.api.http).get = "/api/v1/projects/{name}/links";
   147    }
   148  
   149  }