Google Cloud Functions
Google Cloud Functions is an event-driven serverless compute platform that enables you to run your code locally or in the cloud without having to provision servers.
Utilities · Google Cloud Functions
Details
| ID | Google Cloud Functions |
|---|---|
| Provider | |
| Category | Utilities |
| From Version | 5.0.0 |
| Docker Image | demisto/google-api-py3:1.0.0.10182333 |
| Supported Modules | Agentix XSIAM |
README
Google Cloud Functions is an event-driven serverless compute platform that enables you to run your code locally or in the cloud without having to provision servers.
This integration was integrated and tested with API version 1 of Google Cloud Functions
Configure Google Cloud Functions in Cortex
| Parameter | Description | Required |
|---|---|---|
| credentials_json | Service account private key file contents (JSON) | True |
| project_id | Default project ID | False |
| region | Default region | False |
| proxy | Use system proxy settings | False |
| insecure | Trust any certificate (not secure) | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
google-cloud-functions-list
Lists all Google Cloud functions.
Base Command
google-cloud-functions-list
Input
| Argument Name | Description | Required |
|---|---|---|
| project_id | The project ID the Google Cloud function is in. Default is the instance's project. | Optional |
| region | The region of the Google Cloud function. Default is all regions. You can get a full list of regions using the google-cloud-function-regions-list command. |
Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| GoogleCloudFunctions.Function.name | String | A user-defined name of the Google Cloud function. |
| GoogleCloudFunctions.Function.status | String | Status of the Google Cloud function deployment. The status can be: ACTIVE, OFFLINE, DEPLOY_IN_PROGRESS, DELETE_IN_PROGRESS, UNKNOWN. |
| GoogleCloudFunctions.Function.labels | String | Labels associated with this Google Cloud function. |
| GoogleCloudFunctions.Function.runtime | String | The time in which to run the Google Cloud function. |
Command Example
##### Context Example
{
“GoogleCloudFunctions”: {
“Function”: [
{
“availableMemoryMb”: 128,
“entryPoint”: “hello_world”,
“httpsTrigger”: {
“url”: “www.example.com”
},
“ingressSettings”: “ALLOW_ALL”,
“labels”: {
“deployment-tool”: “console-cloud”
},
“name”: “projects/project/locations/us-central1/functions/demisto-func”,
“runtime”: “python37”,
“serviceAccountEmail”: “email”,
“sourceUploadUrl”: “”,
“status”: “ACTIVE”,
“timeout”: “60s”,
“updateTime”: “2020-04-05T12:43:29.610Z”,
“versionId”: “1”
}
]
}
}
##### Human Readable Output
### Functions in project "gcp-integrations" and region "us-central1"
|name|httpsTrigger|status|entryPoint|timeout|availableMemoryMb|serviceAccountEmail|updateTime|versionId|labels|sourceUploadUrl|runtime|ingressSettings|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| projects/project/locations/us-central1/functions/demisto-func | url: www.example.com | ACTIVE | hello_world | 60s | 128 | email | 2020-04-05T12:43:29.610Z | 1 | deployment-tool: console-cloud | | python37 | ALLOW_ALL |
### google-cloud-function-regions-list
***
Lists all regions in the project.
##### Base Command
`google-cloud-function-regions-list`
##### Input
| **Argument Name** | **Description** | **Required** |
| --- | --- | --- |
| project_id | The project ID the Google Cloud function is in. Default is the instance's project. | Optional |
##### Context Output
| **Path** | **Type** | **Description** |
| --- | --- | --- |
| GoogleCloudFunctions.Region.locationId | String | The location ID of the region. |
| GoogleCloudFunctions.Region.name | String | The full name of the region. |
| GoogleCloudFunctions.Region.labels | String | The labels for the region. |
##### Command Example
```!google-cloud-function-regions-list```
##### Context Example
{
“GoogleCloudFunctions”: {
“Region”: [
{
“labels”: {
“cloud.googleapis.com/region”: “europe-west1”
},
“locationId”: “europe-west1”,
“name”: “projects/gcp-integrations/locations/europe-west1”
},
{
“labels”: {
“cloud.googleapis.com/region”: “europe-west3”
},
“locationId”: “europe-west3”,
“name”: “projects/gcp-integrations/locations/europe-west3”
},
{
“labels”: {
“cloud.googleapis.com/region”: “europe-west2”
},
“locationId”: “europe-west2”,
“name”: “projects/gcp-integrations/locations/europe-west2”
},
{
“labels”: {
“cloud.googleapis.com/region”: “us-central1”
},
“locationId”: “us-central1”,
“name”: “projects/gcp-integrations/locations/us-central1”
},
{
“labels”: {
“cloud.googleapis.com/region”: “us-east1”
},
“locationId”: “us-east1”,
“name”: “projects/gcp-integrations/locations/us-east1”
},
{
“labels”: {
“cloud.googleapis.com/region”: “us-east4”
},
“locationId”: “us-east4”,
“name”: “projects/gcp-integrations/locations/us-east4”
},
{
“labels”: {
“cloud.googleapis.com/region”: “asia-northeast1”
},
“locationId”: “asia-northeast1”,
“name”: “projects/gcp-integrations/locations/asia-northeast1”
},
{
“labels”: {
“cloud.googleapis.com/region”: “asia-east2”
},
“locationId”: “asia-east2”,
“name”: “projects/gcp-integrations/locations/asia-east2”
}
]
}
}
##### Human Readable Output
### Regions in project "gcp-integrations"
|locationId|name|labels|
|---|---|---|
| europe-west1 | projects/gcp-integrations/locations/europe-west1 | cloud.googleapis.com/region: europe-west1 |
| europe-west3 | projects/gcp-integrations/locations/europe-west3 | cloud.googleapis.com/region: europe-west3 |
| europe-west2 | projects/gcp-integrations/locations/europe-west2 | cloud.googleapis.com/region: europe-west2 |
| us-central1 | projects/gcp-integrations/locations/us-central1 | cloud.googleapis.com/region: us-central1 |
| us-east1 | projects/gcp-integrations/locations/us-east1 | cloud.googleapis.com/region: us-east1 |
| us-east4 | projects/gcp-integrations/locations/us-east4 | cloud.googleapis.com/region: us-east4 |
| asia-northeast1 | projects/gcp-integrations/locations/asia-northeast1 | cloud.googleapis.com/region: asia-northeast1 |
| asia-east2 | projects/gcp-integrations/locations/asia-east2 | cloud.googleapis.com/region: asia-east2 |
### google-cloud-function-get-by-name
***
Gets the details of a specific Google Cloud function.
##### Base Command
`google-cloud-function-get-by-name`
##### Input
| **Argument Name** | **Description** | **Required** |
| --- | --- | --- |
| project_id | The project ID the Google Cloud function is in. Default is the instance's project. | Optional |
| region | The region of the Google Cloud function. You can get a full list of regions using the `google-cloud-function-regions-list` command. Default is all regions. | Optional |
| function_name | The name of the function. | Required |
##### Context Output
| **Path** | **Type** | **Description** |
| --- | --- | --- |
| GoogleCloudFunctions.Function.name | String | A user\-defined name of the Google Cloud function. |
| GoogleCloudFunctions.Function.status | String | Status of the Google Cloud function deployment. The status can be ACTIVE, OFFLINE, DEPLOY\_IN\_PROGRESS, DELETE\_IN\_PROGRESS, UNKNOWN. |
| GoogleCloudFunctions.Function.labels | String | The labels associated with this Google Cloud Function. |
| GoogleCloudFunctions.Function.runtime | String | The time in which to run the Google Cloud function. |
##### Command Example
```!google-cloud-function-get-by-name function_name="demisto-func"```
##### Context Example
{
“GoogleCloudFunctions”: {
“Function”: {
“availableMemoryMb”: 128,
“entryPoint”: “hello_world”,
“httpsTrigger”: {
“url”: “”
},
“ingressSettings”: “ALLOW_ALL”,
“labels”: {
“deployment-tool”: “console-cloud”
},
“name”: “projects/project/locations/us-central1/functions/demisto-func”,
“runtime”: “python37”,
“serviceAccountEmail”: “email”,
“sourceUploadUrl”: “”,
“status”: “ACTIVE”,
“timeout”: “60s”,
“updateTime”: “2020-04-05T12:43:29.610Z”,
“versionId”: “1”
}
}
}
##### Human Readable Output
### Here are the details for demisto-func
|name|httpsTrigger|status|entryPoint|timeout|availableMemoryMb|serviceAccountEmail|updateTime|versionId|labels|sourceUploadUrl|runtime|ingressSettings|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| projects/project/locations/us-central1/functions/demisto-func | url: www.example.com | ACTIVE | hello_world | 60s | 128 | email | 2020-04-05T12:43:29.610Z | 1 | deployment-tool: console-cloud | | python37 | ALLOW_ALL |
### google-cloud-function-execute
***
Executes a Google Cloud function.
##### Base Command
`google-cloud-function-execute`
##### Input
| **Argument Name** | **Description** | **Required** |
| --- | --- | --- |
| function_name | The name of the Google Cloud function to execute. | Required |
| region | The region of the Google Cloud function. Default is all regions. You can get a full list of regions using the `google-cloud-function-regions-list` command. | Optional |
| parameters | The Google Cloud function parameters in a key:value format. Multiple parameters should be comma-separated (i.e., key1:value1,key2:value2). | Optional |
##### Context Output
| **Path** | **Type** | **Description** |
| --- | --- | --- |
| GoogleCloudFunctions.Execution.executionId | String | Execution ID of the Google Cloud function invocated. |
| GoogleCloudFunctions.Execution.result | String | Result populated for successful execution of a synchronous Google Cloud function. It will not be populated if the Google Cloud function does not return a result through context. |
| GoogleCloudFunctions.Execution.error | String | Either a system or user\-function generated error. Set if the execution was not successful. |
##### Command Example
```!google-cloud-function-execute function_name=demisto-func parameters=message:hell\"oThere```
##### Context Example
{
“GoogleCloudFunctions”: {
“Execution”: {
“executionId”: “xp9hifb4y996”,
“result”: “hell"oThere”
}
}
}
```
Human Readable Output
Execution details for demisto-func
| executionId | result |
|---|---|
| xp9hifb4y996 | hell”oThere |
Configuration parameters
credentials_json— Service account private key file contents (JSON)project_id_creds— Default project IDproject_id— Default project IDregion— Default regionproxy— Use system proxy settingsinsecure— Trust any certificate (not secure)
Commands (4)
-
google-cloud-function-executeExecutes a Google Cloud function.
-
google-cloud-function-get-by-nameGets the details of a specific Google Cloud function.
-
google-cloud-function-regions-listLists all regions in the project.
-
google-cloud-functions-listLists all Google Cloud functions.
category: Utilities provider: Google commonfields: id: Google Cloud Functions version: -1 configuration: - display: Service account private key file contents (JSON) name: credentials_json type: 4 hidden: true required: false - display: Default project ID name: project_id_creds type: 9 displaypassword: Service account private key file contents (JSON) required: false - display: Default project ID name: project_id type: 0 hidden: true required: false - display: Default region name: region type: 0 required: false - display: Use system proxy settings name: proxy type: 8 required: false - display: Trust any certificate (not secure) name: insecure type: 8 required: false description: Google Cloud Functions is an event-driven serverless compute platform that enables you to run your code locally or in the cloud without having to provision servers. display: Google Cloud Functions name: Google Cloud Functions script: commands: - arguments: - description: The project ID the Google Cloud function is in. Default is the instance's project. name: project_id - description: The region of the Google Cloud function. Default is all regions. You can get a full list of regions using the `google-cloud-function-regions-list` command. name: region description: Lists all Google Cloud functions. name: google-cloud-functions-list outputs: - contextPath: GoogleCloudFunctions.Function.name description: A user-defined name of the Google Cloud function. type: String - contextPath: GoogleCloudFunctions.Function.status description: 'Status of the Google Cloud function deployment. The status can be: ACTIVE, OFFLINE, DEPLOY_IN_PROGRESS, DELETE_IN_PROGRESS, UNKNOWN.' type: String - contextPath: GoogleCloudFunctions.Function.labels description: Labels associated with this Google Cloud function. type: String - contextPath: GoogleCloudFunctions.Function.runtime description: The time in which to run the Google Cloud function. type: String - arguments: - description: The project ID the Google Cloud function is in. Default is the instance's project. name: project_id description: Lists all regions in the project. name: google-cloud-function-regions-list outputs: - contextPath: GoogleCloudFunctions.Region.locationId description: The location ID of the region. type: String - contextPath: GoogleCloudFunctions.Region.name description: The full name of the region. type: String - contextPath: GoogleCloudFunctions.Region.labels description: The labels for the region. type: String - arguments: - description: The project ID the Google Cloud function is in. Default is the instance's project. name: project_id - description: The region of the Google Cloud function. You can get a full list of regions using the `google-cloud-function-regions-list` command. Default is all regions. name: region - description: The name of the function. name: function_name required: true description: Gets the details of a specific Google Cloud function. name: google-cloud-function-get-by-name outputs: - contextPath: GoogleCloudFunctions.Function.name description: A user-defined name of the Google Cloud function. type: String - contextPath: GoogleCloudFunctions.Function.status description: 'Status of the Google Cloud function deployment. The status can be ACTIVE, OFFLINE, DEPLOY_IN_PROGRESS, DELETE_IN_PROGRESS, UNKNOWN.' type: String - contextPath: GoogleCloudFunctions.Function.labels description: The labels associated with this Google Cloud Function. type: String - contextPath: GoogleCloudFunctions.Function.runtime description: The time in which to run the Google Cloud function. type: String - arguments: - description: The name of the Google Cloud function to execute. name: function_name required: true - description: The region of the Google Cloud function. Default is all regions. You can get a full list of regions using the `google-cloud-function-regions-list` command. name: region - description: The Google Cloud function parameters in a key:value format. Multiple parameters should be comma-separated (i.e., key1:value1,key2:value2). name: parameters description: Executes a Google Cloud function. name: google-cloud-function-execute outputs: - contextPath: GoogleCloudFunctions.Execution.executionId description: Execution ID of the Google Cloud function invocated. type: String - contextPath: GoogleCloudFunctions.Execution.result description: Result populated for successful execution of a synchronous Google Cloud function. It will not be populated if the Google Cloud function does not return a result through context. type: String - contextPath: GoogleCloudFunctions.Execution.error description: Either a system or user-function generated error. Set if the execution was not successful. type: String dockerimage: demisto/google-api-py3:1.0.0.10182333 runonce: false script: '-' type: python subtype: python3 fromversion: 5.0.0 tests: - No tests (auto formatted)