Skip to main content

hubs

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

Overview

Namehubs
TypeResource
Idgoogle.networkconnectivity.hubs

Fields

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}
descriptionstringAn optional description of the hub.
createTimestringOutput only. The time the hub was created.
exportPscbooleanOptional. Whether Private Service Connect transitivity 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.
routingVpcsarrayThe 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.
spokeSummaryobjectSummarizes information about 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.
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.
updateTimestringOutput only. The time the hub was last updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECThubsId, projectsIdGets details about a Network Connectivity Center hub.
listSELECTprojectsIdLists the Network Connectivity Center hubs associated with a given project.
createINSERTprojectsIdCreates a new Network Connectivity Center hub in the specified project.
deleteDELETEhubsId, projectsIdDeletes a Network Connectivity Center hub.
patchUPDATEhubsId, projectsIdUpdates the description and/or labels of a Network Connectivity Center hub.
accept_spokeEXEChubsId, projectsIdAccepts a proposal to attach a Network Connectivity Center spoke to a hub.
reject_spokeEXEChubsId, projectsIdRejects 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.

SELECT examples

Lists the Network Connectivity Center hubs associated with a given project.

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

INSERT example

Use the following StackQL query and manifest file to create a new hubs resource.

/*+ create */
INSERT INTO google.networkconnectivity.hubs (
projectsId,
name,
labels,
description,
routingVpcs,
policyMode,
presetTopology,
exportPsc
)
SELECT
'{{ projectsId }}',
'{{ name }}',
'{{ labels }}',
'{{ description }}',
'{{ routingVpcs }}',
'{{ policyMode }}',
'{{ presetTopology }}',
{{ exportPsc }}
;

UPDATE example

Updates a hubs resource.

/*+ update */
UPDATE google.networkconnectivity.hubs
SET
name = '{{ name }}',
labels = '{{ labels }}',
description = '{{ description }}',
routingVpcs = '{{ routingVpcs }}',
policyMode = '{{ policyMode }}',
presetTopology = '{{ presetTopology }}',
exportPsc = true|false
WHERE
hubsId = '{{ hubsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified hubs resource.

/*+ delete */
DELETE FROM google.networkconnectivity.hubs
WHERE hubsId = '{{ hubsId }}'
AND projectsId = '{{ projectsId }}';