# REST Resource: namespaces.domainmappings

- [Resource: DomainMapping](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMapping)
  - [JSON representation](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMapping.SCHEMA_REPRESENTATION)
- [DomainMappingSpec](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMappingSpec)
  - [JSON representation](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMappingSpec.SCHEMA_REPRESENTATION)
- [CertificateMode](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#CertificateMode)
- [DomainMappingStatus](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMappingStatus)
  - [JSON representation](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMappingStatus.SCHEMA_REPRESENTATION)
- [ResourceRecord](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#ResourceRecord)
  - [JSON representation](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#ResourceRecord.SCHEMA_REPRESENTATION)
- [RecordType](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#RecordType)
- [Methods](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#METHODS_SUMMARY)

## Resource: DomainMapping

Resource to hold the state and status of a user's domain mapping. NOTE: This resource is currently in Beta.

| JSON representation |
|---|
| ``` { "apiVersion": string, "kind": string, "metadata": { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/ObjectMeta`) }, "spec": { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMappingSpec`) }, "status": { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMappingStatus`) } } ``` |

| Fields ||
|---|---|
| `apiVersion` | `string` The API version for this call such as "domains.cloudrun.com/v1". |
| `kind` | `string` The kind of resource, in this case "DomainMapping". |
| `metadata` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/ObjectMeta`)`` Metadata associated with this BuildTemplate. |
| `spec` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMappingSpec`)`` The spec for this DomainMapping. |
| `status` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMappingStatus`)`` The current status of the DomainMapping. |

## DomainMappingSpec

The desired state of the Domain Mapping.

| JSON representation |
|---|
| ``` { "routeName": string, "certificateMode": enum (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#CertificateMode`), "forceOverride": boolean } ``` |

| Fields ||
|---|---|
| `routeName` | `string` The name of the Knative Route that this DomainMapping applies to. The route must exist. |
| `certificateMode` | ``enum (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#CertificateMode`)`` The mode of the certificate. |
| `forceOverride` | `boolean` If set, the mapping will override any mapping set before this spec was set. It is recommended that the user leaves this empty to receive an error warning about a potential conflict and only set it once the respective UI has given such a warning. |

## CertificateMode

SSL management type. If `AUTOMATIC` or a type is omitted, a managed certificate is automatically provisioned. If `None`, the system will not provision a certificate.

| Enums ||
|---|---|
| `CERTIFICATE_MODE_UNSPECIFIED` |   |
| `NONE` | Do not provision an HTTPS certificate. |
| `AUTOMATIC` | Automatically provisions an HTTPS certificate via GoogleCA. |

## DomainMappingStatus

The current state of the Domain Mapping.

| JSON representation |
|---|
| ``` { "conditions": [ { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/Condition`) } ], "observedGeneration": integer, "resourceRecords": [ { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#ResourceRecord`) } ], "mappedRouteName": string, "url": string } ``` |

| Fields ||
|---|---|
| `conditions[]` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/Condition`)`` Array of observed DomainMappingConditions, indicating the current state of the DomainMapping. |
| `observedGeneration` | `integer` ObservedGeneration is the 'Generation' of the DomainMapping that was last processed by the controller. Clients polling for completed reconciliation should poll until observedGeneration = metadata.generation and the Ready condition's status is True or False. |
| `resourceRecords[]` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#ResourceRecord`)`` The resource records required to configure this domain mapping. These records must be added to the domain's DNS configuration in order to serve the application via this domain mapping. |
| `mappedRouteName` | `string` The name of the route that the mapping currently points to. |
| `url` | `string` Optional. Not supported by Cloud Run. |

## ResourceRecord

A DNS resource record.

| JSON representation |
|---|
| ``` { "name": string, "rrdata": string, "type": enum (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#RecordType`) } ``` |

| Fields ||
|---|---|
| `name` | `string` Relative name of the object affected by this record. Only applicable for `CNAME` records. Example: 'www'. |
| `rrdata` | `string` Data for this record. Values vary by record type, as defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). |
| `type` | ``enum (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#RecordType`)`` Resource record type. Example: `AAAA`. |

## RecordType

A resource record type.

| Enums ||
|---|---|
| `RECORD_TYPE_UNSPECIFIED` | An unknown resource record. |
| `A` | An A resource record. Data is an IPv4 address. |
| `AAAA` | An AAAA resource record. Data is an IPv6 address. |
| `CNAME` | A CNAME resource record. Data is a domain name to be aliased. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings/create` | Create a new domain mapping. |
| ### `https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings/delete` | Delete a domain mapping. |
| ### `https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings/get` | Get information about a domain mapping. |
| ### `https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings/list` | List all domain mappings. |