Container/src/V1/Gapic/ClusterManagerGapicClient.php
public function listClusters($projectId, $zone, array $optionalArgs = [])
    {
        $request = new ListClustersRequest();
        $request->setProjectId($projectId);
        $request->setZone($zone);
        if (isset($optionalArgs['parent'])) {
            $request->setParent($optionalArgs['parent']);
        }

        $requestParams = new RequestParamsHeaderDescriptor([
          'parent' => $request->getParent(),
        ]);
        $optionalArgs['headers'] = isset($optionalArgs['headers'])
            ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
            : $requestParams->getHeader();

        return $this->startCall(
            'ListClusters',
            ListClustersResponse::class,
            $optionalArgs,
            $request
        )->wait();
    }
public function listClusters($projectId, $zone, array $optionalArgs = [])
    {
        $request = new ListClustersRequest();
        $request->setProjectId($projectId);
        $request->setZone($zone);
        if (isset($optionalArgs['parent'])) {
            $request->setParent($optionalArgs['parent']);
        }

        $requestParams = new RequestParamsHeaderDescriptor([
          'parent' => $request->getParent(),
        ]);
        $optionalArgs['headers'] = isset($optionalArgs['headers'])
            ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
            : $requestParams->getHeader();

        return $this->startCall(
            'ListClusters',
            ListClustersResponse::class,
            $optionalArgs,
            $request
        )->wait();
    }
public function listClusters ( $ projectId , $ zone , array $ optionalArgs = [ ] ) { $ request = new ListClustersRequest ( ) ; $ request -> setProjectId ( $ projectId ) ; $ request -> setZone ( $ zone ) ; if ( isset ( $ optionalArgs [ 'parent' ] ) ) { $ request -> setParent ( $ optionalArgs [ 'parent' ] ) ; } $ requestParams = new RequestParamsHeaderDescriptor ( [ 'parent' => $ request -> getParent ( ) , ] ) ; $ optionalArgs [ 'headers' ] = isset ( $ optionalArgs [ 'headers' ] ) ? array_merge ( $ requestParams -> getHeader ( ) , $ optionalArgs [ 'headers' ] ) : $ requestParams -> getHeader ( ) ; return $ this -> startCall ( 'ListClusters' , ListClustersResponse :: class , $ optionalArgs , $ request ) -> wait ( ) ; }
Lists all clusters owned by a project in either the specified zone or all
zones.

Sample code:
```
$clusterManagerClient = new ClusterManagerClient();
try {
$projectId = '';
$zone = '';
$response = $clusterManagerClient->listClusters($projectId, $zone);
} finally {
$clusterManagerClient->close();
}
```

@param string $projectId    Deprecated. The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840).
This field has been deprecated and replaced by the parent field.
@param string $zone         Deprecated. The name of the Google Compute Engine
[zone](https://cloud.google.com/compute/docs/zones#available) in which the cluster
resides, or "-" for all zones.
This field has been deprecated and replaced by the parent field.
@param array  $optionalArgs {
Optional.

@type string $parent
The parent (project and location) where the clusters will be listed.
Specified in the format 'projects/&#42;/locations/*'.
Location "-" matches all zones and all regions.
@type RetrySettings|array $retrySettings
Retry settings to use for this call. Can be a
{@see Google\ApiCore\RetrySettings} object, or an associative array
of retry settings parameters. See the documentation on
{@see Google\ApiCore\RetrySettings} for example usage.
}

@return \Google\Cloud\Container\V1\ListClustersResponse

@throws ApiException if the remote call fails
@experimental
Lists all clusters owned by a project in either the specified zone or all zones .