Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion HypercomputeCluster/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
deep-copy-regex:
- source: /google/cloud/hypercomputecluster/(v1beta)/.*-php/(.*)
- source: /google/cloud/hypercomputecluster/(v1|v1beta)/.*-php/(.*)
dest: /owl-bot-staging/HypercomputeCluster/$1/$2
api-name: HypercomputeCluster
35 changes: 35 additions & 0 deletions HypercomputeCluster/metadata/V1/HypercomputeCluster.php

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions HypercomputeCluster/metadata/V1/OperationMetadata.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php
/*
* Copyright 2026 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 CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START hypercomputecluster_v1_generated_HypercomputeCluster_CreateCluster_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\HypercomputeCluster\V1\Client\HypercomputeClusterClient;
use Google\Cloud\HypercomputeCluster\V1\Cluster;
use Google\Cloud\HypercomputeCluster\V1\CreateClusterRequest;
use Google\Rpc\Status;

/**
* Creates a new Cluster in a given project and location.
*
* @param string $formattedParent Parent location in which the cluster should be created, in the
* format `projects/{project}/locations/{location}`. Please see
* {@see HypercomputeClusterClient::locationName()} for help formatting this field.
* @param string $clusterId ID of the cluster to create. Must conform to
* [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case,
* alphanumeric, and at most 63 characters).
*/
function create_cluster_sample(string $formattedParent, string $clusterId): void
{
// Create a client.
$hypercomputeClusterClient = new HypercomputeClusterClient();

// Prepare the request message.
$cluster = new Cluster();
$request = (new CreateClusterRequest())
->setParent($formattedParent)
->setClusterId($clusterId)
->setCluster($cluster);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $hypercomputeClusterClient->createCluster($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
/** @var Cluster $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = HypercomputeClusterClient::locationName('[PROJECT]', '[LOCATION]');
$clusterId = '[CLUSTER_ID]';

create_cluster_sample($formattedParent, $clusterId);
}
// [END hypercomputecluster_v1_generated_HypercomputeCluster_CreateCluster_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?php
/*
* Copyright 2026 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 CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START hypercomputecluster_v1_generated_HypercomputeCluster_DeleteCluster_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\HypercomputeCluster\V1\Client\HypercomputeClusterClient;
use Google\Cloud\HypercomputeCluster\V1\DeleteClusterRequest;
use Google\Rpc\Status;

/**
* Deletes a single Cluster.
*
* @param string $formattedName Name of the cluster to delete, in the format
* `projects/{project}/locations/{location}/clusters/{cluster}`. Please see
* {@see HypercomputeClusterClient::clusterName()} for help formatting this field.
*/
function delete_cluster_sample(string $formattedName): void
{
// Create a client.
$hypercomputeClusterClient = new HypercomputeClusterClient();

// Prepare the request message.
$request = (new DeleteClusterRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $hypercomputeClusterClient->deleteCluster($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = HypercomputeClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]');

delete_cluster_sample($formattedName);
}
// [END hypercomputecluster_v1_generated_HypercomputeCluster_DeleteCluster_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php
/*
* Copyright 2026 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 CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START hypercomputecluster_v1_generated_HypercomputeCluster_GetCluster_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\HypercomputeCluster\V1\Client\HypercomputeClusterClient;
use Google\Cloud\HypercomputeCluster\V1\Cluster;
use Google\Cloud\HypercomputeCluster\V1\GetClusterRequest;

/**
* Gets details of a single Cluster.
*
* @param string $formattedName Name of the cluster to retrieve, in the format
* `projects/{project}/locations/{location}/clusters/{cluster}`. Please see
* {@see HypercomputeClusterClient::clusterName()} for help formatting this field.
*/
function get_cluster_sample(string $formattedName): void
{
// Create a client.
$hypercomputeClusterClient = new HypercomputeClusterClient();

// Prepare the request message.
$request = (new GetClusterRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var Cluster $response */
$response = $hypercomputeClusterClient->getCluster($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = HypercomputeClusterClient::clusterName('[PROJECT]', '[LOCATION]', '[CLUSTER]');

get_cluster_sample($formattedName);
}
// [END hypercomputecluster_v1_generated_HypercomputeCluster_GetCluster_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/*
* Copyright 2026 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 CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START hypercomputecluster_v1_generated_HypercomputeCluster_GetLocation_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\HypercomputeCluster\V1\Client\HypercomputeClusterClient;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;

/**
* Gets information about a location.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function get_location_sample(): void
{
// Create a client.
$hypercomputeClusterClient = new HypercomputeClusterClient();

// Prepare the request message.
$request = new GetLocationRequest();

// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $hypercomputeClusterClient->getLocation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
// [END hypercomputecluster_v1_generated_HypercomputeCluster_GetLocation_sync]
Loading
Loading