Skip to content

Commit

Permalink
feat(aiplatform): add new service proto file (#13325)
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan authored Dec 18, 2023
1 parent 26ac4d9 commit 4be3d06
Show file tree
Hide file tree
Showing 34 changed files with 3,373 additions and 0 deletions.
10 changes: 10 additions & 0 deletions generator/generator_config.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ service {
endpoint_location_style: LOCATION_DEPENDENT
}

service {
service_proto_path: "google/cloud/aiplatform/v1/deployment_resource_pool_service.proto"
product_path: "google/cloud/aiplatform/v1"
initial_copyright_year: "2023"
retryable_status_codes: ["kUnavailable"]
endpoint_location_style: LOCATION_DEPENDENT
# TODO(#13324) - workaround problems in the response proto message
omitted_rpcs: ["QueryDeployedModels"]
}

service {
service_proto_path: "google/cloud/aiplatform/v1/endpoint_service.proto"
product_path: "google/cloud/aiplatform/v1"
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/aiplatform/doc/environment-variables.dox
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ environment variables are convenient when troubleshooting problems.
`EndpointOption` (which defaults to "<location>-aiplatform.googleapis.com")
used by `MakeDatasetServiceConnection()`.

- `GOOGLE_CLOUD_CPP_DEPLOYMENT_RESOURCE_POOL_SERVICE_ENDPOINT=...` overrides the
`EndpointOption` (which defaults to "<location>-aiplatform.googleapis.com")
used by `MakeDeploymentResourcePoolServiceConnection()`.

- `GOOGLE_CLOUD_CPP_ENDPOINT_SERVICE_ENDPOINT=...` overrides the
`EndpointOption` (which defaults to "<location>-aiplatform.googleapis.com")
used by `MakeEndpointServiceConnection()`.
Expand Down
1 change: 1 addition & 0 deletions google/cloud/aiplatform/doc/main.dox
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ parameters, and infrastructure to mock the `*Client` classes when testing your
application.

- [\c aiplatform_v1::DatasetServiceClient](@ref google::cloud::aiplatform_v1::DatasetServiceClient)
- [\c aiplatform_v1::DeploymentResourcePoolServiceClient](@ref google::cloud::aiplatform_v1::DeploymentResourcePoolServiceClient)
- [\c aiplatform_v1::EndpointServiceClient](@ref google::cloud::aiplatform_v1::EndpointServiceClient)
- [\c aiplatform_v1::FeatureOnlineStoreAdminServiceClient](@ref google::cloud::aiplatform_v1::FeatureOnlineStoreAdminServiceClient)
- [\c aiplatform_v1::FeatureOnlineStoreServiceClient](@ref google::cloud::aiplatform_v1::FeatureOnlineStoreServiceClient)
Expand Down
7 changes: 7 additions & 0 deletions google/cloud/aiplatform/doc/override-authentication.dox
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The following example shows how to explicitly load a service account key file:
Follow these links to find examples for other \c *Client classes:

- [\c aiplatform_v1::DatasetServiceClient](@ref aiplatform_v1::DatasetServiceClient-service-account-snippet)
- [\c aiplatform_v1::DeploymentResourcePoolServiceClient](@ref aiplatform_v1::DeploymentResourcePoolServiceClient-service-account-snippet)
- [\c aiplatform_v1::EndpointServiceClient](@ref aiplatform_v1::EndpointServiceClient-service-account-snippet)
- [\c aiplatform_v1::FeatureOnlineStoreAdminServiceClient](@ref aiplatform_v1::FeatureOnlineStoreAdminServiceClient-service-account-snippet)
- [\c aiplatform_v1::FeatureOnlineStoreServiceClient](@ref aiplatform_v1::FeatureOnlineStoreServiceClient-service-account-snippet)
Expand Down Expand Up @@ -57,6 +58,12 @@ guide for more details.

*/

/*! @page aiplatform_v1::DeploymentResourcePoolServiceClient-service-account-snippet Override aiplatform_v1::DeploymentResourcePoolServiceClient Authentication Defaults

@snippet google/cloud/aiplatform/v1/samples/deployment_resource_pool_client_samples.cc with-service-account

*/

/*! @page aiplatform_v1::EndpointServiceClient-service-account-snippet Override aiplatform_v1::EndpointServiceClient Authentication Defaults

@snippet google/cloud/aiplatform/v1/samples/endpoint_client_samples.cc with-service-account
Expand Down
7 changes: 7 additions & 0 deletions google/cloud/aiplatform/doc/override-endpoint.dox
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ For example, this will override the default endpoint for `aiplatform_v1::Dataset
Follow these links to find examples for other \c *Client classes:

- [\c aiplatform_v1::DatasetServiceClient](@ref aiplatform_v1::DatasetServiceClient-endpoint-snippet)
- [\c aiplatform_v1::DeploymentResourcePoolServiceClient](@ref aiplatform_v1::DeploymentResourcePoolServiceClient-endpoint-snippet)
- [\c aiplatform_v1::EndpointServiceClient](@ref aiplatform_v1::EndpointServiceClient-endpoint-snippet)
- [\c aiplatform_v1::FeatureOnlineStoreAdminServiceClient](@ref aiplatform_v1::FeatureOnlineStoreAdminServiceClient-endpoint-snippet)
- [\c aiplatform_v1::FeatureOnlineStoreServiceClient](@ref aiplatform_v1::FeatureOnlineStoreServiceClient-endpoint-snippet)
Expand Down Expand Up @@ -47,6 +48,12 @@ Follow these links to find examples for other \c *Client classes:

*/

/*! @page aiplatform_v1::DeploymentResourcePoolServiceClient-endpoint-snippet Override aiplatform_v1::DeploymentResourcePoolServiceClient Endpoint Configuration

@snippet google/cloud/aiplatform/v1/samples/deployment_resource_pool_client_samples.cc set-client-endpoint

*/

/*! @page aiplatform_v1::EndpointServiceClient-endpoint-snippet Override aiplatform_v1::EndpointServiceClient Endpoint Configuration

@snippet google/cloud/aiplatform/v1/samples/endpoint_client_samples.cc set-client-endpoint
Expand Down
13 changes: 13 additions & 0 deletions google/cloud/aiplatform/doc/override-retry-policies.dox
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ This assumes you have created a custom idempotency policy. Such as:
Follow these links to find examples for other \c *Client classes:

- [\c aiplatform_v1::DatasetServiceClient](@ref aiplatform_v1::DatasetServiceClient-retry-snippet)
- [\c aiplatform_v1::DeploymentResourcePoolServiceClient](@ref aiplatform_v1::DeploymentResourcePoolServiceClient-retry-snippet)
- [\c aiplatform_v1::EndpointServiceClient](@ref aiplatform_v1::EndpointServiceClient-retry-snippet)
- [\c aiplatform_v1::FeatureOnlineStoreAdminServiceClient](@ref aiplatform_v1::FeatureOnlineStoreAdminServiceClient-retry-snippet)
- [\c aiplatform_v1::FeatureOnlineStoreServiceClient](@ref aiplatform_v1::FeatureOnlineStoreServiceClient-retry-snippet)
Expand Down Expand Up @@ -127,6 +128,18 @@ Assuming you have created a custom idempotency policy. Such as:

*/

/*! @page aiplatform_v1::DeploymentResourcePoolServiceClient-retry-snippet Override aiplatform_v1::DeploymentResourcePoolServiceClient Retry Policies

This shows how to override the retry policies for aiplatform_v1::DeploymentResourcePoolServiceClient:

@snippet google/cloud/aiplatform/v1/samples/deployment_resource_pool_client_samples.cc set-retry-policy

Assuming you have created a custom idempotency policy. Such as:

@snippet google/cloud/aiplatform/v1/samples/deployment_resource_pool_client_samples.cc custom-idempotency-policy

*/

/*! @page aiplatform_v1::EndpointServiceClient-retry-snippet Override aiplatform_v1::EndpointServiceClient Retry Policies

This shows how to override the retry policies for aiplatform_v1::EndpointServiceClient:
Expand Down
115 changes: 115 additions & 0 deletions google/cloud/aiplatform/v1/deployment_resource_pool_client.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated by the Codegen C++ plugin.
// If you make any local changes, they will be lost.
// source: google/cloud/aiplatform/v1/deployment_resource_pool_service.proto

#include "google/cloud/aiplatform/v1/deployment_resource_pool_client.h"
#include <memory>

namespace google {
namespace cloud {
namespace aiplatform_v1 {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

DeploymentResourcePoolServiceClient::DeploymentResourcePoolServiceClient(
std::shared_ptr<DeploymentResourcePoolServiceConnection> connection,
Options opts)
: connection_(std::move(connection)),
options_(
internal::MergeOptions(std::move(opts), connection_->options())) {}
DeploymentResourcePoolServiceClient::~DeploymentResourcePoolServiceClient() =
default;

future<StatusOr<google::cloud::aiplatform::v1::DeploymentResourcePool>>
DeploymentResourcePoolServiceClient::CreateDeploymentResourcePool(
std::string const& parent,
google::cloud::aiplatform::v1::DeploymentResourcePool const&
deployment_resource_pool,
std::string const& deployment_resource_pool_id, Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
google::cloud::aiplatform::v1::CreateDeploymentResourcePoolRequest request;
request.set_parent(parent);
*request.mutable_deployment_resource_pool() = deployment_resource_pool;
request.set_deployment_resource_pool_id(deployment_resource_pool_id);
return connection_->CreateDeploymentResourcePool(request);
}

future<StatusOr<google::cloud::aiplatform::v1::DeploymentResourcePool>>
DeploymentResourcePoolServiceClient::CreateDeploymentResourcePool(
google::cloud::aiplatform::v1::CreateDeploymentResourcePoolRequest const&
request,
Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
return connection_->CreateDeploymentResourcePool(request);
}

StatusOr<google::cloud::aiplatform::v1::DeploymentResourcePool>
DeploymentResourcePoolServiceClient::GetDeploymentResourcePool(
std::string const& name, Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
google::cloud::aiplatform::v1::GetDeploymentResourcePoolRequest request;
request.set_name(name);
return connection_->GetDeploymentResourcePool(request);
}

StatusOr<google::cloud::aiplatform::v1::DeploymentResourcePool>
DeploymentResourcePoolServiceClient::GetDeploymentResourcePool(
google::cloud::aiplatform::v1::GetDeploymentResourcePoolRequest const&
request,
Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
return connection_->GetDeploymentResourcePool(request);
}

StreamRange<google::cloud::aiplatform::v1::DeploymentResourcePool>
DeploymentResourcePoolServiceClient::ListDeploymentResourcePools(
std::string const& parent, Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
google::cloud::aiplatform::v1::ListDeploymentResourcePoolsRequest request;
request.set_parent(parent);
return connection_->ListDeploymentResourcePools(request);
}

StreamRange<google::cloud::aiplatform::v1::DeploymentResourcePool>
DeploymentResourcePoolServiceClient::ListDeploymentResourcePools(
google::cloud::aiplatform::v1::ListDeploymentResourcePoolsRequest request,
Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
return connection_->ListDeploymentResourcePools(std::move(request));
}

future<StatusOr<google::cloud::aiplatform::v1::DeleteOperationMetadata>>
DeploymentResourcePoolServiceClient::DeleteDeploymentResourcePool(
std::string const& name, Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
google::cloud::aiplatform::v1::DeleteDeploymentResourcePoolRequest request;
request.set_name(name);
return connection_->DeleteDeploymentResourcePool(request);
}

future<StatusOr<google::cloud::aiplatform::v1::DeleteOperationMetadata>>
DeploymentResourcePoolServiceClient::DeleteDeploymentResourcePool(
google::cloud::aiplatform::v1::DeleteDeploymentResourcePoolRequest const&
request,
Options opts) {
internal::OptionsSpan span(internal::MergeOptions(std::move(opts), options_));
return connection_->DeleteDeploymentResourcePool(request);
}

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace aiplatform_v1
} // namespace cloud
} // namespace google
Loading

0 comments on commit 4be3d06

Please sign in to comment.