Skip to main content

hubs

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

Overview

Namehubs
TypeResource
Idgoogle.networkconnectivity.hubs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringImmutable. The name of the hub. Hub names must be unique. They use the following form: projects/{project_number}/locations/global/hubs/{hub_id}
createTimestring (google-datetime)Output only. The time the hub was created.
descriptionstringOptional. An optional description of the hub.
exportPscbooleanOptional. Whether Private Service Connect connection propagation is enabled for the hub. If true, Private Service Connect endpoints in VPC spokes attached to the hub are made accessible to other VPC spokes attached to the hub. The default value is false.
labelsobjectOptional labels in key-value pair format. For more information about labels, see Requirements for labels.
policyModestringOptional. The policy mode of this hub. This field can be either PRESET or CUSTOM. If unspecified, the policy_mode defaults to PRESET.
presetTopologystringOptional. The topology implemented in this hub. Currently, this field is only used when policy_mode = PRESET. The available preset topologies are MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET, the preset_topology defaults to MESH. When policy_mode = CUSTOM, the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
routeTablesarrayOutput only. The route tables that belong to this hub. They use the following form: projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id} This field is read-only. Network Connectivity Center automatically populates it based on the route tables nested under the hub.
routingVpcsarrayOutput only. The VPC networks associated with this hub's spokes. This field is read-only. Network Connectivity Center automatically populates it based on the set of spokes attached to the hub.
spokeSummaryobjectOutput only. A summary of the spokes associated with a hub. The summary includes a count of spokes according to type and according to state. If any spokes are inactive, the summary also lists the reasons they are inactive, including a count for each reason. (id: SpokeSummary)
statestringOutput only. The current lifecycle state of this hub.
uniqueIdstringOutput only. The Google-generated UUID for the hub. This value is unique across all hub resources. If a hub is deleted and another with the same name is created, the new hub is assigned a different unique_id.
updateTimestring (google-datetime)Output only. The time the hub was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, hubsIdGets details about a Network Connectivity Center hub.
query_statusselectprojectsId, hubsIdpageSize, pageToken, filter, orderBy, groupByQuery the Private Service Connect propagation status of a Network Connectivity Center hub.
listselectprojectsIdpageSize, pageToken, filter, orderByLists the Network Connectivity Center hubs associated with a given project.
createinsertprojectsIdhubId, requestIdCreates a new Network Connectivity Center hub in the specified project.
patchupdateprojectsId, hubsIdupdateMask, requestIdUpdates the description and/or labels of a Network Connectivity Center hub.
deletedeleteprojectsId, hubsIdrequestIdDeletes a Network Connectivity Center hub.
reject_spokeexecprojectsId, hubsIdRejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was previously in the ACTIVE state, it transitions to the INACTIVE state and is no longer able to connect to other spokes that are attached to the hub.
accept_spokeexecprojectsId, hubsIdAccepts a proposal to attach a Network Connectivity Center spoke to a hub.
accept_spoke_updateexecprojectsId, hubsIdAccepts a proposal to update a Network Connectivity Center spoke in a hub.
reject_spoke_updateexecprojectsId, hubsIdRejects a proposal to update a Network Connectivity Center spoke in a hub.

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
hubsIdstring
projectsIdstring
filterstring
groupBystring
hubIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details about a Network Connectivity Center hub.

SELECT
name,
createTime,
description,
exportPsc,
labels,
policyMode,
presetTopology,
routeTables,
routingVpcs,
spokeSummary,
state,
uniqueId,
updateTime
FROM google.networkconnectivity.hubs
WHERE projectsId = '{{ projectsId }}' -- required
AND hubsId = '{{ hubsId }}' -- required;

INSERT examples

Creates a new Network Connectivity Center hub in the specified project.

INSERT INTO google.networkconnectivity.hubs (
data__name,
data__labels,
data__description,
data__policyMode,
data__presetTopology,
data__exportPsc,
projectsId,
hubId,
requestId
)
SELECT
'{{ name }}',
'{{ labels }}',
'{{ description }}',
'{{ policyMode }}',
'{{ presetTopology }}',
{{ exportPsc }},
'{{ projectsId }}',
'{{ hubId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the description and/or labels of a Network Connectivity Center hub.

UPDATE google.networkconnectivity.hubs
SET
data__name = '{{ name }}',
data__labels = '{{ labels }}',
data__description = '{{ description }}',
data__policyMode = '{{ policyMode }}',
data__presetTopology = '{{ presetTopology }}',
data__exportPsc = {{ exportPsc }}
WHERE
projectsId = '{{ projectsId }}' --required
AND hubsId = '{{ hubsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a Network Connectivity Center hub.

DELETE FROM google.networkconnectivity.hubs
WHERE projectsId = '{{ projectsId }}' --required
AND hubsId = '{{ hubsId }}' --required
AND requestId = '{{ requestId }}';

Lifecycle Methods

Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was previously in the ACTIVE state, it transitions to the INACTIVE state and is no longer able to connect to other spokes that are attached to the hub.

EXEC google.networkconnectivity.hubs.reject_spoke 
@projectsId='{{ projectsId }}' --required,
@hubsId='{{ hubsId }}' --required
@@json=
'{
"spokeUri": "{{ spokeUri }}",
"requestId": "{{ requestId }}",
"details": "{{ details }}"
}';