@@ -22,9 +22,11 @@ import "google/api/field_behavior.proto";
2222import "google/api/field_info.proto" ;
2323import "google/api/resource.proto" ;
2424import "google/cloud/batch/v1alpha/job.proto" ;
25+ import "google/cloud/batch/v1alpha/resource_allowance.proto" ;
2526import "google/cloud/batch/v1alpha/task.proto" ;
2627import "google/longrunning/operations.proto" ;
2728import "google/protobuf/empty.proto" ;
29+ import "google/protobuf/field_mask.proto" ;
2830import "google/protobuf/timestamp.proto" ;
2931
3032option csharp_namespace = "Google.Cloud.Batch.V1Alpha" ;
@@ -96,6 +98,58 @@ service BatchService {
9698 };
9799 option (google.api.method_signature ) = "parent" ;
98100 }
101+
102+ // Create a Resource Allowance.
103+ rpc CreateResourceAllowance (CreateResourceAllowanceRequest )
104+ returns (ResourceAllowance ) {
105+ option (google.api.http ) = {
106+ post : "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances"
107+ body : "resource_allowance"
108+ };
109+ option (google.api.method_signature ) =
110+ "parent,resource_allowance,resource_allowance_id" ;
111+ }
112+
113+ // Get a ResourceAllowance specified by its resource name.
114+ rpc GetResourceAllowance (GetResourceAllowanceRequest )
115+ returns (ResourceAllowance ) {
116+ option (google.api.http ) = {
117+ get : "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}"
118+ };
119+ option (google.api.method_signature ) = "name" ;
120+ }
121+
122+ // Delete a ResourceAllowance.
123+ rpc DeleteResourceAllowance (DeleteResourceAllowanceRequest )
124+ returns (google.longrunning.Operation ) {
125+ option (google.api.http ) = {
126+ delete : "/v1alpha/{name=projects/*/locations/*/resourceAllowances/*}"
127+ };
128+ option (google.api.method_signature ) = "name" ;
129+ option (google.longrunning.operation_info ) = {
130+ response_type : "google.protobuf.Empty"
131+ metadata_type : "google.cloud.batch.v1alpha.OperationMetadata"
132+ };
133+ }
134+
135+ // List all ResourceAllowances for a project within a region.
136+ rpc ListResourceAllowances (ListResourceAllowancesRequest )
137+ returns (ListResourceAllowancesResponse ) {
138+ option (google.api.http ) = {
139+ get : "/v1alpha/{parent=projects/*/locations/*}/resourceAllowances"
140+ };
141+ option (google.api.method_signature ) = "parent" ;
142+ }
143+
144+ // Update a Resource Allowance.
145+ rpc UpdateResourceAllowance (UpdateResourceAllowanceRequest )
146+ returns (ResourceAllowance ) {
147+ option (google.api.http ) = {
148+ patch : "/v1alpha/{resource_allowance.name=projects/*/locations/*/resourceAllowances/*}"
149+ body : "resource_allowance"
150+ };
151+ option (google.api.method_signature ) = "resource_allowance,update_mask" ;
152+ }
99153}
100154
101155// CreateJob Request.
@@ -247,6 +301,163 @@ message GetTaskRequest {
247301 ];
248302}
249303
304+ // CreateResourceAllowance Request.
305+ message CreateResourceAllowanceRequest {
306+ // Required. The parent resource name where the ResourceAllowance will be
307+ // created. Pattern: "projects/{project}/locations/{location}"
308+ string parent = 1 [
309+ (google.api.field_behavior ) = REQUIRED ,
310+ (google.api.resource_reference ) = {
311+ child_type : "batch.googleapis.com/ResourceAllowance"
312+ }
313+ ];
314+
315+ // ID used to uniquely identify the ResourceAllowance within its parent scope.
316+ // This field should contain at most 63 characters and must start with
317+ // lowercase characters.
318+ // Only lowercase characters, numbers and '-' are accepted.
319+ // The '-' character cannot be the first or the last one.
320+ // A system generated ID will be used if the field is not set.
321+ //
322+ // The resource_allowance.name field in the request will be ignored and the
323+ // created resource name of the ResourceAllowance will be
324+ // "{parent}/resourceAllowances/{resource_allowance_id}".
325+ string resource_allowance_id = 2 ;
326+
327+ // Required. The ResourceAllowance to create.
328+ ResourceAllowance resource_allowance = 3
329+ [(google.api.field_behavior ) = REQUIRED ];
330+
331+ // Optional. An optional request ID to identify requests. Specify a unique
332+ // request ID so that if you must retry your request, the server will know to
333+ // ignore the request if it has already been completed. The server will
334+ // guarantee that for at least 60 minutes since the first request.
335+ //
336+ // For example, consider a situation where you make an initial request and
337+ // the request times out. If you make the request again with the same request
338+ // ID, the server can check if original operation with the same request ID
339+ // was received, and if so, will ignore the second request. This prevents
340+ // clients from accidentally creating duplicate commitments.
341+ //
342+ // The request ID must be a valid UUID with the exception that zero UUID is
343+ // not supported (00000000-0000-0000-0000-000000000000).
344+ string request_id = 4 [
345+ (google.api.field_info ).format = UUID4 ,
346+ (google.api.field_behavior ) = OPTIONAL
347+ ];
348+ }
349+
350+ // GetResourceAllowance Request.
351+ message GetResourceAllowanceRequest {
352+ // Required. ResourceAllowance name.
353+ string name = 1 [
354+ (google.api.field_behavior ) = REQUIRED ,
355+ (google.api.resource_reference ) = {
356+ type : "batch.googleapis.com/ResourceAllowance"
357+ }
358+ ];
359+ }
360+
361+ // DeleteResourceAllowance Request.
362+ message DeleteResourceAllowanceRequest {
363+ // Required. ResourceAllowance name.
364+ string name = 1 [
365+ (google.api.field_behavior ) = REQUIRED ,
366+ (google.api.resource_reference ) = {
367+ type : "batch.googleapis.com/ResourceAllowance"
368+ }
369+ ];
370+
371+ // Optional. Reason for this deletion.
372+ string reason = 2 [(google.api.field_behavior ) = OPTIONAL ];
373+
374+ // Optional. An optional request ID to identify requests. Specify a unique
375+ // request ID so that if you must retry your request, the server will know to
376+ // ignore the request if it has already been completed. The server will
377+ // guarantee that for at least 60 minutes after the first request.
378+ //
379+ // For example, consider a situation where you make an initial request and
380+ // the request times out. If you make the request again with the same request
381+ // ID, the server can check if original operation with the same request ID
382+ // was received, and if so, will ignore the second request. This prevents
383+ // clients from accidentally creating duplicate commitments.
384+ //
385+ // The request ID must be a valid UUID with the exception that zero UUID is
386+ // not supported (00000000-0000-0000-0000-000000000000).
387+ string request_id = 4 [
388+ (google.api.field_info ).format = UUID4 ,
389+ (google.api.field_behavior ) = OPTIONAL
390+ ];
391+ }
392+
393+ // ListResourceAllowances Request.
394+ message ListResourceAllowancesRequest {
395+ // Required. Parent path.
396+ string parent = 1 [
397+ (google.api.field_behavior ) = REQUIRED ,
398+ (google.api.resource_reference ) = {
399+ child_type : "batch.googleapis.com/ResourceAllowance"
400+ }
401+ ];
402+
403+ // Optional. Page size.
404+ int32 page_size = 2 [(google.api.field_behavior ) = OPTIONAL ];
405+
406+ // Optional. Page token.
407+ string page_token = 3 [(google.api.field_behavior ) = OPTIONAL ];
408+ }
409+
410+ // ListResourceAllowances Response.
411+ message ListResourceAllowancesResponse {
412+ // ResourceAllowances.
413+ repeated ResourceAllowance resource_allowances = 1 ;
414+
415+ // Next page token.
416+ string next_page_token = 2 ;
417+
418+ // Locations that could not be reached.
419+ repeated string unreachable = 3 ;
420+ }
421+
422+ // UpdateResourceAllowance Request.
423+ message UpdateResourceAllowanceRequest {
424+ // Required. The ResourceAllowance to update.
425+ // Update description.
426+ // Only fields specified in `update_mask` are updated.
427+ ResourceAllowance resource_allowance = 1
428+ [(google.api.field_behavior ) = REQUIRED ];
429+
430+ // Required. Mask of fields to update.
431+ //
432+ // Field mask is used to specify the fields to be overwritten in the
433+ // ResourceAllowance resource by the update.
434+ // The fields specified in the update_mask are relative to the resource, not
435+ // the full request. A field will be overwritten if it is in the mask. If the
436+ // user does not provide a mask then all fields will be overwritten.
437+ //
438+ // UpdateResourceAllowance request now only supports update on `limit` field.
439+ google.protobuf.FieldMask update_mask = 2
440+ [(google.api.field_behavior ) = REQUIRED ];
441+
442+ // Optional. An optional request ID to identify requests. Specify a unique
443+ // request ID so that if you must retry your request, the server will know to
444+ // ignore the request if it has already been completed. The server will
445+ // guarantee that for at least 60 minutes since the first request.
446+ //
447+ // For example, consider a situation where you make an initial request and
448+ // the request times out. If you make the request again with the same request
449+ // ID, the server can check if original operation with the same request ID
450+ // was received, and if so, will ignore the second request. This prevents
451+ // clients from accidentally creating duplicate commitments.
452+ //
453+ // The request ID must be a valid UUID with the exception that zero UUID is
454+ // not supported (00000000-0000-0000-0000-000000000000).
455+ string request_id = 3 [
456+ (google.api.field_info ).format = UUID4 ,
457+ (google.api.field_behavior ) = OPTIONAL
458+ ];
459+ }
460+
250461// Represents the metadata of the long-running operation.
251462message OperationMetadata {
252463 // Output only. The time the operation was created.
0 commit comments