Cloud Functions API Migration Guide
The Cloud Functions v1beta2 API is deprecated. To avoid potential service disruptions, please use the Cloud Functions v1 API instead. This page provides instructions for migrating from the Cloud Functions v1beta2 API to the Cloud Functions v1 API.
gcloud CLI
Customers who use the Google Cloud CLI should upgrade to the most
recent gcloud
version by issuing the following command in a terminal:
gcloud components update
See the gcloud components update reference for details.
Firebase CLI
Customers who use the Firebase CLI should upgrade to the most current CLI version. See the Firebase CLI Reference for details.
API
Customers who use the API directly using Google API Client Libraries should use the libraries that are based on the Cloud Functions v1 API:
The differences between the v1 API and the v1beta2 API are minimal. All of the differences are listed below.
Two new fields have been added to the v1 API. These fields are not present in the v1beta2 API.
v1 API field | Description |
---|---|
CloudFunction.description |
Allows you to set a user-friendly description of the Cloud Function. |
CloudFunction.source_repository.deployed_url |
Allows you to see the URL to a source repository from a time of deployment. It references a specific revision ID even if deployment happened from a branch or a tag. |
Four fields have a different name in the v1 API.
v1beta2 API field | v1 API field |
---|---|
CloudFunction.source_repository_url |
CloudFunction.source_repository.url |
CloudFunction.service_account |
CloudFunction.service_account_email |
ListFunctions.location |
ListFunctions.parent |
EventTrigger.retry_policy |
EventTrigger.failure_policy |
CloudFunction.last_operation
has been removed. We recommend that you use the
Operations
service to find the latest operation performed on a given function.
The semantics for updating a function
have been changed from PUT
to PATCH
. The update request
(UpdateFunctionRequest
)
takes two parameters: a Cloud Function and an update mask.
Whereas the v1beta2 API
takes the function's name as an input, the
v1 API
takes a CloudFunction
instance. The update mask contains a list of all fields
to be updated. The function's name is extracted from the CloudFunction
instance and no longer needs to be explicitly provided.
You can try out the new API using the APIs Explorer.