class Projects extends Resource (View source)

The "projects" collection of methods.

Typical usage is:

 $computeService = new Google\Service\Compute(...);
 $projects = $computeService->projects;

Methods

disableXpnHost(string $project, array $optParams = [])

Disable this project as a shared VPC host project. (projects.disableXpnHost)

disableXpnResource(string $project, ProjectsDisableXpnResourceRequest $postBody, array $optParams = [])

Disable a service resource (also known as service project) associated with this host project. (projects.disableXpnResource)

enableXpnHost(string $project, array $optParams = [])

Enable this project as a shared VPC host project. (projects.enableXpnHost)

enableXpnResource(string $project, ProjectsEnableXpnResourceRequest $postBody, array $optParams = [])

Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.

get(string $project, array $optParams = [])

Returns the specified Project resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the quotas field). To exclude one or more fields, set your request's fields query parameter to only include the fields you need. For example, to only include the id and selfLink fields, add the query parameter ?fields=id,selfLink to your request. (projects.get)

getXpnHost(string $project, array $optParams = [])

Gets the shared VPC host project that this project links to. May be empty if no link exists. (projects.getXpnHost)

getXpnResources(string $project, array $optParams = [])

Gets service resources (a.k.a service project) associated with this host project. (projects.getXpnResources)

listXpnHosts(string $project, ProjectsListXpnHostsRequest $postBody, array $optParams = [])

Lists all shared VPC host projects visible to the user in an organization.

moveDisk(string $project, DiskMoveRequest $postBody, array $optParams = [])

Moves a persistent disk from one zone to another. (projects.moveDisk)

moveInstance(string $project, InstanceMoveRequest $postBody, array $optParams = [])

Moves an instance and its attached persistent disks from one zone to another.

setCloudArmorTier(string $project, ProjectsSetCloudArmorTierRequest $postBody, array $optParams = [])

Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise.

setCommonInstanceMetadata(string $project, Metadata $postBody, array $optParams = [])

Sets metadata common to all instances within the specified project using the data included in the request. (projects.setCommonInstanceMetadata)

setDefaultNetworkTier(string $project, ProjectsSetDefaultNetworkTierRequest $postBody, array $optParams = [])

Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. (projects.setDefaultNetworkTier)

setUsageExportBucket(string $project, UsageExportLocation $postBody, array $optParams = [])

Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. (projects.setUsageExportBucket)

Details

Operation disableXpnHost(string $project, array $optParams = [])

Disable this project as a shared VPC host project. (projects.disableXpnHost)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation disableXpnResource(string $project, ProjectsDisableXpnResourceRequest $postBody, array $optParams = [])

Disable a service resource (also known as service project) associated with this host project. (projects.disableXpnResource)

Parameters

string $project

Project ID for this request.

ProjectsDisableXpnResourceRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation enableXpnHost(string $project, array $optParams = [])

Enable this project as a shared VPC host project. (projects.enableXpnHost)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation enableXpnResource(string $project, ProjectsEnableXpnResourceRequest $postBody, array $optParams = [])

Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.

(projects.enableXpnResource)

Parameters

string $project

Project ID for this request.

ProjectsEnableXpnResourceRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Project get(string $project, array $optParams = [])

Returns the specified Project resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the quotas field). To exclude one or more fields, set your request's fields query parameter to only include the fields you need. For example, to only include the id and selfLink fields, add the query parameter ?fields=id,selfLink to your request. (projects.get)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

Project

Exceptions

Exception

Project getXpnHost(string $project, array $optParams = [])

Gets the shared VPC host project that this project links to. May be empty if no link exists. (projects.getXpnHost)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

Project

Exceptions

Exception

ProjectsGetXpnResources getXpnResources(string $project, array $optParams = [])

Gets service resources (a.k.a service project) associated with this host project. (projects.getXpnResources)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

ProjectsGetXpnResources

Exceptions

Exception

XpnHostList listXpnHosts(string $project, ProjectsListXpnHostsRequest $postBody, array $optParams = [])

Lists all shared VPC host projects visible to the user in an organization.

(projects.listXpnHosts)

Parameters

string $project

Project ID for this request.

ProjectsListXpnHostsRequest $postBody
array $optParams

Optional parameters.

Return Value

XpnHostList

Exceptions

Exception

Operation moveDisk(string $project, DiskMoveRequest $postBody, array $optParams = [])

Moves a persistent disk from one zone to another. (projects.moveDisk)

Parameters

string $project

Project ID for this request.

DiskMoveRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation moveInstance(string $project, InstanceMoveRequest $postBody, array $optParams = [])

Moves an instance and its attached persistent disks from one zone to another.

Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue. [Deprecated] This method is deprecated. See moving instance across zones instead. (projects.moveInstance)

Parameters

string $project

Project ID for this request.

InstanceMoveRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation setCloudArmorTier(string $project, ProjectsSetCloudArmorTierRequest $postBody, array $optParams = [])

Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise.

See Subscribing to Cloud Armor Enterprise for more information. (projects.setCloudArmorTier)

Parameters

string $project

Project ID for this request.

ProjectsSetCloudArmorTierRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation setCommonInstanceMetadata(string $project, Metadata $postBody, array $optParams = [])

Sets metadata common to all instances within the specified project using the data included in the request. (projects.setCommonInstanceMetadata)

Parameters

string $project

Project ID for this request.

Metadata $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation setDefaultNetworkTier(string $project, ProjectsSetDefaultNetworkTierRequest $postBody, array $optParams = [])

Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. (projects.setDefaultNetworkTier)

Parameters

string $project

Project ID for this request.

ProjectsSetDefaultNetworkTierRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation setUsageExportBucket(string $project, UsageExportLocation $postBody, array $optParams = [])

Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. (projects.setUsageExportBucket)

Parameters

string $project

Project ID for this request.

UsageExportLocation $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception