Skip to main content

api_hub_instances

Creates, updates, deletes, gets or lists an api_hub_instances resource.

Overview

Nameapi_hub_instances
TypeResource
Idgoogle.apihub.api_hub_instances

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. Format: projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}.
configobjectRequired. Config of the ApiHub instance. (id: GoogleCloudApihubV1Config)
createTimestring (google-datetime)Output only. Creation timestamp.
descriptionstringOptional. Description of the ApiHub instance.
labelsobjectOptional. Instance labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. https://cloud.google.com/compute/docs/labeling-resources
statestringOutput only. The current state of the ApiHub instance. (STATE_UNSPECIFIED, INACTIVE, CREATING, ACTIVE, UPDATING, DELETING, FAILED)
stateMessagestringOutput only. Extra information about ApiHub instance state. Currently the message would be populated when state is FAILED.
updateTimestring (google-datetime)Output only. Last update timestamp.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, apiHubInstancesIdGets details of a single API Hub instance.
createinsertprojectsId, locationsIdapiHubInstanceIdProvisions instance resources for the API Hub.
patchupdateprojectsId, locationsId, apiHubInstancesIdupdateMaskUpdate an Api Hub instance. The following fields in the ApiHubInstance can be updated: * disable_search * vertex_location * agent_registry_sync_config The update_mask should be used to specify the fields being updated.
deletedeleteprojectsId, locationsId, apiHubInstancesIdDeletes the API hub instance. Deleting the API hub instance will also result in the removal of all associated runtime project attachments and the host project registration.
lookupexecprojectsId, locationsIdLooks up an Api Hub instance in a given Google Cloud project. There will always be only one Api Hub instance for a Google Cloud project across all locations.

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
apiHubInstancesIdstring
locationsIdstring
projectsIdstring
apiHubInstanceIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single API Hub instance.

SELECT
name,
config,
createTime,
description,
labels,
state,
stateMessage,
updateTime
FROM google.apihub.api_hub_instances
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND apiHubInstancesId = '{{ apiHubInstancesId }}' -- required
;

INSERT examples

Provisions instance resources for the API Hub.

INSERT INTO google.apihub.api_hub_instances (
data__description,
data__name,
data__labels,
data__config,
projectsId,
locationsId,
apiHubInstanceId
)
SELECT
'{{ description }}',
'{{ name }}',
'{{ labels }}',
'{{ config }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ apiHubInstanceId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update an Api Hub instance. The following fields in the ApiHubInstance can be updated: * disable_search * vertex_location * agent_registry_sync_config The update_mask should be used to specify the fields being updated.

UPDATE google.apihub.api_hub_instances
SET
data__description = '{{ description }}',
data__name = '{{ name }}',
data__labels = '{{ labels }}',
data__config = '{{ config }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apiHubInstancesId = '{{ apiHubInstancesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes the API hub instance. Deleting the API hub instance will also result in the removal of all associated runtime project attachments and the host project registration.

DELETE FROM google.apihub.api_hub_instances
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apiHubInstancesId = '{{ apiHubInstancesId }}' --required
;

Lifecycle Methods

Looks up an Api Hub instance in a given Google Cloud project. There will always be only one Api Hub instance for a Google Cloud project across all locations.

EXEC google.apihub.api_hub_instances.lookup
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
;