Skip to main content

host_project_registrations

Creates, updates, deletes, gets or lists a host_project_registrations resource.

Overview

Namehost_project_registrations
TypeResource
Idgoogle.apihub.host_project_registrations

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The name of the host project registration. Format: "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
createTimestring (google-datetime)Output only. The time at which the host project registration was created.
gcpProjectstringRequired. Immutable. Google cloud project name in the format: "projects/abc" or "projects/123". As input, project name with either project id or number are accepted. As output, this field will contain project number.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, hostProjectRegistrationsIdGet a host project registration.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists host project registrations.
createinsertprojectsId, locationsIdhostProjectRegistrationIdCreate a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
hostProjectRegistrationsIdstring
locationsIdstring
projectsIdstring
filterstring
hostProjectRegistrationIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Get a host project registration.

SELECT
name,
createTime,
gcpProject
FROM google.apihub.host_project_registrations
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND hostProjectRegistrationsId = '{{ hostProjectRegistrationsId }}' -- required;

INSERT examples

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

INSERT INTO google.apihub.host_project_registrations (
data__name,
data__gcpProject,
projectsId,
locationsId,
hostProjectRegistrationId
)
SELECT
'{{ name }}',
'{{ gcpProject }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ hostProjectRegistrationId }}'
RETURNING
name,
createTime,
gcpProject
;