Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [NetworkManagement] add messages and fields related to Redis Instances #7748

Merged
merged 2 commits into from
Oct 17, 2024
Merged
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
Binary file modified NetworkManagement/metadata/V1/ConnectivityTest.php
Binary file not shown.
33 changes: 19 additions & 14 deletions NetworkManagement/metadata/V1/Reachability.php

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

Binary file modified NetworkManagement/metadata/V1/Trace.php
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,31 @@
* <code>AMBIGUOUS</code>. For more information,
* see the Connectivity Test documentation.
*
* @param string $parent The parent resource of the Connectivity Test to create:
* `projects/{project_id}/locations/global`
* @param string $testId The logical name of the Connectivity Test in your project
* with the following restrictions:
* @param string $formattedParent The parent resource of the Connectivity Test to create:
* `projects/{project_id}/locations/global`
* Please see {@see ReachabilityServiceClient::projectName()} for help formatting this field.
* @param string $testId The logical name of the Connectivity Test in your project
* with the following restrictions:
*
* * Must contain only lowercase letters, numbers, and hyphens.
* * Must start with a letter.
* * Must be between 1-40 characters.
* * Must end with a number or a letter.
* * Must be unique within the customer project
* @param string $resourceName Unique name of the resource using the form:
* `projects/{project_id}/locations/global/connectivityTests/{test_id}`
* * Must contain only lowercase letters, numbers, and hyphens.
* * Must start with a letter.
* * Must be between 1-40 characters.
* * Must end with a number or a letter.
* * Must be unique within the customer project
*/
function create_connectivity_test_sample(
string $parent,
string $testId,
string $resourceName
): void {
function create_connectivity_test_sample(string $formattedParent, string $testId): void
{
// Create a client.
$reachabilityServiceClient = new ReachabilityServiceClient();

// Prepare the request message.
$resourceSource = new Endpoint();
$resourceDestination = new Endpoint();
$resource = (new ConnectivityTest())
->setName($resourceName)
->setSource($resourceSource)
->setDestination($resourceDestination);
$request = (new CreateConnectivityTestRequest())
->setParent($parent)
->setParent($formattedParent)
->setTestId($testId)
->setResource($resource);

Expand Down Expand Up @@ -110,10 +105,9 @@ function create_connectivity_test_sample(
*/
function callSample(): void
{
$parent = '[PARENT]';
$formattedParent = ReachabilityServiceClient::projectName('[PROJECT]');
$testId = '[TEST_ID]';
$resourceName = '[NAME]';

create_connectivity_test_sample($parent, $testId, $resourceName);
create_connectivity_test_sample($formattedParent, $testId);
}
// [END networkmanagement_v1_generated_ReachabilityService_CreateConnectivityTest_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@
/**
* Deletes a specific `ConnectivityTest`.
*
* @param string $name Connectivity Test resource name using the form:
* `projects/{project_id}/locations/global/connectivityTests/{test_id}`
* @param string $formattedName Connectivity Test resource name using the form:
* `projects/{project_id}/locations/global/connectivityTests/{test_id}`
* Please see {@see ReachabilityServiceClient::connectivityTestName()} for help formatting this field.
*/
function delete_connectivity_test_sample(string $name): void
function delete_connectivity_test_sample(string $formattedName): void
{
// Create a client.
$reachabilityServiceClient = new ReachabilityServiceClient();

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

// Call the API and handle any network failures.
try {
Expand Down Expand Up @@ -73,8 +74,8 @@ function delete_connectivity_test_sample(string $name): void
*/
function callSample(): void
{
$name = '[NAME]';
$formattedName = ReachabilityServiceClient::connectivityTestName('[PROJECT]', '[TEST]');

delete_connectivity_test_sample($name);
delete_connectivity_test_sample($formattedName);
}
// [END networkmanagement_v1_generated_ReachabilityService_DeleteConnectivityTest_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@
/**
* Gets the details of a specific Connectivity Test.
*
* @param string $name `ConnectivityTest` resource name using the form:
* `projects/{project_id}/locations/global/connectivityTests/{test_id}`
* @param string $formattedName `ConnectivityTest` resource name using the form:
* `projects/{project_id}/locations/global/connectivityTests/{test_id}`
* Please see {@see ReachabilityServiceClient::connectivityTestName()} for help formatting this field.
*/
function get_connectivity_test_sample(string $name): void
function get_connectivity_test_sample(string $formattedName): void
{
// Create a client.
$reachabilityServiceClient = new ReachabilityServiceClient();

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

// Call the API and handle any network failures.
try {
Expand All @@ -64,8 +65,8 @@ function get_connectivity_test_sample(string $name): void
*/
function callSample(): void
{
$name = '[NAME]';
$formattedName = ReachabilityServiceClient::connectivityTestName('[PROJECT]', '[TEST]');

get_connectivity_test_sample($name);
get_connectivity_test_sample($formattedName);
}
// [END networkmanagement_v1_generated_ReachabilityService_GetConnectivityTest_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@
/**
* Lists all Connectivity Tests owned by a project.
*
* @param string $parent The parent resource of the Connectivity Tests:
* `projects/{project_id}/locations/global`
* @param string $formattedParent The parent resource of the Connectivity Tests:
* `projects/{project_id}/locations/global`
* Please see {@see ReachabilityServiceClient::projectName()} for help formatting this field.
*/
function list_connectivity_tests_sample(string $parent): void
function list_connectivity_tests_sample(string $formattedParent): void
{
// Create a client.
$reachabilityServiceClient = new ReachabilityServiceClient();

// Prepare the request message.
$request = (new ListConnectivityTestsRequest())
->setParent($parent);
->setParent($formattedParent);

// Call the API and handle any network failures.
try {
Expand All @@ -69,8 +70,8 @@ function list_connectivity_tests_sample(string $parent): void
*/
function callSample(): void
{
$parent = '[PARENT]';
$formattedParent = ReachabilityServiceClient::projectName('[PROJECT]');

list_connectivity_tests_sample($parent);
list_connectivity_tests_sample($formattedParent);
}
// [END networkmanagement_v1_generated_ReachabilityService_ListConnectivityTests_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,18 @@
* read permissions to the network configurations of listed projects), then
* the reachability result returns a value of `UNKNOWN`.
*
* @param string $name Connectivity Test resource name using the form:
* `projects/{project_id}/locations/global/connectivityTests/{test_id}`
* @param string $formattedName Connectivity Test resource name using the form:
* `projects/{project_id}/locations/global/connectivityTests/{test_id}`
* Please see {@see ReachabilityServiceClient::connectivityTestName()} for help formatting this field.
*/
function rerun_connectivity_test_sample(string $name): void
function rerun_connectivity_test_sample(string $formattedName): void
{
// Create a client.
$reachabilityServiceClient = new ReachabilityServiceClient();

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

// Call the API and handle any network failures.
try {
Expand Down Expand Up @@ -87,8 +88,8 @@ function rerun_connectivity_test_sample(string $name): void
*/
function callSample(): void
{
$name = '[NAME]';
$formattedName = ReachabilityServiceClient::connectivityTestName('[PROJECT]', '[TEST]');

rerun_connectivity_test_sample($name);
rerun_connectivity_test_sample($formattedName);
}
// [END networkmanagement_v1_generated_ReachabilityService_RerunConnectivityTest_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@
*
* If the endpoint specifications in `ConnectivityTest` are incomplete, the
* reachability result returns a value of `AMBIGUOUS`. See the documentation
* in `ConnectivityTest` for for more details.
* in `ConnectivityTest` for more details.
*
* @param string $resourceName Unique name of the resource using the form:
* `projects/{project_id}/locations/global/connectivityTests/{test_id}`
* 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 update_connectivity_test_sample(string $resourceName): void
function update_connectivity_test_sample(): void
{
// Create a client.
$reachabilityServiceClient = new ReachabilityServiceClient();
Expand All @@ -61,7 +64,6 @@ function update_connectivity_test_sample(string $resourceName): void
$resourceSource = new Endpoint();
$resourceDestination = new Endpoint();
$resource = (new ConnectivityTest())
->setName($resourceName)
->setSource($resourceSource)
->setDestination($resourceDestination);
$request = (new UpdateConnectivityTestRequest())
Expand All @@ -87,20 +89,4 @@ function update_connectivity_test_sample(string $resourceName): void
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
{
$resourceName = '[NAME]';

update_connectivity_test_sample($resourceName);
}
// [END networkmanagement_v1_generated_ReachabilityService_UpdateConnectivityTest_sync]
31 changes: 31 additions & 0 deletions NetworkManagement/src/V1/AbortInfo/Cause.php

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

Loading
Loading