Reference documentation and code samples for the Google Cloud Edge Network V1 Client class EdgeNetworkClient.
Service Description: EdgeNetwork API provides managed, highly available cloud dynamic network configuration service to the GEC customer to enable edge application and network function solutions. This allows the customers to easily define and configure the network setup and property to meet the workload requirement.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Namespace
Google \ Cloud \ EdgeNetwork \ V1 \ ClientMethods
__construct
Constructor.
options
array
Optional. Options for configuring the service API wrapper.
↳ apiEndpoint
string
The address of the API remote host. May optionally include the port, formatted as "
↳ credentials
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage : In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. Important : If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud Platform, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information https://cloud.google.com/docs/authentication/external/externally-sourced-credentials
↳ credentialsConfig
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .
↳ disableRetries
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to false
.
↳ clientConfig
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.
↳ transport
string|TransportInterface
The transport used for executing network requests. May be either the string rest
or grpc
. Defaults to grpc
if gRPC support is detected on the system. Advanced usage
: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface
object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.
↳ transportConfig
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.
↳ clientCertSource
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.
↳ logger
false|LoggerInterface
A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag
createInterconnectAttachment
Creates a new InterconnectAttachment in a given project and location.
The async variant is EdgeNetworkClient::createInterconnectAttachmentAsync() .
request
Google\Cloud\EdgeNetwork\V1\CreateInterconnectAttachmentRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\CreateInterconnectAttachmentRequest;
use Google\Cloud\EdgeNetwork\V1\InterconnectAttachment;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see EdgeNetworkClient::zoneName()} for help formatting this field.
* @param string $interconnectAttachmentId Id of the requesting object
* If auto-generating Id server-side, remove this field and
* interconnect_attachment_id from the method_signature of Create RPC
* @param string $interconnectAttachmentName The canonical resource name of the interconnect attachment.
* @param string $formattedInterconnectAttachmentInterconnect The canonical name of underlying Interconnect object that this
* attachment's traffic will traverse through. The name is in the form of
* `projects/{project}/locations/{location}/zones/{zone}/interconnects/{interconnect}`. Please see
* {@see EdgeNetworkClient::interconnectName()} for help formatting this field.
* @param int $interconnectAttachmentVlanId VLAN id provided by user. Must be site-wise unique.
*/
function create_interconnect_attachment_sample(
string $formattedParent,
string $interconnectAttachmentId,
string $interconnectAttachmentName,
string $formattedInterconnectAttachmentInterconnect,
int $interconnectAttachmentVlanId
): void {
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$interconnectAttachment = (new InterconnectAttachment())
->setName($interconnectAttachmentName)
->setInterconnect($formattedInterconnectAttachmentInterconnect)
->setVlanId($interconnectAttachmentVlanId);
$request = (new CreateInterconnectAttachmentRequest())
->setParent($formattedParent)
->setInterconnectAttachmentId($interconnectAttachmentId)
->setInterconnectAttachment($interconnectAttachment);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $edgeNetworkClient->createInterconnectAttachment($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var InterconnectAttachment $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
$interconnectAttachmentId = '[INTERCONNECT_ATTACHMENT_ID]';
$interconnectAttachmentName = '[NAME]';
$formattedInterconnectAttachmentInterconnect = EdgeNetworkClient::interconnectName(
'[PROJECT]',
'[LOCATION]',
'[ZONE]',
'[INTERCONNECT]'
);
$interconnectAttachmentVlanId = 0;
create_interconnect_attachment_sample(
$formattedParent,
$interconnectAttachmentId,
$interconnectAttachmentName,
$formattedInterconnectAttachmentInterconnect,
$interconnectAttachmentVlanId
);
}
createNetwork
Creates a new Network in a given project and location.
The async variant is EdgeNetworkClient::createNetworkAsync() .
request
Google\Cloud\EdgeNetwork\V1\CreateNetworkRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\CreateNetworkRequest;
use Google\Cloud\EdgeNetwork\V1\Network;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see EdgeNetworkClient::zoneName()} for help formatting this field.
* @param string $networkId Id of the requesting object
* If auto-generating Id server-side, remove this field and
* network_id from the method_signature of Create RPC
* @param string $networkName The canonical resource name of the network.
*/
function create_network_sample(
string $formattedParent,
string $networkId,
string $networkName
): void {
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$network = (new Network())
->setName($networkName);
$request = (new CreateNetworkRequest())
->setParent($formattedParent)
->setNetworkId($networkId)
->setNetwork($network);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $edgeNetworkClient->createNetwork($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Network $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
$networkId = '[NETWORK_ID]';
$networkName = '[NAME]';
create_network_sample($formattedParent, $networkId, $networkName);
}
createRouter
Creates a new Router in a given project and location.
The async variant is EdgeNetworkClient::createRouterAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\CreateRouterRequest;
use Google\Cloud\EdgeNetwork\V1\Router;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see EdgeNetworkClient::zoneName()} for help formatting this field.
* @param string $routerId Id of the requesting object
* If auto-generating Id server-side, remove this field and
* router_id from the method_signature of Create RPC
* @param string $routerName The canonical resource name of the router.
* @param string $formattedRouterNetwork The canonical name of the network to which this router belongs.
* The name is in the form of
* `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`. Please see
* {@see EdgeNetworkClient::networkName()} for help formatting this field.
*/
function create_router_sample(
string $formattedParent,
string $routerId,
string $routerName,
string $formattedRouterNetwork
): void {
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$router = (new Router())
->setName($routerName)
->setNetwork($formattedRouterNetwork);
$request = (new CreateRouterRequest())
->setParent($formattedParent)
->setRouterId($routerId)
->setRouter($router);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $edgeNetworkClient->createRouter($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Router $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
$routerId = '[ROUTER_ID]';
$routerName = '[NAME]';
$formattedRouterNetwork = EdgeNetworkClient::networkName(
'[PROJECT]',
'[LOCATION]',
'[ZONE]',
'[NETWORK]'
);
create_router_sample($formattedParent, $routerId, $routerName, $formattedRouterNetwork);
}
createSubnet
Creates a new Subnet in a given project and location.
The async variant is EdgeNetworkClient::createSubnetAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\CreateSubnetRequest;
use Google\Cloud\EdgeNetwork\V1\Subnet;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see EdgeNetworkClient::zoneName()} for help formatting this field.
* @param string $subnetId Id of the requesting object
* If auto-generating Id server-side, remove this field and
* subnet_id from the method_signature of Create RPC
* @param string $subnetName The canonical resource name of the subnet.
* @param string $formattedSubnetNetwork The network that this subnetwork belongs to. Please see
* {@see EdgeNetworkClient::networkName()} for help formatting this field.
*/
function create_subnet_sample(
string $formattedParent,
string $subnetId,
string $subnetName,
string $formattedSubnetNetwork
): void {
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$subnet = (new Subnet())
->setName($subnetName)
->setNetwork($formattedSubnetNetwork);
$request = (new CreateSubnetRequest())
->setParent($formattedParent)
->setSubnetId($subnetId)
->setSubnet($subnet);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $edgeNetworkClient->createSubnet($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Subnet $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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
$subnetId = '[SUBNET_ID]';
$subnetName = '[NAME]';
$formattedSubnetNetwork = EdgeNetworkClient::networkName(
'[PROJECT]',
'[LOCATION]',
'[ZONE]',
'[NETWORK]'
);
create_subnet_sample($formattedParent, $subnetId, $subnetName, $formattedSubnetNetwork);
}
deleteInterconnectAttachment
Deletes a single InterconnectAttachment.
The async variant is EdgeNetworkClient::deleteInterconnectAttachmentAsync() .
request
Google\Cloud\EdgeNetwork\V1\DeleteInterconnectAttachmentRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\DeleteInterconnectAttachmentRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource
* Please see {@see EdgeNetworkClient::interconnectAttachmentName()} for help formatting this field.
*/
function delete_interconnect_attachment_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new DeleteInterconnectAttachmentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $edgeNetworkClient->deleteInterconnectAttachment($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 = EdgeNetworkClient::interconnectAttachmentName(
'[PROJECT]',
'[LOCATION]',
'[ZONE]',
'[INTERCONNECT_ATTACHMENT]'
);
delete_interconnect_attachment_sample($formattedName);
}
deleteNetwork
Deletes a single Network.
The async variant is EdgeNetworkClient::deleteNetworkAsync() .
request
Google\Cloud\EdgeNetwork\V1\DeleteNetworkRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\DeleteNetworkRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource
* Please see {@see EdgeNetworkClient::networkName()} for help formatting this field.
*/
function delete_network_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new DeleteNetworkRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $edgeNetworkClient->deleteNetwork($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 = EdgeNetworkClient::networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]');
delete_network_sample($formattedName);
}
deleteRouter
Deletes a single Router.
The async variant is EdgeNetworkClient::deleteRouterAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\DeleteRouterRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource
* Please see {@see EdgeNetworkClient::routerName()} for help formatting this field.
*/
function delete_router_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new DeleteRouterRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $edgeNetworkClient->deleteRouter($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 = EdgeNetworkClient::routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]');
delete_router_sample($formattedName);
}
deleteSubnet
Deletes a single Subnet.
The async variant is EdgeNetworkClient::deleteSubnetAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\DeleteSubnetRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource
* Please see {@see EdgeNetworkClient::subnetName()} for help formatting this field.
*/
function delete_subnet_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new DeleteSubnetRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $edgeNetworkClient->deleteSubnet($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 = EdgeNetworkClient::subnetName('[PROJECT]', '[LOCATION]', '[ZONE]', '[SUBNET]');
delete_subnet_sample($formattedName);
}
diagnoseInterconnect
Get the diagnostics of a single interconnect resource.
The async variant is EdgeNetworkClient::diagnoseInterconnectAsync() .
request
Google\Cloud\EdgeNetwork\V1\DiagnoseInterconnectRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\DiagnoseInterconnectRequest;
use Google\Cloud\EdgeNetwork\V1\DiagnoseInterconnectResponse;
/**
* @param string $formattedName The name of the interconnect resource. Please see
* {@see EdgeNetworkClient::interconnectName()} for help formatting this field.
*/
function diagnose_interconnect_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new DiagnoseInterconnectRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var DiagnoseInterconnectResponse $response */
$response = $edgeNetworkClient->diagnoseInterconnect($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 = EdgeNetworkClient::interconnectName(
'[PROJECT]',
'[LOCATION]',
'[ZONE]',
'[INTERCONNECT]'
);
diagnose_interconnect_sample($formattedName);
}
diagnoseNetwork
Get the diagnostics of a single network resource.
The async variant is EdgeNetworkClient::diagnoseNetworkAsync() .
request
Google\Cloud\EdgeNetwork\V1\DiagnoseNetworkRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\DiagnoseNetworkRequest;
use Google\Cloud\EdgeNetwork\V1\DiagnoseNetworkResponse;
/**
* @param string $formattedName The name of the network resource. Please see
* {@see EdgeNetworkClient::networkName()} for help formatting this field.
*/
function diagnose_network_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new DiagnoseNetworkRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var DiagnoseNetworkResponse $response */
$response = $edgeNetworkClient->diagnoseNetwork($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 = EdgeNetworkClient::networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]');
diagnose_network_sample($formattedName);
}
diagnoseRouter
Get the diagnostics of a single router resource.
The async variant is EdgeNetworkClient::diagnoseRouterAsync() .
request
Google\Cloud\EdgeNetwork\V1\DiagnoseRouterRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\DiagnoseRouterRequest;
use Google\Cloud\EdgeNetwork\V1\DiagnoseRouterResponse;
/**
* @param string $formattedName The name of the router resource. Please see
* {@see EdgeNetworkClient::routerName()} for help formatting this field.
*/
function diagnose_router_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new DiagnoseRouterRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var DiagnoseRouterResponse $response */
$response = $edgeNetworkClient->diagnoseRouter($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 = EdgeNetworkClient::routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]');
diagnose_router_sample($formattedName);
}
getInterconnect
Gets details of a single Interconnect.
The async variant is EdgeNetworkClient::getInterconnectAsync() .
request
Google\Cloud\EdgeNetwork\V1\GetInterconnectRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\GetInterconnectRequest;
use Google\Cloud\EdgeNetwork\V1\Interconnect;
/**
* @param string $formattedName Name of the resource
* Please see {@see EdgeNetworkClient::interconnectName()} for help formatting this field.
*/
function get_interconnect_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new GetInterconnectRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Interconnect $response */
$response = $edgeNetworkClient->getInterconnect($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 = EdgeNetworkClient::interconnectName(
'[PROJECT]',
'[LOCATION]',
'[ZONE]',
'[INTERCONNECT]'
);
get_interconnect_sample($formattedName);
}
getInterconnectAttachment
Gets details of a single InterconnectAttachment.
The async variant is EdgeNetworkClient::getInterconnectAttachmentAsync() .
request
Google\Cloud\EdgeNetwork\V1\GetInterconnectAttachmentRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\GetInterconnectAttachmentRequest;
use Google\Cloud\EdgeNetwork\V1\InterconnectAttachment;
/**
* @param string $formattedName Name of the resource
* Please see {@see EdgeNetworkClient::interconnectAttachmentName()} for help formatting this field.
*/
function get_interconnect_attachment_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new GetInterconnectAttachmentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var InterconnectAttachment $response */
$response = $edgeNetworkClient->getInterconnectAttachment($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 = EdgeNetworkClient::interconnectAttachmentName(
'[PROJECT]',
'[LOCATION]',
'[ZONE]',
'[INTERCONNECT_ATTACHMENT]'
);
get_interconnect_attachment_sample($formattedName);
}
getNetwork
Gets details of a single Network.
The async variant is EdgeNetworkClient::getNetworkAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\GetNetworkRequest;
use Google\Cloud\EdgeNetwork\V1\Network;
/**
* @param string $formattedName Name of the resource
* Please see {@see EdgeNetworkClient::networkName()} for help formatting this field.
*/
function get_network_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new GetNetworkRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Network $response */
$response = $edgeNetworkClient->getNetwork($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 = EdgeNetworkClient::networkName('[PROJECT]', '[LOCATION]', '[ZONE]', '[NETWORK]');
get_network_sample($formattedName);
}
getRouter
Gets details of a single Router.
The async variant is EdgeNetworkClient::getRouterAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\GetRouterRequest;
use Google\Cloud\EdgeNetwork\V1\Router;
/**
* @param string $formattedName Name of the resource
* Please see {@see EdgeNetworkClient::routerName()} for help formatting this field.
*/
function get_router_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new GetRouterRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Router $response */
$response = $edgeNetworkClient->getRouter($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 = EdgeNetworkClient::routerName('[PROJECT]', '[LOCATION]', '[ZONE]', '[ROUTER]');
get_router_sample($formattedName);
}
getSubnet
Gets details of a single Subnet.
The async variant is EdgeNetworkClient::getSubnetAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\GetSubnetRequest;
use Google\Cloud\EdgeNetwork\V1\Subnet;
/**
* @param string $formattedName Name of the resource
* Please see {@see EdgeNetworkClient::subnetName()} for help formatting this field.
*/
function get_subnet_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new GetSubnetRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Subnet $response */
$response = $edgeNetworkClient->getSubnet($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 = EdgeNetworkClient::subnetName('[PROJECT]', '[LOCATION]', '[ZONE]', '[SUBNET]');
get_subnet_sample($formattedName);
}
getZone
Deprecated: not implemented.
Gets details of a single Zone.
The async variant is EdgeNetworkClient::getZoneAsync() .
request
Google\Cloud\EdgeNetwork\V1\GetZoneRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\GetZoneRequest;
use Google\Cloud\EdgeNetwork\V1\Zone;
/**
* @param string $formattedName Name of the resource
* Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field.
*/
function get_zone_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new GetZoneRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Zone $response */
$response = $edgeNetworkClient->getZone($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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
get_zone_sample($formattedName);
}
initializeZone
InitializeZone will initialize resources for a zone in a project.
The async variant is EdgeNetworkClient::initializeZoneAsync() .
request
Google\Cloud\EdgeNetwork\V1\InitializeZoneRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\InitializeZoneRequest;
use Google\Cloud\EdgeNetwork\V1\InitializeZoneResponse;
/**
* @param string $formattedName The name of the zone resource. Please see
* {@see EdgeNetworkClient::zoneName()} for help formatting this field.
*/
function initialize_zone_sample(string $formattedName): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new InitializeZoneRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var InitializeZoneResponse $response */
$response = $edgeNetworkClient->initializeZone($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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
initialize_zone_sample($formattedName);
}
listInterconnectAttachments
Lists InterconnectAttachments in a given project and location.
The async variant is EdgeNetworkClient::listInterconnectAttachmentsAsync() .
request
Google\Cloud\EdgeNetwork\V1\ListInterconnectAttachmentsRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\InterconnectAttachment;
use Google\Cloud\EdgeNetwork\V1\ListInterconnectAttachmentsRequest;
/**
* @param string $formattedParent Parent value for ListInterconnectAttachmentsRequest
* Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field.
*/
function list_interconnect_attachments_sample(string $formattedParent): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new ListInterconnectAttachmentsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $edgeNetworkClient->listInterconnectAttachments($request);
/** @var InterconnectAttachment $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
list_interconnect_attachments_sample($formattedParent);
}
listInterconnects
Lists Interconnects in a given project and location.
The async variant is EdgeNetworkClient::listInterconnectsAsync() .
request
Google\Cloud\EdgeNetwork\V1\ListInterconnectsRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\Interconnect;
use Google\Cloud\EdgeNetwork\V1\ListInterconnectsRequest;
/**
* @param string $formattedParent Parent value for ListInterconnectsRequest
* Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field.
*/
function list_interconnects_sample(string $formattedParent): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new ListInterconnectsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $edgeNetworkClient->listInterconnects($request);
/** @var Interconnect $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
list_interconnects_sample($formattedParent);
}
listNetworks
Lists Networks in a given project and location.
The async variant is EdgeNetworkClient::listNetworksAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\ListNetworksRequest;
use Google\Cloud\EdgeNetwork\V1\Network;
/**
* @param string $formattedParent Parent value for ListNetworksRequest
* Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field.
*/
function list_networks_sample(string $formattedParent): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new ListNetworksRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $edgeNetworkClient->listNetworks($request);
/** @var Network $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
list_networks_sample($formattedParent);
}
listRouters
Lists Routers in a given project and location.
The async variant is EdgeNetworkClient::listRoutersAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\ListRoutersRequest;
use Google\Cloud\EdgeNetwork\V1\Router;
/**
* @param string $formattedParent Parent value for ListRoutersRequest
* Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field.
*/
function list_routers_sample(string $formattedParent): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new ListRoutersRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $edgeNetworkClient->listRouters($request);
/** @var Router $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
list_routers_sample($formattedParent);
}
listSubnets
Lists Subnets in a given project and location.
The async variant is EdgeNetworkClient::listSubnetsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\ListSubnetsRequest;
use Google\Cloud\EdgeNetwork\V1\Subnet;
/**
* @param string $formattedParent Parent value for ListSubnetsRequest
* Please see {@see EdgeNetworkClient::zoneName()} for help formatting this field.
*/
function list_subnets_sample(string $formattedParent): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new ListSubnetsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $edgeNetworkClient->listSubnets($request);
/** @var Subnet $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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 = EdgeNetworkClient::zoneName('[PROJECT]', '[LOCATION]', '[ZONE]');
list_subnets_sample($formattedParent);
}
listZones
Deprecated: not implemented.
Lists Zones in a given project and location.
The async variant is EdgeNetworkClient::listZonesAsync() .
request
Google\Cloud\EdgeNetwork\V1\ListZonesRequest
A request to house fields associated with the call.
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\ListZonesRequest;
use Google\Cloud\EdgeNetwork\V1\Zone;
/**
* @param string $formattedParent Parent value for ListZonesRequest
* Please see {@see EdgeNetworkClient::locationName()} for help formatting this field.
*/
function list_zones_sample(string $formattedParent): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = (new ListZonesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $edgeNetworkClient->listZones($request);
/** @var Zone $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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 = EdgeNetworkClient::locationName('[PROJECT]', '[LOCATION]');
list_zones_sample($formattedParent);
}
updateRouter
Updates the parameters of a single Router.
The async variant is EdgeNetworkClient::updateRouterAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\Router;
use Google\Cloud\EdgeNetwork\V1\UpdateRouterRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param string $routerName The canonical resource name of the router.
* @param string $formattedRouterNetwork The canonical name of the network to which this router belongs.
* The name is in the form of
* `projects/{project}/locations/{location}/zones/{zone}/networks/{network}`. Please see
* {@see EdgeNetworkClient::networkName()} for help formatting this field.
*/
function update_router_sample(string $routerName, string $formattedRouterNetwork): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$updateMask = new FieldMask();
$router = (new Router())
->setName($routerName)
->setNetwork($formattedRouterNetwork);
$request = (new UpdateRouterRequest())
->setUpdateMask($updateMask)
->setRouter($router);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $edgeNetworkClient->updateRouter($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Router $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
{
$routerName = '[NAME]';
$formattedRouterNetwork = EdgeNetworkClient::networkName(
'[PROJECT]',
'[LOCATION]',
'[ZONE]',
'[NETWORK]'
);
update_router_sample($routerName, $formattedRouterNetwork);
}
updateSubnet
Updates the parameters of a single Subnet.
The async variant is EdgeNetworkClient::updateSubnetAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\EdgeNetwork\V1\Subnet;
use Google\Cloud\EdgeNetwork\V1\UpdateSubnetRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param string $subnetName The canonical resource name of the subnet.
* @param string $formattedSubnetNetwork The network that this subnetwork belongs to. Please see
* {@see EdgeNetworkClient::networkName()} for help formatting this field.
*/
function update_subnet_sample(string $subnetName, string $formattedSubnetNetwork): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$updateMask = new FieldMask();
$subnet = (new Subnet())
->setName($subnetName)
->setNetwork($formattedSubnetNetwork);
$request = (new UpdateSubnetRequest())
->setUpdateMask($updateMask)
->setSubnet($subnet);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $edgeNetworkClient->updateSubnet($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Subnet $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
{
$subnetName = '[NAME]';
$formattedSubnetNetwork = EdgeNetworkClient::networkName(
'[PROJECT]',
'[LOCATION]',
'[ZONE]',
'[NETWORK]'
);
update_subnet_sample($subnetName, $formattedSubnetNetwork);
}
getLocation
Gets information about a location.
The async variant is EdgeNetworkClient::getLocationAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\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.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = new GetLocationRequest();
// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $edgeNetworkClient->getLocation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
listLocations
Lists information about the supported locations for this service.
The async variant is EdgeNetworkClient::listLocationsAsync() .
request
callOptions
array
Optional.
↳ retrySettings
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\EdgeNetwork\V1\Client\EdgeNetworkClient;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\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 list_locations_sample(): void
{
// Create a client.
$edgeNetworkClient = new EdgeNetworkClient();
// Prepare the request message.
$request = new ListLocationsRequest();
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $edgeNetworkClient->listLocations($request);
/** @var Location $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
createInterconnectAttachmentAsync
optionalArgs
array
createNetworkAsync
optionalArgs
array
createRouterAsync
optionalArgs
array
createSubnetAsync
optionalArgs
array
deleteInterconnectAttachmentAsync
optionalArgs
array
deleteNetworkAsync
optionalArgs
array
deleteRouterAsync
optionalArgs
array
deleteSubnetAsync
optionalArgs
array
diagnoseInterconnectAsync
optionalArgs
array
diagnoseNetworkAsync
optionalArgs
array
diagnoseRouterAsync
optionalArgs
array
getInterconnectAsync
optionalArgs
array
getInterconnectAttachmentAsync
optionalArgs
array
getNetworkAsync
optionalArgs
array
getRouterAsync
getSubnetAsync
getZoneAsync
request
Google\Cloud\EdgeNetwork\V1\GetZoneRequest
optionalArgs
array
initializeZoneAsync
optionalArgs
array
listInterconnectAttachmentsAsync
optionalArgs
array
listInterconnectsAsync
optionalArgs
array
listNetworksAsync
optionalArgs
array
listRoutersAsync
optionalArgs
array
listSubnetsAsync
optionalArgs
array
listZonesAsync
request
Google\Cloud\EdgeNetwork\V1\ListZonesRequest
optionalArgs
array
updateRouterAsync
optionalArgs
array
updateSubnetAsync
optionalArgs
array
getLocationAsync
listLocationsAsync
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Google\LongRunning\Client\OperationsClient
resumeOperation
Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.
operationName
string
The name of the long running operation
methodName
string
The name of the method used to start the operation
static::interconnectName
Formats a string containing the fully-qualified path to represent a interconnect resource.
project
string
location
string
zone
string
interconnect
string
string
static::interconnectAttachmentName
Formats a string containing the fully-qualified path to represent a interconnect_attachment resource.
project
string
location
string
zone
string
interconnectAttachment
string
string
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
project
string
location
string
string
static::networkName
Formats a string containing the fully-qualified path to represent a network resource.
project
string
location
string
zone
string
network
string
string
static::routerName
Formats a string containing the fully-qualified path to represent a router resource.
project
string
location
string
zone
string
router
string
string
static::subnetName
Formats a string containing the fully-qualified path to represent a subnet resource.
project
string
location
string
zone
string
subnet
string
string
static::zoneName
Formats a string containing the fully-qualified path to represent a zone resource.
project
string
location
string
zone
string
string
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- interconnect: projects/{project}/locations/{location}/zones/{zone}/interconnects/{interconnect}
- interconnectAttachment: projects/{project}/locations/{location}/zones/{zone}/interconnectAttachments/{interconnect_attachment}
- location: projects/{project}/locations/{location}
- network: projects/{project}/locations/{location}/zones/{zone}/networks/{network}
- router: projects/{project}/locations/{location}/zones/{zone}/routers/{router}
- subnet: projects/{project}/locations/{location}/zones/{zone}/subnets/{subnet}
- zone: projects/{project}/locations/{location}/zones/{zone}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
formattedName
string
The formatted name string
template
?string
Optional name of template to match
array