api_hub_instances
Creates, updates, deletes, gets or lists an api_hub_instances resource.
Overview
| Name | api_hub_instances |
| Type | Resource |
| Id | google.apihub.api_hub_instances |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. Format: projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}. |
config | object | Required. Config of the ApiHub instance. (id: GoogleCloudApihubV1Config) |
createTime | string (google-datetime) | Output only. Creation timestamp. |
description | string | Optional. Description of the ApiHub instance. |
labels | object | Optional. Instance labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. https://cloud.google.com/compute/docs/labeling-resources |
state | string | Output only. The current state of the ApiHub instance. (STATE_UNSPECIFIED, INACTIVE, CREATING, ACTIVE, UPDATING, DELETING, FAILED) |
stateMessage | string | Output only. Extra information about ApiHub instance state. Currently the message would be populated when state is FAILED. |
updateTime | string (google-datetime) | Output only. Last update timestamp. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, apiHubInstancesId | Gets details of a single API Hub instance. | |
create | insert | projectsId, locationsId | apiHubInstanceId | Provisions instance resources for the API Hub. |
patch | update | projectsId, locationsId, apiHubInstancesId | updateMask | 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. |
delete | delete | projectsId, locationsId, apiHubInstancesId | 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. | |
lookup | exec | projectsId, locationsId | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
apiHubInstancesId | string | |
locationsId | string | |
projectsId | string | |
apiHubInstanceId | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
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
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: api_hub_instances
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the api_hub_instances resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the api_hub_instances resource.
- name: description
value: "{{ description }}"
description: |
Optional. Description of the ApiHub instance.
- name: name
value: "{{ name }}"
description: |
Identifier. Format: `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
- name: labels
value: "{{ labels }}"
description: |
Optional. Instance labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. https://cloud.google.com/compute/docs/labeling-resources
- name: config
description: |
Required. Config of the ApiHub instance.
value:
vertexLocation: "{{ vertexLocation }}"
disableSearch: {{ disableSearch }}
cmekKeyName: "{{ cmekKeyName }}"
encryptionType: "{{ encryptionType }}"
agentRegistrySyncConfig:
disabled: {{ disabled }}
- name: apiHubInstanceId
value: "{{ apiHubInstanceId }}"
UPDATE examples
- patch
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
- delete
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
- lookup
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
;