ProjectsLocationsFunctions
class ProjectsLocationsFunctions extends Resource (View source)
The "functions" collection of methods.
Typical usage is:
$cloudfunctionsService = new Google\Service\CloudFunctions(...);
$functions = $cloudfunctionsService->projects_locations_functions;
Methods
Aborts generation upgrade process for a function with the given name from the specified project. Deletes all 2nd Gen copy related configuration and resources which were created during the upgrade process.
Finalizes the upgrade after which function upgrade can not be rolled back.
Creates a new function. If a function with the given name already exists in
the specified project, the long running operation will return
ALREADY_EXISTS
error. (functions.create)
Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger will be updated to remove this function. (functions.delete)
Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within 30 minutes of generation. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls (functions.generateDownloadUrl)
Returns a signed URL for uploading a function source code. For more
information about the signed URL usage see:
https://cloud.google.com/storage/docs/access-control/signed-urls. Once the
function source code upload is complete, the used signed URL should be
provided in CreateFunction or UpdateFunction request as a reference to the
function source code. When uploading source code to the generated signed URL,
please follow these restrictions: Source file type should be a zip file.
No credentials should be attached - the signed URLs provide access to the
target bucket using internal service identity; if credentials were attached,
the identity from the credentials would be used, but that identity does not
have permissions to upload files to the URL. When making a HTTP PUT request,
specify this header: content-type: application/zip
Do not specify this
header: Authorization: Bearer YOUR_TOKEN
(functions.generateUploadUrl)
Returns a function with the given name from the requested project.
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. (functions.getIamPolicy)
Returns a list of functions that belong to the requested project.
Updates existing function. (functions.patch)
Changes the traffic target of a function from the original 1st Gen function to the 2nd Gen copy. This is the second step of the multi step process to upgrade 1st Gen functions to 2nd Gen. After this operation, all new traffic will be served by 2nd Gen copy. (functions.redirectFunctionUpgradeTraffic)
Reverts the traffic target of a function from the 2nd Gen copy to the original 1st Gen function. After this operation, all new traffic would be served by the 1st Gen. (functions.rollbackFunctionUpgradeTraffic)
Sets the access control policy on the specified resource. Replaces any
existing policy. Can return NOT_FOUND
, INVALID_ARGUMENT
, and
PERMISSION_DENIED
errors. (functions.setIamPolicy)
Creates a 2nd Gen copy of the function configuration based on the 1st Gen function with the given name. This is the first step of the multi step process to upgrade 1st Gen functions to 2nd Gen. Only 2nd Gen configuration is setup as part of this request and traffic continues to be served by 1st Gen. (functions.setupFunctionUpgradeConfig)
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of permissions, not a
NOT_FOUND
error. Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization checking.
Details
Operation
abortFunctionUpgrade(string $name, AbortFunctionUpgradeRequest $postBody, array $optParams = [])
Aborts generation upgrade process for a function with the given name from the specified project. Deletes all 2nd Gen copy related configuration and resources which were created during the upgrade process.
(functions.abortFunctionUpgrade)
Operation
commitFunctionUpgrade(string $name, CommitFunctionUpgradeRequest $postBody, array $optParams = [])
Finalizes the upgrade after which function upgrade can not be rolled back.
This is the last step of the multi step process to upgrade 1st Gen functions to 2nd Gen. Deletes all original 1st Gen related configuration and resources. (functions.commitFunctionUpgrade)
Operation
create(string $parent, CloudfunctionsFunction $postBody, array $optParams = [])
Creates a new function. If a function with the given name already exists in
the specified project, the long running operation will return
ALREADY_EXISTS
error. (functions.create)
Operation
delete(string $name, array $optParams = [])
Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger will be updated to remove this function. (functions.delete)
GenerateDownloadUrlResponse
generateDownloadUrl(string $name, GenerateDownloadUrlRequest $postBody, array $optParams = [])
Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within 30 minutes of generation. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls (functions.generateDownloadUrl)
GenerateUploadUrlResponse
generateUploadUrl(string $parent, GenerateUploadUrlRequest $postBody, array $optParams = [])
Returns a signed URL for uploading a function source code. For more
information about the signed URL usage see:
https://cloud.google.com/storage/docs/access-control/signed-urls. Once the
function source code upload is complete, the used signed URL should be
provided in CreateFunction or UpdateFunction request as a reference to the
function source code. When uploading source code to the generated signed URL,
please follow these restrictions: Source file type should be a zip file.
No credentials should be attached - the signed URLs provide access to the
target bucket using internal service identity; if credentials were attached,
the identity from the credentials would be used, but that identity does not
have permissions to upload files to the URL. When making a HTTP PUT request,
specify this header: content-type: application/zip
Do not specify this
header: Authorization: Bearer YOUR_TOKEN
(functions.generateUploadUrl)
CloudfunctionsFunction
get(string $name, array $optParams = [])
Returns a function with the given name from the requested project.
(functions.get)
Policy
getIamPolicy(string $resource, array $optParams = [])
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. (functions.getIamPolicy)
ListFunctionsResponse
listProjectsLocationsFunctions(string $parent, array $optParams = [])
Returns a list of functions that belong to the requested project.
(functions.listProjectsLocationsFunctions)
Operation
patch(string $name, CloudfunctionsFunction $postBody, array $optParams = [])
Updates existing function. (functions.patch)
Operation
redirectFunctionUpgradeTraffic(string $name, RedirectFunctionUpgradeTrafficRequest $postBody, array $optParams = [])
Changes the traffic target of a function from the original 1st Gen function to the 2nd Gen copy. This is the second step of the multi step process to upgrade 1st Gen functions to 2nd Gen. After this operation, all new traffic will be served by 2nd Gen copy. (functions.redirectFunctionUpgradeTraffic)
Operation
rollbackFunctionUpgradeTraffic(string $name, RollbackFunctionUpgradeTrafficRequest $postBody, array $optParams = [])
Reverts the traffic target of a function from the 2nd Gen copy to the original 1st Gen function. After this operation, all new traffic would be served by the 1st Gen. (functions.rollbackFunctionUpgradeTraffic)
Policy
setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])
Sets the access control policy on the specified resource. Replaces any
existing policy. Can return NOT_FOUND
, INVALID_ARGUMENT
, and
PERMISSION_DENIED
errors. (functions.setIamPolicy)
Operation
setupFunctionUpgradeConfig(string $name, SetupFunctionUpgradeConfigRequest $postBody, array $optParams = [])
Creates a 2nd Gen copy of the function configuration based on the 1st Gen function with the given name. This is the first step of the multi step process to upgrade 1st Gen functions to 2nd Gen. Only 2nd Gen configuration is setup as part of this request and traffic continues to be served by 1st Gen. (functions.setupFunctionUpgradeConfig)
TestIamPermissionsResponse
testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of permissions, not a
NOT_FOUND
error. Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization checking.
This operation may "fail open" without warning. (functions.testIamPermissions)