hubs
Creates, updates, deletes, gets or lists a hubs
resource.
Overview
Name | hubs |
Type | Resource |
Id | google.networkconnectivity.hubs |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Immutable. The name of the hub. Hub names must be unique. They use the following form: projects/{project_number}/locations/global/hubs/{hub_id} |
description | string | An optional description of the hub. |
createTime | string | Output only. The time the hub was created. |
exportPsc | boolean | Optional. 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. |
labels | object | Optional labels in key-value pair format. For more information about labels, see Requirements for labels. |
policyMode | string | Optional. The policy mode of this hub. This field can be either PRESET or CUSTOM. If unspecified, the policy_mode defaults to PRESET. |
presetTopology | string | Optional. 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. |
routeTables | array | Output 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. |
routingVpcs | array | 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. |
spokeSummary | object | Summarizes 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. |
state | string | Output only. The current lifecycle state of this hub. |
uniqueId | string | Output 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. |
updateTime | string | Output only. The time the hub was last updated. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | hubsId, projectsId | Gets details about a Network Connectivity Center hub. |
list | SELECT | projectsId | Lists the Network Connectivity Center hubs associated with a given project. |
create | INSERT | projectsId | Creates a new Network Connectivity Center hub in the specified project. |
delete | DELETE | hubsId, projectsId | Deletes a Network Connectivity Center hub. |
patch | UPDATE | hubsId, projectsId | Updates the description and/or labels of a Network Connectivity Center hub. |
accept_spoke | EXEC | hubsId, projectsId | Accepts a proposal to attach a Network Connectivity Center spoke to a hub. |
reject_spoke | EXEC | hubsId, projectsId | 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. |
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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.networkconnectivity.hubs (
projectsId,
name,
labels,
description,
routingVpcs,
policyMode,
presetTopology,
exportPsc
)
SELECT
'{{ projectsId }}',
'{{ name }}',
'{{ labels }}',
'{{ description }}',
'{{ routingVpcs }}',
'{{ policyMode }}',
'{{ presetTopology }}',
{{ exportPsc }}
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: labels
value: object
- name: description
value: string
- name: uniqueId
value: string
- name: state
value: string
- name: routingVpcs
value:
- - name: uri
value: string
- name: requiredForNewSiteToSiteDataTransferSpokes
value: boolean
- name: routeTables
value:
- string
- name: spokeSummary
value:
- name: spokeTypeCounts
value:
- - name: spokeType
value: string
- name: count
value: string
- name: spokeStateCounts
value:
- - name: state
value: string
- name: count
value: string
- name: spokeStateReasonCounts
value:
- - name: stateReasonCode
value: string
- name: count
value: string
- name: policyMode
value: string
- name: presetTopology
value: string
- name: exportPsc
value: boolean
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 }}';