Skip to content

Commit

Permalink
feat: add Persistent Resource reboot api call to v1beta1
Browse files Browse the repository at this point in the history
docs: A comment for field `service_account` in message `.google.cloud.aiplatform.v1beta1.ServiceAccountSpec` is changed

PiperOrigin-RevId: 620918445
  • Loading branch information
Google APIs authored and Copybara-Service committed Apr 1, 2024
1 parent 152a4c1 commit ca6f884
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 10 deletions.
26 changes: 16 additions & 10 deletions google/cloud/aiplatform/v1beta1/persistent_resource.proto
Expand Up @@ -60,6 +60,13 @@ message PersistentResource {
// The ERROR state indicates the persistent resource may be unusable.
// Details can be found in the `error` field.
ERROR = 5;

// The REBOOTING state indicates the persistent resource is being rebooted
// (PR is not available right now but is expected to be ready again later).
REBOOTING = 6;

// The UPDATING state indicates the persistent resource is being updated.
UPDATING = 7;
}

// Immutable. Resource name of a PersistentResource.
Expand Down Expand Up @@ -275,18 +282,17 @@ message ServiceAccountSpec {
bool enable_custom_service_account = 1
[(google.api.field_behavior) = REQUIRED];

// Optional. Default service account that this PersistentResource's workloads
// run as. The workloads include:
//
// * Any runtime specified via `ResourceRuntimeSpec` on creation time,
// for example, Ray.
// * Jobs submitted to PersistentResource, if no other service account
// specified in the job specs.
// Optional. Required when all below conditions are met
// * `enable_custom_service_account` is true;
// * any runtime is specified via `ResourceRuntimeSpec` on creation time,
// for example, Ray
//
// Only works when custom service account is enabled and users have the
// `iam.serviceAccounts.actAs` permission on this service account.
// The users must have `iam.serviceAccounts.actAs` permission on this service
// account and then the specified runtime containers will run as it.
//
// Required if any containers are specified in `ResourceRuntimeSpec`.
// Do not set this field if you want to submit jobs using custom service
// account to this PersistentResource after creation, but only specify the
// `service_account` inside the job.
string service_account = 2 [(google.api.field_behavior) = OPTIONAL];
}

Expand Down
37 changes: 37 additions & 0 deletions google/cloud/aiplatform/v1beta1/persistent_resource_service.proto
Expand Up @@ -99,6 +99,20 @@ service PersistentResourceService {
metadata_type: "UpdatePersistentResourceOperationMetadata"
};
}

// Reboots a PersistentResource.
rpc RebootPersistentResource(RebootPersistentResourceRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{name=projects/*/locations/*/persistentResources/*}:reboot"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "PersistentResource"
metadata_type: "RebootPersistentResourceOperationMetadata"
};
}
}

// Request message for
Expand Down Expand Up @@ -143,6 +157,15 @@ message UpdatePersistentResourceOperationMetadata {
string progress_message = 2;
}

// Details of operations that perform reboot PersistentResource.
message RebootPersistentResourceOperationMetadata {
// Operation metadata for PersistentResource.
GenericOperationMetadata generic_metadata = 1;

// Progress Message for Reboot LRO
string progress_message = 2;
}

// Request message for
// [PersistentResourceService.GetPersistentResource][google.cloud.aiplatform.v1beta1.PersistentResourceService.GetPersistentResource].
message GetPersistentResourceRequest {
Expand Down Expand Up @@ -219,3 +242,17 @@ message UpdatePersistentResourceRequest {
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = REQUIRED];
}

// Request message for
// [PersistentResourceService.RebootPersistentResource][google.cloud.aiplatform.v1beta1.PersistentResourceService.RebootPersistentResource].
message RebootPersistentResourceRequest {
// Required. The name of the PersistentResource resource.
// Format:
// `projects/{project_id_or_number}/locations/{location_id}/persistentResources/{persistent_resource_id}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/PersistentResource"
}
];
}

0 comments on commit ca6f884

Please sign in to comment.