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:

Successful response

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.
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.
deletedeleteprojectsId, locationsId, apiHubInstancesIdDeletes the API hub instance.
lookupexecprojectsId, locationsIdLooks up an Api Hub instance in a given GCP project. There will always be only one Api Hub instance for a GCP 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

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__name,
data__config,
data__labels,
data__description,
projectsId,
locationsId,
apiHubInstanceId
)
SELECT
'{{ name }}',
'{{ config }}',
'{{ labels }}',
'{{ description }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ apiHubInstanceId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Deletes the API hub instance.

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 GCP project. There will always be only one Api Hub instance for a GCP project across all locations.

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