class InstanceTemplates extends Resource (View source)

The "instanceTemplates" collection of methods.

Typical usage is:

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

Methods

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

Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

delete(string $project, string $instanceTemplate, array $optParams = [])

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. (instanceTemplates.delete)

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

Returns the specified instance template. (instanceTemplates.get)

getIamPolicy(string $project, string $resource, array $optParams = [])

Gets the access control policy for a resource. May be empty if no such policy or resource exists. (instanceTemplates.getIamPolicy)

insert(string $project, InstanceTemplate $postBody, array $optParams = [])

Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.

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

Retrieves a list of instance templates that are contained within the specified project. (instanceTemplates.listInstanceTemplates)

setIamPolicy(string $project, string $resource, GlobalSetPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on the specified resource. Replaces any existing policy. (instanceTemplates.setIamPolicy)

testIamPermissions(string $project, string $resource, TestPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on the specified resource.

Details

InstanceTemplateAggregatedList aggregatedList(string $project, array $optParams = [])

Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

(instanceTemplates.aggregatedList)

Parameters

string $project

Name of the project scoping this request.

array $optParams

Optional parameters.

Return Value

InstanceTemplateAggregatedList

Exceptions

Exception

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

Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. (instanceTemplates.delete)

Parameters

string $project

Project ID for this request.

string $instanceTemplate

The name of the instance template to delete.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

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

Returns the specified instance template. (instanceTemplates.get)

Parameters

string $project

Project ID for this request.

string $instanceTemplate

The name of the instance template.

array $optParams

Optional parameters.

Return Value

InstanceTemplate

Exceptions

Exception

Policy getIamPolicy(string $project, string $resource, array $optParams = [])

Gets the access control policy for a resource. May be empty if no such policy or resource exists. (instanceTemplates.getIamPolicy)

Parameters

string $project

Project ID for this request.

string $resource

Name or id of the resource for this request.

array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

Operation insert(string $project, InstanceTemplate $postBody, array $optParams = [])

Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template.

(instanceTemplates.insert)

Parameters

string $project

Project ID for this request.

InstanceTemplate $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

InstanceTemplateList listInstanceTemplates(string $project, array $optParams = [])

Retrieves a list of instance templates that are contained within the specified project. (instanceTemplates.listInstanceTemplates)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

InstanceTemplateList

Exceptions

Exception

Policy setIamPolicy(string $project, string $resource, GlobalSetPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on the specified resource. Replaces any existing policy. (instanceTemplates.setIamPolicy)

Parameters

string $project

Project ID for this request.

string $resource

Name or id of the resource for this request.

GlobalSetPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

TestPermissionsResponse testIamPermissions(string $project, string $resource, TestPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on the specified resource.

(instanceTemplates.testIamPermissions)

Parameters

string $project

Project ID for this request.

string $resource

Name or id of the resource for this request.

TestPermissionsRequest $postBody
array $optParams

Optional parameters.

Return Value

TestPermissionsResponse

Exceptions

Exception