> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# cloud_run_v2

# `prefect_gcp.models.cloud_run_v2`

## Classes

### `SecretKeySelector` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L9](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L9)</sup>

SecretKeySelector is a data model for specifying a GCP secret to inject
into a Cloud Run V2 Job as an environment variable.
Follows Cloud Run V2 rest API, docs:
[https://cloud.google.com/run/docs/reference/rest/v2/Container#SecretKeySelector](https://cloud.google.com/run/docs/reference/rest/v2/Container#SecretKeySelector)

### `JobV2` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L21](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L21)</sup>

JobV2 is a data model for a job that will be run on Cloud Run with the V2 API.

**Methods:**

#### `create` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L139](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L139)</sup>

```python theme={null}
create(cr_client: Resource, project: str, location: str, job_id: str, body: Dict) -> Dict
```

Create a job on Cloud Run with the V2 API.

**Args:**

* `cr_client`: The base client needed for interacting with GCP
  Cloud Run V2 API.
* `project`: The GCP project ID.
* `location`: The GCP region.
* `job_id`: The ID of the job to create.
* `body`: The job body.

**Returns:**

* The response from the Cloud Run V2 API.

#### `delete` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L172](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L172)</sup>

```python theme={null}
delete(cr_client: Resource, project: str, location: str, job_name: str) -> Dict
```

Delete a job on Cloud Run with the V2 API.

**Args:**

* `cr_client`: The base client needed for interacting with GCP
  Cloud Run V2 API.
* `project`: The GCP project ID.
* `location`: The GCP region.
* `job_name`: The name of the job to delete.

**Returns:**

* The response from the Cloud Run V2 API.

#### `get` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L87](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L87)</sup>

```python theme={null}
get(cls, cr_client: Resource, project: str, location: str, job_name: str)
```

Get a job from Cloud Run with the V2 API.

**Args:**

* `cr_client`: The base client needed for interacting with GCP
  Cloud Run V2 API.
* `project`: The GCP project ID.
* `location`: The GCP region.
* `job_name`: The name of the job to get.

#### `get_ready_condition` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L74](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L74)</sup>

```python theme={null}
get_ready_condition(self) -> Dict
```

Get the ready condition for the job.

**Returns:**

* The ready condition for the job.

#### `is_ready` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L60](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L60)</sup>

```python theme={null}
is_ready(self) -> bool
```

Check if the job is ready to run.

**Returns:**

* Whether the job is ready to run.

#### `run` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L225](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L225)</sup>

```python theme={null}
run(cr_client: Resource, project: str, location: str, job_name: str)
```

Run a job on Cloud Run with the V2 API.

**Args:**

* `cr_client`: The base client needed for interacting with GCP
  Cloud Run V2 API.
* `project`: The GCP project ID.
* `location`: The GCP region.
* `job_name`: The name of the job to run.

### `ExecutionV2` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L267](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L267)</sup>

ExecutionV2 is a data model for an execution of a job that will be run on
Cloud Run API v2.

**Methods:**

#### `condition_after_completion` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L329](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L329)</sup>

```python theme={null}
condition_after_completion(self) -> Dict
```

Return the condition after completion.

**Returns:**

* The condition after completion.

#### `get` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L342](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L342)</sup>

```python theme={null}
get(cls, cr_client: Resource, execution_id: str)
```

Get an execution from Cloud Run with the V2 API.

**Args:**

* `cr_client`: The base client needed for interacting with GCP
  Cloud Run V2 API.
* `execution_id`: The name of the execution to get, in the form of
  projects/{project}/locations/{location}/jobs/{job}/executions
  /{execution}

#### `is_running` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L309](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L309)</sup>

```python theme={null}
is_running(self) -> bool
```

Return whether the execution is running.

**Returns:**

* Whether the execution is running.

#### `succeeded` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect\_gcp/models/cloud\_run\_v2.py#L318](https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-gcp/prefect_gcp/models/cloud_run_v2.py#L318)</sup>

```python theme={null}
succeeded(self)
```

Whether or not the Execution completed is a successful state.
