workspace.proto 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.example.endpointsapis.v1;
  16. import "google/api/annotations.proto";
  17. import "google/protobuf/empty.proto";
  18. option java_multiple_files = true;
  19. option java_package = "com.google.example.endpointsapis.v1";
  20. option java_outer_classname = "WorkspaceProto";
  21. // Manages workspaces.
  22. service Workspaces {
  23. // List workspaces.
  24. rpc ListWorkspaces(ListWorkspacesRequest) returns (ListWorkspacesResponse) {
  25. option (google.api.http) = {
  26. get: "/v1/{parent=projects/*/locations/*}/workspaces"
  27. };
  28. }
  29. // Get information about a Workspace.
  30. rpc GetWorkspace(GetWorkspaceRequest) returns (Workspace) {
  31. option (google.api.http) = {
  32. get: "/v1/{name=projects/*/locations/*/workspaces/*}"
  33. };
  34. }
  35. // Create a Workspace.
  36. rpc CreateWorkspace(CreateWorkspaceRequest) returns (Workspace) {
  37. option (google.api.http) = {
  38. post: "/v1/{parent=projects/*/locations/*}/workspaces"
  39. body: "workspace"
  40. };
  41. }
  42. // Updates a Workspace.
  43. rpc UpdateWorkspace(UpdateWorkspaceRequest) returns (Workspace) {
  44. option (google.api.http) = {
  45. patch: "/v1/{name=projects/*/locations/*/Workspaces/*}"
  46. body: "workspace"
  47. };
  48. }
  49. // Deletes a Workspace.
  50. rpc DeleteWorkspace(DeleteWorkspaceRequest) returns (google.protobuf.Empty) {
  51. option (google.api.http) = {
  52. delete: "/v1/{name=projects/*/locations/*/workspaces/*}"
  53. };
  54. }
  55. }
  56. // Presents a workspace
  57. message Workspace {
  58. // The Workspace name in the format of "projects/*/locations/*/workspaces/*".
  59. string name = 1;
  60. }
  61. // Request message for listing Workspaces.
  62. message ListWorkspacesRequest {
  63. // The parent used for listing. It should have the format of
  64. // `projects/{number}/locations/{location}`.
  65. string parent = 1;
  66. // The page size for list pagination.
  67. int32 page_size = 2;
  68. // The page token for list pagination.
  69. string page_token = 3;
  70. }
  71. // A list of workspaces.
  72. message ListWorkspacesResponse {
  73. // The list of workspaces.
  74. repeated Workspace items = 1;
  75. // The next page token for list pagination.
  76. string next_page_token = 2;
  77. }
  78. // Request message for retrieving a Workspace.
  79. message GetWorkspaceRequest {
  80. // The name of the Workspace to retrieve.
  81. string name = 1;
  82. }
  83. // Request message for creating a Workspace.
  84. message CreateWorkspaceRequest {
  85. // The namespace in which the Workspace should be created.
  86. string parent = 1;
  87. // The Workspace instance to create.
  88. Workspace workspace = 2;
  89. }
  90. // Request message for replacing a Workspace.
  91. message UpdateWorkspaceRequest {
  92. // The name of the Workspace being replaced.
  93. string name = 1;
  94. // The Workspace object being replaced.
  95. Workspace workspace = 2;
  96. }
  97. // Request message for deleting a Workspace.
  98. message DeleteWorkspaceRequest {
  99. // The name of the Workspace to delete.
  100. string name = 1;
  101. }