Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Node-1st-gen/assistant-say-number/action.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"intent": "assistant.intent.action.MAIN"
},
"httpExecution": {
"url": "https://us-east4-<YOUR_PROJECT_ID>.cloudfunctions.net/sayNumber"
"url": "https://us-central1-<YOUR_PROJECT_ID>.cloudfunctions.net/sayNumber"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion Node-1st-gen/fulltext-search-firestore/public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function searchAlgoliaAuthenticated(query) {
.then(function(token) {
// The token is then passed to our getSearchKey Cloud Function
const searchKeyUrl = new URL(
`https://us-east4-${PROJECT_ID}.cloudfunctions.net/getSearchKey/`
`https://us-central1-${PROJECT_ID}.cloudfunctions.net/getSearchKey/`
);
return fetch(searchKeyUrl, {
headers: { Authorization: 'Bearer ' + token }
Expand Down
2 changes: 1 addition & 1 deletion Node-1st-gen/github-to-slack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To test this integration:
- Configure this sample to use your project using `firebase use --add` and select your project.
- Install dependencies locally by running: `cd functions; npm install; cd -`
- [Add a WebHook to your GitHub repo](https://help.github.com/articles/about-webhooks/) with the following settings:
- Payload URL: `https://us-east4-<FIREBASE_PROJECT_ID>.cloudfunctions.net/githubWebhook`
- Payload URL: `https://us-central1-<FIREBASE_PROJECT_ID>.cloudfunctions.net/githubWebhook`
- Content type: `application/json`
- Secret: `A_SECRET_YOU_DEFINE`
- Which events would you like to trigger this webhook? `Just the push event.`
Expand Down
4 changes: 2 additions & 2 deletions Node-1st-gen/okta-auth/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ When you deploy the Cloud Function, the endpoint looks like:
https://<YOUR_PROJECT_AND_LOCATION>.cloudfunctions.net/api/firebaseCustomToken`
: `
When using the emulator, the endpoint is the following:
http://localhost:5001/${GCLOUD_PROJECT}/us-east4/api/firebaseCustomToken`
http://localhost:5001/${GCLOUD_PROJECT}/us-central1/api/firebaseCustomToken`
);

const TOKEN_ENDPOINT_PROMPT = `\
Expand Down Expand Up @@ -121,7 +121,7 @@ const OKTA_CLIENT_ID = '${oktaClientId}';

// The complete URL of your custom token endpoint. When using the emulator, the
// endpoint is:
// http://localhost:5001/<YOUR_FIREBASE_PROJECT_ID>/us-east4/api/firebaseCustomToken
// http://localhost:5001/<YOUR_FIREBASE_PROJECT_ID>/us-central1/api/firebaseCustomToken
const CUSTOM_TOKEN_ENDPOINT = '${tokenEndpoint}';

if (OKTA_ORG_URL === ''
Expand Down
2 changes: 1 addition & 1 deletion Node-1st-gen/paypal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ To test locally do:
To deploy and test on prod do:

1. Deploy your project using `firebase deploy`
1. Send a `POST` request with body `{price:5}` to `https://us-east4-<project-id>.cloudfunctions.net/pay`. You will get a 302 Redirect redirecting to the payment page.
1. Send a `POST` request with body `{price:5}` to `https://us-central1-<project-id>.cloudfunctions.net/pay`. You will get a 302 Redirect redirecting to the payment page.

## Contributing

Expand Down
8 changes: 4 additions & 4 deletions Node-1st-gen/quickstarts/https-time-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,24 @@ This deploys and activates the date Function.
After deploying the function you can open the following URLs in your browser:

```
https://us-east4-<project-id>.cloudfunctions.net/date
https://us-central1-<project-id>.cloudfunctions.net/date

https://us-east4-<project-id>.cloudfunctions.net/date?format=MMMM%20Do%20YYYY%2C%20h%3Amm%3Ass%20a
https://us-central1-<project-id>.cloudfunctions.net/date?format=MMMM%20Do%20YYYY%2C%20h%3Amm%3Ass%20a
```

You can also send the format in the request body. For instance using cURL in the command line:

```bash
curl -H 'Content-Type: application/json' /
-d '{"format": "MMMM Do YYYY, h:mm:ss a"}' /
https://us-east4-<project-id>.cloudfunctions.net/date
https://us-central1-<project-id>.cloudfunctions.net/date
```
Formatted dates should be displayed.

We are responding with a 403 error in case of PUT requests:

```bash
curl -X PUT -d '{"format": "MMMM Do YYYY, h:mm:ss a"}' https://us-east4-<project-id>.cloudfunctions.net/date
curl -X PUT -d '{"format": "MMMM Do YYYY, h:mm:ss a"}' https://us-central1-<project-id>.cloudfunctions.net/date
```


Expand Down
4 changes: 2 additions & 2 deletions Node-1st-gen/quickstarts/https-time-server/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ const cors = require('cors')({
*
* Example format: "MMMM Do YYYY, h:mm:ss a".
* Example request using URL query parameters:
* https://us-east4-<project-id>.cloudfunctions.net/date?format=MMMM%20Do%20YYYY%2C%20h%3Amm%3Ass%20a
* https://us-central1-<project-id>.cloudfunctions.net/date?format=MMMM%20Do%20YYYY%2C%20h%3Amm%3Ass%20a
* Example request using request body with cURL:
* curl -H 'Content-Type: application/json' /
* -d '{"format": "MMMM Do YYYY, h:mm:ss a"}' /
* https://us-east4-<project-id>.cloudfunctions.net/date
* https://us-central1-<project-id>.cloudfunctions.net/date
*
* This endpoint supports CORS.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ https://cloud.google.com/iam/docs/impersonating-service-accounts#impersonate-sa-

```
gcloud functions add-iam-policy-binding $FUNCTION_NAME \
--region=us-east4 \
--region=us-central1 \
--member=serviceAccount:${PROJECT_ID}@appspot.gserviceaccount.com \
--role=roles/cloudfunctions.invoker
```
6 changes: 3 additions & 3 deletions Node-1st-gen/quickstarts/uppercase-firestore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ a Firebase project.
1. Trigger the functions
1. Look in the output of the `firebase emulators:start` command for the URL
of the http function "addMessage". It will look similar to:
`http://localhost:5001/MY_PROJECT/us-east4/addMessage`
`http://localhost:5001/MY_PROJECT/us-central1/addMessage`
1. `MY_PROJECT` will be replaced with your project ID
1. The port may be different on your local machine
1. Add the query string `?text=uppercaseme` to the end of the function's URL.
It should now look something like:
`http://localhost:5001/MY_PROJECT/us-east4/addMessage?text=uppercaseme`
`http://localhost:5001/MY_PROJECT/us-central1/addMessage?text=uppercaseme`
1. Optionally, you can change the message "uppercaseme" to a custom
message
1. Create a new message by opening the URL in a new tab in your browser
Expand All @@ -71,7 +71,7 @@ To deploy and test the sample:
[Firebase Console](https://console.firebase.google.com)
1. Deploy your project's code using `firebase deploy`
1. Create a message by opening the following URL in your browser:
https://us-east4-[MY_PROJECT].cloudfunctions.net/addMessage?text=uppercaseme
https://us-central1-[MY_PROJECT].cloudfunctions.net/addMessage?text=uppercaseme
(Replace [MY_PROJECT] by your project ID and you can change the message
"uppercaseme").

Expand Down
2 changes: 1 addition & 1 deletion Node-1st-gen/quickstarts/uppercase-rtdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To deploy and try out the sample:
- Create a Firebase project on the [Firebase Console](https://console.firebase.google.com)
- Install the required dependencies by running `npm install` in the `functions` directory
- Deploy your project's code using `firebase deploy`
- Create a message by opening the following URL in your browser: https://us-east4-[MY_PROJECT].cloudfunctions.net/addMessage?text=uppercaseme (Replace [MY_PROJECT] by your project ID and you can change the message "uppercaseme").
- Create a message by opening the following URL in your browser: https://us-central1-[MY_PROJECT].cloudfunctions.net/addMessage?text=uppercaseme (Replace [MY_PROJECT] by your project ID and you can change the message "uppercaseme").

The function executes and redirects the browser to the Firebase console at the database location where the text string was stored. You should see your text value displayed in the console and uppercase.

Expand Down
4 changes: 2 additions & 2 deletions Node-1st-gen/spotify-auth/public/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
document.body.innerText = 'Error back from the Spotify auth page: ' + error;
} else if(!code) {
// Start the auth flow.
window.location.href = 'https://us-east4-' + getFirebaseProjectId() + '.cloudfunctions.net/redirect';
window.location.href = 'https://us-central1-' + getFirebaseProjectId() + '.cloudfunctions.net/redirect';
} else {
// Use JSONP to load the 'token' Firebase Function to exchange the auth code against a Firebase custom token.
const script = document.createElement('script');
script.type = 'text/javascript';
// This is the URL to the HTTP triggered 'token' Firebase Function.
// See https://firebase.google.com/docs/functions.
var tokenFunctionURL = 'https://us-east4-' + getFirebaseProjectId() + '.cloudfunctions.net/token';
var tokenFunctionURL = 'https://us-central1-' + getFirebaseProjectId() + '.cloudfunctions.net/token';
script.src = tokenFunctionURL +
'?code=' + encodeURIComponent(code) +
'&state=' + encodeURIComponent(state) +
Expand Down
2 changes: 1 addition & 1 deletion Node-1st-gen/username-password-auth/public/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Demo.prototype.signIn = function() {
req.onerror = function() {
err.innerText = 'Network error in Firebase Cloud Function call see developer console for details';
};
var url = new URL(`https://us-east4-${getFirebaseProjectId()}.cloudfunctions.net/auth`);
var url = new URL(`https://us-central1-${getFirebaseProjectId()}.cloudfunctions.net/auth`);
req.open('POST', url, true);
req.setRequestHeader('Content-Type', 'application/json');
req.send(JSON.stringify({
Expand Down
2 changes: 1 addition & 1 deletion Node-1st-gen/youtube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ default it will return information about the
```bash
firebase emulators:start --only functions
```
1. Check the emulator output to find the URL of the `getChannelInfo` function. It will looks something like `http://localhost:5001/my-project-id/us-east4/getChannelInfo`
1. Check the emulator output to find the URL of the `getChannelInfo` function. It will looks something like `http://localhost:5001/my-project-id/us-central1/getChannelInfo`
1. Via CURL or in your browser, visit the URL that the function is running at. Optionally, add a query string `?channelId=SOME_CHANNEL_ID` to the end of the URL.
1. You should get a JSON response with information about the YouTube channel!

Expand Down
2 changes: 1 addition & 1 deletion Node/call-vertex-remote-config-server/client/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const callVertexWithRC = httpsCallable(getFunctions(), "callVertexWithRC", {
});

// Enable emulator so that it can be used in test mode.
const functions = getFunctions(app, "us-east4"); // Replace with your region
const functions = getFunctions(app, "us-central1"); // Replace with your region

if (testMode) {
connectFunctionsEmulator(functions, "localhost", 5001);
Expand Down
2 changes: 1 addition & 1 deletion Node/call-vertex-remote-config-server/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const defaultConfig = {
],

// Vertex AI location.
location: "us-east4",
location: "us-central1",

// Disable Vertex AI Gemini API access for testing.
vertex_enabled: false,
Expand Down
2 changes: 1 addition & 1 deletion Node/quickstarts/firestore-sync-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ a Firebase project.
1. Trigger the functions
1. Look in the output of the `firebase emulators:start` command for the URL
of the http function "verifyComment". It will look similar to:
`http://localhost:5001/MY_PROJECT/us-east4/verifyComment`
`http://localhost:5001/MY_PROJECT/us-central1/verifyComment`
1. `MY_PROJECT` will be replaced with your project ID
1. The port may be different on your local machine
1. Create a new document in the `comments` collection in Firestore in the emulator UI.
Expand Down
4 changes: 2 additions & 2 deletions Node/quickstarts/genkit-helloworld/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Getting Started
1. The emulator will output the function URL. It is usually of the form:

```
https://127.0.0.1:5001/{$PROJECT}/us-east4/tellJoke
https://127.0.0.1:5001/{$PROJECT}/us-central1/tellJoke
```

1. Call the function from a terminal, replacing the `url` argument with your function's URL:

```bash
$ curl -X POST \
--url https://127.0.0.1:5001/{$PROJECT}/us-east4/tellJoke \
--url https://127.0.0.1:5001/{$PROJECT}/us-central1/tellJoke \
--header "Content-Type: application/json" \
--header "Accept: text/event-stream" \
--data '{"data": "Observational comedy"}'
Expand Down
4 changes: 2 additions & 2 deletions Node/quickstarts/uppercase-firestore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ a Firebase project.
1. Trigger the functions
1. Look in the output of the `firebase emulators:start` command for the URL
of the http function "addmessage". It will look similar to:
`http://localhost:5001/MY_PROJECT/us-east4/addmessage`
`http://localhost:5001/MY_PROJECT/us-central1/addmessage`
1. `MY_PROJECT` will be replaced with your project ID
1. The port may be different on your local machine
1. Add the query string `?text=uppercaseme` to the end of the function's URL.
It should now look something like:
`http://localhost:5001/MY_PROJECT/us-east4/addmessage?text=uppercaseme`
`http://localhost:5001/MY_PROJECT/us-central1/addmessage?text=uppercaseme`
1. Optionally, you can change the message "uppercaseme" to a custom
message
1. Create a new message by opening the URL in a new tab in your browser
Expand Down
2 changes: 1 addition & 1 deletion Node/remote-config-server-with-vertex/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const defaultConfig = {
"HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT",
"threshold": "HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE"
}],
location: 'us-east4',
location: 'us-central1',

// Disable Vertex AI Gemini API access for testing.
vertex_enabled: false
Expand Down
2 changes: 1 addition & 1 deletion Node/taskqueues-backup-images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Please follow Google Cloud IAM documentation to add App Engine default service a

```
gcloud functions add-iam-policy-binding backupapod \
--region=us-east4 \
--region=us-central1 \
--member=serviceAccount:${PROJECT_NUMBER}-compute@developer.gserviceaccount.com \
--role=roles/run.invoker
```
2 changes: 1 addition & 1 deletion Node/youtube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ default it will return information about the
```bash
firebase emulators:start --only functions
```
1. Check the emulator output to find the URL of the `getChannelInfo` function. It will looks something like `http://localhost:5001/my-project-id/us-east4/getChannelInfo`
1. Check the emulator output to find the URL of the `getChannelInfo` function. It will looks something like `http://localhost:5001/my-project-id/us-central1/getChannelInfo`
1. Via CURL or in your browser, visit the URL that the function is running at. Optionally, add a query string `?channelId=SOME_CHANNEL_ID` to the end of the URL.
1. You should get a JSON response with information about the YouTube channel!

Expand Down
6 changes: 3 additions & 3 deletions Python/http-flask/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ To deploy and test the sample:
4. Set up the CLI to use your Firebase project using `firebase use --add` and select your Firebase project.
5. Deploy your project's code using `firebase deploy`.
6. Use a tool like `curl` to test the function:
- **Add a widget:** `curl -X POST -d "My new widget" https://us-east4-YOUR_PROJECT_ID.cloudfunctions.net/httpsflaskexample/widgets`
- **Get all widgets:** `curl https://us-east4-YOUR_PROJECT_ID.cloudfunctions.net/httpsflaskexample/widgets`
- **Get a specific widget:** `curl https://us-east4-YOUR_PROJECT_ID.cloudfunctions.net/httpsflaskexample/widgets/WIDGET_ID`
- **Add a widget:** `curl -X POST -d "My new widget" https://us-central1-YOUR_PROJECT_ID.cloudfunctions.net/httpsflaskexample/widgets`
- **Get all widgets:** `curl https://us-central1-YOUR_PROJECT_ID.cloudfunctions.net/httpsflaskexample/widgets`
- **Get a specific widget:** `curl https://us-central1-YOUR_PROJECT_ID.cloudfunctions.net/httpsflaskexample/widgets/WIDGET_ID`
4 changes: 2 additions & 2 deletions Python/post-signup-event/functions/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def savegoogletoken(

tasks_client = google.cloud.tasks_v2.CloudTasksClient()
task_queue = tasks_client.queue_path(
params.PROJECT_ID.value, options.SupportedRegion.US_EAST4.value, "scheduleonboarding"
params.PROJECT_ID.value, options.SupportedRegion.US_CENTRAL1.value, "scheduleonboarding"
)
target_uri = get_function_url("scheduleonboarding")
calendar_task = google.cloud.tasks_v2.Task(
Expand Down Expand Up @@ -124,7 +124,7 @@ def scheduleonboarding(request: tasks_fn.CallableRequest) -> https_fn.Response:
# [END scheduleonboarding]


def get_function_url(name: str, location: str = options.SupportedRegion.US_EAST4.value) -> str:
def get_function_url(name: str, location: str = options.SupportedRegion.US_CENTRAL1.value) -> str:
"""Get the URL of a given v2 cloud function.

Params:
Expand Down
4 changes: 2 additions & 2 deletions Python/quickstarts/https-time-server/functions/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#
# Example format: "%B %d %Y, %I:%M:%S %p".
# Example request using URL query parameters:
# https://us-east4-<project-id>.cloudfunctions.net/date?format=%25B%20%25d%20%25Y%2C%20%25I%3A%25M%3A%25S%20%25p
# https://us-central1-<project-id>.cloudfunctions.net/date?format=%25B%20%25d%20%25Y%2C%20%25I%3A%25M%3A%25S%20%25p
# Example request using request body with cURL:
# curl -H 'Content-Type: application/json' /
# -d '{"format": "%B %d %Y, %I:%M:%S %p"}' /
# https://us-east4-<project-id>.cloudfunctions.net/date
# https://us-central1-<project-id>.cloudfunctions.net/date
#
# This endpoint supports CORS.
# [START trigger]
Expand Down
2 changes: 1 addition & 1 deletion Python/taskqueues-backup-images/functions/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def enqueuebackuptasks(_: https_fn.Request) -> https_fn.Response:


# [START v2GetFunctionUri]
def get_function_url(name: str, location: str = SupportedRegion.US_EAST4.value) -> str:
def get_function_url(name: str, location: str = SupportedRegion.US_CENTRAL1.value) -> str:
"""Get the URL of a given v2 cloud function.

Params:
Expand Down
Loading