appengine.proto 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. // Copyright 2016 Google Inc.
  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.appengine.v1;
  16. import "google/api/annotations.proto";
  17. import "google/appengine/v1/application.proto";
  18. import "google/appengine/v1/instance.proto";
  19. import "google/appengine/v1/service.proto";
  20. import "google/appengine/v1/version.proto";
  21. import "google/iam/v1/iam_policy.proto";
  22. import "google/iam/v1/policy.proto";
  23. import "google/longrunning/operations.proto";
  24. import "google/protobuf/empty.proto";
  25. import "google/protobuf/field_mask.proto";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "AppengineProto";
  28. option java_package = "com.google.appengine.v1";
  29. // Manages instances of a version.
  30. service Instances {
  31. // Lists the instances of a version.
  32. rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
  33. option (google.api.http) = { get: "/v1/{parent=apps/*/services/*/versions/*}/instances" };
  34. }
  35. // Gets instance information.
  36. rpc GetInstance(GetInstanceRequest) returns (Instance) {
  37. option (google.api.http) = { get: "/v1/{name=apps/*/services/*/versions/*/instances/*}" };
  38. }
  39. // Stops a running instance.
  40. rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) {
  41. option (google.api.http) = { delete: "/v1/{name=apps/*/services/*/versions/*/instances/*}" };
  42. }
  43. // Enables debugging on a VM instance. This allows you to use the SSH
  44. // command to connect to the virtual machine where the instance lives.
  45. // While in "debug mode", the instance continues to serve live traffic.
  46. // You should delete the instance when you are done debugging and then
  47. // allow the system to take over and determine if another instance
  48. // should be started.
  49. //
  50. // Only applicable for instances in App Engine flexible environment.
  51. rpc DebugInstance(DebugInstanceRequest) returns (google.longrunning.Operation) {
  52. option (google.api.http) = { post: "/v1/{name=apps/*/services/*/versions/*/instances/*}:debug" body: "*" };
  53. }
  54. }
  55. // Manages versions of a service.
  56. service Versions {
  57. // Lists the versions of a service.
  58. rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) {
  59. option (google.api.http) = { get: "/v1/{parent=apps/*/services/*}/versions" };
  60. }
  61. // Gets the specified Version resource.
  62. // By default, only a `BASIC_VIEW` will be returned.
  63. // Specify the `FULL_VIEW` parameter to get the full resource.
  64. rpc GetVersion(GetVersionRequest) returns (Version) {
  65. option (google.api.http) = { get: "/v1/{name=apps/*/services/*/versions/*}" };
  66. }
  67. // Deploys code and resource files to a new version.
  68. rpc CreateVersion(CreateVersionRequest) returns (google.longrunning.Operation) {
  69. option (google.api.http) = { post: "/v1/{parent=apps/*/services/*}/versions" body: "version" };
  70. }
  71. // Updates the specified Version resource.
  72. // You can specify the following fields depending on the App Engine
  73. // environment and type of scaling that the version resource uses:
  74. //
  75. // * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status):
  76. // For Version resources that use basic scaling, manual scaling, or run in
  77. // the App Engine flexible environment.
  78. // * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class):
  79. // For Version resources that run in the App Engine standard environment.
  80. // * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling):
  81. // For Version resources that use automatic scaling and run in the App
  82. // Engine standard environment.
  83. // * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling):
  84. // For Version resources that use automatic scaling and run in the App
  85. // Engine standard environment.
  86. rpc UpdateVersion(UpdateVersionRequest) returns (google.longrunning.Operation) {
  87. option (google.api.http) = { patch: "/v1/{name=apps/*/services/*/versions/*}" body: "version" };
  88. }
  89. // Deletes an existing Version resource.
  90. rpc DeleteVersion(DeleteVersionRequest) returns (google.longrunning.Operation) {
  91. option (google.api.http) = { delete: "/v1/{name=apps/*/services/*/versions/*}" };
  92. }
  93. }
  94. // Manages services of an application.
  95. service Services {
  96. // Lists all the services in the application.
  97. rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
  98. option (google.api.http) = { get: "/v1/{parent=apps/*}/services" };
  99. }
  100. // Gets the current configuration of the specified service.
  101. rpc GetService(GetServiceRequest) returns (Service) {
  102. option (google.api.http) = { get: "/v1/{name=apps/*/services/*}" };
  103. }
  104. // Updates the configuration of the specified service.
  105. rpc UpdateService(UpdateServiceRequest) returns (google.longrunning.Operation) {
  106. option (google.api.http) = { patch: "/v1/{name=apps/*/services/*}" body: "service" };
  107. }
  108. // Deletes the specified service and all enclosed versions.
  109. rpc DeleteService(DeleteServiceRequest) returns (google.longrunning.Operation) {
  110. option (google.api.http) = { delete: "/v1/{name=apps/*/services/*}" };
  111. }
  112. }
  113. // Manages App Engine applications.
  114. service Applications {
  115. // Gets information about an application.
  116. rpc GetApplication(GetApplicationRequest) returns (Application) {
  117. option (google.api.http) = { get: "/v1/{name=apps/*}" };
  118. }
  119. // Recreates the required App Engine features for the application in your
  120. // project, for example a Cloud Storage bucket or App Engine service account.
  121. // Use this method if you receive an error message about a missing feature,
  122. // for example "*Error retrieving the App Engine service account*".
  123. rpc RepairApplication(RepairApplicationRequest) returns (google.longrunning.Operation) {
  124. option (google.api.http) = { post: "/v1/{name=apps/*}:repair" body: "*" };
  125. }
  126. }
  127. // Request message for `Applications.GetApplication`.
  128. message GetApplicationRequest {
  129. // Name of the Application resource to get. Example: `apps/myapp`.
  130. string name = 1;
  131. }
  132. // Request message for 'Applications.RepairApplication'.
  133. message RepairApplicationRequest {
  134. // Name of the application to repair. Example: `apps/myapp`
  135. string name = 1;
  136. }
  137. // Request message for `Services.ListServices`.
  138. message ListServicesRequest {
  139. // Name of the parent Application resource. Example: `apps/myapp`.
  140. string parent = 1;
  141. // Maximum results to return per page.
  142. int32 page_size = 2;
  143. // Continuation token for fetching the next page of results.
  144. string page_token = 3;
  145. }
  146. // Response message for `Services.ListServices`.
  147. message ListServicesResponse {
  148. // The services belonging to the requested application.
  149. repeated Service services = 1;
  150. // Continuation token for fetching the next page of results.
  151. string next_page_token = 2;
  152. }
  153. // Request message for `Services.GetService`.
  154. message GetServiceRequest {
  155. // Name of the resource requested. Example: `apps/myapp/services/default`.
  156. string name = 1;
  157. }
  158. // Request message for `Services.UpdateService`.
  159. message UpdateServiceRequest {
  160. // Name of the resource to update. Example: `apps/myapp/services/default`.
  161. string name = 1;
  162. // A Service resource containing the updated service. Only fields set in the
  163. // field mask will be updated.
  164. Service service = 2;
  165. // Standard field mask for the set of fields to be updated.
  166. google.protobuf.FieldMask update_mask = 3;
  167. // Set to `true` to gradually shift traffic from one version to another
  168. // single version. By default, traffic is shifted immediately.
  169. // For gradual traffic migration, the target version
  170. // must be located within instances that are configured for both
  171. // [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#inboundservicetype)
  172. // and
  173. // [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#automaticscaling).
  174. // You must specify the
  175. // [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#shardby)
  176. // field in the Service resource. Gradual traffic migration is not
  177. // supported in the App Engine flexible environment. For examples, see
  178. // [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
  179. bool migrate_traffic = 4;
  180. }
  181. // Request message for `Services.DeleteService`.
  182. message DeleteServiceRequest {
  183. // Name of the resource requested. Example: `apps/myapp/services/default`.
  184. string name = 1;
  185. }
  186. // Request message for `Versions.ListVersions`.
  187. message ListVersionsRequest {
  188. // Name of the parent Service resource. Example:
  189. // `apps/myapp/services/default`.
  190. string parent = 1;
  191. // Controls the set of fields returned in the `List` response.
  192. VersionView view = 2;
  193. // Maximum results to return per page.
  194. int32 page_size = 3;
  195. // Continuation token for fetching the next page of results.
  196. string page_token = 4;
  197. }
  198. // Response message for `Versions.ListVersions`.
  199. message ListVersionsResponse {
  200. // The versions belonging to the requested service.
  201. repeated Version versions = 1;
  202. // Continuation token for fetching the next page of results.
  203. string next_page_token = 2;
  204. }
  205. // Request message for `Versions.GetVersion`.
  206. message GetVersionRequest {
  207. // Name of the resource requested. Example:
  208. // `apps/myapp/services/default/versions/v1`.
  209. string name = 1;
  210. // Controls the set of fields returned in the `Get` response.
  211. VersionView view = 2;
  212. }
  213. // Request message for `Versions.CreateVersion`.
  214. message CreateVersionRequest {
  215. // Name of the parent resource to create this version under. Example:
  216. // `apps/myapp/services/default`.
  217. string parent = 1;
  218. // Application deployment configuration.
  219. Version version = 2;
  220. }
  221. // Request message for `Versions.UpdateVersion`.
  222. message UpdateVersionRequest {
  223. // Name of the resource to update. Example:
  224. // `apps/myapp/services/default/versions/1`.
  225. string name = 1;
  226. // A Version containing the updated resource. Only fields set in the field
  227. // mask will be updated.
  228. Version version = 2;
  229. // Standard field mask for the set of fields to be updated.
  230. google.protobuf.FieldMask update_mask = 3;
  231. }
  232. // Request message for `Versions.DeleteVersion`.
  233. message DeleteVersionRequest {
  234. // Name of the resource requested. Example:
  235. // `apps/myapp/services/default/versions/v1`.
  236. string name = 1;
  237. }
  238. // Request message for `Instances.ListInstances`.
  239. message ListInstancesRequest {
  240. // Name of the parent Version resource. Example:
  241. // `apps/myapp/services/default/versions/v1`.
  242. string parent = 1;
  243. // Maximum results to return per page.
  244. int32 page_size = 2;
  245. // Continuation token for fetching the next page of results.
  246. string page_token = 3;
  247. }
  248. // Response message for `Instances.ListInstances`.
  249. message ListInstancesResponse {
  250. // The instances belonging to the requested version.
  251. repeated Instance instances = 1;
  252. // Continuation token for fetching the next page of results.
  253. string next_page_token = 2;
  254. }
  255. // Request message for `Instances.GetInstance`.
  256. message GetInstanceRequest {
  257. // Name of the resource requested. Example:
  258. // `apps/myapp/services/default/versions/v1/instances/instance-1`.
  259. string name = 1;
  260. }
  261. // Request message for `Instances.DeleteInstance`.
  262. message DeleteInstanceRequest {
  263. // Name of the resource requested. Example:
  264. // `apps/myapp/services/default/versions/v1/instances/instance-1`.
  265. string name = 1;
  266. }
  267. // Request message for `Instances.DebugInstance`.
  268. message DebugInstanceRequest {
  269. // Name of the resource requested. Example:
  270. // `apps/myapp/services/default/versions/v1/instances/instance-1`.
  271. string name = 1;
  272. }
  273. // Fields that should be returned when [Version][google.appengine.v1.Version] resources
  274. // are retreived.
  275. enum VersionView {
  276. // Basic version information including scaling and inbound services,
  277. // but not detailed deployment information.
  278. BASIC = 0;
  279. // The information from `BASIC`, plus detailed information about the
  280. // deployment. This format is required when creating resources, but
  281. // is not returned in `Get` or `List` by default.
  282. FULL = 1;
  283. }